Jump to content
  • 0

[Request] Display emblems in webpage


Law

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   1
  • Joined:  01/21/12
  • Last Seen:  

Im making my own website/CP, and when show the online list(example) the image of the guild emblem dont show.

I try using the ceres script, modifying, using another scripts, but nothing works.

<?php
include ("jobs.php");
mysql_connect(host,user,pass);
mysql_select_db(db);
$result = mysql_query("
SELECT `char`.`name`, `char`.`class`, `char`.`base_level`, `char`.`last_map`, `char`.`job_level`, `login`.`level`, `login`.`sex`, `guild`.`name` AS `gname`, `char`.`zeny`, `guild`.`guild_id`
FROM `char` LEFT JOIN `login` ON `login`.`account_id` = `char`.`account_id` LEFT JOIN `guild` ON `guild`.`guild_id` = `char`.`guild_id`
WHERE `char`.`online` <> '0'
ORDER BY `char`.`name`
");
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td width='35px'><img style='vertical-align: middle;' src='emblem.php?data=".$row["guild_id"].".png'></td>";
echo "<td width='35px'><img style='vertical-align: middle;' src='../images/".$row["sex"].".png'></td>";
echo "<td> ".$row["name"]." </td><td>";
echo $jobs[$row['class']];
echo "</td>";
echo "<td> ".$row["gname"]." </td>";
echo "<td style='text-align:right;'> ".$row["base_level"]."/".$row["job_level"]." </td>";
echo "</tr>";
}
;
?>?>

The URLs and config of mysql connections are right. I put the files of Ceres and the emblem only show a black square, I go to the url "emblem.php?data=ID" and show the download windows, I see the file and have this characters

BMv 6 (     @ € € €€ € € € €€ ÀÀÀ ÀÜÀ ðʦ @ ` €   À À @ @ @@ @` @€ @  @À @À ` ` `@ `` `€ `  `À `À € € €@ €` €€ €  €À €À      @  `  €     À  À À À À@ À` À€ À  ÀÀ ÀÀ À À À@ À` À€ À  ÀÀ ÀÀ @ @ @ @ @ ` @ € @   @ À @ À @ @ @ @ @ ` @ € @   @ À @ À @@ @@ @@@ @@` @@€ @@  @@À @@À @` @` @`@ @`` @`€ @`  @`À @`À @€ @€ @€@ @€` @€€ @€  @€À @€À @  @  @ @ @ ` @ € @   @ À @ À @À @À @À@ @À` @À€ @À  @ÀÀ @ÀÀ @À @À @À@ @À` @À€ @À  @ÀÀ @ÀÀ € € € @ € ` € € €   € À € À € € € @ € ` € € €   € À € À €@ €@ €@@ €@` €@€ €@  €@À €@À €` €` €`@ €`` €`€ €`  €`À €`À €€ €€ €€@ €€` €€€ €€  €€À €€À €  €  € @ € ` € € €   € À € À €À €À €À@ €À` €À€ €À  €ÀÀ €ÀÀ €À €À €À@ €À` €À€ €À  €ÀÀ €ÀÀ À À À @ À ` À € À   À À À À À À À @ À ` À € À   À À À À À@ À@ À@@ À@` À@€ À@  À@À À@À À` À` À`@ À`` À`€ À`  À`À À`À À€ À€ À€@ À€` À€€ À€  À€À À€À À  À  À @ À ` À € À   À À À À ÀÀ ÀÀ ÀÀ@ ÀÀ` ÀÀ€ ÀÀ  ðûÿ ¤   €€€ ÿ ÿ ÿÿ ÿ ÿ ÿ ÿÿ ÿÿÿ  

Edited by Law
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   1
  • Joined:  01/21/12
  • Last Seen:  

bump, i need help really xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   19
  • Joined:  11/22/11
  • Last Seen:  

1 billion scary things going on

1) you didn't actually show us the contents of emblem.php that would in fact help

2) you're linking to emblem.php?data=id.png which is most likely not proper

3) you're an evil man using <> instead of !=

4) you're echoing html

5) you're using mysql_ functions

6) you might not be sending the header in emblem.php

Edited by mrjnumber1
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   1
  • Joined:  01/21/12
  • Last Seen:  

Im using the emblem.php of ceresplus D:

theres the actual code


$lastguild = 0;
while ($char = mysql_fetch_array($result)) {
if( $lastguild != $char['guild_id'])
{
$lastguild = $char['guild_id'];
$emblems[$lastguild] = $char['emblem_data'];
echo "<table><tbody>";
echo '<tr>
<th width="5%">
 '.($lastguild > 0 ?' <img src="emblema.php?data='.$lastguild.'" alt="X">' : '' ).' 
</th>
<th width="50%">
<b>' . ($lastguild > 0 ? htmlspecialchars($char['gname']) : 'Sin Guild' ) . '</b>
</th>
<th width="20%"></td>
<th width="20%" style="text-align:right;">
<b>[ ' . $char['connect_member'] . ' | ' . $char['max_member'] . ' ]</b>
</th>
</tr>';
}

copy from custom ceres CP(gaia-games.com cp)

Edited by Law
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   19
  • Joined:  11/22/11
  • Last Seen:  

You aren't providing anything useful, and I'm assuming that the black square is the contents of image/no_emblema.bmp. You probably don't have GD installed.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

you dont need the .png from the image link

Try this:

<?php

include ("jobs.php");

mysql_connect(host,user,pass);

mysql_select_db(db);

$result = mysql_query("

SELECT `char`.`name`, `char`.`class`, `char`.`base_level`, `char`.`last_map`, `char`.`job_level`, `login`.`level`, `login`.`sex`, `guild`.`name` AS `gname`, `char`.`zeny`, `guild`.`guild_id`

FROM `char` LEFT JOIN `login` ON `login`.`account_id` = `char`.`account_id` LEFT JOIN `guild` ON `guild`.`guild_id` = `char`.`guild_id`

WHERE `char`.`online` <> '0'

ORDER BY `char`.`name`

");

while ($row = mysql_fetch_array($result)) {

echo "<tr>";

echo "<td width='35px'><img style='vertical-align: middle;' src='emblem.php?data=".$row["guild_id"]."'></td>";

echo "<td width='35px'><img style='vertical-align: middle;' src='../images/".$row["sex"].".png'></td>";

echo "<td> ".$row["name"]." </td><td>";

echo $jobs[$row['class']];

echo "</td>";

echo "<td> ".$row["gname"]." </td>";

echo "<td style='text-align:right;'> ".$row["base_level"]."/".$row["job_level"]." </td>";

echo "</tr>";

}

;

?>

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

6) you might not be sending the header in emblem.php

I agree.

@Law: there are full examples in

CeresCP - emblema.php (check guild.php for an example how to use it)

FluxCP - /lib/functions/imagecreatefrombmpstring.php (check /modules/guild/emblem.php for an example)

Link to comment
Share on other sites

×
×
  • Create New...