Zen Cart Logo
Forums / Customization from the Admin / How to add pages to define page status?

How to add pages to define page status?

Locked

Views: 53,479

Results 41 to 60 of 66
This thread is locked. New replies are disabled.
21 Aug 2009, 4:23 PM
#41
ajeh avatar

ajeh

Oba-san

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

How to add pages to define page status?

Do you have defined somewhere:
FILENAME_PAGE_5
DEFINE_PAGE_5_STATUS
BOX_INFORMATION_PAGE_5

Without them things will not work ...

21 Aug 2009, 7:09 PM
#42
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

charmedbytina2:

There is a module in the Free Software Add Ons tab above to add 3 pages to the More Information sidebox.

Compare the files there with what you have done to see what is missing (filenames.php edited for your new page?)

Tina
===============================
Hi Tina,

thanks for your help.

You are correct, filenames.php was one of them I missed...

When I managed to find the "Software Add Ons" I decided I'd have a go.

Then, as I was surfing on the wave top, I decided I'd to it all for a triple language site, translating files and so forth.

Now, after four hours work I meet a blank screen.
BLAST!
:(
So I'm zillating a backup up the server and, whilst hoping for the best for saving the day... I answer you..

Thinking ZEN CART... I'll tell you a thought I am having at intervals.

Being someone who earns his living by brains, not hands, my job being that of an automotive project engineer, when I set on a new project I forcibly start on a white sheet, from the first line up.

This ZEN CART demands an opposite approach, which I often find disconcerting.

Sometimes I feel like I were a writer and they, telling me that all the words I might need to compose my next novel are on it, gave me a dictionary.

And a set of instructions the size of a Bible.

That's undoubtedly true, all words I need are there, but I haven't yet been able so size how long is to take (with the help of the Bible and the many well meaning volunteers helping this community) to search for my words through the pages of "that" dictionary.

A book where words are not entered following the a, b, c, d, alphabet order.

Which is why I am discouraged.
In french they call it "Broyer du noir"

I wonder... am I an exception or such feelings are shared by others?

PS
8:45pm, meantime Zilla FTP has finished...

The site is back to what it was.

To the contrary the admin shows the "Hello, thank you for loading Zen Cart" invite...

:dontgetit

Time is that I pack up for the week.

Wish you a splendid week-end!

24 Aug 2009, 8:06 AM
#43
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Hi Tina,

call it pride, warm summer nights helping, my basic “Let’s know each other” test site is operative.

Thanks to your tip the [More information] pages are now up to seven, they are indexed too.

I suppose the previously reported snag of the [admin] screen was due for having replaced all over in my [admin] folders the [define_pages_editor.php] off the the bundle ,whereas that file should only be used in [admin/includes/laguages/your_language/ define_pages_editor.php]

A minor snag, pages 5 to7 don't show in the Site Map, a bug I do not seem capable to fix.

Considering the free nature of the imposing Zen Cart software and its international vocation I feel I would like to make a small contribution.

I elaborated a tri-lingual frame over the [More Information]Add On software.

Folders and files don't come at random but are placed in a root starting with [admin], [includes] and [languages]: that IMHO should help installation.

Following these lines the Add On structure, from present en, fr and it, could be opened further to comprise any language.

If you think this work could be useful to the community, I presume the bundle should next be checked by someone having the ZEN CART competence I miss and then edited. Helping is my compensation, else I want no merit.

I look forward to a suggestion for the right person to whom post a zip.

Thanks!

24 Aug 2009, 3:02 PM
#44
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

You have to customize the Site Map to include your new pages ...

The code currently has:

<?php if (DEFINE_PAGE_4_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_4) . '">' . BOX_INFORMATION_PAGE_4 . '</a>'; ?></li>
<?php } ?>

If you add a similar set of code and change the 4 to 5, 6, 7 etc. these should show up on your site map ...

24 Aug 2009, 3:44 PM
#45
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Thanks Linda, most appreciate.

Using the Developers Tool I find the following strings in the remote server file
STORE/includes/templates/template_default/templates/tpl_site_map_default.php

OMISSIS

<?php } ?> <?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_UNSUBSCRIBE) . '">' . BOX_INFORMATION_UNSUBSCRIBE . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_2_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_2) . '">' . BOX_INFORMATION_PAGE_2 . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_3_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_3) . '">' . BOX_INFORMATION_PAGE_3 . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_4_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_4) . '">' . BOX_INFORMATION_PAGE_4 . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_5_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_5) . '">' . BOX_INFORMATION_PAGE_5 . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_6_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_6) . '">' . BOX_INFORMATION_PAGE_6 . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_7_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_7) . '">' . BOX_INFORMATION_PAGE_7 . '</a>'; ?></li>
<?php } ?>
     </ul></li>
 </ul>

