• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior ACC] Guild statistics new version!

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Script preview


14466601.jpg

Requirements


Req. 1) A copy of Gesior ACC


Installation Instructions


Step 1) Open the location of your Gesior ACC (e.g. C:/xampp/htdocs/ or /var/www/).
Step 2) Locate the guilds.php file , and open it.
Step 3) Search for
PHP:
  //show guild page
Step 4) Mark everything until you find the lane
PHP:
include('pot/InvitesDriver.php');
Step 5) Paste the code of the script in download area.
Step 6) Download the required images from download area.
Step 7) Unzip the package inside the main folder (e.g C:/xampp/htdocs/).

Download Area

VersionDate of ReleaseDetailsDownload Package
1.0.019th of August, 2011ImagesView attachment images_guild_statistic.rar
The version with a green color is the most recommended version.
PHP:
//show guild page
#################################################################################
##                            CONFIGURATION PAGE                               ##
#################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                  #
## ---------------------------------------------------------------------------- #
## Script created by  Kavvson (http://otland.net/members/kavvson/)              #
## Author & developer:  Kavvson                                                 #
##                                                                              #
## Helpers:             Stian       <http://www.otland.net>                     #
##                      MiPo91      <http://www.otland.net>                     #
##                      Gesior.pl   <http://www.otland.net>                     #
#################################################################################
## +--------------------------Show Guild Page-----------------------------------+
## | DONE: v.1.0.0
## | - Show online | offline (total) members
## | - Show the total level of members in guild
## | - Show the average level of members in guild
## | - Show the highest level in guild
## | - Show the lowest level in guild
## | - Skill ranking (all skills,mlvl experience)
## | - Average level script fix .round(value)
## | - Show number of invited members
## | - Show vocations in guild
## | - Show guild points | Formula [Sum of (Sum levels in guild) + 
## |   Members in guild + Average Level + Minimum Level + Maximum Level]
## +----------------------------------------------------------------------------+
#################################################################################
        $guild_logo = $guild->getCustomField('logo_gfx_name');
        if(empty($guild_logo) || !file_exists("guilds/".$guild_logo))
            $guild_logo = "default_logo.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;
        $guild_owner = $guild->getOwner();
        if($guild_owner->isLoaded())
            $guild_owner = $guild_owner->getName();
		$main_content .= ' <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
        <TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Guild Details</B></TD></TR>
        <TR BGCOLOR='.$config['site']['darkborder'].'>
		<TD WIDTH=64><IMG SRC="guilds/'.$guild_logo.'" WIDTH=64 HEIGHT=64></TD>
        <TD ALIGN=center WIDTH=100%><H1>'.$guild->getName().'</H1></TD>
		 <TD WIDTH=64><IMG SRC="guilds/'.$guild_logo.'" WIDTH=64 HEIGHT=64></TD>
		</tr></table>
		<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
		<TR BGCOLOR='.$config['site']['lightborder'].'>
		<td width="50px"><small>Description</small></td><td width="80%"><p style="font-size:10px";>'.$description.'</p></td>
		</tr>
		<TR BGCOLOR='.$config['site']['darkborder'].'>
		<td width="50px"><small>Leadership</small></td><td width="80%"><a href="?subtopic=characters&name='.urlencode($guild_owner).'"><b>'.$guild_owner.'</b></a> is guild leader of <b>'.$guild->getName().'</b></td>
		</tr>
		<TR BGCOLOR='.$config['site']['lightborder'].'>
		<td width="50px"><small>Created</small></td><td width="80%">The guild was founded on '.$config['server']['serverName'].' on '.date("j F Y", $guild->getCreationData()).'</td>
		</tr>		
		';
		 if($guild_leader){
          $main_content .= '
		  <TR BGCOLOR='.$config['site']['darkborder'].'>
		<td width="50px"><small>Administration</small></td><td width="80%"><a href="?subtopic=guilds&action=manager&guild='.$guild_name.'"><IMG SRC="'.$layout_name.'/images/buttons/sbutton_manageguild.png" BORDER=0 WIDTH=120 HEIGHT=18 alt="Manage Guild"></a></td>
		</tr>';
		}
        $main_content .= '</table><BR><BR>
        <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
        <TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Guild Members</B></TD></TR>
        <TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=30%><B>Rank</B></TD>
        <TD WIDTH=50%><B>Name and Title</B></TD>
		 <TD WIDTH=20%><B>Vocation and Level</B></TD>
		</TR>';
        $showed_players = 1;
        foreach($rank_list as $rank)
        {
            $players_with_rank = $rank->getPlayersList();
            $players_with_rank->orderBy('name');
            $players_with_rank_number = count($players_with_rank);
            if($players_with_rank_number > 0)
            {
                if(is_int($showed_players / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $showed_players++;
                $main_content .= '<TR BGCOLOR="'.$bgcolor.'">
				<TD valign="top">'.$rank->getName().'</TD>
                <TD>';
                foreach($players_with_rank as $player)
                {
                    $main_content .= '<FORM ACTION="?subtopic=guilds&action=change_nick&name='.urlencode($player->getName()).'" METHOD=post><A HREF="?subtopic=characters&name='.urlencode($player->getName()).'">'.($player->isOnline() ? "<font color=\"green\">".$player->getName()."</font>" : "<font color=\"red\">".$player->getName()."</font>").'</A>';
                    $guild_nick = $player->getGuildNick();
                    if($logged)
                        if(in_array($player->getId(), $players_from_account_ids))
                            $main_content .= ' <br>[<input type="text" size="20%" name="nick" value="'.htmlentities($player->getGuildNick()).'"> <input type="submit" value="Change">]';
                        else
                        if(!empty($guild_nick))
                            $main_content .= ' ('.htmlentities($player->getGuildNick()).')';
                    else
                        if(!empty($guild_nick))
                            $main_content .= ' ('.htmlentities($player->getGuildNick()).')';
                    if($level_in_guild > $rank->getLevel() || $guild_leader)
                        if($guild_leader_char->getName() != $player->getName())
                            $main_content .= '&nbsp;<font size=1>{<a href="?subtopic=guilds&action=kickplayer&guild='.$guild->getId().'&name='.urlencode($player->getName()).'">KICK</a>}</font>';
                    $main_content .= '<td><small>Level: '.$player->getLevel().' '.$vocation_name[$player->getWorld()][$player->getPromotion()][$player->getVocation()].'</small></td>
					</FORM>';
                }
                $main_content .= '</TD></TR>';
            }
        }
        $main_content .= '</TABLE><br><br>';
#################################################################################
## +---------------------------------------------------------------------------
## | Database queries
## +---------------------------------------------------------------------------
#################################################################################
        $guild_id = (int)$_GET['guild'];
		$guildMembers = $SQL->query( 'SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = '.$guild_id )->fetch( );        $allM = $SQL->query ('SELECT COUNT(1) as `people` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') AND online = 1')->fetch(); 
		$sumav = $SQL->query ('SELECT SUM(`level`) as `level_sum`,AVG(`level`) as `level_avg` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.')  ')->fetch(); 
		$allM3 = $SQL->query ('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ORDER BY `level` ASC LIMIT 1')->fetch(); 
		$allM4 = $SQL->query ('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ORDER BY `level` DESC LIMIT 1')->fetch(); 
		$invite = $SQL->query( 'SELECT COUNT(`guild_id`) FROM `guild_invites` WHERE `guild_id` = '.$guild_id.'')->fetch( );     
		$vocations = array();
			foreach($SQL->query('SELECT `vocation`, COUNT(`vocation`) AS `voc_count` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') GROUP BY `vocation`')  as $voc) {
		$vocations[$voc['vocation']] = $voc['voc_count'];      
			}
		$point = $SQL->query('
        SELECT 
            `g`.`id` AS `id`,
            `g`.`name` AS `name`,
            SUM(`p`.`level`) AS `level`,
            COUNT(`p`.`name`) AS `count`,
            AVG(`p`.`level`) AS `average`,
            MIN(`p`.`level`) AS `min`,
            MAX(`p`.`level`) AS `max`
        FROM `players` p
            LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
            LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
        WHERE `guild_id` = '.$guild_id.'
    ')->fetch();
###############
## Variables ##
###############
$off = $guildMembers['total'] - $allM[0];
$skills = array(0 => "Fist Fighting", 1 => "Club Fighting", 2 => "Sword Fighting", 3 => "Axe Fighting", 4 => "Distance Fighting", 5 => "Shielding", 6 => "Fishing");
$Points = $point['level'] + $point['count'] + round($point['average']) + $point['min'] + $point['max']; 	
#################################################################################
$main_content .= '
<table width="100%" cellspacing="1" cellpadding="4" border="0">
	<tr bgcolor="#505050"><td class="white" colspan="3"><b>Guild Statistic</b></td></tr>
	<tr bgcolor="#d4c0a1"><td width="30%"><b>Type</b></td><td width="50%"><b>Value</b></td></tr>
	<tr bgcolor="#f1e0c6"><td valign="top">Number of Members in Guild</td>
   	    <td><font color="green">'.$allM[0].'</font> online | <font color="red">'.$off.'</font> offline ('.$guildMembers['total'].')</td>
    </tr>    
    <tr bgcolor="#d4c0a1"><td valign="top">Total Level in guild</td>       
		<td>'.$sumav['level_sum'].'</td>
    </tr>
	<tr bgcolor="#f1e0c6"><td valign="top">Avg Level in guild</td>
    	<td>'.round($sumav['level_avg']).'</td>
    </tr>
    <tr bgcolor="#d4c0a1"><td valign="top">Lowest Level in guild</td>
   	    <td>'.$allM3[0].'</td>
    </tr>
    <tr bgcolor="#f1e0c6"><td valign="top">Highest Level in guild</td>
    	<td>'.$allM4[0].'</td>
    </tr>
    <tr bgcolor="#d4c0a1"><td valign="top">Number of Invited Members</td>
     <td>'.$invite[0].'
    </tr>
		<tr><td valign="center" bgcolor="#f1e0c6">Vocations in guild</td>
			 <td bgcolor="#f1e0c6">
				 <table width="100%" cellspacing="1" cellpadding="4" border="0">
					<tr bgcolor="#505050" align="center"><td width="30%" class="white"><b>Vocation</b></td><td width="50%" class="white"><b>Value</b></td></tr>
					<tr bgcolor="#f1e0c6"><td valign="top">Druid</td>
						<td>'.(int)$vocations[2].'</td>
					</tr>
					<tr bgcolor="#d4c0a1"><td valign="top">Knight</td>
						<td>'.(int)$vocations[4].'</td>
					</tr>
					<tr bgcolor="#f1e0c6"><td valign="top">Paladin</td>
						<td>'.(int)$vocations[3].'</td>
					</tr>
					<tr bgcolor="#d4c0a1"><td valign="top">Sorcerers</td>
						<td>'.(int)$vocations[1].'</td>
					</tr>
				 </table>
			 </td>
		</tr>
	 <tr bgcolor="#d4c0a1"><td valign="top">Guild points</td>
       <td>'.$Points.'</td>
    </tr>
		<tr><td valign="center" bgcolor="#f1e0c6">Guild Achievements</td>
			 <td bgcolor="#f1e0c6">
				 <table width="100%" cellspacing="1" cellpadding="4" border="0">
					<tr bgcolor="#505050" align="center"><td width="30%" class="white"><b>Skill</b></td><td width="50%" class="white"><b>Name (Value)</b></td></tr>';
	foreach ($skills as $key => $value) {
	if(is_int($number / 2)) { $bgcolor = '#f1e0c6'; } else { $bgcolor = '#d4c0a1'; }
	$number++;
    $allM5 = $SQL->query('
        SELECT `p`.`name` AS `Name`,
		       `ps`.`value` AS `Sword`, 
			   `p`.`maglevel`, 
			   `p`.`experience`
	    FROM `players` AS `p`
		JOIN `player_skills` AS `ps`
		WHERE `ps`.`player_id` = `p`.`id`
		AND `ps`.`skillid` = ' . $key . '
        AND `rank_id`
		IN(SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild_id . ') ORDER BY `Sword` DESC Limit 1 ')->fetch();
		 $main_content .= '
		 <tr BGCOLOR='.$bgcolor.'>
		 <td valign="top"><img style="border:medium none;width:20px;" src="/images/skills/'.$key.'.png">  '.$value.'</td>
		 <td valign="top">   '.$allM5[0].'  ('.$allM5[1].')</td>
		</tr>';
		}
	$main_content .='
		<tr BGCOLOR="#d4c0a1">
		 <td valign="top"><img style="border:medium none;width:20px;" src="/images/skills/7.png">  Experience</td>
		 <td valign="top">'.$allM5[0].' ('.$allM5[3].')</td>
		</tr>
		<tr BGCOLOR="#f1e0c6">
		 <td valign="top"><img style="border:medium none;width:20px;" src="/images/skills/8.png">  Magic Level</td>
		 <td valign="top">'.$allM5[0].' ('.$allM5[2].')</td>
		</tr>
	</table>
			 </td>
		</tr>
    </tr>       
</table>';
///Don't delete this! Please respect my work! I am counting on reputation.
$main_content .= '<div align="right"><small><b>Author of script: <a href="http://otland.net/members/kavvson/">Kavvson</a></b></small></div>';
///Don't delete this! Please respect my work! I am counting on reputation.
		include('pot/InvitesDriver.php');

Have fun and rep me :)
 
It shows top values of guild members like a private guild high score list :)
 
Fatal error: Call to a member function getCustomField() on a non-object in C:\xampp\htdocs\guilds.php on line 140
 
Great work Kavvson! Just copy and paste with no problems :)
 
here is not working when you put more members on the guild page of an error, and it would be great if you put on the latest news from the Guild system of points and no deaths.
 
here is not working when you put more than three members of an error, and it would be nice if you put this system Guild of points and no deaths in index.php.
 
Back
Top