Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    May 2012
    Location
    SOUTH KOREA
    Posts
    21
    Plugin Contributions
    0

    Default Creating a new page issue

    Hi all;




    I am trying to create new define page for FAQ. i have followed up instruction on this link (https://www.zen-cart.com/wiki/index....ting_new_pages) and have created all required files under related folder. I have also inserted a new line to configuration table to control "define_faq.php" on admin panel. But I am getting "page not found" notice when i try to access to this page. I have no idea about what I am doing wrong.I would really appreciated, If someone could help me out to find a solution for this issue.


    Thanks


    Page definition/locations :

    includes/filenames.php :


    Code:
    define('FILENAME_DEFINE_FAQ', 'define_faq');
    includes/modules/pages/faq/header_php.php :

    Code:
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));$breadcrumb->add(NAVBAR_TITLE);// include template specific file name defines
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_FAQ, 'false');
    includes/templates/template_default/templates/tpl_faq_default.php :
    Code:
    <div class="centerColumn" id="pageTwo">
    <div class="page-title mb-45">
    <h1 id="pageTwoHeading"><?php echo HEADING_TITLE; ?></h1>
    </div>
    <?php if (DEFINE_FAQ_STATUS >= 1 and DEFINE_FAQ_STATUS <= 2) { ?>
    <div id="pageTwoMainContent" class="content">
    <?php
    /**
     * load the html_define for the page_faq
     */
      require($define_page);
    ?>
    </div>
    <?php } ?>
    
    
    
    
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
    </div>
    includes/extra_datafiles/faq.php :

    Code:
    <?php 
    define(FILENAME_DEFINE_FAQ, 'define_faq');
    ?>
    includes/languages/english/faq.php :

    Code:
    <?php
    define('NAVBAR_TITLE', 'FAQ');
    define('HEADING_TITLE', 'FAQ');
    define('TEXT_INFORMATION', 'Prestige Cookware FAQ.');
    ?>
    log file error description :
    [03-Dec-2018 06:50:21 UTC] PHP Fatal error: require(): Failed opening required 'includes/templates/template_default/templates/tpl_faq_default.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/theuniv2/public_html/prestige/includes/templates/marcus/common/tpl_main_page.php on line 238

    configuration table record :
    Name:  configuration_table.jpg
Views: 205
Size:  4.5 KB




    Admin panel (Define Page Status) :
    Name:  define_page_status.jpg
Views: 205
Size:  11.6 KB











    Define Page Editor :
    Name:  define_page_editor.jpg