==========================================

Page_2 to Page_7 are there, which is why I was unable to fix it.

Could the snag be elsewhere?

Tipical beginners problem... wonder what's waiting for yours truly around the corner.
:D

BTW, May you enlighten me about what's the STATUS <= '1') meaning?

Thanls again

25 Aug 2009, 4:24 AM
#46
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

Where do you have these defined as 1?
DEFINE_PAGE_5_STATUS
DEFINE_PAGE_6_STATUS
DEFINE_PAGE_7_STATUS

25 Aug 2009, 6:23 AM
#47
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Good morning Linda,

thanks for helping.

The code comes from the file of the Add On bundle named [tpl_site_map_default.php]

Here is part of it:

(OMISSIS)

<?php if (DEFINE_PAGE_4_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_4) . '">' . BOX_INFORMATION_PAGE_4 . '</a>'; ?></li>
<?php } ?> <?php if (DEFINE_PAGE_5_STATUS <= '1') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_5) . '">' . BOX_INFORMATION_PAGE_5 . '</a>'; ?></li>
<?php } ?>

(and so forth up to DEFINE_PAGE_7_STATUS <= '1')

25 Aug 2009, 3:55 PM
#48
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

That is where the define constants are "used" ... the question is ... where are these "defined"?

Are they on the configuration table like the original pages?

Are they defined in a php fine somewhere?

Constants, such as:
DEFINE_PAGE_5_STATUS
DEFINE_PAGE_6_STATUS
DEFINE_PAGE_7_STATUS

when referenced have a "value" or "text" ... if that "value" or "text" is not "defined" somewhere, then its value will be 0 ... and in an IF statement such as in the Site Map ... 0 means OFF or false ...

So, it sounds like you do not have these "defined" ...

26 Aug 2009, 6:29 AM
#49
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Ajeh:

That is where the define constants are "used" ... the question is ... where are these "defined"?
(OMISSIS)
So, it sounds like you do not have these "defined" ...

Good morning Linda,

I do not to know php scripture and regrettably I haven' the time to learn it...

So I read what I see written and try to apply some brain to it, but I can not really tell what's doing what.

In doing my homework and trying to implement your suggestion the best I understood it, I made a search going to:

[/STORE/admin/developers_tool_kit.php?action=locate_all_files]

and found these hints:

I did it for [DEFINE_PAGE_4_] but pages 5,6 & 7 are similar.

Are the files [/STORE/includes/templates/template_default/templates/tpl_page_2, 3, 4, 5, 6 & 7_default.php] the place where "DEFINE" are "defined"?

Or I am missing something on the way?
:dontgetit

Hope you will be able to enlighten my ignorance.

Thanks again!

27 Aug 2009, 3:31 AM
#50
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

The original defines for pages are stored in the database, example page 4:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page 4', 'DEFINE_PAGE_4_STATUS', '1', 'Enable the Defined Page 4 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', '84', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

These then show up on Configuration ... Define Pages ...

You could back up your database and make a set of these for page 5, 6, 7 etc. and add them to your database ...

27 Aug 2009, 6:33 AM
#51
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Good morning Linda,

a day you have a minute, I'd love to learn how you manage to insert those codes, so neat, with scroll bar and all that... me... I am left with the [PrintScreen] key...
:lookaroun

As a pupil I'd like to be more brilliant, hope time will help...

I tell you what I've done.

1.) Saved DataBase and exported: size 564 KB

2.) Went into [Tools]>[Define Pages Editor] I opened up pages 5, 6 & 7, saved them 9 times, in en, fr & it

3.) I saved again and exported the database: size 570 KB, plus 6 KB

4.) I compared the .sql files, the 6 KB are due to a diffrence shown partially here:

5.) It does not change that in the DEFINE_PAGE_? the situation is unchanged... only 2,3 & 4 show.

6.) Obviously I haven't done it again, question is... what?

:Flush:

Eh, eh, eh!

27 Aug 2009, 7:15 AM
#52
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to add pages to define page status?

