• 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] How can I insert php in my layout

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,136
Solutions
12
Reaction score
1,115
Location
Germany :O
Hello
I hope you can help me.
I am rewriting my layout for modern aac and I have a problem. My layout contains a php code and I want to know how to add it in modern aac.
If I use "<?php ?>" as normally it just displays the whole code.
I tried using an injection but it only works on a certain page then and also it is in the content part then.
~Summ
 
Last edited:
You can create external PHP file and use {include_php}

Smarty

or just between
{php} {/php} buy you need to include in index.php Smarty library because use of PHP is disallowed by default.
 
Example of PAXTON's post:

test.php
PHP:
<?php

require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();

$data = $SQL->query('SELECT * FROM `players` WHERE `name` = "Account Manager"')->fetch();

echo 'Character name: '.$data['name'];

?>

templatename.tpl
Code:
{include_php file='test.php'}
 
Back
Top