• 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 (Character view)

Pete Doherty

New Member
Joined
Sep 12, 2008
Messages
60
Reaction score
0
The problem is that when viewing a character who got a multiple character account I only see one of its characters in the "list".

Also, I would like to add the character I'm currently viewing in the same field, with online/offline-status down there instead (like real Tibia).

Code:
<?PHP

        // Reject any unwanted access.
        if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
        
        $player = $GLOBALS['player'];
        $config = $GLOBALS['config'];
        $SQL = POT::getInstance()->getDBHandle();
        
        $characters = $SQL->query( 'SELECT `c`.`name`, `c`.`vocation`, `c`.`world_id` FROM `players` AS `c` LEFT JOIN `players` AS `p` ON `p`.`account_id` = `c`.`account_id` AND c.deleted = 0 AND c.hide_char = 0 AND p.hide_char = 0 WHERE `p`.`id` = '.$player->getId( ).' AND `c`.`id` != '.$player->getId( ).';' )->fetchAll();
        if(!empty($characters))
        echo '<div class="bar">Characters</div>';
        foreach( $characters as $character )
        {
                ?>
                <table style="width: 100%;">
                        <tr>
                                <td style="width: 40%;"><?PHP echo $character['name']; ?></td>
                                <td style="width: 25%;"><?PHP echo $config['server_vocations'][$character['vocation']]; ?></td>
                                <td style="width: 25%;"><?PHP echo $config['worlds'][$character['world_id']]; ?></td>
                                <td style="width: 10%;"><a href="<?PHP echo WEBSITE; ?>/index.php/character/view/<?PHP echo $character['name']; ?>"><strong>View</strong></a></td>
                        </tr>
                </table>
                <?PHP
        }
?>


UPDATED, Read my latest post please.
 
Last edited:
characterview.jpg

This illustrates what I'm thinking, I think.

EDIT: The smaller pictures within the picture is from another OT-server which has it the way I'd like it to be.
 
With a little of php-knowlage, copy the part of name and world from the characters.php to the place u want to move.
I would do it for u but i dont have time and modern aac files atm, maybe later x_x

Good luck btw.
 
Ok, my initial problem has gotten worse, I now can't see ANY other account character when viewing characters on my homepage. It's like the injection of specifically "characters" is left out, because deaths, quests and so fourth work like a charm.

Code:
<?PHP

        // Reject any unwanted access.
        if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
        
        $player = $GLOBALS['player'];
        $config = $GLOBALS['config'];
        $SQL = POT::getInstance()->getDBHandle();
        
        $characters = $SQL->query( 'SELECT `c`.`name`, `c`.`vocation`, `c`.`world_id` FROM `players` AS `c` LEFT JOIN `players` AS `p` ON `p`.`account_id` = `c`.`account_id` AND c.deleted = 0 AND c.hide_char = 0 AND p.hide_char = 0 WHERE `p`.`id` = '.$player->getId( ).' AND `c`.`id` != '.$player->getId( ).';' )->fetchAll();
        if(!empty($characters))
        echo "<br /><table width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr><td bgcolor='505050'><font color='white'><b>Characters</b></font></td></tr></table>";
        foreach( $characters as $character )
        {
                ?>
                <table bgcolor="505050" style="width: 100%;">
                        <tr>
                                <td style="width: 40%;"><a href="<?PHP echo WEBSITE; ?>/index.php/character/view/<?PHP echo $character['name']; ?>"><b><?PHP echo $character['name']; ?></b></a></td>
                        </tr>
                </table>
				<br />
                <?PHP
        }

?>

I've made sure no characters are hidden, and also tried hiding them if it for some reason was a "reversed" issue, this obviously did not work either. (Also: I haven't tampered with the injection code in view_character.php). This leaves me to believe it's a database problem, but I'm not sure.

Help please!

EDIT: When I remove the line "if(!empty($characters))", the grahpics of the injection appears, but without characters, as if the account only had 1 character, when in fact I know it has numerous characters.
 
try this

PHP:
<?PHP

	// Reject any unwanted access.
	if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
	
	$player = $GLOBALS['player'];
	$config = $GLOBALS['config'];
	$SQL = POT::getInstance()->getDBHandle();
	
	$characters = $SQL->query( 'SELECT `c`.`name`, `c`.`vocation`, `c`.`world_id` FROM `players` AS `c` LEFT JOIN `players` AS `p` ON `p`.`account_id` = `c`.`account_id` AND c.deleted = 0 AND c.hide_char = 0 AND p.hide_char = 0 WHERE `p`.`id` = '.$player->getId( ).' AND `c`.`id` != '.$player->getId( ).';' )->fetchAll();
	if(!empty($characters))
	echo '<div class="bar">Characters</div>';
	foreach( $characters as $character )
	{
		?>
		<table style="width: 100%;">
			<tr>
				<td style="width: 40%;"><?PHP echo $character['name']; ?></td>
				<td style="width: 25%;"><?PHP echo $config['server_vocations'][$character['vocation']]; ?></td>
				<td style="width: 25%;"><?PHP echo $config['worlds'][$character['world_id']]; ?></td>
				<td style="width: 10%;"><a href="<?PHP echo WEBSITE; ?>/index.php/character/view/<?PHP echo $character['name']; ?>"><strong>View</strong></a></td>
			</tr>
		</table>
		<?PHP
	}
?>
 
Same problem, no show. And the same thing happens when I remove the line "if(!empty($characters))" graphic shows without characters. Do you think It's my database that's messed up?
 
Back
Top