Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Help] How to Fixed Logo Guild Show in Website..!

Newbie Spellweaver
Joined
May 9, 2020
Messages
37
Reaction score
10
Help How to Fixed Logo Guild Show in Website... (PHP +MSSQL)

example images :
muonline1996 - [Help] How to Fixed Logo Guild Show in Website..! - RaGEZONE Forums


Code :
PHP:
<? $ICN_CS=mssql_query("select OWNER_GUILD,SIEGE_START_DATE,SIEGE_END_DATE from MuOnline.dbo.MuCastle_DATA");

while($row=mssql_fetch_assoc($ICN_CS)){

$ICN_OWNER_GUILD=$row['OWNER_GUILD'];        

$ICN_CS_Start=$row['SIEGE_START_DATE'];

$ICN_CS_Battle=$row['SIEGE_END_DATE'];

$ICN_CSlogo="select G_Name,G_Mark,G_Master from MuOnline.dbo.Guild where G_Name='$ICN_OWNER_GUILD'";

$ICN_sql_siegelogo_check=mssql_query($ICN_CSlogo);        

$row1=mssql_fetch_row($ICN_sql_siegelogo_check);        

$ICN_logosiege=urlencode(bin2hex($row1[1]));

$ICN_duenologo="select Name from MuOnline.dbo.Character where Name='$row1[2]'";        

$ICN_sql_duenologo_check=mssql_query($ICN_duenologo);        

$row2=mssql_fetch_row($ICN_sql_duenologo_check); ?>

<table border="0" cellpadding="0" cellspacing="0">

<tr><td bgcolor="#CCCC99"><img src="get.php?aL=<?=$ICN_logosiege;?>.png" alt="logo" width="100" height="100"></a></td></tr></table>

<div class="siege_winner"><p>Guild: <b>

<?=$ICN_OWNER_GUILD;?></b></p>

<p>Master: <span><?=$row2[0];?></span></p></div>

<div class="siege_prox">Last Castle Date: <?=$ICN_CS_Start;?> <span>Next Castle Date: 

<?=$ICN_CS_Battle;?></span></div>

<? }?>

thank for fixed :)
 
Last edited:
Joined
Jul 31, 2012
Messages
490
Reaction score
93
Help How to Fixed Logo Guild Show in Website... (PHP +MSSQL)

example images :
muonline1996 - [Help] How to Fixed Logo Guild Show in Website..! - RaGEZONE Forums


Code :
PHP:
<? $ICN_CS=mssql_query("select OWNER_GUILD,SIEGE_START_DATE,SIEGE_END_DATE from MuOnline.dbo.MuCastle_DATA");

while($row=mssql_fetch_assoc($ICN_CS)){

$ICN_OWNER_GUILD=$row['OWNER_GUILD'];        

$ICN_CS_Start=$row['SIEGE_START_DATE'];

$ICN_CS_Battle=$row['SIEGE_END_DATE'];

$ICN_CSlogo="select G_Name,G_Mark,G_Master from MuOnline.dbo.Guild where G_Name='$ICN_OWNER_GUILD'";

$ICN_sql_siegelogo_check=mssql_query($ICN_CSlogo);        

$row1=mssql_fetch_row($ICN_sql_siegelogo_check);        

$ICN_logosiege=urlencode(bin2hex($row1[1]));

$ICN_duenologo="select Name from MuOnline.dbo.Character where Name='$row1[2]'";        

$ICN_sql_duenologo_check=mssql_query($ICN_duenologo);        

$row2=mssql_fetch_row($ICN_sql_duenologo_check); ?>

<table border="0" cellpadding="0" cellspacing="0">

<tr><td bgcolor="#CCCC99"><img src="get.php?aL=<?=$ICN_logosiege;?>.png" alt="logo" width="100" height="100"></a></td></tr></table>

<div class="siege_winner"><p>Guild: <b>

<?=$ICN_OWNER_GUILD;?></b></p>

<p>Master: <span><?=$row2[0];?></span></p></div>

<div class="siege_prox">Last Castle Date: <?=$ICN_CS_Start;?> <span>Next Castle Date: 

<?=$ICN_CS_Battle;?></span></div>

<? }?>

thank for fixed :)

Hi, I think the mistake will be to use the same function to display the guild logo, for example in the TOP 5 guild on the same page.

Try creating the same function with a different name.

Alternatively, comment out the feature in the TOP 5 Guild and see if the logo is displayed.

Update: You shouldn't knit Apples with Pears.
Learn to use echo(), print(), ...
 
