Category Descriptions 1.1.1P2

Ability for the admin to add descriptions to categories and display them below the category names

  1. nay27uk
    WeBid Version:
    • 1.1.1/1.1.2
    <!-- BEGIN LEGAL DISCLAIMER -->
    LEGAL DISCLAIMER!!!
    COPYRIGHT AND LEGAL DISCLAIMER:

    This Webid modification has been written and released to the following URL's only.
    1. http://www.webidsupport.com/forums/index.php?resources/
    2. http://www.webidsupport.com/forums/index.php?resources/categories/admin.7/
    3. http://www.webidsupport.com/forums/index.php?resources/category-descriptions.109/
    Therefore this WeBid modification has been released on the above listed URL's as a free WeBid modification ONLY and solely for the users and/or members of the WeBid script (this does not include any members still registered here or not that have taken the WeBid script and made a new script from WeBid) this WeBid modification is only available from the URL's posted above as well as at the URL of http://www.webidsupport.com.

    The use of this WeBid modification, and/or the inclusion of this WeBid modification, in full, or in part with the same name or renamed in any way in any script other than that of the WeBid script, and/or the inclusion of this WeBid modification, in any script that is based off of the original coding of the WeBid script is STRICTLY FORBIDDEN.

    I declare herein that I claim and hold the copyright to this WeBid Modification.

    <!-- END LEGAL DISCLAIMER -->


    ABOUT THE MODIFICATION
    I have created this mod in response to this forum thread HERE.

    This mod adds the ability for the WeBid admin to enter a category description to any category both Parent Categories and Child/Sub Categories and display them under the main Category Name on both the Homepage and Browse page (See Screen Shots at the end of this instructional).

    On with the Edits and Instructions.

    DATABASE EDITS
    First
    we need to add a new Column to the Database in the webid_categories table.

    To do this Log in to your PhpMyadmin and log into the database for your WeBid install, then follow the steps below (images are included for ease of following the steps you can click the images to see a larger view of them).

    When logged into PhpMyAdmin and you have selected your WeBid Database follow the below steps, use the attached image below to help you follow the steps.

    myadmin1.jpg

    Step 1: Select the webid_categories table from the left hand sidebar.
    Step 2: Click on the Structure Tab at the top of the page.
    Step 3: At the bottom of the page we are now going to tell PhpMyAdmin that we wish to create a New Column in the Selected Table after the cat_image column to do this follow the STEP 3 in the image above exactly and then click the GO button.

    Next we need to make the actual new column, to do this in the new window that you are seeing now follow the steps below and don't forget you can use the image attached below to help you.

    myadmin2.jpg

    Step 1: For the Name section, enter into the box cat_description.
    Step 2: For the Type section, select TEXT from the dropdown.
    Step 3: For the Default section, select None from the dropdown menu.
    Step 4: For the Collation section, select latin1_swedish_ci from the dropdown menu.
    Step 5: Click on the Save Button

    That is the new Column now added and you should now be seeing the below page.

    myadmin3.jpg

    So now we have finished all the Database edits and we will continue with the WeBid file edits.

    PHP EDITS CORE FILES
    Open the file index.php and on or around line 80 find code.
    PHP:
    'COLOUR' => (empty($row['cat_colour'])) ? '#FFFFFF' $row['cat_colour'],
    Directly below it add code.
    PHP:
    'DESCRIPTION' => (empty($row['cat_description'])) ? '' $row['cat_description'],
    Save and Re Upload index.php

    Next open browse.php and on lines 121 - 128 find the bellow code
    PHP:
            if ($row['cat_colour'] != '')
            {
                
    $BG 'bgcolor=' $row['cat_colour'];
            }
            else
            {
                
    $BG '';
            }
    Directly bellow it add code
    PHP:
            if ($row['cat_description'] != '')
            {
                
    $description $row['cat_description'];
            }
            else
            {
                
    $description '';
            }
    In the same file on line 132 find code
    PHP:
    $TPL_main_value .= "\t" '<td ' $BG ' WIDTH="33%">' $catimage '<a href="' $system->SETTINGS['siteurl'] . 'browse.php?id=' $row['cat_id'] . '">' $row['cat_name'] . $count_string '</a></td>' "\n";
    Replace it with code
    PHP:
    $TPL_main_value .= "\t" '<td ' $BG ' WIDTH="33%">' $catimage '<a href="' $system->SETTINGS['siteurl'] . 'browse.php?id=' $row['cat_id'] . '">' $row['cat_name'] . $count_string '</a><br>' $description '</td>' "\n";
    Save and Re Upload browse.php

    PHP EDITS ADMIN FILES
    Open the file categories.php and on line 88 find code
    PHP:
    cat_colour '" . mysql_real_escape_string($_POST['colour'][$k]) . "'cat_image '" . mysql_real_escape_string($_POST['image'][$k]) . "'
    Replace with code
    PHP:
    cat_colour '" . mysql_real_escape_string($_POST['colour'][$k]) . "'cat_image '" . mysql_real_escape_string($_POST['image'][$k]) . "'cat_description '" . mysql_real_escape_string($_POST['description'][$k]) . "'
    In the same file on line 99 find code
    PHP:
    'cat_colour' => $_POST['cat_colour'],
    Directly bellow add code
    PHP:
    'cat_description' => $_POST['cat_description'],
    Save and Re Upload categories.php

    TEMPLATE EDITS DEFAULT THEME
    Open the file home.tpl and on line line 12 find code
    PHP:
    <a href="browse.php?id={cat_list.ID}">{cat_list.IMAGE}{cat_list.NAME}</a> {cat_list.CATAUCNUM}
    Replace with code
    PHP:
    <a href="browse.php?id={cat_list.ID}">{cat_list.IMAGE}{cat_list.NAME}</a> {cat_list.CATAUCNUM}<br>{cat_list.DESCRIPTION}
    Save and Re Upload home.tpl

    TEMPLATE EDITS BOOTSTRAP 3 THEME
    Open the file home.tpl and on line 27 find code
    PHP:
    <class="list-group-item" href="browse.php?id={cat_list.ID}">{cat_list.IMAGE}{cat_list.NAME}<span class="pull-right">{cat_list.CATAUCNUM}</span></a>
    Replace with code
    PHP:
    <class="list-group-item" href="browse.php?id={cat_list.ID}">{cat_list.IMAGE}{cat_list.NAME}<span class="pull-right">{cat_list.CATAUCNUM}</span><br>{cat_list.DESCRIPTION}</a>
    Save and Re Upload home.tpl

    TEMPLATE EDITS ADMIN THEME

    Open the file categories.tpl and on line 22 find code
    PHP:
    <th width="40%"><b>{L_087}</b></th>
    Replace with code
    PHP:
    <th width="40%"><b>{L_302}</b></th>
    <
    th width="20%">{L_087}</th>
    Next on line 32 find code
    PHP:
    <td><input type="text" name="categories[{cats.CAT_ID}]" value="{cats.CAT_NAME}" size="50"></td>
    Replace with code
    PHP:
    <td><input type="text" name="categories[{cats.CAT_ID}]" value="{cats.CAT_NAME}" size="30"></td>
    <
    td><input type="text" name="description[{cats.CAT_ID}]" value="{cats.CAT_DESCRIPTION}" size="25"></td>
    Next on line 54 find code
    PHP:
    <td><input type="text" name="new_category" size="25"></td>
    Replace with code
    PHP:
    <td><input type="text" name="new_category" size="25"></td>
    <
    td><input type="text" name="cat_description" size="25"></td>
    Save and Re Upload categories.tpl

    That's it your now finished but there is one last IMPORTANT!!!! step to do.

    Log in to your WeBid admin and click on the CLEAR TEMPLATE CACHE button.

    Now we are finished

    SCREEN SHOTS

    DEFAULT THEME
    Homepage
    homepage default.jpg

    Browse Page
    browse default.jpg

    BOOTSTRAP 3 THEME
    Homepage
    homepage bootstrap.jpg

    Browse Page
    browse bootstrap.jpg

    ADMIN THEME

    Add Category Page
    admin category.jpg

    Thanks for looking t this MOD and if you like it please leave a Review or Rating on the Right of this page.

    Thank You