[WIDGET] PhotoPost Classifieds Latest Items Posted w/images only
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
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(); 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. Download No files for download. |