Upvote 0
Joined
Jul 31, 2012
Messages
490
Reaction score
93
PHP:
	$color[0]	=	"";
	$color[1]	=	"#000000";
	$color[2]	=	"#8c8a8d";
	$color[3]	=	"#ffffff";
	$color[4]	=	"#fe0000";
	$color[5]	=	"#ff8a00";
	$color[6]	=	"#ffff00";
	$color[7]	=	"#8cff01";
	$color[8]	=	"#00ff00";
	$color[9]	=	"#01ff8d";
	$color["a"]	=	"#00ffff";
	$color["b"]	=	"#008aff";
	$color["c"]	=	"#0000fe";
	$color["d"]	=	"#8c00ff";
	$color["e"]	=	"#ff00fe";
	$color["f"]	=	"#ff008c";

I don't know how your function converts to IMG but it just assigns.

Try replacing <img> </img> with <div> </div>



PHP:
	$color[0]	=	"";
	$color[1]	=	"#000000";
	$color[2]	=	"#8c8a8d";
	$color[3]	=	"#ffffff";
	$color[4]	=	"#fe0000";
	$color[5]	=	"#ff8a00";
	$color[6]	=	"#ffff00";
	$color[7]	=	"#8cff01";
	$color[8]	=	"#00ff00";
	$color[9]	=	"#01ff8d";
	$color["a"]	=	"#00ffff";
	$color["b"]	=	"#008aff";
	$color["c"]	=	"#0000fe";
	$color["d"]	=	"#8c00ff";
	$color["e"]	=	"#ff00fe";
	$color["f"]	=	"#ff008c";

I don't know how your function converts to IMG but it just assigns.

Try replacing <img> </img> with <div> </div>

Or use the function

PHP:
<?
function	guildlogo($guildmark,	$coordxy)
{
	$guildmark	=	bin2hex($guildmark);
	$color[0]	=	"";
	$color[1]	=	"#000000";
	$color[2]	=	"#8c8a8d";
	$color[3]	=	"#ffffff";
	$color[4]	=	"#fe0000";
	$color[5]	=	"#ff8a00";
	$color[6]	=	"#ffff00";
	$color[7]	=	"#8cff01";
	$color[8]	=	"#00ff00";
	$color[9]	=	"#01ff8d";
	$color["a"]	=	"#00ffff";
	$color["b"]	=	"#008aff";
	$color["c"]	=	"#0000fe";
	$color["d"]	=	"#8c00ff";
	$color["e"]	=	"#ff00fe";
	$color["f"]	=	"#ff008c";
	$i			=	0;
	$td			=	0;
	$table		=	"<table style=\"width: ".(8*$coordxy)."px;height:".(8*$coordxy)."px\" border=0 cellpadding=0 cellspacing=0><tr>";
	do
	{
		$place	=	$guildmark{$i};
		$i++;
		$td++;
		$add	=	$color[$place];
		$table	.=	"<td class=\"guildlogo\" style=\"background-color: ".$add."; border:0px;\" width=\"".$coordxy."\" height=\"".$coordxy."\"></td>";
		if	($td	==	8)
		{ 
			$table	.=	"</tr>"; 
			if	($td	!=	64)	$table	.=	"<tr>";
			$td	=	0; 
		}
	}
	while	($i	<	64);
	$table	.=	"</table>";
	return	$table;
}
?>

PHP:
guildlogo("1144441111333311113333111133331111333311116666111155551111555511", size);
 
Upvote 0
Newbie Spellweaver
Joined
May 9, 2020
Messages
37
Reaction score
10
My File :

Castle.php
PHP:
https://drive.google.com/file/d/1vmjfrj0TQbz33eEGGivf5MKTk8Ml73G0/view

Castle2.php
PHP:
https://drive.google.com/file/d/1B3oEj8Q4pn1ELRxcDu3G9qsTvGKTv4so/view


you can fixed in my file ? :)
 
Last edited:
Upvote 0
Joined
Jul 31, 2012
Messages
490
Reaction score
93
My File :

Castle.php
PHP:
https://drive.google.com/file/d/1vmjfrj0TQbz33eEGGivf5MKTk8Ml73G0/view

Castle2.php
PHP:
https://drive.google.com/file/d/1B3oEj8Q4pn1ELRxcDu3G9qsTvGKTv4so/view


you can fixed in my file ? :)


