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

Solved Characters injection doesn't work.

Pete Doherty

New Member
Joined
Sep 12, 2008
Messages
60
Reaction score
0
Solved. It was the hide_char value that was set to NULL when infact it was needed to be set to 0 or 1.

Code:
UPDATE players SET hide_char = 0 WHERE hide_char IS NULL;

Code:
ALTER TABLE players MODIFY hide_char INT(11) DEFAULT 0;


Thank you Chris!

---------

Ok, this is the original code from the latest Modern AAC. I don't know if any others have this problem, but anyways, it seems that the query doesn't find my characters and hence doesn't load. If I remove "if(!empty($characters))" the title "Characters" appear, thus proving that the injection itself loads. I've made sure my account have plenty of characters but still the "Characters" does not appear when viewing characters.

So my quess is that the query is faulty or perhaps my database. Any ideas?

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="title">Characters</div>';
        foreach( $characters as $character )
        {
                ?>
                <table 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 have also tried this code without success.
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
        }
?>
 
Last edited:
Get on teamviewer and your problems will be resolved in less than 10 minutes (probably 5), with Chris.

Magic! :thumbup:
Haha why thank you. xD But the issue is almost resolved so shouldn't be necessary.
 
Thank you sooo much for all the help Chris.

J.Dre I actually didnt know of teamviewer until just now, for the next time ill keep that in mind. thank you
 
Back
Top