Exemplo n.º 1
0
function DisplayCategories($parentid = 0, $sublevelmarker = '')
{
    global $db, $config, $link, $dle_vb_conf;
    if ($parentid != 0) {
        $sublevelmarker .= '--';
    }
    $getcategories = $db->query("SELECT * FROM " . PREFIX . "_category WHERE parentid = '{$parentid}' ORDER BY posi ASC");
    while ($row = $db->get_row($getcategories)) {
        $link .= "<tr><td style=\"padding-right:3px;\">" . $sublevelmarker . "<a class=\"list\" href=\"{$config['http_home_url']}index.php?do=cat&category=" . $row['alt_name'] . "\" target=\"_blank\">" . stripslashes($row['name']) . "</a></td><td><input class=edit type=text style=\"text-align: center;\" name='save_con[vb_link_forumid][{$row['id']}]' value='{$dle_vb_conf['vb_link_forumid'][$row['id']]}' size=10></td></tr><tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=2></td></tr>";
        DisplayCategories($row['id'], $sublevelmarker);
    }
}
Exemplo n.º 2
0
    function DisplayCategories($parentid = 0, $sublevelmarker = '')
    {
        global $lang, $cat_info, $config, $dle_login_hash;
        // start table
        if ($parentid == 0) {
            echo <<<HTML
<form method="post" action="">
<div style="padding-top:5px;padding-bottom:2px;">
<table width="100%">
    <tr>
        <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
        <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
        <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
    </tr>
    <tr>
        <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
        <td style="padding:5px;" bgcolor="#FFFFFF">
<table width="100%">
    <tr>
        <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_list']}</div></td>
    </tr>
</table>
<div class="unterline"></div>
<table width="100%">
    <tr>
        <td style="padding:2px;">ID</td>
        <td style="padding:2px;">Position</td>
        <td>{$lang['cat_cat']}</td>
        <td>{$lang['cat_url']}</td>
        <td>{$lang['cat_addicon']}</td>
        <td>{$lang['cat_skin_t']}</td>
        <td width="120">{$lang['cat_action']}</td>
    </tr>
    <tr>
        <td colspan="7"><div class="hr_line"></div></td>
    </tr>
HTML;
        } else {
            $sublevelmarker .= '--';
        }
        if (count($cat_info)) {
            foreach ($cat_info as $cats) {
                if ($cats['parentid'] == $parentid) {
                    $root_category[] = $cats['id'];
                }
            }
            if (count($root_category)) {
                foreach ($root_category as $id) {
                    $category_name = $cat[$id];
                    if ($config['allow_alt_url'] == "yes") {
                        $link = "<a class=\"list\" href=\"" . $config['http_home_url'] . get_url($id) . "/\" target=\"_blank\">" . stripslashes($cat_info[$id]['name']) . "</a>";
                    } else {
                        $link = "<a class=\"list\" href=\"{$config['http_home_url']}index.php?do=cat&category=" . $cat_info[$id]['alt_name'] . "\" target=\"_blank\">" . stripslashes($cat_info[$id]['name']) . "</a>";
                    }
                    echo "<tr>\r\n\t\t\t\t\t\t<td height=\"14\">&nbsp;<b>" . $cat_info[$id]['id'] . "</b></td>\r\n\t\t\t\t\t\t<td height=\"20\"><input class=\"edit\" type=\"text\" size=\"5\" name=\"posi[{$cat_info[$id]['id']}]\" maxlength=\"5\" value=\"{$cat_info[$id]['posi']}\"></td>\r\n\t\t\t\t\t\t<td>&nbsp;{$sublevelmarker}&nbsp;" . $link . "</td>\r\n\t\t\t\t\t\t<td>";
                    if ($cat_info[$id]['alt_name'] != "") {
                        echo $cat_info[$id]['alt_name'];
                    } else {
                        echo "---";
                    }
                    echo "</td><td>";
                    if ($cat_info[$id]['icon'] != "") {
                        echo "<img border=0 src=\"" . $cat_info[$id]['icon'] . "\" height=40 width=40 alt=\"" . $cat_info[$id]['icon'] . "\">";
                    } else {
                        echo "---";
                    }
                    echo "</td><td>";
                    if ($cat_info[$id]['skin'] != "") {
                        echo $cat_info[$id]['skin'];
                    } else {
                        echo "---";
                    }
                    echo "</td>\r\n\t\t\t\t\t\t<td class=\"list\"><nobr>[<a href=\"?mod=categories&action=edit&catid=" . $cat_info[$id]['id'] . "\">{$lang['cat_ed']}</a>] [<a class=maintitle href=\"?mod=categories&user_hash=" . $dle_login_hash . "&action=remove&catid=" . $cat_info[$id]['id'] . "\">{$lang['cat_del']}</a>]</nobr></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>";
                    DisplayCategories($id, $sublevelmarker);
                }
            }
        }
        // end table
        if ($parentid == 0) {
            echo <<<HTML
    <tr>
        <td colspan="7" style="padding:5px;"><input type=hidden name=action value=sort><input type="submit" id="posi" class="btn btn-primary" value="{$lang['cat_posi']}" /></td>
    </tr>
     </table>
</td>
        <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
    </tr>
    <tr>
        <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
        <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
        <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
    </tr>
</table>
</div></form>
HTML;
        }
    }