Try it like this. I didn't try it.
PHP:
<?php
function	guildlogo($guildmark,	$coordxy)
{
	$guildmark	=	bin2hex($guildmark);
	$color[0]	=	"";
	$color[1]	=	"#000000";
	$color[2]	=	"#8c8a8d";
	$color[3]	=	"#ffffff";
	$color[4]	=	"#fe0000";
	$color[5]	=	"#ff8a00";
	$color[6]	=	"#ffff00";
	$color[7]	=	"#8cff01";
	$color[8]	=	"#00ff00";
	$color[9]	=	"#01ff8d";
	$color["a"]	=	"#00ffff";
	$color["b"]	=	"#008aff";
	$color["c"]	=	"#0000fe";
	$color["d"]	=	"#8c00ff";
	$color["e"]	=	"#ff00fe";
	$color["f"]	=	"#ff008c";
	$i			=	0;
	$td			=	0;
	$table		=	"<table style=\"width: ".(8*$coordxy)."px;height:".(8*$coordxy)."px\" border=0 cellpadding=0 cellspacing=0><tr>";
	do
	{
		$place	=	$guildmark{$i};
		$i++;
		$td++;
		$add	=	$color[$place];
		$table	.=	"<td class=\"guildlogo\" style=\"background-color: ".$add."; border:0px;\" width=\"".$coordxy."\" height=\"".$coordxy."\"></td>";
		if	($td	==	8)
		{ 
			$table	.=	"</tr>"; 
			if	($td	!=	64)	$table	.=	"<tr>";
			$td	=	0; 
		}
	}
	while	($i	<	64);
	$table	.=	"</table>";
	return	$table;
}

