Removing |_ from category drop down menu

Free Mods For phpLD v2.x series

Removing |_ from category drop down menu

Postby shadav on Thu Jan 31, 2008 4:59 pm

Project: PHPLinkDirectory: Link exchange directory @ http://www.phplinkdirectory.com/
Mod: Removing |_ from category drop down menu @ http://www.shadav.info/mods.php
Version: 1.00
Notice: Maintain this section
Author: Shadav
License: Copyright (c) 2005 - 2008 Shadav

Any redistribution of Shadav mods without the expressed written consent of Shadav is strictly prohibited. Copying any of the code contained within any Shadav mod and claiming it as your own is also prohibited. By using these mods, you agree to indemnify Shadav from any liability that might arise from their use.

SHADAV MODS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

open include folder and then open functions.php
find or simular
Code: Select all
function get_categs_tree($id=0)
{
    global $db, $tables;
    static $categs = array ("0" => "[Top]");
    static $level = 0;
    $level++;
    $rs = $db->Execute("SELECT `ID`, `TITLE` FROM `{$tables['category']['name']}` WHERE `STATUS` = '2' AND `PARENT_ID` = ".$db->qstr($id)." AND `SYMBOLIC` <> 1 ORDER BY `TITLE`");

    while (!$rs->EOF)
   {
        if (empty($_SESSION['user_id']) ||$_SESSION['is_admin'])
            $categs[$rs->Fields('ID')] = str_repeat('|&nbsp;&nbsp;&nbsp;', $level -1).'|___'.$rs->Fields('TITLE');
      else
      {
            if (in_array($rs->Fields('ID'),$_SESSION['user_permission_array']))
                $categs[$rs->Fields('ID')] = str_repeat('|&nbsp;&nbsp;&nbsp;', $level -1).'|___'.$rs->Fields('TITLE');
        }
        get_categs_tree($rs->Fields('ID'));
        $rs->MoveNext();
    }
    $level--;
    return $categs;
}


replace with
Code: Select all
function get_categs_tree($id=0,$previous='') {global $db, $tables; static $categs = array ("0" => "[Top]"); static $level = 0; $level++; $rs = $db->Execute("SELECT `ID`, `TITLE` FROM `{$tables['category']['name']}` WHERE `STATUS` = '2' AND `PARENT_ID` = ".$db->qstr($id)." AND `SYMBOLIC` <> 1 ORDER BY `TITLE`"); while (!$rs->EOF) {if (empty($_SESSION['user_id']) ||$_SESSION['is_admin']) $categs[$rs->Fields('ID')] = $previous . $rs->Fields('TITLE'); else {if (in_array($rs->Fields('ID'),$_SESSION['user_permission_array'])) $categs[$rs->Fields('ID')] = $previous . $rs->Fields('TITLE');} get_categs_tree($rs->Fields('ID'), $previous . $rs->Fields('TITLE') . ' > '); $rs->MoveNext();} $level--; return $categs;}


this work fine on submit.php however in the admin section for some reason it displays as
0Auto
0Auto > Auto Parts
0Travel
0Travel > Hotels

or download the instructions:
CatDropDownMenu.zip
You do not have the required permissions to view the files attached to this post.
User avatar
shadav
Admin
Admin
 
Posts: 52
Joined: Aug 2007

Your Ad Here
Advertise with The Help Line :: Webmasters Resource Forum
Advertisement
 

Return to v2.x

Who is online

Users browsing this forum: No registered users and 0 guests