orzeleagle122
Advanced User
- Joined
- May 18, 2010
- Messages
- 449
- Reaction score
- 16
Potrzebuje zrobic takie cos na mojej stronce,
uzywam acc by gesior
oto czesc mojego guild.php:
za pomoc rep
pozdrawiam
uzywam acc by gesior
oto czesc mojego guild.php:
PHP:
//show list of guilds
if($action == '')
{
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD></TD><TD>
<FORM ACTION="" METHOD=get><INPUT TYPE=hidden NAME=subtopic VALUE=guilds><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'">
<TABLE BORDER=0 CELLPADDING=1><TR><TD>World: </TD><TD><INPUT TYPE=hidden NAME=subtopic VALUE=guilds><SELECT SIZE="1" NAME="world"><OPTION VALUE="" SELECTED>(choose world)</OPTION>';
foreach($config['site']['worlds'] as $id => $world_n)
{
$main_content .= '<OPTION VALUE="'.$id.'">'.$world_n.'</OPTION>';
}
$main_content .= '</SELECT> </TD><TD><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif">
</TD></TR></TABLE></TABLE></FORM></TABLE>';
foreach($config['site']['worlds'] as $idd => $world_n)
{
if($idd == (int) $_REQUEST['world'])
{
$world_id = $idd;
$world_name = $world_n;
}
}
if(!isset($world_id))
{
$world_id = 0;
$world_name = $config['server']['serverName'];
}
$filter = new OTS_SQLFilter();
$filter->compareField('world_id', (int) $world_id);
$guilds_list = $ots->createObject('Guilds_List');
$guilds_list->setFilter($filter);
$guilds_list->orderBy('name');
$main_content .= '<h2><center><i>World:</i> '.$world_name.'</center></h2><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Guilds on '.$world_name.'</B></TD></TR>
<TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=64><B>Logo</B></TD>
<TD WIDTH=100%><B>Description</B></TD>
<TD WIDTH=56><B>*</B></TD></TR>';
$showed_guilds = 1;
if(count($guilds_list) > 0)
{
foreach($guilds_list as $guild)
{
if(is_int($showed_guilds / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $showed_guilds++;
$guild_logo = $guild->getCustomField('logo_gfx_name');
if(empty($guild_logo) || !file_exists("guilds/".$guild_logo))
$guild_logo = "wypierdalaj.gif";
$description = $guild->getCustomField('description');
$newlines = array("\r\n", "\n", "\r");
$description_with_lines = str_replace($newlines, '<br />', $description, $count);
if($count < $config['site']['guild_description_lines_limit'])
$description = $description_with_lines;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD><IMG SRC="guilds/'.$guild_logo.'" WIDTH=64 HEIGHT=64></TD>
<TD valign="top"><B>'.$guild->getName().'</B><BR/>'.$description.'';
if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
$main_content .= '<br /><a href="?subtopic=guilds&action=deletebyadmin&guild='.$guild->getId().'">Delete this guild (for ADMIN only!)</a>';
$main_content .= '</TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild->getId().'" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE>
</TD></TR>';
}
}
else
$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD><IMG SRC="guilds/wypierdalaj.gif" WIDTH=64 HEIGHT=64></TD>
<TD valign="top"><B>Create guild</B><BR/>Actually there is no guild on server. Create first! Press button "Create Guild".</TD>
<TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=createguild" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$layout_name.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD></TR>';
$main_content .= '</TABLE><br><br>';
if($logged)
$main_content .= '<TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=createguild" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$layout_name.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD><TD ALIGN=center><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD></TR></TABLE>
<BR />If you have any problem with guilds try:
<BR /><a href="?subtopic=guilds&action=cleanup_players">Cleanup players</a> - can\'t join guild/be invited? Can\'t create guild? Try cleanup players.
<BR /><a href="?subtopic=guilds&action=cleanup_guilds">Cleanup guilds</a> - made guild, you are a leader, but you are not on players list? Cleanup guilds!';
else
$main_content .= 'Before you can create guild you must login.<br><TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=login&redirect=guilds" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$layout_name.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD><TD ALIGN=center><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD></TR></TABLE>';
}
pozdrawiam