Quote:
Originally posted by kaost451
damn has any one got this to work on vb index.php? Because I got it to work but cant call the php file ? can some one help me out?
|
Yes. Firefly helped me out with this one, it's a modification to code posted a few months back here by wajones.
First, put this in your phpinclude template:
PHP Code:
function getLast10() {
global $last10;
ob_start();
include_once('./last10.php');
$last10 = ob_get_contents();
ob_end_clean();
}
getLast10();
Now, in the last10.php script itself, comment the following out (it's near the top)
PHP Code:
require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
Now just stick the variable $last10 wherever you want it in your templates, including the forumhome (index) and you are set.
Note that if you want to use this script in more than one place - say, one on your vb index (or it's own template, like I do) and one on your non-vb home page - you will want to use two instances of it. I renamed one last5.php and use it for my front page minus the change I outlined above.