PDA

View Full Version : PHP Widget???


mse2k
05-25-2010, 05:50 PM
i have integrated a php widget for the vbgallery. i like to show the newest galeries. But it doesn`t work. Can everyone give me a help? This is the code ...

ob_start();

$username = ''; // the username for your db
$password = ''; // the password for your db
$host = 'localhost'; // in 90% of cases its localhost, if not you can check in your vbulletin config file.

mysql_connect ($host, $username, $password) or die
("Keine Verbindung moeglich");

mysql_select_db("...") or die
("Die Datenbank existiert nicht.");

$ergebnis = "SELECT catid, title FROM ppgal_categories ORDER BY catid DESC LIMIT 2";

while($row = mysql_fetch_object($ergebnis))
{
$output_bits .= '<a href="http://........de/gallery/browseimages.php?c='.$row[catid].'">'.$row[title].'</a>';

}

mysql_close;

$output = $output_bits;

ob_end_clean();

thx

ragtek
05-26-2010, 03:18 PM
you're fetching it as object (and not as an array) so you have to use $row->title ;)

mse2k
05-26-2010, 04:45 PM
$output_bits .= '<a href="http://.....de/gallery/browseimages.php?c='.$row->catid.'">'.$row->title.'</a>';

it doesn`t work too :o( Nothing to see in the cms...

ragtek
05-26-2010, 05:43 PM
remove ob_start();

mse2k
05-26-2010, 07:38 PM
i remove the ob_start(); nothing to see and then i remove the ob_end and see nothing too ...

fdifranco
05-28-2010, 11:09 PM
Check out a suggestion that I had for another fellow here (https://vborg.vbsupport.ru/showthread.php?t=237244). It might help you out.

-fab