[French NK Probleme d'accent] NK fusion

phpNuke integration forum

[French NK Probleme d'accent] NK fusion

Postby clana » Sun Mar 18, 2007 4:32 pm

Hi =)

Well i'll try to explain my problem in english as well i can... :S

Here is the page i want to fix... Click here
Now, here is my code :
Code: Select all
require_once( 'roster2/settings.php' );

//---[ Check for Guild Info ]------------
if( empty($guild_info) )
{
   message_die( $wordings[$roster_conf['roster_lang']]['nodata'] );
}

$header_title = $wordings[$roster_conf['roster_lang']]['guildbank'];
//include_once (ROSTER_BASE.'roster_header.tpl');


$query1= "SELECT m.member_id, m.name as member_name, m.note as member_note, m.officer_note as member_officer_note, i.*, sum(i.item_quantity) as total_quantity
 FROM `".ROSTER_ITEMSTABLE."` as i, `".ROSTER_MEMBERSTABLE."` as m
 WHERE i.member_id=m.member_id
 AND m.".$roster_conf['banker_fieldname']." LIKE '%".$roster_conf['banker_rankname']."%'
 AND i.item_parent!='bags'
 AND i.item_parent!='equip'
 AND (i.item_tooltip
 NOT LIKE '%".$wordings[$roster_conf['roster_lang']]['tooltip_soulbound']."%'
 OR i.item_tooltip
 LIKE '%".$wordings[$roster_conf['roster_lang']]['tooltip_boe']."%')
 GROUP BY i.item_name";

$query2= "SELECT m.member_id, m.name as member_name, m.note as member_note, m.officer_note as member_officer_note, i.*
 FROM `".ROSTER_ITEMSTABLE."` as i, `".ROSTER_MEMBERSTABLE."` as m
 WHERE i.member_id=m.member_id
 AND m.".$roster_conf['banker_fieldname']." LIKE '%".$roster_conf['banker_rankname']."%'
 AND i.item_parent!='bags'
 AND i.item_parent!='equip'
 AND (i.item_tooltip
 NOT LIKE '%".$wordings[$roster_conf['roster_lang']]['tooltip_soulbound']."%'
 OR i.item_tooltip
 LIKE '%".$wordings[$roster_conf['roster_lang']]['tooltip_boe']."%')
 ORDER BY i.item_name";

if ($wowdb->sqldebug)
  echo "<!-- $query1 --> \n";


$result = $wowdb->query( $query1 );
$result2 = $wowdb->query( $query2 );
while ($row2 = $wowdb->fetch_array($result2))
{
   list($base_id, $extras) = split(':',$row2['item_id'],2);
   $owners[$base_id][]=$row2['member_name'];
   $mains[$row2['member_name']]=$row2['member_note'];
}

//include_once (ROSTER_LIB.'menu.php');
echo "<br />\n";

if ( $roster_conf['bank_money'] )
{
   $mulemoney = $wowdb->fetch_array($wowdb->query(
"SELECT SUM( p.money_g ) AS gold, SUM( p.money_s ) AS silver, SUM( p.money_c ) as copper
 FROM `".ROSTER_PLAYERSTABLE."` AS p, `".ROSTER_MEMBERSTABLE."` AS m
 WHERE m.".$roster_conf['banker_fieldname']." LIKE '%".$roster_conf['banker_rankname']."%'
 AND p.member_id = m.member_id
 ORDER  BY m.name"
));
if ($mulemoney['copper']>=100)
{
   $mulemoney['copper'] = $mulemoney['copper']/100;
   $addsilver= (int)$mulemoney['copper'];
   $mulemoney['copper'] = explode (".", $mulemoney['copper']);
   $mulemoney['copper'] = $mulemoney['copper'][1];
}
$mulemoney['silver'] = $mulemoney['silver'] + $addsilver;
if ($mulemoney['silver']>=100)
{
   $mulemoney['silver'] = $mulemoney['silver']/100;
   $addgold = (int)$mulemoney['silver'];
   $mulemoney['silver'] = explode (".", $mulemoney['silver']);
   $mulemoney['silver'] = $mulemoney['silver'][1];
}
$mulemoney['gold'] = $mulemoney['gold']+$addgold;

   echo '<br /> '.$wordings[$roster_conf['roster_lang']]['guildbank_totalmoney'].
      ' <div class="money">'.$mulemoney['gold'].' <img src="roster/'.$roster_conf['img_url'].'bagcoingold.gif" alt="g" /> '.
   $mulemoney['silver'].' <img src="roster/'.$roster_conf['img_url'].'bagcoinsilver.gif" alt="s" /> '.
   $mulemoney['copper'].' <img src="roster/'.$roster_conf['img_url'].'bagcoinbronze.gif" alt="c" /></div>
<br />';
}

echo border('sgray','start').'<table class="bodyline" cellspacing="0" cellpadding="0">
  <tr>
    <th class="membersHeader">'.utf8_decode($wordings[$roster_conf['roster_lang']]['guildbankcontact']).'</th>
    <th colspan="2" class="membersHeaderRight">'.utf8_decode($wordings[$roster_conf['roster_lang']]['guildbankitem']).'</th>
  </tr>
';

$striping_counter = 1;

while($row = $wowdb->fetch_array($result))
{
   $stripe_class = 'membersRow'.( ( ++$striping_counter % 2 ) + 1 );
   $stripe_class_right = 'membersRowRight'.( ( $striping_counter % 2 ) + 1 );
   $item_texture=str_replace('\\','/',$row['item_texture']);
   echo '  <tr valign="top">'."\n";

   // Item holder column
   echo '    <td align="center" class="'.$stripe_class.'" style="white-space:normal;">';
   list($base_id, $extras) = split(':',$row['item_id'],2);
   //echo "<!-- base_id = $base_id -->\n";
   foreach (array_unique($owners[$base_id]) as $owner)
   {
      // Parse the contact field for possible html characters
      $prg_find = array('/"/','/&/','|\\>|','|\\<|',"/\\n/");
      $prg_rep  = array('"','&','>','<','<br />');

      $note = preg_replace($prg_find, $prg_rep, $mains[$owner]);
      echo $owner.' ('.utf8_decode($note).")<br />";
   }
   echo "</td>\n";

   // Item texture and quantity column
   echo '    <td class="'.$stripe_class.'"><div class="item">'."\n";

   echo '      <img src="roster/'.$roster_conf['interface_url'].$item_texture.'.'.$roster_conf['img_suffix'].'" class="icon"'.' alt="'.utf8_decode($row['item_name']).'" width="30" height="30" />';
   if( ($row['total_quantity'] > 1) && ($itemRow['item_parent'] != 'bags') )
         echo '<span class="quant">'.$row['total_quantity'].'</span>';


   echo '</div></td>'."\n";

   // Item description column
   echo '    <td width="220" class="'.$stripe_class_right.'" style="white-space:normal;">';
   $first_line = true;
   $tooltip_out = '';
   $row['item_tooltip'] = stripslashes($row['item_tooltip']);
   foreach (explode("\n", $row['item_tooltip']) as $line )
   {
      $color = '';

      if( !empty($line) )
      {
         $line = preg_replace('|\\>|','›', $line );
         $line = preg_replace('|\\<|','‹', $line );
         $line = preg_replace('|\|c[a-f0-9]{2}([a-f0-9]{6})(.+?)\|r|','<span style="color:#$1;">$2</span>',$line);

         // Do this on the first line
         // This is performed when $caption_color is set
         if( $first_line )
         {
            if( $row['item_color'] == '' )
               $row['item_color'] = '9d9d9d';

            if( strlen($row['item_color']) > 6 )
               $color = substr( $row['item_color'], 2, 6 );
            else
               $color = $row['item_color'];

            $color .= ';font-size:12px;font-weight:bold';
            $first_line = false;
         }
         else
         {
            if ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_use'],$line) )
               $color = '00ff00';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_requires'],$line) )
               $color = 'ff0000';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_reinforced'],$line) )
               $color = '00ff00';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_equip'],$line) )
               $color = '00ff00';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_chance'],$line) )
               $color = '00ff00';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_enchant'],$line) )
               $color = '00ff00';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_soulbound'],$line) )
               $color = '00bbff';
            elseif ( ereg('^'.$wordings[$roster_conf['roster_lang']]['tooltip_set'],$line) )
               $color = '00ff00';
            elseif ( preg_match('|\([a-f0-9]\).'.$wordings[$roster_conf['roster_lang']]['tooltip_set'].'|',$line) )
               $color = '666666';
            elseif ( ereg('^\\"',$line) )
               $color = 'ffd517';
         }

         // Convert tabs to a formated table
         if( strpos($line,"\t") )
         {
            $line = utf8_decode(str_replace("\t",'</td><td align="right" class="overlib_maintext">', utf8_decode($line)));
            $line = '<table width="100%" cellspacing="0" cellpadding="0"><tr><td class="overlib_maintext">'.utf8_decode($line).'</td></tr></table>';
            $tooltip_out .= utf8_decode($line);
         }
         elseif( !empty($color) )
         {
            $tooltip_out .= '<span style="color:#'.$color.';">'.utf8_decode($line).'</span><br />';
         }
         else
         {
            $tooltip_out .= "$line<br />";
         }
      }
      else
      {
         $tooltip_out .= '<br />';
      }
   }

   echo utf8_decode("$tooltip_out");
   echo '</td>
  </tr>'."\n";
}
echo "</table>\n".border('sgray','end');

As you can see, i try to fix my probleme with
Code: Select all
echo utf8_decode(string)
, but my problem is still on. Someone can help me please?
Last edited by clana on Sun Mar 18, 2007 4:34 pm, edited 1 time in total.
clana
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Wed Mar 14, 2007 10:52 pm

[French NK Probleme d'accent] NK fusion

Postby clana » Sun Mar 18, 2007 5:19 pm

Does
Code: Select all
Content-type: text/html; charset=utf-8
could help me? How to use it?
clana
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Wed Mar 14, 2007 10:52 pm

[French NK Probleme d'accent] NK fusion

Postby clana » Sun Mar 18, 2007 5:32 pm

So :
Code: Select all
header('Content-type: text/html; charset=utf-8');
helps me, but now the problem is on the entire web site instaed of this page.

Can i cancel this command at the end of my code?
Last edited by clana on Sun Mar 18, 2007 6:00 pm, edited 1 time in total.
clana
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Wed Mar 14, 2007 10:52 pm

[French NK Probleme d'accent] NK fusion

Postby clana » Sun Mar 18, 2007 7:36 pm

Up

Nobody?
clana
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Wed Mar 14, 2007 10:52 pm


Return to phpNuke

Who is online

Users browsing this forum: No registered users and 1 guest

cron