• 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!

Modern AAC - Customize your Guild_view

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Guild_View.php​

10h11y9.jpg

Open \system\application\views and view_guild.php replace all with:

PHP:
<?php
$ide = new IDE;
try { $ide->loadInjections('guild_view'); } catch(Exception $e) { error($e->getMessage()); }
$logo = (file_exists("public/guild_logos/".$guild->getId().".gif")) ? "<img src='".WEBSITE."/public/guild_logos/".$guild->getId().".gif' width='64' height='64'>" : "<img src='".WEBSITE."/public/guild_logos/default.gif'>";
?>

<style type="text/css">
	#logon { width: 97%; height: 100%; padding: 0.5em; }
	#logon h3 { text-align: center; margin: 0; height 10px;}
	</style>

<div id="logon" class="ui-widget-content">
	<h3 class="ui-widget-header"> <?PHP ECHO "".$guild->getName()."";?> </h3>
	<br>
<div id="characters" class="ui-helper-clearfix">
<?PHP 
ECHO "<div style=\"float:left;padding: 0px 5% 9px;\">";
ECHO "$logo"; 
ECHO "</div>";
ECHO "<div style=\"padding: 0px 23% 0px; width:75%;\">";
$mod = $guild->getCustomField("motd");
ECHO $mod;
ECHO "<br><BR>Guild Leader: <a href='".WEBSITE."/index.php/character/view/".$guild->getOwner()."'>".$guild->getOwner()."</a>";
ECHO "</div>";
?>
</div>
</div>
<br>
<?PHP

       
        $rank_list = $guild->getGuildRanksList();
        $rank_list->orderBy('level', POT::ORDER_DESC);
        $showed_players = 1;
                if($ide->isLogged()) {
                $ots = POT::getInstance();
                $ots->connect(POT::DB_MYSQL, connection());
                $account_logged = new OTS_Account();
                $account_logged->load($_SESSION['account_id']);
                $account_players = $account_logged->getPlayers();
                }
        echo "<div style=\"padding: 0.5em;\" class=\"ui-widget-content\">";
                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)
                        {
                                echo "<div class=\"ui-widget-header\"><center><b>".$rank->getName()."</b></center></div>";
                                foreach($players_with_rank as $player)
                                {
                                        $guild_nick = $player->getGuildNick();
                                        if(!empty($guild_nick)) $guild_nick = "($guild_nick)"; else $guild_nick = "";
										
                                        if($ide->isLogged()) {$leave = (in_array($player->getName(), $account_players)) ? "<a href='#' onClick='if(confirm(\"Are you sure you want to leave ".$guild->getName()." with a ".$player->getName()." ?\")) window.location.href=\"".WEBSITE."/index.php/guilds/leave/".$guild->getId()."/".$player->getId()."\"'><img src='".WEBSITE."/public/images/false.gif'/></a>" : ""; }
                                        echo @"<li class=\"ui-state-default ui-corner-all\">$leave <a onmouseover=\"tooltip.show('$input', 225);\" onmouseout=\"tooltip.hide();\" href=\"".WEBSITE."/index.php/character/view/".$player->getName()."\">".$player->getName()."</a> $guild_nick </li>";
                                }
                        }
                }
        echo "</div><br>";
               
        if(!$ide->isLogged()) {
                alert("You need to be logged in to access any options.");
        }
        else {

                require_once('system/application/libraries/POT/InvitesDriver.php');
                new InvitesDriver($guild);
                $invited_list = $guild->listInvites();
				        echo "<div style=\"padding: 0.5em;\" class=\"ui-widget-content\">";
                if(count($invited_list) == 0)
                        echo "<center><b>This guild did not invite anyone.</b></center>";
                else {

                echo "<table width=\"100%\"><tr align=center><td width=50%><div class=\"ui-widget-header\"><b>Name<b></div></td><td width=50%><div class=\"ui-widget-header\"><b>Join</b></div></td></tr></table><table width=\"100%\">";
                $characters = array();
                if($ide->isLogged()) {
                        foreach($account_players as $player_from_acc) {
                                $characters[] = $player_from_acc->getName();
                        }
                }
                       
                foreach($invited_list as $invited_player)
                        {
if($ide->isLogged() && in_array($invited_player->getName(), $characters)) {
echo "<tr><td><li class=\"ui-state-default ui-corner-all\"><center><a href=\"".WEBSITE."/index.php/character/view/".$invited_player->getName()."\">".$invited_player->getName()."</a></center></li></td><td><center><a href='".WEBSITE."/index.php/guilds/join/".$guild->getId()."/".$invited_player->getId()."'><span class=\"ui-icon ui-icon-check\"></span></a></center></li>";    
             }
       else {
       echo "<tr><td width=50%><li class=\"ui-state-default ui-corner-all\"><center><a href=\"".WEBSITE."/index.php/character/view/".$invited_player->getName()."\">".$invited_player->getName()."</a></center></li></td><td width=50%><center><span class=\"ui-icon ui-icon-closethick\"></span></center></tr>";
                                               
                                                }
                               
                               
                        }
                echo "</table></div>";
                }
       
        }
        if($ide->isLogged() && in_array($guild->getOwner(), $account_players)) {
                echo "<br/><div class='toolbar'>";
                echo "<a href='".WEBSITE."/index.php/guilds/management/".$guild->getId()."'>Guild Management</a>";     
                echo "</div>";
        }

?>

The colors might change since its all based on the Jquery theme
 
Looks really nice though.. When I added it my layout got abit messed up and I dont know how to fix that..
Ofcourse I saved a copy of my old file though, I rather fix the layout then going back to my old one.
 
Nice :D
What this variable <a onmouseover=\"tooltip.show('$input', 225);\" etc...> must show?
 
A PHP Error was encountered

Severity: Notice

Message: Undefined index: account_id

Filename: models/guilds_model.php

Line Number: 76

A PHP Error was encountered

Severity: Notice

Message: Undefined index: account_id

Filename: models/guilds_model.php

Line Number: 82

76
$viceRank = 2;


82
return $this->db->query("SELECT `p`.`id`, `p`.`name` FROM `guild_ranks` AS `r` LEFT JOIN `players` AS `p` ON `p`.`rank_id` = `r`.`id` WHERE `r`.`guild_id` = ".$this->db->escape($id)." AND `r`.`level` = '".$Rank."' AND `p`.`account_id` = '".$_SESSION['account_id']."' ")->num_rows() ? true : false;
 
its show a black line when you put a mouse over a player, how to make that thing work?
like vocation, level or some information?
 
Back
Top