Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Apr 2006
    Location
    City Drama in Greece
    Posts
    160
    Plugin Contributions
    6

    Default Subscription System with Auto Menu Pages

    /**
    *
    * ================================
    * Instructions for Auto Menu Pages
    * ================================
    *
    * A new Project for Zen Cart compatible with version 1.3.7
    * started by Charis Chrisochoou.
    *
    * ================================
    * Description - Features - History
    * ================================
    *
    * This Project includes modified files for a "Subscription System" setup,
    * Tabbed Products Lite v3.8, and a new page in admin am_pages.php, which
    * is based on ezpages.php. The main idea started when one of my clients
    * wanted to make a new web page for soccer in Greece, www.doctorbet.gr/gr
    * We needed to make a system for Subscribers...a new chalenge for me !!!
    * I am new in PHP and MySQL but have enough experience with computers and
    * internet, so I had to read a lot! Well now we running a web site for
    * subscribers, (they can pay by Visa through Eurobank in Greece) based on
    * the above contributions in combination with my project.
    *
    * How it works ?
    *
    * Using the downloads feature, system checks automatically when subscription
    * has expired, where "subscription" is just a downloadable product !
    *
    * If subscription is active (not expired) we provide the user the content, else
    * we inform him that subscription has expired and we provide a link for renewall.
    * As for the charges, lot of Bank's provide nice tools you can use in their backoffice
    * if you want to charge periodically etc.
    *
    * To reach a downloadable product, you go to account history info which uses the file
    * "tpl_account_history_info_default", which requires (if downloads are enabled)
    * the file "tpl_modules_downloads.php". So I wanted to provide content instead of a
    * download link. This was easy. But I should find a way so I could create a menu in this area.
    *
    * After some thoughts I deciced to use only some lines of code of the file "tpl_product_info_display.php"
    * as it was modified in the contribution Tabbed Products Lite v3.8. Before all I had install and tested
    * this contribution and I discovered many ways to add custom buttons to a zen cart shop, editing and
    * updating it's database where entries where `product_description`.
    *
    * This gave me the idea to make a new file to call it with "require", where I should display the download
    * link in the file "tpl_modules_downloads.php".
    *
    * This is the file I used some lines of code of the file "tpl_product_info_display.php". The tip was that
    * I gave a new value to the variable "$products_description". The value of a define inside this file.
    * This define was "responsible" to keep all other defines where every define was a name of a button or
    * content of a button where every button define had to be inside <!--% %--> tags, as this is the way that
    * Tabbed Products Lite using to construct buttons and content.
    *
    * OK but now what ? How can we update the content ? I made a file with button name defines and some other
    * files with content defines which they were all included with "require" in my new file. So to change
    * button names or content we could not have graphical interface though administration area and we should
    * every time edit all these files.
    *
    * As my experience with PHP and MySQL started to "grow"? ; I thought it would be a good idea to start a
    * new project to manage all this content through Admin area. As for the defines I though they could be
    * just variables taken from queries, buttons and content should be recorder in a new table and there
    * should be a new page in Admin to edit this table. This way "Auto Menu Pages" started. Maybe some say
    * "Why you do not modify ezpages to a different menu?" Yes, maybe we can even use css menu from the admin
    * or any other css menu BUT using Auto Menu Pages menu it is just like using Tabbed Products Lite in a
    * shop. The benefit is that once the file am_pages.php load, we have all buttons and content in front of
    * us, ready to "surf"? ; VERY FAST once all queries are done and content is "included" inside the buttons !!!
    *
    * For me it was a new chalenge as I was new to all of these things. So I thought it was a good idea to copy
    * ezpages.php code and modify it to my new table needs. After one day it was working just fine but now what ?
    *
    * The Project stuck here because I was not able to construct the right queries, so I made some custom queries
    * only for my client's web page, just to provide the content I needed. You can see the first Auto Menu here :
    * http://www.doctorbet.gr/gr/index.php?main_page=xthesina
    *
    * WELL, I AM SEARCHING FOR DEVELOPERS, USERS AND ZEN CART SPECIALISTS TEAM TO WORK ON THIS PROJECT.
    *
    * Below you can find the installation of the new table and some new config values. I also provide some files
    * in a zip. All files I made or modified for a Subscription System to work with Auto Menou Pages.
    *
    *
    *
    * ================================================================================ ======================
    * INSTALLATION - INSTALLATION - INSTALLATION - INSTALLATION - INSTALLATION - INSTALLATION - INSTALLATION
    * ================================================================================ ======================
    *
    * 1. First go to Admin->Tools->Install SQL Patches
    * Copy all the following and paste it in the text area
    * of the page SQL Query Executor ( admin/sqlpatch.php )
    *
    * The following installs one new database table called `am_pages`, one new cfg group value and eight new cfg values
    * for AM Pages Configuration, in databases without prefix defined. If you have defined prefix for your database
    * and even you do not remember it, see the attached file prefix_help.txt for help.
    *
    * DO NOT INSTALL THE FOLLOWING AS IT IS IF YOU HAVE PREFIX FOR YOUR DATA BASE TABLES
    *
    * After you install the following you will be able to go to :
    *
    * Admin->Configuration->AM Pages Config but there is no need to configure anything there yet (Project is running)
    * ################################################################################################################################################################ ################################################################################################################################################################ ################################################################################################################################################################ ################################################################################################################################################################ ################################################################################################################################################################ ############################################################__
    *
    **/


    INSTALL


    CREATE TABLE `am_pages` (`am_page_id` int(11) NOT NULL auto_increment,`am_page_status_id` int(1) NOT NULL default '1',`am_page_button_title` varchar(64) NOT NULL default '',`am_page_html_text` text,`am_page_menu_group` int(11) NOT NULL default '0',PRIMARY KEY (`am_page_id`)) TYPE=MyISAM AUTO_INCREMENT=1;
    INSERT INTO configuration_group VALUES ('', 'AM Pages Config', 'Auto Menu Pages Config', '1', '1');
    UPDATE configuration_group SET sort_order = '0' WHERE configuration_group_title LIKE 'AM Pages Config' LIMIT 1;
    UPDATE configuration_group SET configuration_group_id = '2810' WHERE configuration_group_title LIKE 'AM Pages Config';
    INSERT INTO `configuration` VALUES ('','Are Auto Menu Pages protected or public - Override','AM_P_OVER','1','Set this to 0 if you want all Auto Menu Pages to be protected.<br /><br />This way you can override all Auto Menu Pages protection configuration.<br /><br />Setting this to 1 your configuration in every page will not be overriden.<br /><br />0= off 1= on',2810,1,now(),now(),NULL,"zen_cfg_select_option(array('0','1'),");
    INSERT INTO `configuration` VALUES ('', 'AM Pages to disable left-column', 'AM_P_DLCL', '0', 'AM Pages on which to NOT display the normal "left" column (of sideboxes) for your site.Simply list page ID numbers separated by commas with no spaces.Page ID numbers can be obtained from the Auto Menu Pages screen under Admin->Tools.ie: 14 or leave blank.', 2810, 2, now(), now(), NULL, 'zen_cfg_textarea_small(');
    INSERT INTO `configuration` VALUES ('', 'AM Pages to disable right-column', 'AM_P_DRCL', '0', 'AM Pages on which to NOT display the normal "right" column (of sideboxes) for your site.Simply list page ID numbers separated by commas with no spaces.Page ID numbers can be obtained from the Auto Menu Pages screen under Admin->Tools.ie: 14 or leave blank.', 2810, 3, now(), now(), NULL, 'zen_cfg_textarea_small(');
    INSERT INTO `configuration` VALUES ('', 'First Button Title prefix name - Override', 'AM_P_FBPN', 'Main Page', 'This is for overriding all first buttons titles in all AM Pages.<br /><br />The default value is Main Page. Give another name or leave blank', 2810, 4, now(), now(), NULL, 'zen_cfg_textarea_small(');
    INSERT INTO `configuration` VALUES ('', 'General Settings A - 0-5', 'AM_P_GSAN', '0', 'There is no need to change something here.<br /><br />This is only for future use if needed.<br />0= AMP GS A 0<br />0= AMP GS A 1<br />0= AMP GS A 2<br />0= AMP GS A 3<br />0= AMP GS A 4<br />0= AMP GS A 5', 2810, 5, now(), now(), NULL, "zen_cfg_select_option(array('0', '1', '2', '3', '4', '5'),");
    INSERT INTO `configuration` VALUES ('', 'General Settings B - 0-5', 'AM_P_GSBN', '0', 'There is no need to change something here.<br /><br />This is only for future use if needed.<br />0= AMP GS B 0<br />0= AMP GS B 1<br />0= AMP GS B 2<br />0= AMP GS B 3<br />0= AMP GS B 4<br />0= AMP GS B 5', 2810, 6, now(), now(), NULL, "zen_cfg_select_option(array('0', '1', '2', '3', '4', '5'),");
    INSERT INTO `configuration` VALUES ('', 'General Settings C - Small Text Area', 'AM_P_GSCTAS', '0', 'There is no need to change something here.<br /><br />This is only for future use if needed.',2810, 7, now(), now(), NULL, 'zen_cfg_textarea_small(');
    INSERT INTO `configuration` VALUES ('', 'General Settings D - Text Area', 'AM_P_GSDTA', '0', 'There is no need to change something here.<br /><br />This is only for future use if needed.',2810, 8, now(), now(), NULL, 'zen_cfg_textarea(');



    UNINSTALL - Use the following in Admin->Tools->Install SQL Patches to uninstall all the above installation if needed

    DELETE FROM `configuration_group` WHERE configuration_group_title LIKE 'AM Pages Config';
    DELETE FROM `configuration` WHERE `configuration_group_id` = '2810';

    ################################################################################################################################################################ ################################################################################################################################################################ ################################################################################################################################################################ ################################################################################################################################################################ ################################################################################################################################################################ ############################################################___


    IF YOU NEED A ZEN CART FOR SUBSCRIPTIONS ONLY, DO ALL THE FOLLOWING :


    /**
    *
    * 2. Make a new directory(catalog) in includes and name it "subscribers"
    *
    * 3. In your topic file includes\configure.php add the line :
    * define('DIR_WS_SUBSCRIBERS', DIR_WS_INCLUDES . 'subscribers/');
    * and uploaded it.
    *
    * ATTENTION - ATTENTION - ATTENTION - ATTENTION - ATTENTION - ATTENTION - ATTENTION - ATTENTION - ATTENTION
    *
    * Do not modify your topic file includes\configure.php before you download the "valid" one from your server
    * because the includes/configure.php file in your server keeps all "valid" data. So FIRST DOWNLOAD the file
    * includes/configure.php and then edit it.
    *
    * 4. In your topic file includes\database_tables.php add the line :
    * define('TABLE_AM_PAGES', DB_PREFIX . 'am_pages');
    * and uploaded it.
    *
    * 5. From the attached zip, upload the files :
    *
    * - am_pages.php to your admin directory.
    * - am_pages_queries.php to your catalog/includes/subscribers directory.
    * - tabbed_products_lite_override.php to your catalog/includes/modules directory.
    * - am_pages_menu_construction.php to your catalog/include/subscribers directory.
    * - am_pages_lang.php to your admin/includes/languages/english/extra_definitions directory.
    * - am_pages_tools_dhtml.php to your admin/includes/boxes/extra_boxes directory.
    * - am_pages_file_name_definition.php to your admin/includes/extra_datafiles directroy.

    TO BE CONTINUED

    THIS IS THE FIRST PART

    SECOND PART WHEN I HAVE TIME
    Attached Files Attached Files

 

 

Similar Threads

  1. Subscription System and Auto Menu Pages
    By cjsmiff in forum Addon Payment Modules
    Replies: 0
    Last Post: 26 Sep 2007, 01:38 AM
  2. Subscription System for 1.3.7 - Subscription Product
    By lebrand2006 in forum Addon Templates
    Replies: 1
    Last Post: 27 Apr 2007, 10:57 AM
  3. Subscription System
    By lebrand2006 in forum General Questions
    Replies: 0
    Last Post: 14 Mar 2007, 09:17 PM

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