Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[WIDGET] PhotoPost Classifieds Latest Items Posted w/images only Details »»
[WIDGET] PhotoPost Classifieds Latest Items Posted w/images only
Version: 1.00, by Hostboard Hostboard is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.1.4 Rating:
Released: 09-03-2011 Last Update: Never Installs: 8
 
No support by the author.

I take no credit for the code presented. The code was posted by individuals on PhotoPost.com All I did was put the posted code from the few threads together to make this work and present it in a single location. Also I hope by placing it at .org others who do not visit photopost.com often will be able to use it.

If this code infringes on anything or Chuck at PhotoPost wants it removed please feel free to do so.

If there is a better way to do this, please feel free to post any changes, additions or alterations.

This code is unsupported by me.
Working on 4.1.5pl1
  • Goto Admincp->vBullietin CMS->Widgets->Create New Widget
  • Choose PHP Direct Execution as Widget's Type
  • Place a Title. eg Upcoming Events. Keep it short as this is what will appear as title on your pages.
  • Click Save
  • Click Configure on the right of the new created widget.
  • Remove the default code that appears.
  • Copy and Paste the code that you can find below.
  • Edit: $host, $dbUser, $dbPass, and $db entries to their correct values.
  • Edit: Enter your domain and path to classifieds.
  • Edit: Set limit to number of classifieds you want (currently set for 6)
  • Leave the template name as is (vbcms_widget_execphp_page)
  • Click Save
  • Goto Admincp->vBullietin CMS->Layout Manager
  • Click Go on the Default Layout
  • Add the Widget to your Layout
  • Click Save
Code:
$host = 'localhost';
$dbUser = 'DataBaseUserID';
$dbPass = 'DatebasePassword';
$db = 'DataBaseName';
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,title FROM cp_products WHERE bigimage != '' order by rand() LIMIT 6" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print"<center>";
print "<a href=\"http://www.YourDomain.com/PathTo/classifieds/showproduct.php?product=" . $row['id'] . "&cat=" . $row['cat'] . "\"><img src=\"http://www.YourDomain.com/PathTo/classifieds/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\" border=\"0\"></a>";
print "<br />" . $row['title'] . "</center><br />";
}

$output .= ob_get_contents();
ob_end_clean();
Working Demo: http://www.pwrhouse.com/rcmt/index.php
This is a temporary location for this site. When it becomes 404'd the permanent location will be http://www.rcmt.net and a working demo will be able to be seen there.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-04-2011, 09:33 PM
1320Nation 1320Nation is offline
 
Join Date: Sep 2008
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Guest do not have permission to access this page to view demo. Go ahead and delete this post once you fix the permissions.
Reply With Quote
  #3  
Old 09-04-2011, 10:19 PM
Hostboard's Avatar
Hostboard Hostboard is offline
 
Join Date: May 2002
Location: CT
Posts: 843
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by psychobike View Post
Guest do not have permission to access this page to view demo. Go ahead and delete this post once you fix the permissions.
Fixed. Sorry about that...
Reply With Quote
Reply


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 01:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03630 seconds
  • Memory Usage 2,228KB
  • Queries Executed 17 (?)
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)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)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