Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34
  1. #21
    Join Date
    Nov 2008
    Location
    Pacific Northwest
    Posts
    40
    Plugin Contributions
    0

    Default Re: members only area

    I'm working on a similar update for my site except I'm using the customers group pricing id to determine who has access to what. Now I'm able to setup as many pricing groups as I want and customize various parts of the site depending on which group a customer belongs to.

    This isn't fully implemented yet, but it seems functional. So let me know if you'd like more info.

  2. #22
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    thanks Ells

    this could well be of interest.

    My implementation uses the define pages as they recognize the necessary php coding at the top of the page.

    If you have similar coding for category/product/ezpages this could well prove very useful

    best regards

    Derek

  3. #23
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    Members only Section – update – 6 March 2009

    You are welcome to use these notes and programs for your own use at your own risk!!
    If you can improve anything, that would be very welcome – please post on the forum.
    Please backup all your files before any mods.

    Use customers newsletter (char (1) field on database (customers)) to determine membership status 1 = member, 0 = non member
    Set the newsletter field = 0 for all customers using program below
    Set up membership category to purchase subscription
    ClubBaitworks member - if subscribed manually set the newletter to subscribed using edit customer details (this sets the field to “1”)
    For general email correspondence use the Tools/email option not newsletter.
    Tools/newsletter to be used for members.

    Configuration/Customer details set the show newsletter subscription to off, to remove option at customer account set up and ability of customer to edit his account details

    Configuration/Email options remove unsubscribe link

    This is a general program to send queries to the zencart (mysql) database

    <!-- Program: mysql_send.php
    Desc: PHP program that sends an SQL query to the
    MySQL server and displays the results.
    -->
    <html>
    <head><title>SQL Query Sender</title></head>
    <body>
    <?php
    $host="localhost";
    $user="username";
    $password="password";

    /* Section that executes query */
    if(@$_GET['form'] == "yes")
    {
    mysql_connect($host,$user,$password);
    mysql_select_db($_POST['database']);
    $query = stripSlashes($_POST['query']);
    $result = mysql_query($query);
    echo "Database Selected: <b>{$_POST['database']}</b><br>
    Query: <b>$query</b><h3>Results</h3><hr>";
    if($result == 0)
    {
    echo "<b>Error ".mysql_errno().": ".mysql_error().
    "</b>";
    }
    elseif (@mysql_num_rows($result) == 0)
    {
    echo("<b>Query completed. No results returned.
    </b><br>");
    }
    else
    {
    echo "<table border='1'>
    <thead>
    <tr>";
    for($i = 0;$i < mysql_num_fields($result);$i++)
    {
    echo "<th>".mysql_field_name($result,$i).
    "</th>";
    }
    echo " </tr>
    </thead>
    <tbody>";
    for ($i = 0; $i < mysql_num_rows($result); $i++)
    {
    echo "<tr>";
    $row = mysql_fetch_row($result);
    for($j = 0;$j<mysql_num_fields($result);$j++)
    {
    echo("<td>" . $row[$j] . "</td>");
    }
    echo "</tr>";
    }
    echo "</tbody>
    </table>";
    } //end else
    echo "
    <hr><br>
    <form action=\"{$_SERVER['PHP_SELF']}\" method=\"POST\">
    <input type='hidden' name='query' value='$query'>
    <input type='hidden' name='database'
    value={$_POST['database']}>
    <input type='submit' name=\"queryButton\"
    value=\"New Query\">
    <input type='submit' name=\"queryButton\"
    value=\"Edit Query\">
    </form>";
    unset($form);
    exit();
    } // endif form=yes

    /* Section that requests user input of query */
    @$query=stripSlashes($_POST['query']);
    if (@$_POST['queryButton'] != "Edit Query")
    {
    $query = " ";
    }
    ?>

    <form action="<?php echo $_SERVER['PHP_SELF'] ?>?form=yes"
    method="POST">
    <table>
    <tr>
    <td align=right><b>Type in database name</b></td>
    <td><input type="text" name="database"
    value=<?php echo @$_POST['database'] ?> ></td>
    </tr>
    <tr>
    <td align="right" valign="top">
    <b>Type in SQL query</b></td>
    <td><textarea name="query" cols="60"
    rows="10"><?php echo $query ?></textarea>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit"
    value="Submit Query"></td>
    </tr>
    </table>
    </form>
    </body></html>

    A typical query might be:
    SELECT customers_firstname, customers_lastname, customers_id, customers_newsletter from customers

    Which will display the database info in tabular form


    Program to change newsletter status to zero on customers database

    <!-- Program: newsletter field set.php
    Desc: PHP program that sets the newsletter field to 0
    -->
    <html>
    <head><title>Newsletter set</title></head>
    <body>
    <?php
    $host="localhost";
    $user="username";
    $password="password";
    $databasename = "databasename";

    $connection = mysql_connect($host, $user, $password)
    or die ("Could not connect to server");
    $db = mysql_select_db($databasename,$connection)
    or die ("Could not select derekbry_zen database");

    $query = "update customers SET customers_newsletter = 0 WHERE customers_newsletter != 0";
    $result = mysql_query($query)
    or die ("Could not execute query");

    echo "customers_newsletter field set to 0";
    ?>

    </body>
    </html

    The define pages are stored as .php files and are therefore used as the membership home page

    To change define page names modify:


    /zen/includes/languages/english/page_4.php

    Line #22 : define('NAVBAR_TITLE', 'clubderek');

    Line #23 : define('HEADING_TITLE', 'clubderek');

    At the top of the define page used as the membership home page insert the following code:

    <?php
    session_start();

    $custID = $_SESSION['customer_id'];

    if ($custID == "")
    echo "<br>Please log in at the top of the screen to enter Club Baitworks<br> ";
    stop();

    /*
    else


    {
    $host="localhost";
    $user="username";
    $password="password";
    $database="databasename";
    $connection = mysql_connect($host, $user, $password)
    or die ("Could not connect");
    $db = mysql_select_db($database, $connection)
    or die ("Could not connect");

    $query = "SELECT customers_firstname, customers_lastname, customers_id, customers_newsletter from customers WHERE customers_id=$custID";
    $result = mysql_query($query)
    or die ("couldn't execute query");

    $row = mysql_fetch_array($result,MYSQL_BOTH);

    $newlettercode = $row[3];

    if ($newlettercode != 1)
    {echo "non ClubBaitworks member - please purchase membership subscription above at Club Baitworks";
    stop(); }
    else
    {
    $_SESSION['auth'] = "YES";

    /* echo "carry on to members section";*/
    }

    }
    */

    ?>

    The html code for the members home page follows this php code

  4. #24
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: members only area

    Derek, thanks for taking time to post further details/update.

  5. #25
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    Further update

    We now have a members only section on our website, where visitors must have an account before they can enter the members section. This obviously builds up our email/marketing database.
    A category was set up called Club Baitworks containing a simple navigation bar to the other member exclusive sections (using HTML).
    Using the excellent download "Define Pages Generator" available from the download centre, all the individual pages for Club Baitworks were created with their appropriate names. We created a total of seven pages - I know of no limitation on this number.
    The define pages are stored as .php files.
    To stop people hacking into the members site, all the individual pages start with the following code which checks (a) whether they are signed in, (b) whether they have an account:

    <?php
    session_start();

    $custID = $_SESSION['customer_id'];

    if ($custID == "")
    { echo "<br>To enter Club Baitworks, either log in to your account with your existing username and password, <br> or create a new account using log in at the top of your screen<br> ";
    stop();}
    ?>

    The rest of the HTML for the page follows after for each page.

    If and when we want to charge for membership we will use the newsletter code to determine membership adding in the newsletter code check php as outlined in previous posts

  6. #26
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: members only area

    Are you still using format outlined in your post number 23, dated 6th March 2009, of this thread? Thanks for posting updates BTW..

  7. #27
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    Hi Misty

    Not quite sure what you mean by Format.

    The most recent thread I have posted is a stand alone simple solution for a members area branching off a standard category.

    I understand that category pages and EZ pages are stored as text pages and therefore cannot interpret the php code needed at the top of each members page.

    The define pages generator is a very fast way of generating the necessary (members) define pages.

    If we decide to charge for membership, the "Program to change newsletter status to zero on customers database" will be used.
    The php code to check newsletter field will then be added to the top of the define pages.

    On one section of the members section we would like to have a "special offer" - is it possible to add in a zen cart shopping facility in the define page which will add to the shopping cart in the normal way?

    Perhaps I ought to post that in another forum!
    best regards


    Derek

  8. #28
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: members only area

    By format, meant coding...
    shopping facility in define main page....
    can only suggest you link to products that are hidden
    unless exact url given to members...mod in download section
    to hide categories/prods...
    zencart gurus may be able to suggest different method/s..
    HTH

  9. #29
    Join Date
    Mar 2009
    Location
    PA, USA
    Posts
    31
    Plugin Contributions
    0

    Default Re: members only area

    I have a similar requirement for my site.

    I just want an area of my site that only people who are signed in can see. I want to offer technical support pages for the products I sell, but I want people to complete a registration form before they can see those pages.

    The rest of my site, products and prices are available to anyone.

    Does anyone know of a add-on or download that will help me do this? PLEASE be gentle, I am no expert!!

  10. #30
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    Hi Liam

    are you familiar with using ftp software and modifying zen cart files with text editors?

    cheers

    Derek

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Members only area
    By jlong in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 8 Jan 2011, 07:11 PM
  2. members only: hiding the products from non members
    By poosk in forum General Questions
    Replies: 2
    Last Post: 18 Nov 2009, 04:17 PM
  3. Add a members only area
    By jdl in forum General Questions
    Replies: 8
    Last Post: 3 May 2007, 02:46 PM
  4. Replies: 7
    Last Post: 3 May 2007, 04:40 AM

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