PHP scripts dont work?

xryskom

Member
How do i add php scripts to the visiolist?
We tried to add this script:
<?php
include('/home/domair/public_html/forum/SSI.php');

$translations = array(
'posts'=>'Posts on forum',
'topics'=>'Threads on forum',
);

$info = ssi_boardStats('return');
foreach($info as $key=>$val) {
if(($k = array_key_exists($key, $translations)) !== false) {
$title = $translations[$key];
echo '<li>'.$title.': '.$val.'</li>';
}
}
?>
to the wrapper file in the skin but instead of working , it shows whole php code . Ps. Separately or in any other sites the script works just fine .
Help me as quick as possible.
Thanks~
 

Mark

Administrator
Staff member
Php should be handled in plugins, not templates. See the tutorial on how to make a simple plugin.
 

Mark

Administrator
Staff member
Maybe, I seen code after the include. So that code needs to be moved into the included file, or handled via plugin
 

Basti

Administrator
Staff member
Ahh ye. Well easiest for him would be if he places that code onto his forum folder e.g forum_stats.php
then do the include html tag
 

xryskom

Member
ok fixed!!! is working!

and one more

is it posible to display number of sites in top in total? ( for servers indexed )
 

Mark

Administrator
Staff member
this is part of the default theme:

{$lng->main_members}: {$num_members}
 

xryskom

Member
one last!!!!! :p

I wrote a small php script that displays site visitor IP and his country flag , now I have a problem adding that script into the VisioList , is there any way of making this script work on VisioList?

If the only way is writing some sort of plugin atleast give a hint of how to make a plugin with special codes like for example {$visitor_ip} .
Also , is there any ready code like that for displaying visitor's ip? country?
 

Mark

Administrator
Staff member
No, this is what plugins are designed for. The easy insertion of PHP into the application.
 
Top