2007-03-05, 04:12 PM
2007-03-05, 04:19 PM
You cannot use PHP code in templates, as far as I know. You will have to edit the php files manually. What are you trying to do ?
2007-03-05, 04:33 PM
i want to put php script at Board Statistic,such as including file from other directory.If can't edited from ACP there must by php itself,so do i need edit index.php ?? if so where i must put a line php code ??
exm:
// Build the forum statistics to show on the index page.
eval("\$forumstats = \"".$templates->get("index_stats")."";");
php code:
include '../stats.php';
exm:
// Build the forum statistics to show on the index page.
eval("\$forumstats = \"".$templates->get("index_stats")."";");
php code:
include '../stats.php';
2007-03-05, 06:50 PM
So you want to include the states page into some other external page?
Well usually we include everything at the start of the file.
However i believe you are trying to show stats in the index page of MyBB. Well including stats.php in index.php will cause a blank page i guess it wont work properly, so if you can specify what stats you want to show on MyBB index if this was your case tell us so that we give only the needed codes.
regards
Well usually we include everything at the start of the file.
However i believe you are trying to show stats in the index page of MyBB. Well including stats.php in index.php will cause a blank page i guess it wont work properly, so if you can specify what stats you want to show on MyBB index if this was your case tell us so that we give only the needed codes.
regards
2007-03-05, 08:09 PM
I have another code but hard to explain,because i need to include for each script.I have member already register whit one database,but after install myBB i need data member (username,password) automatically insert into myBB database after registration and then can be use by myBB board also website..thats why i need to develope by follow the rules
stats.php:
stats.php:
<?php //module to display the top users
include "../connect.php";
if(!isset($start))
{
$start=0;
}
$order="SELECT * from ext_users";
$order2=mysql_query($order);
$d=0;
$f=0;
$g=1;
while($order3=mysql_fetch_array($order2))
{
if($f%20==0)
{
$g++;
}
$d=$d+1;
$f++;
}
print " <table border='0' cellspacing=1 width='100%' align=center bgcolor=#333333><tr><td bgcolor=#484848 align=center>Player</td><td bgcolor=#484848 align=center>Monster</td><td bgcolor=#484848 align=center>Result</td></tr>";
$getbattlerecords="SELECT * from ext_battlerecords order by ID DESC Limit 0, 5";
$getbattlerecords2=mysql_query($getbattlerecords) or die("Could not query players");
while($getbattlerecords3=mysql_fetch_array($getbattlerecords2))
{
$getbattlerecords3[attname]=strip_tags($getbattlerecords3[attname]);
$command2 = "SELECT * from ext_users where ID='$getbattlerecords3[victimid]'";
$query2 = mysql_query($command2)
or die($db_error);
$fortinfo = mysql_fetch_array($query2);
$command1 = "SELECT * from gh_box where idname='$fortinfo[playername]'";
$query1 = mysql_query($command1)
or die($db_error);
$playerinfo = mysql_fetch_array($query1);
print " <tr><td style=background-color:#333333
onMouseover=\"this.style.backgroundColor='#FF9900';\"
onMouseout=this.style.backgroundColor='#333333';><a href=javascript:openpop('profile.php?name=$getbattlerecords3[attname]')>$getbattlerecords3[attname]</a></td><td align=center style=background-color:#333333
onMouseover=\"this.style.backgroundColor='#FF9900';\"
onMouseout=this.style.backgroundColor='#333333';><a href=index.box?url=$playerinfo[domain] target=_blank>$playerinfo[domain]</a></td><td style=background-color:#333333
onMouseover=\"this.style.backgroundColor='#FF9900';\"
onMouseout=this.style.backgroundColor='#333333';>$getbattlerecords3[result]</td></tr>";
}
print "</table>";
?>