$ICN_CS=mssql_query("select OWNER_GUILD,SIEGE_START_DATE,SIEGE_END_DATE from MuOnline.dbo.MuCastle_DATA");
while($row=mssql_fetch_assoc($ICN_CS)){
$ICN_OWNER_GUILD=$row['OWNER_GUILD'];
$ICN_CS_Start=$row['SIEGE_START_DATE'];
$ICN_CS_Battle=$row['SIEGE_END_DATE'];
$ICN_CSlogo="select G_Name,G_Mark,G_Master from MuOnline.dbo.Guild where G_Name='$ICN_OWNER_GUILD'";
$ICN_sql_siegelogo_check=mssql_query($ICN_CSlogo);
$row1=mssql_fetch_row($ICN_sql_siegelogo_check);
//$ICN_logosiege=urlencode(bin2hex($row1[1]));
$ICN_logosiege=guildlogo($row1[1],5); 
$ICN_duenologo="select Name from MuOnline.dbo.Character where Name='$row1[2]'";
$ICN_sql_duenologo_check=mssql_query($ICN_duenologo);
$row2=mssql_fetch_row($ICN_sql_duenologo_check);

echo "<table border='0' cellpadding='0' cellspacing='0'>
		<tr>
			<td bgcolor='#CCCC99'>".$ICN_logosiege." alt='logo' width='100' height='100'>
			</td>
		</tr>
	</table>
	<div class='siege_winner'><p>Guild: <b>".$ICN_OWNER_GUILD."</b></p>
		<p>Master: 
			<span>".$row2[0]."</span>
		</p>
	</div>
	<div class='siege_prox'>Last Castle Date: ".$ICN_CS_Start."
		<span>Next Castle Date: ".$ICN_CS_Battle."</span>
	</div>";
?>

Update:
The entire code is not secure.
You should also use the new PHP in which some functions like
PHP:
mssql_query ();
or
PHP:
bin2hex ();
Also
PHP:
<? ?>
is wrong, it's supposed to be
PHP:
<?php ?>
 
Last edited:
Upvote 0

cMu

Elite Diviner
Joined
Jan 8, 2017
Messages
427
Reaction score
133
Try it like this. I didn't try it.
PHP:
<?php
function    guildlogo($guildmark,    $coordxy)
{
    $guildmark    =    bin2hex($guildmark);
    $color[0]    =    "";
    $color[1]    =    "#000000";
    $color[2]    =    "#8c8a8d";
    $color[3]    =    "#ffffff";
    $color[4]    =    "#fe0000";
    $color[5]    =    "#ff8a00";
    $color[6]    =    "#ffff00";
    $color[7]    =    "#8cff01";
    $color[8]    =    "#00ff00";
    $color[9]    =    "#01ff8d";
    $color["a"]    =    "#00ffff";
    $color["b"]    =    "#008aff";
    $color["c"]    =    "#0000fe";
    $color["d"]    =    "#8c00ff";
    $color["e"]    =    "#ff00fe";
    $color["f"]    =    "#ff008c";
    $i            =    0;
    $td            =    0;
    $table        =    "<table style=\"width: ".(8*$coordxy)."px;height:".(8*$coordxy)."px\" border=0 cellpadding=0 cellspacing=0><tr>";
    do
    {
        $place    =    $guildmark{$i};
        $i++;
        $td++;
        $add    =    $color[$place];
        $table    .=    "<td class=\"guildlogo\" style=\"background-color: ".$add."; border:0px;\" width=\"".$coordxy."\" height=\"".$coordxy."\"></td>";
        if    ($td    ==    8)
        { 
            $table    .=    "</tr>"; 
            if    ($td    !=    64)    $table    .=    "<tr>";
            $td    =    0; 
        }
    }
    while    ($i    <    64);
    $table    .=    "</table>";
    return    $table;
}

$ICN_CS=mssql_query("select OWNER_GUILD,SIEGE_START_DATE,SIEGE_END_DATE from MuOnline.dbo.MuCastle_DATA");
while($row=mssql_fetch_assoc($ICN_CS)){
$ICN_OWNER_GUILD=$row['OWNER_GUILD'];
$ICN_CS_Start=$row['SIEGE_START_DATE'];
$ICN_CS_Battle=$row['SIEGE_END_DATE'];
$ICN_CSlogo="select G_Name,G_Mark,G_Master from MuOnline.dbo.Guild where G_Name='$ICN_OWNER_GUILD'";
$ICN_sql_siegelogo_check=mssql_query($ICN_CSlogo);
$row1=mssql_fetch_row($ICN_sql_siegelogo_check);
//$ICN_logosiege=urlencode(bin2hex($row1[1]));
$ICN_logosiege=guildlogo($row1[1],5); 
$ICN_duenologo="select Name from MuOnline.dbo.Character where Name='$row1[2]'";
$ICN_sql_duenologo_check=mssql_query($ICN_duenologo);
$row2=mssql_fetch_row($ICN_sql_duenologo_check);

echo "<table border='0' cellpadding='0' cellspacing='0'>
        <tr>
            <td bgcolor='#CCCC99'>".$ICN_logosiege." alt='logo' width='100' height='100'>
            </td>
        </tr>
    </table>
    <div class='siege_winner'><p>Guild: <b>".$ICN_OWNER_GUILD."</b></p>
        <p>Master: 
            <span>".$row2[0]."</span>
        </p>
    </div>
    <div class='siege_prox'>Last Castle Date: ".$ICN_CS_Start."
        <span>Next Castle Date: ".$ICN_CS_Battle."</span>
    </div>";
?>

Update:
The entire code is not secure.
You should also use the new PHP in which some functions like
PHP:
mssql_query ();
or
PHP:
bin2hex ();
Also
PHP:
<? ?>
is wrong, it's supposed to be
PHP:
<?php ?>

1. you speak about security and u tell him to use mssql_query? advice him to leave this website on the side and create new one using PDO connection.
2. <? instant <?php is the same, its called "short open tag". nothing wrong using it, personally i don't use it but its doesnt harm anything.
 
Upvote 0
Joined
Jul 31, 2012
Messages
490
Reaction score
93
1. you speak about security and u tell him to use mssql_query? advice him to leave this website on the side and create new one using PDO connection.
2. <? instant <?php is the same, its called "short open tag". nothing wrong using it, personally i don't use it but its doesnt harm anything.

I guess I just put it wrong, I should have written straight away that these functions will not work on web hosting.

Also, short_open_tag "<?" will not work if a new PHP is set up.

I do not know the reason for using the PDO? There are many other database connection options.
 
Upvote 0

cMu

Elite Diviner
Joined
Jan 8, 2017
Messages
427
Reaction score
133
I guess I just put it wrong, I should have written straight away that these functions will not work on web hosting.

Also, short_open_tag "<?" will not work if a new PHP is set up.

I do not know the reason for using the PDO? There are many other database connection options.

you talk about new php and u tell him to use mssql_query? its out dated bro.
 
Upvote 0
Joined
Jul 31, 2012
Messages
490
Reaction score
93

For you

PHP:
		if( strtotime($myrow[start_date])+86400 > $real_time ) {$cs_status = "Register for Attack";} //0 00:00 - 0 23:59
		elseif( (strtotime($myrow[start_date])+432000) > $real_time ) {$cs_status = "Collect Sing of Lord";} //1 00:00 - 4 23:59
		elseif( (strtotime($myrow[start_date])+500400) > $real_time ) {$cs_status = "Information Period";} //5 00:00 - 5 19:00
		elseif( (strtotime($myrow[start_date])+586800) > $real_time ) {$cs_status = "Get Ready for Attack";} //5 19:00 - 6 19:00
		elseif( (strtotime($myrow[start_date])+594000) > $real_time ) {$cs_status = "Attack Castle Siege";} //6 19:00 - 6 21:00
		else {$cs_status="Truce Period";}
 
Upvote 0
Back
Top