4images Modifications / Modifikationen > Requests for paid modifications / Jobbörse

Second Description Box for Categories: $75

(1/1)

IndoX:
Hello,

Requesting a paid mod for 1.7.11.

I would like a second description box for categories. Simple enough. Paying $75.

Please PM me if interested.

Regards,
Indo

Sunny C.:
Open: categories.php
Search

--- Code: ---"cat_description" => htmlspecialchars(format_text($cat_cache[$cat_id]['cat_description'], 1, 0, 1)),
--- End code ---
Add after

--- Code: ---"cat_second_description" => htmlspecialchars(format_text($cat_cache[$cat_id]['cat_second_description'], 1, 0, 1)),
--- End code ---

Open: global.php
Search

--- Code: ---$sql = "SELECT cat_id, cat_name, cat_description,
--- End code ---
find and Replace

--- Code: ---cat_description,
--- End code ---
With

--- Code: ---cat_second_description,
--- End code ---

Open: rss.php
Search

--- Code: ---$rss_desc  = format_rss_html($cat_cache[$cat_id]['cat_description']);
--- End code ---
Replace with

--- Code: ---$rss_desc  = format_rss_html($cat_cache[$cat_id]['cat_description']."\n".$cat_cache[$cat_id]['cat_second_description']);
--- End code ---

Open: admin/categories.php
Search

--- Code: ---$cat_description = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_description']));
--- End code ---
Add after

--- Code: ---$cat_second_description = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_second_description']));
--- End code ---

Search

--- Code: ---$sql = "INSERT INTO ".CATEGORIES_TABLE."
--- End code ---
Find

--- Code: ---(cat_name, cat_description,
--- End code ---
Replace with

--- Code: ---(cat_name, cat_description, cat_second_description,
--- End code ---
Find

--- Code: ---('$cat_name', '$cat_description',
--- End code ---
Replace with

--- Code: ---('$cat_name', '$cat_description', '$cat_second_description',
--- End code ---

Search

--- Code: ---show_textarea_row($lang['field_description_ext'], "cat_description", "", $textarea_size);
--- End code ---
Add after

--- Code: ---show_textarea_row("Second ".$lang['field_description_ext'], "cat_second_description", "", $textarea_size);
--- End code ---

Search

--- Code: ---$cat_description = strip_tags(un_htmlspecialchars(trim($HTTP_POST_VARS['cat_description'])), '<div><p><a><strong><bold><i><em><u><h1><h2><h3><h4><h5><h6><span>');
--- End code ---
Add after

--- Code: ---$cat_second_description = strip_tags(un_htmlspecialchars(trim($HTTP_POST_VARS['cat_second_description'])), '<div><p><a><strong><bold><i><em><u><h1><h2><h3><h4><h5><h6><span>');
--- End code ---

Search

--- Code: ---        $sql = "UPDATE ".CATEGORIES_TABLE."
            SET cat_name = '$cat_name', cat_description = '$cat_description',
--- End code ---
Replace with

--- Code: ---        $sql = "UPDATE ".CATEGORIES_TABLE."
            SET cat_name = '$cat_name', cat_description = '$cat_description', cat_second_description = '$cat_second_description',
--- End code ---

Search

--- Code: ---    $cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);

    $sql = "SELECT cat_name, cat_description,
--- End code ---
Replace with

--- Code: ---    $cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);

    $sql = "SELECT cat_name, cat_description, cat_second_description,
--- End code ---

Search

--- Code: ---show_textarea_row($lang['field_description_ext'], "cat_description", $cat_row['cat_description'], $textarea_size);
--- End code ---
Add after

--- Code: ---show_textarea_row("Second ".$lang['field_description_ext'], "cat_second_description", $cat_row['cat_second_description'], $textarea_size);
--- End code ---

Search

--- Code: ---    if (isset($HTTP_GET_VARS['closeall'])) {
        $open_all = false;
        $GLOBALS['map'] = array();
    }

    $sql = "SELECT cat_id, cat_name, cat_description,
--- End code ---
Replace with

--- Code: ---    if (isset($HTTP_GET_VARS['closeall'])) {
        $open_all = false;
        $GLOBALS['map'] = array();
    }

    $sql = "SELECT cat_id, cat_name, cat_description, cat_second_description,
--- End code ---

Search

--- Code: ---        if (!$show_all_subcats && !$open_all) {
            $where_sql = "WHERE cat_parent_id IN (".implode(", ", $GLOBALS['map']).")";
        }
        $sql = "SELECT cat_id, cat_name, cat_description,
--- End code ---
Replace with

--- Code: ---        if (!$show_all_subcats && !$open_all) {
            $where_sql = "WHERE cat_parent_id IN (".implode(", ", $GLOBALS['map']).")";
        }
        $sql = "SELECT cat_id, cat_name, cat_description, cat_second_description,
--- End code ---

Open: includes/functions.php
Search

--- Code: ---"cat_description" => htmlspecialchars(format_text($cat_cache[$category_id]['cat_description'], 1)),
--- End code ---
Add after

--- Code: ---"cat_second_description" => htmlspecialchars(format_text($cat_cache[$category_id]['cat_second_description'], 1)),
--- End code ---

Open: templates/your-template/categories.html
Search

--- Code: ---                          <br>{cat_description} (Hits: {cat_hits})
                          <hr size="1" />
--- End code ---
Replace with (or set {cat_second_description} at a desired position)

--- Code: ---                          <br>{cat_description} (Hits: {cat_hits})
                          <hr size="1" />
                          {cat_second_description}
                           <hr size="1" />
--- End code ---

Open: templates/your-template/category_bit.html
Search

--- Code: ---{if cat_description}<span class="smalltext">{cat_description}</span><br />{endif cat_description}
--- End code ---
Add after

--- Code: ---{if cat_second_description}<span class="smalltext">{cat_second_description}</span><br />{endif cat_second_description}
--- End code ---

And then a new column needs to be added in phpMyAdmin.


* Open: phpMyAdmin
* Select your database
* Click on SQL at the topEnter there

--- Code: ---ALTER TABLE 4images_categories
ADD COLUMN cat_second_description VARCHAR(255) NOT NULL;
--- End code ---
Click OK

Navigation

[0] Message Index

Go to full version