spooks Posted August 6, 2008 Posted August 6, 2008 Yes, just using specials is a bit short sited. The following query will take a random selection of product, to the limit set, from the current parent category. Please note: as the flash is cached, if you change category you will see no change. Find: $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC LIMIT $limit_product_number"; $specials_query = tep_db_query($specials_query_raw); while ($specials = tep_db_fetch_array($specials_query)) { if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) { $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'"); $products = tep_db_fetch_array($products_query); } Replace with: $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_id = pd.products_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$current_category_id. "' ORDER BY RAND() LIMIT " . $limit_product_number; $specials_query = tep_db_query($specials_query_raw); while ($specials = tep_db_fetch_array($specials_query)) { Find: $xmlfile .= "\t\t" . '<product filename="'.$new_image.'" productname="'.$specials['products_name'].'" productprice="'.$kampanya->display_price($specials['specials_new_products_price'],'').'" url="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']). '" />'."\n"; Replace with: $xmlfile .= "\t\t" . '<product filename="'.$new_image.'" productname="'.$specials['products_name'].'" productprice="'.($specials['products_price'] > 0 ? $kampanya->display_price($specials['products_price'],'') : 'P.O.A').'" url="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']). '" />'."\n"; Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
spooks Posted August 6, 2008 Posted August 6, 2008 Good contrib, but I have a couple of issues: You start looking at DIR_WS_IMAGES but the rest of the time refer to images/ so if DIR_WS_IMAGES is not set to images/ the contrib will not work. This requires that the images folder be writable, this is a known security risk. Especially now that you've given the possibility to write new resized images, why not ask to create a special directory (kampanya?) and put images + xml in that. :) Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
libralion Posted August 6, 2008 Posted August 6, 2008 Hi Comarge, It looks great, but what version of Oscommerce are you using? Because I have searched in all files, but I can't find: <td class="main"><?php echo TEXT_MAIN; ?></td> I am using oscommerce 2.2ms2 The code at the end of the index.php looks like this: <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="main"><?php echo tep_customer_greeting(); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><?php echo tep_get_defined_content('Catalog Main'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_DEFAULT_SPECIALS); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '4'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> Quote
libralion Posted August 6, 2008 Posted August 6, 2008 Hi, I found it. Just replace this line in index.php: <td class="main"><?php echo tep_get_defined_content('Catalog Main'); ?></td> with this line: <td class="main" align="center"><?php include(DIR_FS_CATALOG . 'kampanya.php'); ?></td> Works great! Thanks! Looks nice. Quote
spooks Posted August 6, 2008 Posted August 6, 2008 Hi,I found it. Just replace this line in index.php: <td class="main"><?php echo tep_get_defined_content('Catalog Main'); ?></td> with this line: <td class="main" align="center"><?php include(DIR_FS_CATALOG . 'kampanya.php'); ?></td> Works great! Thanks! Looks nice. You have a template, thats why you have a non-standard layout. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
libralion Posted August 6, 2008 Posted August 6, 2008 You have a template, thats why you have a non-standard layout. No sorry I have no template. Just the standard Oscommerce version. Quote
spooks Posted August 6, 2008 Posted August 6, 2008 No sorry I have no template. Just the standard Oscommerce version. You don't have standard osC, some of the lines you show don't exist in MS2 - rc2a and the function tep_get_defined_content does not appear anywhere in the function list!! Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
trainwatcher Posted August 6, 2008 Posted August 6, 2008 (edited) Very nice mod! Can someone tell me how the background colour codes work? There seem to be six figures 000000 etc. Sorry - I feel you're probably going to laugh at this question but hope you can help non the less. Thanks! Edited August 6, 2008 by trainwatcher Quote
libralion Posted August 6, 2008 Posted August 6, 2008 You don't have standard osC, some of the lines you show don't exist in MS2 - rc2a and the function tep_get_defined_content does not appear anywhere in the function list!! Sam I have the standard Oscommerce-2.2ms2-060817. The lines that were changed are probably because of a contribution that I installed. :rolleyes: Quote
spooks Posted August 6, 2008 Posted August 6, 2008 Sam I have the standard Oscommerce-2.2ms2-060817. The lines that were changed are probably because of a contribution that I installed. :rolleyes: Precisely, so the code you showed was 'non standard' Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
libralion Posted August 6, 2008 Posted August 6, 2008 Precisely, so the code you showed was 'non standard' Sure Sam if that makes you happy. :rolleyes: Quote
trainwatcher Posted August 6, 2008 Posted August 6, 2008 So these back ground codes. I'm sure its a doddle. Can anyone enlighten me? Quote
libralion Posted August 6, 2008 Posted August 6, 2008 So these back ground codes. I'm sure its a doddle. Can anyone enlighten me? 000000 is the color black. Here you can find the codes of a lot of colours: HTML Colours Quote
♥stubbsy Posted August 6, 2008 Posted August 6, 2008 Suggestion: make the products shown in the carousel selectable via the admin interface! perhaps this contribution can help, cause much of the code can be reused for the selection: http://addons.oscommerce.com/info/651 I'll second that... nearly all my prices are 'special' so I wouldn't have any control over what goes in the carousell at the moment! Dave Quote
trainwatcher Posted August 6, 2008 Posted August 6, 2008 Cheers, I'm much obliged Libralion. You are most kind. Thanks! Quote
bksbeat Posted August 6, 2008 Posted August 6, 2008 Hi Folks, Just added this contrib and its great, but I am having a few issues Please check my website www.nontando.com The images seem small and I am getting somewhat of a shadow. Now I have changed the code in kampanya.php to pref = 'small'; $file = DIR_FS_CATALOG . DIR_WS_IMAGES .$specials['products_image']; $newfile = DIR_FS_CATALOG . DIR_WS_IMAGES .$pref .$specials['products_image']; copy($file, $newfile); $obj = new img_opt(); // set maximum width within wich the image should be resized $obj->max_width(140); // set maximum height within wich the image should be resized // for example size of the area in which image to be displayed $obj->max_height(140); $obj->image_path(DIR_FS_CATALOG . DIR_WS_IMAGES .$pref .$specials['products_image']); // call the functio to resize the image $obj->image_resize(); So, it seems increasing the max width & height does not seem to be making much diff. Hence, is there any way I can improve the look of the images as it looks so so? Also, is there any way it can display anything else besides what I have on "specials" ** It is no biggie, but I had a swf file for my footer, and I think when I installed the javascript file it overwrote the existing file I had there, hence the footer seemed to disappear? Thanks Gary Quote
kjvision Posted August 6, 2008 Posted August 6, 2008 (edited) Hello Together Its very nice contribute but i think carrousel is not every man things,thats mean its just confiuse some people. I have already talk with MIN(The maker of this flash) and i found a like same thinks on his website but its not Carousel , its Thumbnail in slide show. Very very nice. So i have ask here. WHO HAS INTRESST TO MAKE A NEW CONTRIBUTES LIKE THIS AS SLIDE ? I will be happy if COM ARGE work with me or wiht us. So who has Intresst ? Changes in the new contibutes slide show: smal images no security risk in image folder (maybe create owhn folder) what do you think ? beste wishes kjvision P.S. sorry for my bad english Edited August 6, 2008 by kjvision Quote
bksbeat Posted August 6, 2008 Posted August 6, 2008 Sorry - but you guys can ignore my previous post. This is a great contr. but I just realized it caused me to lose all my text that I had incl. in english.php (as you can see www.nontando.com). No fault of the contr. - Just basically I needed to decide and have some of that info, is important. Maybe down the road I can find a way to get this contr on the site Thks Gary Hello Together Its very nice contribute but i think carrousel is not every man things,thats mean its just confiuse some people. I have already talk with MIN(The maker of this flash) and i found a like same thinks on his website but its not Carousel , its Thumbnail in slide show. Very very nice. So i have ask here. WHO HAS INTRESST TO MAKE A NEW CONTRIBUTES LIKE THIS AS SLIDE ? I will be happy if COM ARGE work with me or wiht us. So who has Intresst ? Changes in the new contibutes slide show: smal images no security risk in image folder (maybe create owhn folder) what do you think ? beste wishes kjvision P.S. sorry for my bad english Quote
3goo Posted August 6, 2008 Posted August 6, 2008 the errors im getting?? Warning: include(kampanya.php) [function.include]: failed to open stream: No such file or directory in /home2/*****/public_html/index.php on line 307 Warning: include() [function.include]: Failed opening 'kampanya.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/******/public_html/index.php on line 307 hi everyone, i got the same problem.... any one help? thanks regards Quote
barraboy Posted August 6, 2008 Posted August 6, 2008 Hi,I found it. Just replace this line in index.php: <td class="main"><?php echo tep_get_defined_content('Catalog Main'); ?></td> with this line: <td class="main" align="center"><?php include(DIR_FS_CATALOG . 'kampanya.php'); ?></td> Works great! Thanks! Looks nice. Guys, can you help me please - I'm using a template and the only "Main" thing that is listed is this: <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' '; if (isset($HTTP_GET_VARS['manufacturers_id'])) How do I add the file? Thanks. Quote
spooks Posted August 6, 2008 Posted August 6, 2008 Compllete the installation as detailed, uploading all required files & your 'error' will disappear!! Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
3goo Posted August 6, 2008 Posted August 6, 2008 Compllete the installation as detailed, uploading all required files & your 'error' will disappear!! thanks sam, it is solved however, it is empty now!!!1 any ideal? thanks Quote
stelaras1 Posted August 6, 2008 Posted August 6, 2008 I get the following error..any ideas please? Warning: fopen(/public_html/commerce/images/kampanya.xml) [function.fopen]: failed to open stream: No such file or directory in /home/xxxx/public_html/commerce/kampanya.php on line 18 Please keep in mind that i have not the "catalog" folder but the "commerce" instead.. Thanks a lot! Quote
3goo Posted August 6, 2008 Posted August 6, 2008 thanks sam, it is solvedhowever, it is empty now!!!1 any ideal? thanks sorry, it is on now, anyway, thank sam regards barry Quote
libralion Posted August 7, 2008 Posted August 7, 2008 I get the following error..any ideas please? Please keep in mind that i have not the "catalog" folder but the "commerce" instead.. Thanks a lot! Did you upload the kampanya.php? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.