Dear all,

Some times, to make something to work, you need fantasy.

I am new to PHP but as for simple things to do, I think I can manage.

So I wanted to create a subscribers area in www.doctorbet.gr/gr

With many modifications, in template and other files, I managed to control a 'subscription product' , checking if subscription has expired and using parts of code of TABBED PRODUCTS LITE contribution and other files I created for this purpose, to show the user the protected content.

The point was to create an automated menu for subscribers, using some code from the above contribution.

Well, it is a long story to describe here,what exactly I did but when I have time I will post it here, with as many information as I can.

As for the TIP, using code from the above contribution ( specials thanks to the one [and any other] who created this ) my MAIN IDEA was to give another value to the variable '$products_description'.

So [inside a new .php file I made] I gave it the value of a define [could be another variable] like this :

$products_description = SUBSCRIBERS_MENU;

I did not know what is going to happen but based on how TABBED PRODUCTS LITE work, I tied the following :

Inside my new .php file [could be external file also, using include()] I made the define 'SUBSCRIBERS_MENU' some like as following :

define('SUBSCRIBERS_MENU' , '

' . MAIN_MENU_BUTTON_AND_CONTENT . '

<!--%' . FIRST_BUTTON . '%-->
' . FIRST_BUTTON_CONTENT . '

<!--%' . SECOND_BUTTON . '%-->
' . SECOND_BUTTON_CONTENT . '


<!--%' . THIRD_BUTTON . '%-->
' . THIRD_BUTTON_CONTENT . '

';)
Notice that I used some defines above. Buttons defines are placed in another .php file called subscribers_button_names.php and buttons content defines are placed in other files they are called first_button_content.php, second_button_content, third_button_content.php etc, using as many files needed. They could also all be inside one file.

For buttons, I made a catalog 'subscribers_button_names'
inside catalog/includes [ I put everything inside catalog/includes so it is protected content] , a file 'button_names.php' inside it, and I configured the path in catalog/includes/configure.php :

define('DIR_WS_SUBSCRIBERS_BUTTON_NAMES', DIR_WS_INCLUDES . 'subscribers_button_names/');
For the content, I made a catalog 'subscribers_content' inside catalog/includes and all my content file inside it (for eg. first_button_content.php, second_button_content.php etc.) and I also configured the path in catalog/includes/configure.php :

define('DIR_WS_SUBSCRIBERS_CONTENT', DIR_WS_INCLUDES . 'subscribers_content/');
So my define 'SUBSCRIBERS_MENU' needed to 'know' all that defines to use them, and I did the following :


<?php
include(DIR_WS_SUBSCRIBERS_BUTTON_NAMES . 'button_names.php');
?>


<?php
include(DIR_WS_SUBSCRIBERS_CONTENT. 'first_button_content.php');
include(DIR_WS_SUBSCRIBERS_CONTENT. 'second_button_content.php');
include(DIR_WS_SUBSCRIBERS_CONTENT. 'third_button_content.php');
?>
I also used some code, not all of it, from the tpl_product_info_display.php I found in TABBED PRODUCTS LITE contribution :
THE FOLLOWING IS NOT THE ORDER I PUT IT

<?php require(DIR_WS_MODULES . 'tabbed_products_lite.php');?>

<?php

if ($products_description != '') {

if ($chkTabStart === false || $chkTabEnd === false) {
?>
<div id="productDescription" class="productGeneral biggerText">
<?php echo stripslashes($products_description); ?>
</div>

<?php
If ($bAddToCart || $bMediaCollection || $bAdditionalImages || $bCustomersAlsoPurchased || $bCrossSell_Tab || $bReviews_Tab) {
require($template->get_template_dir('/tpl_tabbed_products_lite.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_tabbed_products_lite.php');
}
} else {
require($template->get_template_dir('/tpl_tabbed_products_lite.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_tabbed_products_lite.php');
}
}
?>
You can also make a copy of 'tabbed_products_lite.php' from catalog/includes/modules and rename it to 'tabbed_products_lite_custom.php' if you want to make custom modification and override the original file, but in this case you should use :

<?php require(DIR_WS_MODULES . 'tabbed_products_lite_custom.php');?>

instead of

<?php require(DIR_WS_MODULES . 'tabbed_products_lite.php');?>

in the above part of code.

As I am new in PHP I do not yet know a way to include all that files with another easiest way.

Maybe we could create a new table in database to keep all that information and some new pages in Admin area to control all these functions.

Well, I need help from Zen Cart Team, or any other developer, so we can work on some ideas :

Create new table(s) in database, new pages in Admin, and some other modules if needed, combined with ez-pages to produce the following :

Control structures , to create and control all the above and provide information to the users or subscribers as described above.

I will try to make this new contribution but I need help :)

It is not like the ez-pages.

The difference is that we can have protected content and we create buttons menu instead of using TOC and CHAPTERS wit easy pages.

Maybe we could create buttons menu, using the ez-pages system.

Instead of just using defines or variables, we could combine them with the content of our database, where ez-pages page title and page content is kept.

So I supose we need some queries to get the title and the content of our ez-pages.

Then we use some variables to put what we want where we want, and with some modification to the above 'system' I use, automatically we produce button names and their content from ez-pages.

Then we only need a page in Admin, (or modification to Ez-Pages) to control our buttons and their content.