Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Posts
    43
    Plugin Contributions
    0

    Default template_func.php not working on custom template front page

    Hi,
    I've installed a custom template which is using some sort of override setting to force automatic buttons instead of static image buttons. i want to use static image buttons.
    In order to do so i had to remove or replace the following 2 functions: az_tep_image and az_tep_image_submit from /includes/templates/ZC…../common/tpl_main_page.php. since i've done that, i get the following error on my front page:
    Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 0 in /home/fhlinux144/e/efs-pro.fr/user/htdocs/includes/classes/template_func.php on line 60

    Apparently this concerns [function.preg-match]?
    I checked my server info and PCRE (Perl Compatible Regular Expressions) Support has been enabled.

    I then started looking through the forum i found the following Thread:
    http://www.zen-cart.com/forum/showthread.php?t=46691
    Here i found a solution, but i'm a bit worried about the solution that i have found!!

    I replaced the following code inside: includes/classes/template_func.php

    lines 57-60 1.3.5 version:

    $file_pattern = '/'.$file_pattern.'$/';
    if ($mydir = @dir($file_dir)) {
    while ($file = $mydir->read()) {
    if (preg_match($file_pattern, $file))

    to

    lines 57-60 1.3.0 version:

    if ($mydir = @dir($file_dir)) {
    while ($file = $mydir->read()) {
    if ( strstr($file, $file_pattern) ) {

    Why i'm i worried? Well i'm using an older version, will this effect other parts of my shop, do i need to use another solution?

    Could someone please give me their opinion?

    cheers

    baz°

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: template_func.php not working on custom template front page

    If you're using an addon that's using tep_xxxxx functions, that code is designed for an Other Shopping Cart, not Zen Cart ... thus you have an incompatibility problem. Simply renaming or replacing those functions is not likely going to fully resolve your compatibility issues.

    I suggest you talk to whomever you obtained your addon from.


    Moving this out of the Bug Reports section, because your bug is not a Zen Cart core problem.



    BTW ... it's strongly NOT recommended to mix old and new versions of code together. You just might end up creating security problems by using older code in newer versions.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 8 Feb 2011, 02:07 AM
  2. 1.3.8a CUSTOM Template not working properly
    By SPH in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Aug 2009, 09:44 PM
  3. Product Type Info Page Layout Options Not Working in Custom Template
    By johnd in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Aug 2007, 04:09 PM
  4. Custom Template Not working
    By isokodesign in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Mar 2007, 03:45 PM
  5. template_func.php not working with custom product type
    By dbrewster in forum Bug Reports
    Replies: 11
    Last Post: 28 Sep 2006, 04:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR