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

Bugs + Suggestion + Request

Fatal error: Call to a member function getID() on a non-object

That is the problem right?
 
with your script:

Lua:
 <?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)) or $viceleaders) { 
                echo "<br/><div class='toolbar'>"; 
                echo "<a href='".WEBSITE."/index.php/guilds/management/".$guild->getId()."'>Guild Management</a>";      
                echo "</div>"; 
        } 

?>

there's a problem with $viceleaders, it's not defined '-'
 
Already found a fix to all my problems :)
Now vice-leaders can invite players and players can leave perfectly.
 
Hahahaha I was going to post that... Talk to MiPo91, he has solution but he is trading it for other scripts :)
 
Could you post the solutions please? i really need them.. at least how to fix the leave guild error..
thanks
 
@up
change:
Code:
$player->getID()
to
Code:
$player
 
Sry, I wont, because I traded them for some of mine scripts, if you want we can make a trade too... What you can offer?
 
Back
Top