vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Photopost Classifieds in a Widget (https://vborg.vbsupport.ru/showthread.php?t=237960)

roymogg 03-10-2010 05:07 PM

Photopost Classifieds in a Widget
 
I have been trying to get the latest photopost classifieds direct php working:

I am using the following code from over there at PC:

PHP Code:

$host 'localhost';
$dbUser 'example';
$dbPass 'password';
$db 'forum';
mysql_connect("$host""$dbUser""$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());
ob_start();
$result mysql_query("SELECT id,cat,bigimage FROM cp_products WHERE bigimage != '' order by rand() LIMIT 2" ) or die(mysql_error());
while(
$row mysql_fetch_array$result )) {
print
"<center>";
print 
"<a href=\"http://www.example.com/classifieds/showproduct.php?product=" $row['id'] . "&cat=" $row['cat'] . "\"><img src=\"http://www.example.com/classifieds/data/" $row['cat'] . "/thumbs/" $row['bigimage'] . "\" border=\"0\"></a>";
print 
"</center>";
}
$output .= ob_get_contents();
ob_end_clean(); 

I put this into a widget or forum block and module renders but no content and I cannot see a problem.

EDIT: There was a slip in the path to the image - the above code works fine

cheers

Roy

Marco van Herwaarden 03-11-2010 09:32 AM

You should ask this at the vBAdvanced website, assuming you are asking it to be included on a vBA page.

roymogg 03-11-2010 09:49 AM

Marco,

I have posted this question in the wrong forum - I have VB4 and want to run this code in a CMS and a blocks widget (I do not have VBA anymore)

can this thread be moved to the correct forum please?

cheers

roymogg

Marco van Herwaarden 03-11-2010 02:22 PM

In that case, moved. ;)

Videx 03-11-2010 09:47 PM

I've got that same code all ready to go, just haven't had the time for it. Sorry to hear it's not working. I'd also like a forum block, but have no idea how those relate to widget code.

roymogg 03-21-2010 05:36 PM

Hi Marco,

I have the photopost classifieds php direct execution widget working fine as a CMS widget but I have copied the code into a forum blocks php widget and the block shows up but the ads do not render.

Is there any difference between the way CMS widgets work and the forum blocks equivalent?

What is the significance of the cache time in forum-block widgets?

regards

Roy


All times are GMT. The time now is 04:12 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.01495 seconds
  • Memory Usage 1,725KB
  • 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)bbcode_php_printable
  • (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