Collective Configuration

(This document pertains to Enthusiast 3.x and above only.)

This section outlines how to configure your collective to show information about your listings.

  1. Open the config.php file that is outside the enth3/ directory in the zip file, and supply the proper database values of your Enthusiast installation. Do not edit anything else. The database and sendmail values for this config file should mirror (read: is exactly the same) as the config file found in your Enth3 installation. The only difference, if ever, would be the database server if the fanlisting is hosted on another server (see Enthusiast 3.x on multiple domains).
  2. Upload this config file to the directory that you want your collective site to be in. This is not the admin panel; the admin panel and the collective site directory must naturally be different from each other.

    Something to check: make sure that the line containing the text “$listing” is commented out; that is, it has two back slashes at the start of the line, like so:

    //$listing = 1;
  3. To show the Joined Listings, insert the PHP lines below into the PHP file where you want your joined listings to show up (make sure the extension is .php or this will not work):
    <?php
    include 'config.php';
    $show_list = false;
    include $path . 'show_joined.php';
    ?>

    Setting $show_list to true will show a bulletted list instead of a dropdown menu for selecting the category. For 3.1 where subcategories are possible, you may toggle showing/hiding of subcategories in the main list by adding this line before the include line:

    $show_subcats_in_main_list = true;
  4. To show the Owned Listings, insert the PHP line below into the PHP file where you want your owned listings to show up (make sure the extension is .php or this will not work):
    <?php
    include 'config.php';
    $status = 'status';
    $hide_dropdown = false;
    $show_list = false;
    $show = 'show';
    include $path . 'show_owned.php';
    ?>

    where status would be either of the following:

    • pending, for pending listings
    • upcoming , for upcoming listings
    • current, for current listings

    and show would be the category ID of the “default” category to see if no category is selected by the visitor from the dropdown menu, or ‘all’. The variables $hide_dropdown, $show_list, and $show are all optional variables (these lines can be removed). Setting $hide_dropdown to true will not give the visitor any way to select a category; setting $show_list to true will show a bulletted list instead of a dropdown menu for selecting the category; if a category ID is set for $show, that category will be pre-selected for default viewing.

    For example:

    If you just simply want to show the dropdown on your current listings page with the default settings, you insert:

    <?php include 'config.php';
    $status = 'current';
    include $path . 'show_owned.php'; ?>

    But, for example you wish to show your upcoming listings without the dropdown but want every upcoming listing to show up as soon as the page loads (meaning, the user does not have to select anything), you would insert:

    <?php include 'config.php';
    $status = 'upcoming';
    $hide_dropdown = true;
    $show = 'all';
    include $path . 'show_owned.php'; ?>

    If you want to use a bulletted list but pre-select a category for the user to view, you would insert:

    <?php include 'config.php';
    $status = 'current';
    $show_list = true;
    $show = '1';
    include $path . 'show_owned.php'; ?>

    Lastly, for 3.1 where subcategories are possible, you may toggle showing/hiding of subcategories in the main list by adding this line before the include line:

    $show_subcats_in_main_list = true;
  5. To show the collective affiliates, insert the PHP line below into the PHP file where you want your collective affiliates to show up (make sure the extension is .php or this will not work):
    <?php include 'config.php';
    include $path . 'show_collective_affiliates.php'; ?>
  6. Showing collective statistics is possible with Enthusiast 3.x — using an addon for Enthusiast 3.0.x, and built-in starting from Enthusiast 3.1.x. If you’re using the former, download the addon first and upload show_collective_stats.php to your Enthusiast installation directory.

    To show collective statistics in your website, open in a text editor/create the page where you want your collective stats to show up, and insert this line before wherever you want the stats to be placed:

    <?php
    include 'config.php';
    include $path . 'show_collective_stats.php';
    ?>
  7. The instructions proceeding are all optional, depending on what information you want to show on your collective. The PHP snippets below will all show plain numbers unless otherwise specified.

    Tip: if you want to have the numbers show up in comma notation, you can use the following PHP function:

    <?= number_format( $variable ) ?>

    On to the variables!

    Snippet Usage
    <?= $total_cats ?>
    Show the total number of categories registered in your collective (regardless whether or not you have joined/owned listings under it)
    <?= $joined ?>
    Show the total number of joined listings in your collective (regardless of status)
    <?= $joined_pending ?>
    Show the total number of joined listings in your collective (pending only)
    <?= $joined_approved ?>
    Show the total number of joined listings in your collective (approved only)
    <?= $owned ?>
    Show the total number of owned listings in your collective (regardless of status)
    <?= $owned_pending ?>
    Show the total number of owned listings in your collective (pending only)
    <?= $owned_upcoming ?>
    Show the total number of owned listings in your collective (upcoming only)
    <?= $owned_current ?>
    Show the total number of owned listings in your collective (current only)
    <?= $affiliates_collective ?>
    Show the total number of collective affiliates
    <?= $collective_total_fans ?>
    Show the total number of members for your listings, both pending and approved
    <?= $collective_total_fans_approved ?>
    Show the total number of members for your listings, approved only
    <?= $collective_total_fans_pending ?>
    Show the total number of members for your listings, pending only
    <?= $owned_growth_rate ?>
    Show the growth rate of your owned listings (i.e., the rate at which you open/get approved for fanlistings)
    <?= $collective_fans_growth_rate ?>
    Show the cumulative growth rate of your individual listings (i.e., the rate at which your listings get members)
    <?= $joined_growth_rate ?>
    Show the rate at which you join listings

    If you wish to show the newest owned listing in your collective (current only), insert these lines on your page, depending on what you want to show:

    Snippet Usage
    <?= $owned_newest['title'] ?>
    listing title
    <?= $owned_newest['subject'] ?>
    listing subject
    <?= $owned_newest['URL'] ?>
    listing URL
    <?= $owned_newest['desc'] ?>
    listing description
    <?= $owned_newest['listingtype'] ?>
    listing type
    <?= $owned_newest['opened'] ?>
    opened date
    <?= $owned_newest['imagefile'] ?>
    listing image (directory path not included)

    If you wish to show the newest joined listing in your collective (approved only), insert these lines on your page, depending on what you want to show:

    Snippet Usage
    <?= $joined_newest['subject'] ?>
    listing subject
    <?= $joined_newest['URL'] ?>
    listing URL
    <?= $joined_newest['desc'] ?>
    listing description
    <?= $joined_newest['added'] ?>
    joined date
    <?= $joined_newest['imagefile'] ?>
    listing image (directory path not included)

    If you wish to show a random owned listing in your collective (current only), insert these lines on your page, depending on what you want to show:

    Snippet Usage
    <?= $owned_random['title'] ?>
    listing title
    <?= $owned_random['subject'] ?>
    listing subject
    <?= $owned_random['URL'] ?>
    listing URL
    <?= $owned_random['desc'] ?>
    listing description
    <?= $owned_random['listingtype'] ?>
    listing type
    <?= $owned_random['opened'] ?>
    opened date
    <?= $owned_random['imagefile'] ?>
    listing image (directory path not included)

    If you wish to show a random joined listing in your collective (approved only), insert these lines on your page, depending on what you want to show:

    Snippet Usage
    <?= $joined_random['subject'] ?>
    listing subject
    <?= $joined_random['URL'] ?>
    listing URL
    <?= $joined_random['desc'] ?>
    listing description
    <?= $joined_random['added'] ?>
    joined date
    <?= $joined_random['imagefile'] ?>
    listing image (directory path not included)