vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   PHP Widget??? (https://vborg.vbsupport.ru/showthread.php?t=243274)

mse2k 05-25-2010 05:50 PM

PHP Widget???
 
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. It might help you out.

-fab


All times are GMT. The time now is 01:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01224 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete