Silverado05 Posted July 4, 2006 Posted July 4, 2006 Has anyone used this or can tell me of something that I can use to display random items on another site. Nothing like RSS unless I can have it display a picture. I have tried this but I can't seem to get it to work. Has anyone else tried this with success? http://www.oscommerce.com/community/contri...search,anywhere -Thanks Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.
Silverado05 Posted July 4, 2006 Author Posted July 4, 2006 Just some more information on this. This the page it calls that shows the errors. http://www.txcampingoutfitters.com/ext_disp_best_sellers.php Now here is the bit of code I am not quite sure of that I think is cause this problem. //currently in oscommerce/blogs need to be in /oscommerce so change directory //edit next line to change to your catalogue directory ( the .. goes up a directory level) chdir(''); I don't know what is suppose to go in the chdir('HERE'); because it's in the root of my site. Here is the full code. <?php /* Copyright : (c) 2004 lasermemory.com - ken meade Author: Ken meade Date: 27/08/2004 for Oscommerce 2.2 MS1 Link/Donation Ware, feel free to use this, and add to it, but If you use this on a site, please email me and either give a link to http://www.lasermemory.com or http://www.lasermemory.com/blog or send a paypal donation to [email protected] Please leave copyright message intact. */ // Remember current directory $orig_dir=getcwd(); //currently in oscommerce/blogs need to be in /oscommerce so change directory //edit next line to change to your catalogue directory ( the .. goes up a directory level) chdir(''); include('includes/application_top.php'); ob_start(); //start output buffering // You can change the next line to use whatever box you require for example product info,best sellers,whats new,etc include(DIR_WS_BOXES.'show_random.php');//include another file for the box you want $box_buffer=ob_get_contents();//save output ob_end_clean();//stop output buffering //Correct image paths, edit next line for your site details $box_buffer=str_replace("src=\"images", "src=\"http://www.txcampingoutfitters.com/images",$box_buffer); $box_buffer=str_replace("'", "\'" ,$box_buffer); // escape qoutes $box_buffer=str_replace("\n", "') \n document.write('" ,$box_buffer); // add newlines // alter table size if required echo "document.write('" . '<table border="0" width="160" cellspacing="0" cellpadding="0">' . "')\n"; echo "document.write('" . $box_buffer ."')\n"; echo "document.write(' </table>')\n"; chdir($orig_dir);//move back to original directory ?> These is the base of the instructions besides uploading two files. Alter then add the following line just after the <head> statememt <link rel="stylesheet" type="text/css" href="http://www.yourdomain.com/catalog/best_sellers_stylesheet.css"> Alter then insert the following line where you want the content to appear <p><script src="http://www.yourdomain.com/oscommerce/ext_disp_best_sellers.php" type="text/javascript" > </script> I have done this and nothing shows. Any help would be greatly appericated cause I am out of ideas. -Thanks Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.
Guest Posted July 4, 2006 Posted July 4, 2006 well if it's already at the same level simply remove the chdir lines from the top and bottom of the script, you don't need them.
Silverado05 Posted July 4, 2006 Author Posted July 4, 2006 Thank you Mark for the reply. That did the trick, I just commented out those lines and it works great now. -Thanks Again. Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.