Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 03-10-2010, 05:07 PM
roymogg roymogg is offline
 
Join Date: Jun 2007
Location: UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-11-2010, 09:32 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should ask this at the vBAdvanced website, assuming you are asking it to be included on a vBA page.
Reply With Quote
  #3  
Old 03-11-2010, 09:49 AM
roymogg roymogg is offline
 
Join Date: Jun 2007
Location: UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 03-11-2010, 02:22 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In that case, moved.
Reply With Quote
  #5  
Old 03-11-2010, 09:47 PM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 03-21-2010, 05:36 PM
roymogg roymogg is offline
 
Join Date: Jun 2007
Location: UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:33 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.04693 seconds
  • Memory Usage 2,206KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete