Zen Cart Logo
Forums / Basic Configuration / Unable to make a text appear from the sidebox

Unable to make a text appear from the sidebox

Locked

Views: 6,012

Results 1 to 20 of 25
This thread is locked. New replies are disabled.
9 Jan 2007, 3:10 AM
#1
jean avatar

jean

New Zenner

Join Date:
Jan 2004
Posts:
17
Plugin Contributions:
1

Unable to make a text appear from the sidebox

Hello,

I have a small problem writing correrctly the code to add a new page in the sidebox Information. After, I figure out how it works, I do the following. (Note than I not really write the code, I copy it for the conditions page and modify it. That way, I had less chance to do a typo. Anyway, here is what I did:

  1. In catalogue/includes/filenames.php

    Add:
    define('FILENAME_ABOUT_US', 'about_us');
    define('FILENAME_DEFINE_ABOUT_US', 'define_about_us');

  2. In catalogue / includes / modules / pages /

I create a folder about_us and a file header_php.php

  1. In catalogue/includes/modules/pages/about_us/header_php.php (My new created file)

Write:

<?php
/**
 * About us Page
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0
 * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $
 */

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_ABOUT_US, 'false');

$breadcrumb->add(NAVBAR_TITLE);
?>
  1. In catalogue/includes/modules/sideboxes/information.php

Add:

if (DEFINE_ABOUT_US_STATUS <= 1) {
    $information[] = '<a href="' . zen_href_link(FILENAME_ABOUT_US) . '">' . BOX_INFORMATION_ABOUT_US. '</a>';
  }
  1. In catalogue / includes / templates / template_default / templates /,
    I create a new file : tpl_about_us_default.php

  2. In this file, I wrote down:

<?php /** * Page Template * * Loaded automatically by index.php?main_page=about_us.<br /> * Displays conditions page. * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_conditions_default.php 3464 2006-04-19 00:07:26Z ajeh $ */ ?>
<div class="centerColumn" id="about_us">
<h1 id="conditionsHeading"><?php echo HEADING_TITLE; ?></h1>

<?php if (DEFINE_ABOUT_US_STATUS >= 1)  { ?>
<div id="about_usMainContent" class="content">
<?php
/**
 * require the html_define for the about_us page See modules/pages/about_us/header_php.php
 */
  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>

Now, I go on language section.

  1. In : catalogue/includes/languages/english.php, I write

    // information box text in sideboxes/information.php
    define('BOX_HEADING_INFORMATION', 'Informations');
    define('BOX_INFORMATION_ABOUT_US', 'The Company');

  2. In catalogue / includes / languages / english/, I add : about_us.php

  3. In catalogue / includes / languages / english/about_us.php

I write :

<?php
/*
  about_us.php
*/
  define('NAVBAR_TITLE', 'FDMT');
  define('HEADING_TITLE', 'The Company');
  define('TEXT_INFORMATION', '
  ');
?>
  1. In catalogue / includes / languages / english / html_includes / I add : define_about_us.php

  2. in catalogue / includes / languages / english / html_includes / define_about_us.php
    I wrote :

    <P>My text in html form </P>

Now, when I click on the link The company in the sidebox Informations, it opens an about_us page in which I have the NAVBAR_TiTLE and the HEADING_TITLE (not the constante but the variable) and the button Previous but I'm unable to see the texte in the define_about_us.php page.

Is anybody able to tell me why ?

Thanks in advance

12 Jan 2007, 9:29 PM
#2
jean avatar

jean

New Zenner

Join Date:
Jan 2004
Posts:
17
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

Forget about that.

I made a stupid mistake. It works now.

Jean

15 Jan 2007, 12:32 AM
#3
sweetdeal avatar

sweetdeal

New Zenner

Join Date:
Jan 2007
Posts:
2
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

jean:

Forget about that.

I made a stupid mistake. It works now.

Jean
Hi!
I am trying to add pages to the sidebox, and followed your example.
It was the best example that I know how to follow.
Unfortunately I ran into the same problem you have that the texts do not show.
How did you fix it? I couldn't figure it out myself.
Please help!
Thanks!

28 Jan 2007, 12:34 PM
#4
lexz avatar

lexz

New Zenner

Join Date:
Jan 2007
Posts:
26
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

Yes Jean,

Please provide us with your solution. I seem to be making the same mistake here.

Thanks,

Lex.

28 Jan 2007, 2:31 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Unable to make a text appear from the sidebox

Jean posted the 4 areas that must be edited/added to in the initial post.

Alternatively, your can download the aout us or blank bos modules and follow the instructions replacing your names with those in the mod

28 Jan 2007, 6:29 PM
#6
darinland avatar

darinland

New Zenner

Join Date:
Jan 2007
Posts:
15
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

I followed the instructions in Jean's initial post (to add a Security Statement page), and I still have the problem she had initially--the Security Statement page appears, with the header, but the text does not appear on the page.

Also, the Security Statement page will not appear in my sitemap.

Q: Should the text in HTML includes be the same as the text that appears in the Define Pages Editor window for the security.php? Because mine is not.

I also tried using the mod to add an About Us page, and that resulted in the same situation.

Still stuck!!! Any thots? Thanks!

--Michael

29 Jan 2007, 2:14 PM
#7
sweetdeal avatar

sweetdeal

New Zenner

Join Date:
Jan 2007
Posts:
2
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

I figured out the solution.
Go to Jean's " 6) In this file, I wrote down. " The problem is here:

<?php if (DEFINE_ABOUT_US_STATUS >= 1) { ?>

<div id="about_usMainContent" class="content"> <?php

I basically replace the content of this file (tpl_about_us_default.php) with
tpl_conditions.php. Don't change anything.
You can replace it with any file that are the original files and you are sure you are going to keep, otherwise the trick may not work. The reason for that is in the " DEFINE_CONDITIONS_STATUS >= 1".
I am not sure if my thinking is right because I am not familiar with PHP formate. But the solution did work. Good luck to you, too!

29 Jan 2007, 7:49 PM
#8
jean avatar

jean

New Zenner

Join Date:
Jan 2004
Posts:
17
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

Hello,

I'm surprised to see all those posts about the problem I have experienced. In fact the solution was simple : A typo in section 6.

<?php if (DEFINE_ABOUT_US_STATUS >= 1) { ?> <div id="about_usMainContent" class="content"> <?php

should read : <?php if (DEFINE_ABOUT_US >= 1) { ?>

Anyway, as I was also interested to control that from the admin panel, I rewrite everything including sql statement, (it is not exact as I am used to code by modifying existing files. I want to give credit to those people who are real programmers) and submit it to the download section. If it didn't appear there, let me know here and I'll send it directyly to you as I don't know if the file upload or not. I have two statements differents on screen. Green one : file successly upload and red one, unable to upload.

30 Jan 2007, 5:59 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

The reason for that is that the define pages utilizes a configuration_key to control the status of information ...

The module appears to be missing the SQL statement for this configuration_key ...

For your purposes, yes, you can use the code as changed ...

But the better method would be to update to add-on to include the missing SQL statement ... :smile:

Thanks for the update that worked for you ...

30 Jan 2007, 11:49 AM
#10
jean avatar

jean

New Zenner

Join Date:
Jan 2004
Posts:
17
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

Hello Linda,

I agree with you. The first time I did it fast just to solve my problem then I studied the way you did it for the others links. It is why I posted for approbation the whole module including the sql statement which works exactly like the other links in the information box.

But I don't know if you received it as the browser gave me two differents statements. Success and unsuccess.

30 Jan 2007, 2:26 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

Contributions are delayed on releases until reviewed ... usually they are done in 24-72 hours ...

4 Feb 2007, 6:51 PM
#12
lexz avatar

lexz

New Zenner

Join Date:
Jan 2007
Posts:
26
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

jean:

In fact the solution was simple : A typo in section 6.

<?php if (DEFINE_ABOUT_US_STATUS >= 1) { ?> <div id="about_usMainContent" class="content"> <?php

should read : <?php if (DEFINE_ABOUT_US >= 1) { ?>

Hi Jean, thanks for getting back to us.
I removed "STATUS" like you did but still the same result (text not showing up)
Because I'm quite a nitwit in this mather of programming I really mis the clue in al the messages posted after the one I'm qouting here.

What I wonder is that it might be the case that those variables are tested for their value ">=1" I have no idea though where they are set to that value. Could anyone tell me that?

regards

Lex.

6 Feb 2007, 9:36 PM
#13
lexz avatar

lexz

New Zenner

Join Date:
Jan 2007
Posts:
26
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

Some update,

In my case, I wasn;t adding an about_us page but a page called broadcast.
I started my includes/templates/delta-843/templates/tpl_broadcast_default.php like this :


<?php /** * Page Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_privacy_default.php 3464 2006-04-19 00:07:26Z ajeh $ */ ?> <div class="centerColumn" id="broadcast"> <h1 id="broadcastDefaultHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (DEFINE_BROADCAST_STATUS>= 1 and DEFINE_BROADCAST_STATUS <= 2) { ?> <div id="broadcastDefaultMainContent" class="content"> <?php /** * require the html_define for the broadcast page */ 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> _______________________________________________________________ I then deleted those two lines: <?php if (DEFINE_BROADCAST_STATUS>= 1 and DEFINE_BROADCAST_STATUS <= 2) { ?> <?php } ?>

And the text finally showed!

Hence still my question:
Where should it be set that DEFINE_BROADCAST_STATUS >=1 and <=2 ?

Regards,

Lex.

7 Feb 2007, 8:19 PM
#14
jean avatar

jean

New Zenner

Join Date:
Jan 2004
Posts:
17
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

Lexz.

In the exemple that I sent you you have a sql statement. This statement that you will have to modify to deserve your project (Broadcast instead of about_us) should be put in the database. (I did it by phpMyadmin). At that moment, in
admin/COnfiguration/Define Page Status, you will be able to set the page like the other ones in the information box.

Hope it is clear enough.

jean

7 Feb 2007, 11:03 PM
#15
lexz avatar

lexz

New Zenner

Join Date:
Jan 2007
Posts:
26
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

Jean,

Ok I think it's getting clear now. I haven't received your mail yet but I trust this will solve my issue.
Thanks a lot Jean and I will send you my adres again cause that might have gone wrong.

Regards,

Lex.

8 Feb 2007, 2:17 AM
#16
jean avatar

jean

New Zenner

Join Date:
Jan 2004
Posts:
17
Plugin Contributions:
1

Re: Unable to make a text appear from the sidebox

I sent it to you the same day I receive your mail.

Anyway, here is the sql statement:
-- phpMyAdmin SQL Dump
-- version 2.9.0.2
-- http://www.phpmyadmin.net

-- Serveur: localhost
-- Généré le : Jeudi 25 Janvier 2007 à 07:00
-- Version du serveur: 4.0.25
-- Version de PHP: 4.4.2

UPDATE INTO zen_configuration VALUES (655, 'define About us', 'DEFINE_ABOUT_US', '1', 'Enable the Defined About Us Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', 25, 68, '2007-01-12 15:37:39', '0001-01-01 00:00:00', NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),');

Please take note I didn't create anything. I just modified and used what it was already in the script.

Hope everything will be OK.

Jean

11 Jul 2007, 6:41 PM
#17
romy avatar

romy

New Zenner

Join Date:
May 2007
Location:
york, pa
Posts:
98
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

Hi to all.
Need help with the about us sidebox_link_to_about_us_with_admin_control
I'm getting a error
http://blackfriday717.com/index.php?main_page=about_us
this is the page
thanks

11 Jul 2007, 9:44 PM
#18
romy avatar

romy

New Zenner

Join Date:
May 2007
Location:
york, pa
Posts:
98
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

Hi need help
get this error:

Warning: main(includes/templates/template_default/templates/tpl_about_us_default.php) [function.main]: failed to open stream: No such file or directory in /home/4640/domains/blackfriday717.com/html/includes/templates/template_default/common/tpl_main_page.php on line 119

Warning: main(includes/templates/template_default/templates/tpl_about_us_default.php) [function.main]: failed to open stream: No such file or directory in /home/4640/domains/blackfriday717.com/html/includes/templates/template_default/common/tpl_main_page.php on line 119

Fatal error: main() [function.require]: Failed opening required 'includes/templates/template_default/templates/tpl_about_us_default.php' (include_path='.:/usr/local/php-4.4.7-1/share/pear') in /home/4640/domains/blackfriday717.com/html/includes/templates/template_default/common/tpl_main_page.php on line 119

on the about us page

13 Jul 2007, 3:56 PM
#19
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

I've tried to follow the points at the top of this post to add two new pages to the 'More Information' Sidebox BUT I seem to be getting the same problem as many other people. The two pages have been created, the links appear in the 'More Information' Sidebox but no text appears on the pages!

Here is what I did:

** 1) In /includes/filenames.php**

I've added:
define('FILENAME_PAGE_5', 'page_5');
define('FILENAME_DEFINE_PAGE_5', 'define_page_5');

** 2) In /includes/modules/pages/**

I created folder page_5 and a file header_php.php

** 3) In /includes/modules/pages/page_5/header_php.php**

I have written

<?php /** * Page 5 * * @package page * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $ */ 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_PAGE_5, 'false'); ?>

** 4) In /includes/modules/sideboxes/more_information.php**

I have added:

if (DEFINE_PAGE_5_STATUS <= 1) {
$more_information[] = '<a href="' . zen_href_link(FILENAME_PAGE_5) . '">' . BOX_INFORMATION_PAGE_5 . '</a>';
}

** 5) In includes/templates/template_default/templates/**

I created a new file called : tpl_page_5_default.php

** 6) In this file, I put the following:**

<?php /** * Page Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_page_5_default.php 3464 2006-04-19 00:07:26Z ajeh $ */ ?> <div class="centerColumn" id="pageFive"> <h1 id="pageFiveHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (DEFINE_PAGE_5_STATUS >= 1 and DEFINE_PAGE_5_STATUS <= 2) { ?> <div id="pageFiveMainContent" class="content"> <?php /** * require the html_define for the page_5 page */ 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>

** 7) In /includes/languages/english.php, I've added**

// information box text in sideboxes/more_information.php - were TUTORIAL_
define('BOX_INFORMATION_PAGE_5', 'Links');

** 8) In /includes/languages/english/ I've added : page_5.php**

