Reply
Coder Needed ASAP...
Old 05-03-2005, 12:04 PM Coder Needed ASAP...
Brian07002's Avatar
Webmaster Talker

Posts: 527
Name: Brian
Location: United States
Let me explain...

I have purchase Pinnacle Shopping Cart, and they use the Smarty Template Engine for the cart. My problem is that I want to be able to display a featured product table on my homepage, but I need to create a plugin that will create a database query on the products table in my database, and select a random product record. Then the plugin would need to assign the random record to a smarty array. Can you help here?

For a good example of what I want is at the site below (note the feature box right on the homepage) Not too sure if they use the smarty engine, but this is the general idea of what I want.

I have found a working script to query my database for the random product, but I am unfamiliar with the Smarty Template Engine.

Here's the code for the random product:

Code:
// PHP script 
<? 
// Connect to the database 
mysql_connect ('localhost', 'user', 'pass') ; 
mysql_select_db ('db'); 

// Edit this number to however many links you want displaying 
$num_displayed = 1 ; 

// Select random rows from the database 
$result = mysql_query ("SELECT * FROM products ORDER BY RAND() LIMIT $num_displayed"); 

// For all the rows that you selected 
while ($row = mysql_fetch_array($result)) 

{ 
// Display them to the screen... 

echo "<a href=\"" . $row["link"] . "\"> 
<img src=\"" . $row["image"] . "\" border=0 alt=\"" . $row["text"] . "\"> 
</a>" ; 
} 
?>

If you have the time to do a script like that, I would appreciate it alot! I am one to return favors, my homepage is: Also, I am looking for another script, javascript or php for this one...I need the script to rotate banners based on a specific date, (Seasonal Related) and also would run as a cron job...I have searched & searched, and one that I *think* would've worked, but can't find a working link to download it is: Holiday.pl (a perl script). I am planning on using this type of script for advertising merchandise for MY WEBSITE ONLY...It Would even be nice to have an admin section to the script that allows me to select the banners that I want the script to load, and also be able to choose the date I want the banner to display, and the date I want the next banner to show...Needs to support 468x60px banners...Smaller ones will be ok as well.

I hope I have been clear with all this...

Thank you in advance!
-Brian
__________________
Millart's Wonderful World of Vector Art
http://millart.110mb.com/

Last edited by Brian07002 : 05-03-2005 at 12:09 PM.
Brian07002 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Reply     « Reply to Coder Needed ASAP...
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11646 seconds with 12 queries