Jump to content

000---000

Members
  • Content count

    99
  • Joined

  • Last visited

Everything posted by 000---000

  1. I'm trying to create an info box where by each day of the month shows a different product. Just something to keep the site fresh (ish) and controllable. I'm no genius programmer, although I do have a vague idea of what goes on. I've set up a page so far which works out the day of the month, pretty easy. I now want to use that mechanism to define a different product and lay it out. Initially I have... <?php $today=date(d); if($today==1){ echo "<img src='images-by-date/1.jpg'>"; } elseif($today==2){ echo "<img src='images-by-date/2.jpg'>"; } ...and so on. This simply allows me to select a pre chosen image etc. My query is, I want to replace the echo image line with something like &productid=342 and then below the above 31 php elseif statements have an extra section which lays out the data according to that product id. I know how to layout the bottom section once I have a suitable variable to call from, I'm just not sure exactly how I specify the product. For example, I tried something like: if($today==1){ $productid=963; } But this just produced images-by-date/9 ??? When calling/using $productid further down. ie Using: <?php echo $product_info['products_image'] ?> How do I define that on the 1st of the month it always show product 963 for example? Thanks
  2. 000---000

    Home page product per day of month

    Another way I've found of doing it... <?php class foo { var $arr = array('134', '538', '553', '386', '538', '552', '134', '430', '545', '553', '548', '538', '553', '550', '538', '548', '550', '546', '548', '349', '348', '545', '538', '364', '552', '348', '349', '545', '364', '546', '386', '134'); } $foo = new foo(); $arr = 'arr'; $productid = $foo->{$arr}[date("d")]; $date_product_info_query = tep_db_query("select p.products_id, pd.products_url, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = $productid and pd.products_id = $productid"); $fproduct_info = tep_db_fetch_array($date_product_info_query); $products_price = $currencies->display_price($fproduct_info['products_price'], tep_get_tax_rate($fproduct_info['products_tax_class_id'])); echo '<table width=100% bgcolor="#ddddff" border=0><tr><td><h1>Todays featured product:</h1></td><tr><tr><td>'; echo '<table width=100% bgcolor="#eeeeff" CELLPADDING=5><tr> <td valign="top"> <table width=100% bgcolor="#eeeeff" height="100%"><tr><td valign="Top"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid) . '" width="100" height="100"><h1>' . $fproduct_info['products_name'] . '</h1></a><br><br>' . $products_price . ' </td></tr> <tr><td vvalign="bottom"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid) . '" width="100" height="100">' . tep_image(DIR_WS_IMAGES . $fproduct_info['products_image'], addslashes($fproduct_info['products_name']), 200, 200, 'hspace="5" vspace="5"') . '</a>' . '</td> </td></tr></table> <td bgcolor="#ffffff">'; $prod_link2 = tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid); function custom_echo($x) { if(strlen($x)<=2000) { echo $x; } else { $y=substr($x,0,2000) . '...more...'; echo $y; } } echo custom_echo($fproduct_info['products_description']) . '</td></tr></table>'; echo '</td></tr></table>'; ?> The last bit shortens the product listing/description to 2000 characters. File listed in filenames.php and then called into position via "require('whateveryousavedthisfileas.php');"
  3. 000---000

    Home page product per day of month

    @@burt I finally managed to work something out. By placing the following on the index page: <?php require('includes/daterotate.php');?> And then creating the following daterotate.php file, DEFINED in filenames.php too: <?php switch (date("d")) { case 1: $productid = 134; break; case 2: $productid = 538; .... case 31: $productid = 386; break; } $date_product_info_query = tep_db_query("select p.products_id, pd.products_url, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = $productid and pd.products_id = $productid"); $fproduct_info = tep_db_fetch_array($date_product_info_query); $products_price = $currencies->display_price($fproduct_info['products_price'], tep_get_tax_rate($fproduct_info['products_tax_class_id'])); echo '<table width=100% bgcolor="#eeeeee"><tr><td><h1>' . $fproduct_info['products_name'] . '</h1><br><br>' . $products_price . '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid) . '" width="100" height="100">' . tep_image(DIR_WS_IMAGES . $fproduct_info['products_image'], addslashes($fproduct_info['products_name']), 200, 200, 'hspace="5" vspace="5"') . '</a></td><td>' . $fproduct_info['products_description'] . '</td></tr></table>'; ?> Result: I created a table on the index page, which allows me to link a daily products, as per the case variable. Just thought I'd share it. I'm sure this is quite easy for some. Thanks for the help. Matt
  4. 000---000

    Home page product per day of month

    Fantastic. That's put me on the right lines. However, to recall the other product properties, as I realise that I may change a price in one place and not pick it up on the front page, how would I continue this code on? To call the image, description and price... As I think I just need to change the format around and not have a specific product image per day that relates to the product directly. FILENAME_PRODUCT_INFO brings up the "product_info.php/" part etc and the remainder of tep_href_link is the product link... I get that (I hope). DIR_WS_IMAGES gives me the image directory etc, but how do I call the product image from $productid? I've tried all sorts, the most logical seem to be... echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$productid) . '">' . tep_image(DIR_WS_IMAGES . $products_image . (int)$productid) . '</a>'; ?> or echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$productid) . '">' . tep_image(DIR_WS_IMAGES . $productsid['products_image']) . '</a>'; ?> But neither work. I've spent a few hours pulling apart other product listing code to try and give me the correct results. The best I've got is <img src="image/$productsid=963"> Am I misinterpreting the use of $productid here?
  5. 000---000

    Menu Conrtib Required...

    Hi, can someone advise of a contribution that shows the sub-categories in the menu all the time and allows nice formatting of layout. Like: Main Category Sub 1 Sub 2 Sub 3 Another main category Sub 4 sub 5 sub 6 sub 7 Main cat 4 Sub 8 sub 9 and so on... Thanks Matt
  6. 000---000

    NOCHEX API Merchant ID

    refer to: http://forums.oscommerce.com/topic/103320-contribution-nochex-apc-payment-module/page__st__300__gopid__1536682entry1536682
  7. 000---000

    NOCHEX API Merchant ID

    Hi, I've recently installed the NOCHEX API payment modules on one of my OSC stores, but for some reason, there's an error in the admin when I try to install it. I have had Nochex working with one of my other websites and having duplicated the site over to this one, I know it should work. However, because I'm using a different site with the same NOXHEX account, I have set up a new payment page. For this, NOCHEX requires a different download in order to cope with using a MerchantID (can only have one email per NOCHEX account). I've followed the install, to the point of "installing" via the admin section of OSC, but cannot get any further. The admin page stops loading at the point of printing the text for the API module. Whereas usually you get the options on the right to install etc, here, there's nothing. Can anyone give me some pointers as to where to start looking please. I'm guessing something isn't correct with the language file link for starters as [** define('MODULE_PAYMENT_NOCHEXAPC_TEXT_TITLE', 'Secure (SSL) Payment via Nochex'); **] the text line should be 'Secure (SSL) Payment via Nochex' and not 'MODULE_PAYMENT_NOCHEX_APC_TEXT_TITLE' I don't have a backup prior to installing the initial NOCHEX (email only) module, which I feel may have something to do with it. Any help appreciated. Thanks Matt
  8. 000---000

    [CONTRIBUTION] Nochex APC Payment Module

    I've had problems with this for 2.2rca and just fixed them/it. (Am off dancing around the office now!!!) The solution to my problems appeared to be the need to remove some extra lines (white space) at the end of a file, after the ?php> closing tags. Check if any of the nochex files have unnecessary lines at the end of the file - after the php closing tag. My source of the info: http://www.geeklog.net/faqman/index.php?op=view&t=38 Also, I had me server guys set the server to display php errors as suggested by this guy in another post of mine: http://forums.oscommerce.com/topic/365067-testing-output/page__pid__1536632__st__0entry1536632 I don't know if this is of any use to anyone, as I think my editor may have added the blank space at the end of the file. I was using contib: p://www.oscommerce.com/community/contributions,2280 as advised by NOCHEX... Good luck Matt :D
  9. 000---000

    Testing output

    Hi, I'm self taught on the whole OSC idea, and I can edit and change site, install add-ons (usually), design etc all fairly well. However, how do you go about testing a site? I've installed a NOCHEX payment module and now need to test the output that it's sending to NOCHEX/the next page as it keeps freezing (comes up with blank page, URL says still /checkout_nochex.php, this is after Order Confirmation page, so should be loading through to NOCHEX site for payment.) Do I need some software to create or view the output? All I can check is the page that loads, which if I view the source, shows only a blank page. Thanks
  10. 000---000

    NOCHEX API Merchant ID

    If I remove (change extension to phpx instead of php) the file nochex_apc_handler.php then the whole admin page shows, but the payment option won't show to the end user as an option.????
  11. 000---000

    Customer Review Images Problem

    Also, I cannot view the reviews individually. I can write a review, it stores the image name in the data base review_images, i don't think the image is uploaded though. I can only view the full list of all reviews. Clicking on the product image within the review or clicking on the review name just brings up a blank page. There is an SEO add on, but turning that off only breaks the product_info page too.
  12. 000---000

    Customer Review Images Problem

    Hi, I have a site where the review images has stopped working a while ago, and it has only recently been pointed out to me. I get the following error when trying to upload an image or view the products review page. 1054 - Unknown column 'r.reviews_id' in 'on clause' select count(*) as total from reviews r, reviews_description rd left join reviews_images ri on r.reviews_id = ri.reviews_id and ri.reviews_status = '1' where r.products_id = '1278' and r.reviews_id = rd.reviews_id and rd.languages_id = '1' [TEP STOP] Can anyone help?
  13. 000---000

    HSBC XML API Support Thread

    I keep getting an error "syntax error1" when submitting the credit card details. Does anyone know what this error means. Thanks Matt PS I think I've solved the above login problems, although I had to use a redirect to send the user back to the non SSL site after login.
  14. 000---000

    HSBC XML API Support Thread

    SSL Login / HSBC XML API Module 2nd domain for SSL [Duplicated message - more appropraitely placed here rather than general install / config area] I have recently added SSL for my site, which I thought was working fine, until I have come to test it with the HSBC XML API module. Further more, to reduce the costs from my ISP I am sharing the secure area with another domain. Site www.firstsite.com redirects over to www.secondsite.com/hsbc-payment-area-for-firstsite/ to take the payment, login and account details. Although I haven't fully got the API module working yet, I think it is ok. The problem I was/am having is that the login did not redirect to a valid page (once SSL installed) despite the URL showing what should be a valid page. Instead I got a 404 error. I fixed this by editing catalog/includes/functions/general.php and changing function tep_redirect($url) { if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL } } header('Location: ' . $url); tep_exit(); } to function tep_redirect($url) { if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url $url = HTTP_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL } } header('Location: ' . $url); tep_exit(); } This edit resulted in the login page going back to the index.php page and showing the welcome screen rather than an error 404 page which seemed fine. However, when coming to test the payment section, I give 3 choices. Cheque, Paypal or Credit Card via HSBC XML API. The first two work fine. But the HSBC module redirects me back to the login, where even when the correct u&p are entered it simply reloads the login page. I'm assuming the HSBC module should not redirect me to the login page when I'm already logged in?? Changing the HTTPS to HTTP is not the cause of the issue as have tested the payment area with and without the extra "S". I am inclined to think that the login page issue I originally had with regards to the error 404 page may have something to do with this error as they both centre around the login.php page. Any idea greatfully received. Thanks Matt
  15. 000---000

    In need of some help please.

    You need to specify something in the english.php maybe. Have a look through the contirbution notes to see if you missed something to do with that file.
  16. 000---000

    Very Disappointed

    Also, to start with, yes, just copy the image files to images/large and you'll be using the same list of files. You can then update the large files as and when you have them.
  17. 000---000

    Very Disappointed

    I think, the simplest way to do this is to use an FTP client to transfer a large version of the image to your HOST (under directory images/large/) then define DIR_WS_IMAGES_LARGE and replace DIR_WS_IMAGES (5th line from bottom) with DIR_WS_IMAGES_LARGE. You'll also have to DEFINE the large image, DIR_WS_IMAGES_LARGE, in includes/configure.php: something like: define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_IMAGES_LARGE', 'images/large/'); {Add this line below the one above} As long as you remember to upload the large image with exactly the same file name as the small/thumb this will work. It does get a little confusing at times with filenames but as long as you;re carfeul it should be ok. If you want to use the admin area to upload the image it will take quite a bit more. Alternatively, I had a quick look at contributions, and although have not tested it, the following looks quite useful for you: http://addons.oscommerce.com/info/1346 I would expect this link to be more comprehensive, but longer. Don't forget to backup any files you change!!! Regards Matt
  18. 000---000

    Very Disappointed

    Yes you can. I'm the same, image quality is a key factor. I have a few solutions. 1: You can link the thumbnail and popout to separate images. I use the normal image folder (catalog/images) and also a large folder (catalog/images/large) and just add the "/large" to the popout script. You may need the admin area to allow you to uplaod a separate image too. 2: Alternatively I have used a flash zoom of a separate iamge as aboe so the user can zoom in and out of the image - quality depends on the zoom settings and the image quality. Got this from a flash site for $10 / £7 ish. Matt
  19. 000---000

    Saving

    Hi Jan, I can duplicate id 69 to id 70 and save this without table.php. This saves and shows the same when refreshed/reloaded. As id 69 is still present it changed nothing to the site (admin or public) though. So, I removed id 69. Id 70 then changed to include table.php. Therefore, there must be something ensuring table.php remains active within the config. It would appear that there is something in the Admin section that resets the database setting and adds back in table.php (and others). Removing table.php and stand.php - the public area shows the remaining module only as I would expect. This stays like this until I load/open/refresh the admin shipping module page, which shows 3 options still active and also resets the database table to include stand.php and table.php on loading. As the site is working I am prepared to ignore this, but I can see it coming back to haunt me at some point. Any ideas or should I wait for the inevitable? Matt
  20. 000---000

    Saving

    I'm trying to remove one of the shipping options from both the admin area and the public "select shipping" area, but am having difficulties. All but one of the options are editable from the admin. The one which I cannot edit or remove only gives me the option to "install", which does nothing. I have renamed the php (to phpx) files in catalog/includes/modules/shipping so that some methods are no longer options and this works for all but one again. I think this is related to tables.php as all other files can be renamed and subsequently all other methods can be removed. If I rename tables.php or remove it then the Shipping Modules Admin page does not load the right hand side of page, and the public area just freezes leaving a blank page. Is tables.php an integral part of the shipping module? If not, where can I select to remove this shipping method/option. Is there anywhere in the data base or within the php files that tells OSC to use certain shipping modules? When you install a shipping module, what changes in which file(s) in order to make the module live/active? Thanks Matt
  21. 000---000

    Saving

    Hi Jan, Thanks for the info. I agree, I am messing with things in a risky manner. However, the database shows: 69 Installed Modules MODULE_SHIPPING_INSTALLED ukpostarea.php;stand.php;table.php List of shipping module filenames separated by a s... And no matter how much I try to remove it, I cannot remove table.php from the database. Am using phpMyAdmin. I remove the ";table.php" and the following page shows the above line without table.php, but then when I refresh or reload the database page the ";table.php" has returned. In the admin area I now get: Royal Mail Standard Parcels 3 Economy (Based on weight of goods) 0 Standard Delivery 2 but in the public shipping method area I only get: Standard Delivery Scottish Highlands & Channel Islands may take longer £6.50 Royal Mail Standard Parcels Non urgent items across the UK £2.25 So as for the client, the system seems to be working and they do not see the Economy delivery option, but I still have the admin showing me the Economy option. I assume the Economy option is not shown for anyone, but it may show to certain postcodes, I'm not sure. Do you know what part of OSC is restoring ";tables.php" to the database or should this not be happening? Thanks in advance Matt
  22. 000---000

    Saving

    Hi Jan, I've checked all modules.php files that I can find (5) and none have semi-colon separated list of shipping modules. I have found mention of the key. By renaming another php file to tables.php, refreshing the admin and removing the module I have managed to remove the option from the public page, but not the admin, Regards Matt
  23. 000---000

    Upload Image

    Ok, basically, I create a page that uploads an image to a review_image directory, which works fine, how do I make that image name be written into the database table for the review ID? If I manually put the image in the database I can call it back with the review.
  24. 000---000

    Upload Image

    Can somebody help as to how we can create a system where by a user can leave a review and add their own image at the same time? We've created the necessary database tables, having tried it in reviews and review_description, and can call an image once it is placed in the correct directory, but we cannot work out how to allow the user to attach and upload one image when they submit their review. It is very similar to adding a new product in the catalog surely... This does leave us with a second problem of how do we limit the size of file and dimiensions of image, but we will work that out later... unless anyone knows a solution to that. Thanks Matt
×