Exemplo n.º 3
0
 function DisplayCategories($parentid = 0, $sublevelmarker = false)
 {
     global $lang, $cat_info, $config, $dle_login_hash;
     $cat_item = "";
     if (count($cat_info)) {
         foreach ($cat_info as $cats) {
             if ($cats['parentid'] == $parentid) {
                 $root_category[] = $cats['id'];
             }
         }
         if (count($root_category)) {
             foreach ($root_category as $id) {
                 $category_name = $cat[$id];
                 if ($config['allow_alt_url'] == "yes") {
                     $link = "<a class=\"list\" href=\"" . $config['http_home_url'] . get_url($id) . "/\" target=\"_blank\">" . stripslashes($cat_info[$id]['name']) . "</a>";
                 } else {
                     $link = "<a class=\"list\" href=\"{$config['http_home_url']}index.php?do=cat&category=" . $cat_info[$id]['alt_name'] . "\" target=\"_blank\">" . stripslashes($cat_info[$id]['name']) . "</a>";
                 }
                 $cat_item .= "<li id=\"list_{$cat_info[$id]['id']}\"><div><b>ID:{$cat_info[$id]['id']}</b> {$link} <span><a href=\"?mod=categories&action=edit&catid=" . $cat_info[$id]['id'] . "\"><img style=\"vertical-align: middle;border:none;\" title=\"{$lang['cat_ed']}\" alt=\"{$lang['cat_ed']}\" src=\"engine/skins/images/notepad.png\" /></a>&nbsp;&nbsp;<a class=\"maintitle\" onclick=\"javascript:cdelete('{$cat_info[$id]['id']}'); return(false);\" href=\"?mod=categories&user_hash=" . $dle_login_hash . "&action=remove&catid=" . $cat_info[$id]['id'] . "\"><img style=\"vertical-align: middle;border:none;\" alt=\"{$lang['cat_del']}\" title=\"{$lang['cat_del']}\" src=\"engine/skins/images/delete.png\" /></a></span></div>";
                 $cat_item .= DisplayCategories($id, true);
             }
             if ($sublevelmarker) {
                 return "<ol>" . $cat_item . "</ol>";
             } else {
                 return $cat_item;
             }
         }
     }
 }
Exemplo n.º 4
0
 function DisplayCategories($parentid = 0, $sublevelmarker = false)
 {
     global $lang, $cat_info, $config, $dle_login_hash;
     $cat_item = "";
     if (count($cat_info)) {
         foreach ($cat_info as $cats) {
             if ($cats['parentid'] == $parentid) {
                 $root_category[] = $cats['id'];
             }
         }
         if (count($root_category)) {
             foreach ($root_category as $id) {
                 $category_name = $cat[$id];
                 if ($config['allow_alt_url']) {
                     $link = "<a href=\"" . $config['http_home_url'] . get_url($id) . "/\" target=\"_blank\">" . stripslashes($cat_info[$id]['name']) . "</a>";
                 } else {
                     $link = "<a href=\"{$config['http_home_url']}index.php?do=cat&category=" . $cat_info[$id]['alt_name'] . "\" target=\"_blank\">" . stripslashes($cat_info[$id]['name']) . "</a>";
                 }
                 $cat_item .= "<li class=\"dd-item\" data-id=\"{$cat_info[$id]['id']}\"><div class=\"dd-handle\"><b>ID:{$cat_info[$id]['id']}</b> {$link} <div class=\"pull-right\"><a href=\"?mod=categories&action=edit&catid=" . $cat_info[$id]['id'] . "\"><i title=\"{$lang['cat_ed']}\" alt=\"{$lang['cat_ed']}\" class=\"icon-pencil bigger-130\"></i></a>&nbsp;&nbsp;<a onclick=\"javascript:cdelete('{$cat_info[$id]['id']}'); return(false);\" href=\"?mod=categories&user_hash=" . $dle_login_hash . "&action=remove&catid=" . $cat_info[$id]['id'] . "\"><i title=\"{$lang['cat_del']}\" alt=\"{$lang['cat_del']}\" class=\"icon-trash bigger-130 status-error\"></i></a></div></div>";
                 $cat_item .= DisplayCategories($id, true);
             }
             if ($sublevelmarker) {
                 return "<ol class=\"dd-list\">" . $cat_item . "</ol>";
             } else {
                 return $cat_item;
             }
         }
     }
 }