Views: 198
Size:  65.4 KB

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Creating a new page issue

    Looking over the above list of file changes as compared to say define_shippinginfo, it looks like the files are placed in the correct locations (though a define for FILENAME_DEFINE_FAQ is made twice and is only needed once at least on the store front side. The modification made in includes/filenames.php is not necessary with the define captured in includes/extra_datafiles. Further upgrading is made easier if the file remains in its default configuration.)

    So, it seems to me that would want to verify that the tpl_faq_default.php file does exist as described above and to also compare the permissions of it as compared to other tpl_ files adjacent.

    Would have also suggested including the creation of the html_includes file as part of the "new files" needed to present that page, but that issue does not appear to be the problem. It also is visible that there was content to be placed in that file, but still and again, the error doesn't point to that file.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: Creating a new page issue

    This doesn't answer your question, but instead offers a different approach.

    Instead of going through all the hassle of making a new page, why not create an EZ-page instead?

    With EZ-Pages you won't have to muck around with new files and defines and it will utilize the existing Zen-Cart EZ-Page systems.

    That said, it looks like you got this to work (unless I am looking at your old FAQ that you are trying to replicate within Zen-Cart.) A couple extra thoughts though:
    1) remove the hard links from the page if possible. If leaving them, give consideration to whether they should be https instead of http
    2) On your FAQ page you have links that I only realized were links due to seeing your code. As a user I wouldn't know they were clickable. For instance 'Store Location and Trading Hours'
    3) Some of your changes are being made to the default_template files. When possible you should avoid doing that and only make those changes in your custom template versions.

  4. #4
    Join Date
    May 2012
    Location
    SOUTH KOREA
    Posts
    21
    Plugin Contributions
    0

    Default Re: Creating a new page issue

    Thanks for quick response. I am trying to create/implement new page by following up zencart structure because the way will help me to understand zencart system. I have also checked the other tpl_*** files permission they set to 600 same as my file which i created. As I understand from error log shows, zencart can not point the faq page. is there any other configuration files which is related with this ?

  5. #5
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Creating a new page issue

    Quote Originally Posted by probtc View Post
    log file error description :
    [03-Dec-2018 06:50:21 UTC] PHP Fatal error: require(): Failed opening required 'includes/templates/template_default/templates/tpl_faq_default.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/theuniv2/public_html/prestige/includes/templates/marcus/common/tpl_main_page.php on line 238
    error logs always point you to where the error exists. it may be hard to figure it out, but this error seems very clear to me.

    if as you say the file exists, then the permissions and/or the owner of the file is incorrect.

    considering you are asking for help with this problem, i am going to assume that the owner of the file is NOT the same owner as the user running apache (assuming your web server is running apache). 600 for permissions would not work, as only the owner of the file can read the file, and the owner is different from the user running apache.

    i would read up about linux owner and groups; but pretty sure this is an owner/group/permissions problem.

    best.

    ps, the fact that other files are set to 600 means NOTHING. are those files being used in the calling of this script? do they have the same owner/group as this file?

    i would look at the owner/group and permissions of this file and compare it to the file referenced in the error log:

    /home/theuniv2/public_html/prestige/includes/templates/marcus/common/tpl_main_page.php

    as that one is no doubt being read.
    Last edited by carlwhat; 3 Dec 2018 at 04:59 PM.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  6. #6
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Creating a new page issue

    Quote Originally Posted by probtc View Post
    Thanks for quick response. I am trying to create/implement new page by following up zencart structure because the way will help me to understand zencart system. I have also checked the other tpl_*** files permission they set to 600 same as my file which i created. As I understand from error log shows, zencart can not point the faq page. is there any other configuration files which is related with this ?
    You can download the About Us mod and just change the name About to your FAQ for a quick start for a new page setup https://www.zen-cart.com/downloads.php?do=file&id=86

    Defines are language pages read into another page like the contact us define..

    EZ- pages have there own issues and are good for some things... code is stored in sql database...

    Or you can just download one of the many FAQ modulus like this one https://www.zen-cart.com/downloads.php?do=file&id=669
    Dave
    Always forward thinking... Lost my mind!

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Creating a new page issue

    Quote Originally Posted by davewest View Post
    You can download the About Us mod and just change the name About to your FAQ for a quick start for a new page setup https://www.zen-cart.com/downloads.php?do=file&id=86

    Defines are language pages read into another page like the contact us define..

    EZ- pages have there own issues and are good for some things... code is stored in sql database...

    Or you can just download one of the many FAQ modulus like this one https://www.zen-cart.com/downloads.php?do=file&id=669
    downloading a new mod and then uploading it to his site using the same file transfer protocols will result in the same owner/group/permissions problems.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  8. #8
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Creating a new page issue

    Quote Originally Posted by carlwhat View Post
    downloading a new mod and then uploading it to his site using the same file transfer protocols will result in the same owner/group/permissions problems.
    Assuming there was a file permission error.... but the file in question
    Code:
    define(FILENAME_DEFINE_FAQ, 'define_faq');
    in
    Code:
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_FAQ, 'false');
    would not be
    Code:
    includes/languages/english/faq.php
    but
    Code:
    includes/languages/english/html_includes/YOUR_TEMPLATE/define_faq.php
    Which is missing in the provided question... would also match the error log!
    Downloading a mod that has the correct file structure would help...
    Dave
    Always forward thinking... Lost my mind!

  9. #9
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Creating a new page issue

    Quote Originally Posted by davewest View Post
    Assuming there was a file permission error.... but the file in question
    Code:
    define(FILENAME_DEFINE_FAQ, 'define_faq');
    in
    Code:
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_FAQ, 'false');
    would not be
    Code:
    includes/languages/english/faq.php
    but
    Code:
    includes/languages/english/html_includes/YOUR_TEMPLATE/define_faq.php
    Which is missing in the provided question... would also match the error log!
    Downloading a mod that has the correct file structure would help...
    That last part was a little of what I was talking about where a screenshot shows the necessary html_includes/define file, but it was not presented in the neighboring code sections nor discussion of generating a file.

    I randomly chose shippinginfo as an example to what was being attempted and at least all generated files follow the associated format in filenaming.
    A "page" needs an includes/modules/pages/YOUR_PAGE/header_php.php file,
    A template page that relates to the page: includes/templates/YOUR_TEMPLATE/templates/tpl_YOUR_PAGE_default.php
    And then as necessary language files to fill in the gaps.

    In this case, a specific define is to be displayed.

    As pointed out and while I intended my use of the term "permissions" to be applied loosely, having an incorrect owner to a file that has a given set of permissions can cause one file to be reachable where another may not be. I didn't see the response that the permissions were set to 600 like the others and so the next natural progression was to check the owner(s).


    That said, it looks like the issue has been resolved at least when attempting to go directly to the associated uri. Will be interesting to see what the reason was for it not working and/or the solution.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    May 2012
    Location
    SOUTH KOREA
    Posts
    21
    Plugin Contributions
    0

    Default Re: Creating a new page issue

    Thanks for your all. I have also tried to clone "about us" plugin but it didnt work. But i strongly believe there is no file permission/owner issue because I changed all related file permission and i tried 644 and 755 as well but unfortunately there is no luck. i really couldnt get the point what was wrong with configuration. All files are located and configured under proper file location. I think i should go with EZ Pages for my FAQ because it really took my 2 days to figure out for creating only one extra page with no success..

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v155 Creating a new page issue
    By probtc in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Dec 2018, 08:09 PM
  2. Creating a new page
    By buzzfever in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Jun 2010, 05:41 AM
  3. Creating a new page
    By beautifymenow in forum Customization from the Admin
    Replies: 1
    Last Post: 27 Apr 2010, 12:48 AM
  4. Creating A New Page
    By gkarasiewicz in forum General Questions
    Replies: 4
    Last Post: 25 Mar 2010, 07:26 PM
  5. Creating a New page
    By philip937 in forum General Questions
    Replies: 5
    Last Post: 10 Feb 2010, 11:06 PM

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