** 9) In /includes/languages/english/about_us.php**

I've again copied from the other (number) files, just replaced the other number with 5:

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: page_5.php 1969 2005-09-13 06:57:21Z drbyte $ // define('NAVBAR_TITLE', 'Links'); define('HEADING_TITLE', 'Links'); define('TEXT_INFORMATION', 'Page 5 information goes here.'); ?>

** 10) In /includes/languages/english/html_includes/ I've added : define_page_5.php**

** 11) in /includes/languages/english/html_includes/define_page_5.php**

Is included the general text:

<p><strong>Page 5 Sample Text ...</strong></p> <p>This section of text is from the Define Pages Editor located under Tools in the Admin.</p> <p>To remove this section of the text, delete it from the Define Pages Editor.</p>

When I go to the page http://www.cadwyngifts.com/page_5.html it opens with everything showing correctly except that there's no text!

Where have I gone wrong?!?!?! :frusty:

16 Jul 2007, 2:37 PM
#20
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: Unable to make a text appear from the sidebox

I've now used the 'Developers Tool Kit' under Tools in stockroom, and looked for all references to page_2 and page_5 , and I can confirm that page_5 is a complete clone of page_2, therefore I cannot understand why the text appears fine on Page 2, but not the new Page 5 that I have created :wacko:

The only thing I haven't done is to add any sql statement to the database. Is this where I'm going wrong?