Jump to content

MatthewRitchie

Members
  • Content count

    167
  • Joined

  • Last visited

About MatthewRitchie

  • Birthday 11/19/1978

Profile Information

  1. MatthewRitchie

    [contribution] Simple Template System (sts)

    dynamenu extension links from global in appliction_bottom also shows up because stylesheet is not referenced correctly in the template file
  2. MatthewRitchie

    [contribution] Simple Template System (sts)

    You might ask why do all this.... Google (as far as I know) does not like server redirects and I only have one server which several domains share. They are all under my control so I dont mind them sharing. but i do want differnt front pages showing for each domain. Matthew
  3. MatthewRitchie

    [contribution] Simple Template System (sts)

    In addition to my post above: If you want redirects using php for different domain names as well as the different templates then in: www.yourname.com/index.php (the first indexfile to be loaded when all there is in the url is www.yourname.com) above everything put: ##################################################### <?php IF($_SERVER['SERVER_NAME'] == 'www.bluegreenenterprises.com'){ header("Location: http://www.bluegreenenterprises.com/ebusiness_info/index.php"); exit; }elseIF($_SERVER['SERVER_NAME'] == 'www.diywind.co.uk'){ header("Location: http://www.diywind.co.uk/Company/About_Us.php"); exit; } /* $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ##################################################### NOW YOU HAVE: REDIRECTS TO THE RIGHT FILES &&& A DIFFERENT TEMPLATE FOR EVERY DOMAIN NAME .............................. All I need now is a way to block users from one domain entering pages under the second domain_name url..... any ideas. MatthewJohnRitchie
  4. MatthewRitchie

    [contribution] Simple Template System (sts)

    Finally I have a working solution. If any sts users would like to use diferent templates for different domain names then this is how I have done it: GOTO: [1] --- http://www.bluegreenenterprises.com/OSC_TE...a/rc1_GCOv145a/ [2] --- http://www.bluegreentechnologies.com/OSC_T...a/rc1_GCOv145a/ [1] is the normal default template and [2] is a individual template for the domain www.bluegreentechnologies.com p.s. This only works in my test environment at the above addresses. If you click the logo you are now under the control of a different sts installation. THE CODE: IN STS_TEMPLATE.HTML: <?PHP IF(!($_SERVER['SERVER_NAME'] == 'www.bluegreenenterprises.com')){ include('bgt_template.php'); }else{ include('bge_template.php'); } // end ifelse not bluegreenenterprises.com ?> AND IN THE TWO INCLUDE FILES I HAVE THE NORMAL AND ALTERED TEMPLATE CODE WITH NO ADDITIONS OUTSIDE THE DOCTYPE. Thats it for now.... OH! playing around with the shop index with if statements to load different shop content doesnt work ;o) I have tried it.... to resolve the dynamenu thing you still need to inclued $dm_header, you can ignore any menu items etc if you wish but to avoid the mess at the bottom of the page you need the header. this has the benifit of being able to creat other dynamic menus for other domains.... MatthewJohnRitchie
  5. MatthewRitchie

    [contribution] Simple Template System (sts)

    Hello Jesper I have google analitics and adsense which I would guess is used in the same way as adwords. I simply cut&paste the code for each and put it where i wanted in the sts_template.html file. I put analitics at the very bottom after the closing body and html tags. MatthewJohnRitchie
  6. MatthewRitchie

    [contribution] Simple Template System (sts)

    I solved the problem of the above almost.... sorry, this part was actually not a sts question but is mentioned here because dynamenu instructions are included in the sts_power_pack. I will try to ask the question a little better: How does sts pick up application_bottom.php? sts works by capturing code from a file.php in the shop, and using various classes and functions manipulates the code [chopping of sections before/after a table or form] before sticking it all back together in relation to what the template file is telling sts to do. question: How does sts deal with php includes like the one for application_bottom.php? Does the sts start/stop capture() simply ignore the php untill later or is it processed as it goes along? Actually!!! Thinking aloud here.... What am I trying to achieve? --- a front page that determins which domain name has been used to make the call to the server and outputs an individual style of template for that domain name. What was I trying to do above? --- remove the dynamenu links from the bottom of the screen. Where are the dynamenu links included? --- in application_bottom.php which is associated with the oscommerce style of index.php page. Now there are two ways that this could work... first is to have a query statement in the index file that says use this code[1] for domain[1] or code[2] for domain[2] etc. hence the application_bottom.php include could be allowed in [1] and not [2] thus dynamenu links would not show in [2]. second - sts_template.html, I believe would need a similar domain name identifier statement to provide different templates for each domain.
  7. MatthewRitchie

    [contribution] Simple Template System (sts)

    Hello Bill, Not spoken in any way for a while, but i hope i have a '''little''' but interesting question for you... I have just hit upon a novil idea to use STS as the defining software that could solve a long term wish that I wanted to solve. You may remember that I did the sts external pages templates contribution to bring pages outside of the osc folder within the wings of the template. This was aimed at the overall aim of having several domain names targeted at a single server. Now i dont have a server that allows multiple domain names pointing to individual index files but I do have STS AND THAT IS WHEN THE BRAINWAVE HIT TODAY. May i point your attention to my demo site to illustrate my point: http://www.bluegreenenterprises.com/OSC_TE...v145a/index.php Now look at: http://www.bluegreentechnologies.com/OSC_T...v145a/index.php These are both exactly the same index file and hence (((sts_template.html.php))) for both addresses but a little bit of cheeky coding will allow me to effectively produce a secondary template for another domain name. I hope you see where I am going here... Now as you see from the second link, I get the Dynamenu output from my DynamenuGoneNutsBonkers contribution addition. I believe that this only shows up because includes/application_bottom.php is included after the templae file has been processed by STS. Could you shed a little light on how this works? By the way. cheeky coding is: <?PHP IF(!($_SERVER['SERVER_NAME'] == 'www.bluegreenenterprises.com')){ ECHO 'NOT www.bluegreenenterprises.com BUT SERVER = '.$_SERVER['SERVER_NAME'] .' HENCE WE CAN USE A SEPARATE TEMPLATE FOR DIFFERENT WEBSITES <BR> ONE PROBLEM WITH THAT IS WHAT IS SEEN BELOW. THIS COLUD BE DUE TO OSC APPLICATION_BOTTOM.PHP BEING ADDED LATER VIA THE SIMPLE TEMPLATE SYSYEM'; }else{ ?> --- doctype and rest of template file as you would normall do..... finished of with: <?PHP } // end ifelse not bluegreenenterprises.com ?> obviously Dam my spelling still hasnt improved with a few beers... ;o) teehee
  8. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    OH, THIS IS PROBABLE THE LAST TIME I WILL BE VISITING THIS TOPIC SO IF YOU HAVE QUESTIONS PM ME OR GOTO MY WEBSITE WHERE I MAY DO A WRITE UP AND SOME INSTRUCTIONS. ALSO THERE IS A DIRECT CONTACT PAGE FOR ME THERE. ENJOY MATTHEWJOHNRITHIE BLUEGREENENTERPRISES
  9. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    DAM LOST MY LAST POST AND DONT FEEL LIKE TYPING IT OUT AGAIN. new release v1_6 features :- see for yourself individual shipping prices per product code is fully commented out this version will work on you store do not set max search results in config to more that 22/23 that bug still exists and i dont know why fully tested SQL FOR DB IS IN THE FILE AT THE TOP... go get it.......................... http://addons.oscommerce.com/info/2415
  10. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    I am now fully convinced that (I AM GOING BONKERS) and that the above statement is accurate my assumptions then are that because the updated item is always the 23rd on the list and that items 24 to 27 are left unaffected because the code breaks at item number 23 hence 24 to 27 are not outputed in the echo statements for print_r($products); and , print_r($row); on each loop of the foreach post[event_record] i am still using 50 as my maximun for search results listing this leads me to the possibile conclusion that the functions used to split the page results are causing the iritating quirks above. next attempts will have the split page results removed to see what happens, however for shops with thousands of products this will result in a very long page. WRONG just tried it with split page results and associated items removed but still have item 23 losing its data each time update is hit. I am thinking of giving up at this point and reverting the results listing to only 20 per page and concenterting on why all produtc items are updated with modified date when a column is missing, this shouldnt happen so there is a problem still in the code to chew on. ;o) matthewjohnritchie bluegreenenterprises.com
  11. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    OK just happened upon a wierd quirk... I currently have my maximum setting for search results at 50 rows per page, i.e. to show all the products on one page. now, if i reduce this to 20 as it was origionally, most of the problems seem to vanish BUT... back at 50 results per page I have noticed that depending on the sorting order, it is predominately the 23rd item in the list that is errased. Oh and new released version i am now at is number [21].
  12. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    download: http://www.oscommerce.com/community/contributions,2415
  13. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    Ok - first issue mostly resolved, that was the zeroing of columns that were hidden latest edition in product_updates[19].php, --- there is an echo statement at line 308 [[[echo $sql_do_update . '<BR>' . $query_string_parameters;]]] that throughs up the error: UPDATE products SET products_price = '', products_model = '', products_weight = '', products_quantity = '', products_image = '', products_status = '1', products_ship_price = '', products_last_modified = '2008-12-14 15:11:37' where products_id = '19' action=update&ST=1&ID=7& Warning: Cannot modify header information - headers already sent by (output started at /home/bluegree/public_html/OSC_TEST_GCO_GCODEv145a/rc1_GCOv145a/admin/product_updates[19].php:308) in /home/bluegree/public_html/OSC_TEST_GCO_GCODEv145a/rc1_GCOv145a/admin/includes/functions/general.php on line 22 but by commenting this out you can avoid this error message. zip contains file update from [15] to [19] but only [19] is needed. remaining problem: on first load, and first click of update button without editing any data one product's data is errased, you can actually see this happening in the error above to 'theres something about mary' the quizical point is that it is item id/number 19 towards the bottom of the page, hence I have no idea yet why it is being picked up and changed. secondly - when update button is clicked, the get query string in the url has 'listing=' amended to it. I believe this is due to the sorting arrows code but still the answer is alluding me. I am looking in to the functions tep_get_all_get_params() and tep_href_output() ??? to see if i can use these purposefully to alleviate the get array parameter problems. so for now have a look through [19] and let me know your thoughts here: http://forums.oscommerce.com/index.php?showtopic=323536 Many thanks MatthewJohnRitchie bluegreenenterprises.com
  14. MatthewRitchie

    Multi-Product Update v1.00 Revitalised

    ok partially there... this is a beginning to curing the above problems: the code below needs to be above the doctype and in this order so icon clicks work in the right sequence: ################################################# # # # SHOW/HIDE MULTI_PRODUCT_UPDATE COLUMNS # # # ################################################# // Sets the status of a product function set_mpu_col_status($col_id, $col_status) { if ($col_status == '1') { return tep_db_query("update " . DB_TABLE_MPU . " set mpu_col_status = '1' where mpu_col_id = '" . (int)$col_id . "'"); } elseif ($col_status == '0') { return tep_db_query("update " . DB_TABLE_MPU . " set mpu_col_status = '0' where mpu_col_id = '" . (int)$col_id . "'"); } else { return -1; } } if (isset($_GET['action']) && ($_GET['action'] == 'COL')) { set_mpu_col_status($_GET['ID'], $_GET['ST']); } ################################################# # # # MPU COLUMN STATUS ICON # # # ################################################# function COL_status_icons($id = '', $status = '', $parameters = ''){ if ($status == '1') { echo '<a href="' . tep_href_link(FILENAME_PRODUCT_UPDATES, 'action=COL&ST=0&ID=' . $id .'&'. $parameters, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Deactivate', 10, 10) . '</a>' . ' '; } else { echo '<a href="' . tep_href_link(FILENAME_PRODUCT_UPDATES, 'action=COL&ST=1&ID=' . $id .'&'. $parameters, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Activate', 10, 10) . '</a>' . ' '; } } $sql_coloumns = "SELECT * FROM multi_product_update"; $col_result = tep_db_query($sql_coloumns); $show_col = tep_db_fetch_array($col_result); $column_detials = array(); do { $col_id = $show_col['mpu_col_id']; $col_name = $show_col['mpu_col_name']; $col_display_name = $show_col['mpu_col_display_name']; $col_status = $show_col['mpu_col_status']; $column_details[$col_name]['id'] = $col_id; $column_details[$col_name]['name'] = $col_name; $column_details[$col_name]['disname'] = $col_display_name; $column_details[$col_name]['status'] = $col_status; $show_col = tep_db_fetch_array($col_result); }while($show_col); now below in the main page you need: <tr> <td> <?php ?> <br><br> <?PHP foreach($column_details as $key => $value){ echo $column_details[$key]['disname'].' '; COL_status_icons($column_details[$key]['id'], $column_details[$key]['status'], $query_string_parameters); } ?> <br><br> <?php // echo 'COLUMN DETAILS<PRE>'; print_r($column_details); echo '</PRE>'; ?> <?php // echo 'POST <PRE>'; print_r($_POST); echo '</PRE>'; ?> <?php // echo 'GET<PRE>'; print_r($_GET); echo '</PRE>'; ?> </td> </tr> sorry it looks horrid at the moment. the reason for this is to get the column details array above the code that checks for updates then does only the updates needed. why? Ah well this is so that the array details can be used to '''turn off''' certain parts of the updates code so it doesnt try to update any columns that are not actuall present on the screen. lol teehee square eyes and all that melarky...... unfortunately i have not got round to editing the updates code yet --- also there is beginning to be a heck of a lot of repetition in this array checking '''fun''' which could be placed in a function but still that is a little way off. MATTHEWJOHNRITCHIE bluegreenenterprises.com
×