You want to introduce the information from a forum in other pages?
Whether more easy to create 1 ( one) file in $bburl the catalogue, to get access to all functions and to use them? Introduction then should look as
PHP Code:
<? include " http: //full.address.to.site/vbforum_dir/this_file.php ";? >
we create a file this_file.php and we write in him(it) something such as
PHP Code:
//-------------------------------------------
<?
require("./global.php");
if ($ac == "header") {
eval (" \ $headinclude = \ " " .gettemplate ('headinclude.' " \ ";");
eval (" \ $header = \ " " .gettemplate ('header.' " \ ";");
echo replace_var ("{ htmldoctype }<html><head><title>$vbtitle </title>$headinclude</head><body>$header<br>");
}
// -- Function replace_var is taken that it was possible to alter only top of a window, not creating new template. --
function replace_var ($text) {
global $DB_site, $replacementsetid;
$vars = $DB_site->query ("SELECT findword, replaceword FROM replacement WHERE replacementsetid IN (-1, '$replacementsetid') ORDER BY replacementsetid DESC, replacementid DESC ");
while ($var = $DB_site->fetch_array($vars)) {
if ($var ['findword'! = " ") {
$text=str_replace ($var ['findword'], $var ['replaceword'], $text);
}
}
$DB_site-> free_result ($vars);
return $text;
}
?>
it is introduced
PHP Code:
<? include "http://full.address.to.site/vbforum_dir/this_fi le.php?ac=header";? >
On an output we shall receive normal heading for use in other pages.....
Laziness to write footer and other functions?
We add in our file of a line
PHP Code:
<?
if ($ac == "footer") {
eval (" dooutput (\ " " .gettemplate (" footer "). " \ "); ");
}
if ($ac == "login") {
echo makelogincode ();
exit;
}
if ($ac == "forumjump") {
makeforumjump ();
echo $forumjump;
exit;
}
?>
All!!!
For introduction of your example (the last 5 sent) the following
PHP Code:
<?
if($ac=="lastpost") {
if ($getlastpost=$DB_site->query("SELECT postid,username,dateline FROM post WHERE post.visible=1 ORDER BY dateline DESC LIMIT 0,5")) {
$i=1;
while ($getlast=$DB_site->fetch_array($getlastpost)) {
$color = iif((($i/2)==round($i/2)),"{ firstaltcolor }","{ secondaltcolor }");
$lastpost .= "<tr bgcolor=$color><td><a href=showthread.php?s=$session[sessionhash]&postid=$getlast[postid]#post$getlast[postid]>$getlast[username]</a></td><td>".vbdate($dateformat,$getlast[dateline])."</td></tr>";
$i++;
}
$DB_site->free_result($getlastpost);
unset($getlastpost);
echo replace_var("<table cellpadding={ tableouterborderwidth } cellspacing=0 border=0 bgcolor={ tablebordercolor } { tableouterextra } width={ tablewidth } align=center><tr><td><table cellpadding=4 cellspacing={ tableinnerborderwidth } border=0 { tableinnerextra } width=100%>$lastpost</table></table>");
exit;
}
}
?>
Include in other page
PHP Code:
<? include "http://full.address.to.site/vbforum_dir/this_file.php?ac=lastpost";? >
Successes in work