To display code in code boxes in a post, wrap it in the forum tags for generic code: ```
[code] [/code], PHP code: [php] [/php], or HTML code: [html] [/html]

27 Aug 2009, 7:23 AM
#53
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to add pages to define page status?

The defines are done by making a statement like

insert into configuration (...etc

as shown above for each of page 5, 6 and 7, then pasting them in the Tools > Install SQL Patches box.

27 Aug 2009, 4:53 PM
#54
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

gjh42:

The defines are done by making a statement like

insert into configuration (...etc

as shown above for each of page 5, 6 and 7, then pasting them in the Tools > Install SQL Patches box.
=========================================
Hi Glen,

I had two mails from you, THANKS!

The first about [quote] I've already put to effect, as seen below.
Wonderful!

Next post suggestions:

1.) I made a .sql save of the Database.

2.) I went inspecting where the DEFINE_PAGE_X are: they are the 3 which show in Site Map, codes are shown below

(530, 'Define Page 2', 'DEFINE_PAGE_2_STATUS', '1', 'Enable the Defined Page 2 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, 82, '2009-08-17 08:55:59', '2009-08-17 08:55:59', NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),'),
(531, 'Define Page 3', 'DEFINE_PAGE_3_STATUS', '1', 'Enable the Defined Page 3 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, 83, '2009-08-17 08:55:59', '2009-08-17 08:55:59', NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),'),
(532, 'Define Page 4', 'DEFINE_PAGE_4_STATUS', '1', 'Enable the Defined Page 4 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, 84, '2009-08-17 08:55:59', '2009-08-17 08:55:59', NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),'),

3.) Next still I went to see Tools > Install SQL Patches... an adress whith so many WARNINGS! to made me shudder.

INDENT That page is a place which I named "Hic sunt leones", same as in ancient maps from the Roman era for regions about which there was no information that were identified by the Latin inscription "Hic Sunt Leones"... "Here are the lions"[/INDENT]
:D

4.) IMHO I should first be sure how to modify the text of the existing defines for catering for Pages 5, 6 & 7, which I am not.

5.) Next scaring reason is that if I make a mess of the DataBase (which is on a remote Linus server controlled by with Cpanel) I have yet to learn how to import my local backup.

So, before doing anything regrettable... I decided I'd wait and better learn my way about.

Thanks again for your inputs!

27 Aug 2009, 5:06 PM
#55
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

This is how Page 4 is inserted into the database configuration table:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page 4', 'DEFINE_PAGE_4_STATUS', '1', 'Enable the Defined Page 4 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', '84', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

If you were to use the same code but change all of the references to Page 4, PAGE_4 etc. to Page 5, PAGE_5 etc. you can add the information to the database table: configuration ...

This will then show up in your Zen Cart Admin in the Configuration ... Define Page Status ...

27 Aug 2009, 5:52 PM
#56
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Hi Linda,

silly questions are those which aren't asked...

Apart of changing the chain page digits, is the array:

'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'')

to become:
'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', "4","5","6","7",)

Thanks!

27 Aug 2009, 10:26 PM
#57
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

There are only 4 choices on the settings ... those would not be changed ... you are looking at a coincidence of numbers ... :smile:

28 Aug 2009, 6:03 AM
#58
ram336ram avatar

ram336ram

New Zenner

Join Date:
Aug 2009
Posts:
18
Plugin Contributions:
0

Re: How to add pages to define page status?

Ajeh:

There are only 4 choices on the settings ... those would not be changed ... you are looking at a coincidence of numbers ... :smile:
===============================
Thanks Linda,

you message is understood.

I feel like a jumper waiting at the end of the trampoline, afraid of the height, but sooner or later I'll have to push the flush....

I notice that in my database query the line end looks so:

'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),'),

whereas in the string you friendly provided it looks so,

'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

The question is:

"Should I use a comma or a semi column in the end?"

Thanks again!

28 Aug 2009, 1:13 PM
#59
ajeh avatar

ajeh

Oba-san

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

Re: How to add pages to define page status?

Use the code that I posted and change the settings to match your page number ...

Original for Page 4:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page 4', 'DEFINE_PAGE_4_STATUS', '1', 'Enable the Defined Page 4 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', '84', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

New for Page 5:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page 5', 'DEFINE_PAGE_5_STATUS', '1', 'Enable the Defined Page 5 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', '85', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

New for Page 6:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page 6', 'DEFINE_PAGE_6_STATUS', '1', 'Enable the Defined Page 6 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', '86', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

New for Page 7:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page 7', 'DEFINE_PAGE_7_STATUS', '1', 'Enable the Defined Page 7 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', '87', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');
28 Aug 2009, 6:34 PM
#60
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: How to add pages to define page status?

ram336ram:

5.) Next scaring reason is that if I make a mess of the DataBase (which is on a remote Linus server controlled by with Cpanel) I have yet to learn how to import my local backup.
phpmyadmin does that for you.
Select the database and then Import or Export, select tables or whole database, etc....