function list_categories($cats, $sub = '') { foreach ($cats as $cat) { ?> <tr> <td style="padding:8px 0;"> <?php echo $sub; ?> <span class="glyphicon glyphicon-play" style="font-size:0.8em; color:#8bc53f;"></span> <a class="sideCatA" style="" href="<?php echo site_url($cat['category']->slug); ?> "> <?php echo ucwords(strtolower($cat['category']->name)); ?> </a> </td> </tr> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' '; list_categories($cat['children'], $sub2); } } }
function list_categories($categories, $mylevel = 0) { foreach ($categories as $key => $tmp_cat) { $level = $mylevel * 4; echo '<ul class="dl_cat_list" style="border-left:1px solid orange; margin-left:8px; padding-left:2px;">'; echo '<li><a href="?cat=' . $tmp_cat['cid'] . '">' . $tmp_cat['name'] . '</a></li>'; if (isset($tmp_cat['subcategories'])) { list_categories($tmp_cat['subcategories'], $mylevel + 1); } echo '</ul>'; } }
function list_categories($cats, $sub = '') { foreach ($cats as $cat) { ?> <tr class="gc_row"> <td class="gc_cell_left" style="width:16px;"><?php echo $cat['category']->id; ?> </td> <td><?php echo $sub . $cat['category']->name; ?> </td> <td class="gc_cell_right list_buttons"> <a href="<?php echo base_url(); echo ADMIN_FOLDER; ?> /categories/delete/<?php echo $cat['category']->id; ?> " onclick="return areyousure();">Delete</a> <a href="<?php echo base_url(); echo ADMIN_FOLDER; ?> /categories/form/<?php echo $cat['category']->id; ?> " class="ui-state-default ui-corner-all">Edit</a> <a href="<?php echo base_url(); echo ADMIN_FOLDER; ?> /categories/organize/<?php echo $cat['category']->id; ?> ">Organize</a> </td> </tr> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat['children'], $sub2); } } }
function list_categories($id, $categories, $sub = '') { foreach ($categories[$id] as $cat) { ?> <option class="span2" value="<?php echo $cat->id; ?> "><?php echo $sub . $cat->name; ?> </option> <?php if (isset($categories[$cat->id]) && sizeof($categories[$cat->id]) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat->id, $categories, $sub2); } } }
function list_categories($cats, $product_categories, $sub = '') { foreach ($cats as $cat) { ?> <option class="span2" value="<?php echo $cat['category']->id; ?> "><?php echo $sub . $cat['category']->name; ?> </option> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat['children'], $product_categories, $sub2); } } }
function list_categories($cats, $product_categories, $sub = '') { foreach ($cats as $cat) { ?> <tr class="gc_row"> <td><?php echo $sub . $cat['category']->name; ?> </td> <td style="text-align:right"> <?php if ($cat['category']->parent_id == 0) { $parent_id = $cat['category']->id; } else { $parent_id = $cat['category']->parent_id; } ?> <input type="checkbox" name="categories[]" value="<?php echo $cat['category']->id . "." . $parent_id; ?> " <?php echo in_array($cat['category']->id, $product_categories) ? 'checked="checked"' : ''; ?> /> </td> </tr> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat['children'], $product_categories, $sub2); } } }
function collapsCat($args = '', $print = true) { global $collapsCatItems; if (!is_admin()) { list($posts, $categories, $parents, $options) = get_collapscat_fromdb($args); list($collapsCatText, $postsInCat) = list_categories($posts, $categories, $parents, $options); $url = get_settings('siteurl'); extract($options); include 'symbols.php'; if ($print) { print $collapsCatText; echo "<li style='display:none'><script type=\"text/javascript\">\n"; echo "// <![CDATA[\n"; echo '/* These variables are part of the Collapsing Categories Plugin * Version: 2.0.5 * $Id: collapscat.php 982064 2014-09-05 16:23:40Z robfelty $ * Copyright 2007 Robert Felty (robfelty.com) */' . "\n"; echo "var expandSym='{$expandSym}';\n"; echo "var collapseSym='{$collapseSym}';\n"; // now we create an array indexed by the id of the ul for posts echo collapsCat::phpArrayToJS($collapsCatItems, 'collapsItems'); include_once 'collapsFunctions.js'; echo "addExpandCollapse('widget-collapscat-{$number}-top'," . "'{$expandSym}', '{$collapseSym}', " . $accordion . ")"; echo "// ]]>\n</script></li>\n"; } else { return array($collapsCatText, $postsInCat); } } }
} else { if ($action == 'add_product') { $category_id = filter_input(INPUT_POST, 'category_id', FILTER_VALIDATE_INT); $code = filter_input(INPUT_POST, 'code'); $name = filter_input(INPUT_POST, 'name'); $price = filter_input(INPUT_POST, 'price'); if ($category_id == NULL || $category_id == FALSE || $code == NULL || $name == NULL || $price == NULL || $price == FALSE) { $error = "Invalid product data. Check all fields and try again."; include '../errors/error.php'; } else { add_product($category_id, $code, $name, $price); header("Location: .?category_id={$category_id}"); } } else { if ($action == 'list_categories') { list_categories(); } else { if ($action == 'add_categories') { add_categories(); } else { if ($action == 'delete_categories') { delete_categories(); } else { if ($action == 'edit_products') { edit_products(); } } } } } }
function list_categories($cats, $sub = '') { foreach ($cats as $cat) { ?> <tr> <td><?php echo $cat['category']->id; ?> </td> <td><?php echo $sub . $cat['category']->name; ?> </td> <td> <div class="btn-group" style="float:right"> <a class="btn" href="<?php echo site_url(ADMIN_FOLDER . '/categories/form/' . $cat['category']->id); ?> "><i class="icon-pencil"></i> <?php echo lang('edit'); ?> </a> <a class="btn" href="<?php echo site_url(ADMIN_FOLDER . '/categories/organize/' . $cat['category']->id); ?> "><i class="icon-move"></i> <?php echo lang('organize'); ?> </a> <a class="btn btn-danger" href="<?php echo site_url(ADMIN_FOLDER . '/categories/delete/' . $cat['category']->id); ?> " onclick="return areyousure();"><i class="icon-trash icon-white"></i> <?php echo lang('delete'); ?> </a> <a class="btn btn-danger enable" name="<?php echo $cat['category']->id; ?> "><?php echo $cat['category']->enable == 1 ? 'Activated' : 'Deactivated'; ?> </a> </div> </td> </tr> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat['children'], $sub2); } } }
<article class="page"> <h2><?php the_title(); ?> </h2> <p class="post-info"> <?php the_time('d/m/y'); //day/month/year in numbers, otherwise j for the number of day, F mor the name of the month, Y for the year, G for the hours, i for the minutes the_author(); //name of the author echo get_author_posts_url(get_the_author_meta('ID')); //link to the author posts page list_categories(', '); //custom function ?> </p> <p><?php the_content(); ?> </p> </article> <?php } } else { echo 'No content found';
function list_categories($parent_id, $cats, $groups, $sub = '', $hidden = false) { foreach ($cats[$parent_id] as $cat) { ?> <tr> <td><?php echo $hidden ? '<i class="icon-eye-slash"></i>' : ''; ?> </td> <td><?php echo $sub . $cat->name; ?> </td> <?php foreach ($groups as $group) { ?> <td><?php echo $cat->{'enabled_' . $group->id} == '1' ? lang('enabled') : lang('disabled'); ?> </td> <?php } ?> <td class="text-right"> <div class="btn-group"> <a class="btn btn-default" href="<?php echo site_url('admin/categories/form/' . $cat->id); ?> "><i class="icon-pencil"></i></a> <a class="btn btn-danger" href="<?php echo site_url('admin/categories/delete/' . $cat->id); ?> " onclick="return areyousure();"><i class="icon-times "></i></a> </div> </td> </tr> <?php if (isset($cats[$cat->id]) && sizeof($cats[$cat->id]) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat->id, $cats, $groups, $sub2, $hidden); } } }
if ($cat->support_ticket_category_id == $_POST["support_ticket_category_id"]) { echo "selected"; } } ?> ><?php echo $cat->category; ?> </option> <?php } } if (!empty($category_list)) { echo '<select name="support_ticket_category_id" style="height:38px">'; echo '<option value="">Filter by Category</option>'; list_categories($category_list); echo '</select>'; } ?> <input type="text" class="span2" name="term" placeholder="To search type and hit enter..." <?php if (isset($_POST["term"])) { ?> value="<?php echo $_POST["term"]; ?> " <?php } ?> /> <button class="btn" name="submit" value="search" style="height:35px; ">Search</button>
<fieldset> <input type="text" id="s" name="searchtext" value="" /> <input type="submit" id="x" value="<?php echo lang('kb_search'); ?> " /> </fieldset> </form> </li> <li> <h2><?php echo lang('kb_categories'); ?> </h2> <?php echo list_categories('orderby=name&show_count=1&exclude=10'); ?> </li> </ul> </div> <!-- end sidebar --> <div style="clear: both;"> </div> </div> <!-- end page --> <!-- start footer --> <div id="footer"> <p id="legal">( c ) 2009. All Rights Reserved. Powered by <a href="http://68kb.com/">68kb</a> and designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p> </div> <!-- end footer --> </body>
function list_categories($cats, $sub = '') { foreach ($cats as $cat) { ?> <tr> <td><?php echo $cat['category']->id; ?> </td> <td><?php echo $sub . $cat['category']->name; ?> </td> <td><?php echo $cat['category']->slug; ?> </td> <td><?php echo $cat['category']->sequence; ?> </td> <td class="center"> <a class="btn" href="<?php echo site_url(ADMIN_FOLDER . '/categories/form/' . $cat['category']->id); ?> " title="Edit"><i class="icon-pencil"></i></a> <a class="btn btn-danger" href="<?php echo site_url(ADMIN_FOLDER . '/categories/delete/' . $cat['category']->id); ?> " onclick="return areyousure();" style="color:#FFFFFF" title="Delete"><i class="icon-trash icon-white"></i></a> </td> </tr> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat['children'], $sub2); } } }
<i class="ace-icon fa fa-pencil bigger-130"></i> </a> <a class="red delete_rount" rel="<?php echo site_url('admin/category/delete_category/' . $work_cate['id'] . '/new_cates'); ?> " href="javascript:void(0)" title="删除分类信息" > <i class="ace-icon fa fa-trash-o bigger-130"></i> </a> </div> </td> </tr> <?php has_child($work_cate['id'], $sub . " "); } } list_categories($work_cates); ?> </tbody> </table> <div class="hr hr-18 dotted"></div> </div> </div> <div id="member-tab" class="tab-pane"> <form id="add_category" class="form-horizontal message-form col-xs-12" > <div class="hr hr-18 dotted"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-subject">分类标题:</label> <div class="col-sm-6 col-xs-10"> <div class=" block col-xs-12 no-padding"> <input maxlength="100" type="text" class="col-xs-6" name="title" id="form-field-subject" placeholder="分类标题" /> </div>
function list_categories($cats, $sub = '') { foreach ($cats as $cat) { ?> <tr> <td style="padding: 3px 8px;"><?php echo $sub; ?> <a style="font-size: 11px; line-height:13px; text-transform: uppercase; text-decoration: none;" href="<?php echo site_url($cat['category']->slug); ?> "><?php echo ucwords(strtolower($cat['category']->name)); ?> </a></td> </tr> <?php if (sizeof($cat['children']) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat['children'], $sub2); } } }
function list_categories($parent_id, $cats, $sub = '', $product_categories, $primary_category, $groups, $hidden) { if (isset($cats[$parent_id])) { foreach ($cats[$parent_id] as $cat) { ?> <tr> <td><?php echo $hidden ? '<i class="icon-eye-slash">' : ''; ?> </i></td> <td><?php echo $sub . $cat->name; ?> </td> <?php foreach ($groups as $group) { ?> <td><?php echo $cat->{'enabled_' . $group->id} ? '<i class="icon-check"></i>' : ''; ?> </td> <?php } ?> <td class="text-center"> <input type="checkbox" name="categories[]" value="<?php echo $cat->id; ?> " <?php echo in_array($cat->id, $product_categories) ? 'checked="checked"' : ''; ?> /> <input type="radio" name="primary_category" value="<?php echo $cat->id; ?> " <?php echo $primary_category == $cat->id ? 'checked="checked"' : ''; ?> /> </td> </tr> <?php if (isset($cats[$cat->id]) && sizeof($cats[$cat->id]) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat->id, $cats, $sub2, $product_categories, $primary_category, $groups, $hidden); } } } }
echo site_url(config_item('admin_folder') . '/categories/delete/' . $cat->id); ?> " onclick="return areyousure();"><i class="icon-trash icon-white"></i> <?php echo lang('delete'); ?> </a> </div> </td> </tr> <?php } } ?> <?php if (isset($categories[0])) { list_categories(0, $categories); } ?> </tbody> </table> </div> </div> </div> </div> <script type="text/javascript"> function areyousure() { return confirm('<?php echo lang('confirm_delete'); ?>
function list_categories($parent_id, $cats, $sub = '') { foreach ($cats[$parent_id] as $cat) { ?> <tr> <td><?php echo $cat->id; ?> </td> <td><?php echo $sub . $cat->name; ?> </td> <td><?php echo $cat->enabled == '1' ? lang('enabled') : lang('disabled'); ?> </td> <td> <div class="btn-group" style="float:right"> <a class="btn" href="<?php echo site_url(ADMIN_FOLDER . '/categories/form/' . $cat->id); ?> "><i class="icon-pencil"></i> <?php echo lang('edit'); ?> </a> <a class="btn" href="<?php echo site_url(ADMIN_FOLDER . '/categories/organize/' . $cat->id); ?> "><i class="icon-move"></i> <?php echo lang('organize'); ?> </a> <a class="btn btn-danger" href="<?php echo site_url(ADMIN_FOLDER . '/categories/delete/' . $cat->id); ?> " onclick="return areyousure();"><i class="icon-trash icon-white"></i> <?php echo lang('delete'); ?> </a> </div> </td> </tr> <?php if (isset($cats[$cat->id]) && sizeof($cats[$cat->id]) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat->id, $cats, $sub2); } } }
array( 'type' => 'content-end' ), //CONTENT - BLOG array( 'type' => 'content-start', 'id' => 'blog' ), array( 'type' => 'select', 'id' => 'blog_category', 'name' => 'Blog Category', 'desc' => '<p>Select the <b>blog</b> category.</p>', 'options' => list_categories(array('hide_empty' => '0')), 'std' => '0', ), array( 'type' => 'content-end' ) ); /************************************************** DASHBOARD WIDGETS **************************************************/ $theme_dashboards = array(
function list_categories($parent_id, $cats, $sub = '', $product_categories) { foreach ($cats[$parent_id] as $cat) { ?> <tr> <td><?php echo $sub . $cat->name; ?> </td> <td> <input type="checkbox" name="categories[]" value="<?php echo $cat->id; ?> " <?php echo in_array($cat->id, $product_categories) ? 'checked="checked"' : ''; ?> /> </td> </tr> <?php if (isset($cats[$cat->id]) && sizeof($cats[$cat->id]) > 0) { $sub2 = str_replace('→ ', ' ', $sub); $sub2 .= ' → '; list_categories($cat->id, $cats, $sub2, $product_categories); } } }
$db_con = db_connect($mysql_host3, $mysql_user3, $mysql_password3, $database3); $mysql_table_prefix = $mysql_table_prefix3; } if ($dbu_act == '4') { $db_con = db_connect($mysql_host4, $mysql_user4, $mysql_password4, $database4); $mysql_table_prefix = $mysql_table_prefix4; } if ($dbu_act == '5') { $db_con = db_connect($mysql_host5, $mysql_user5, $mysql_password5, $database5); $mysql_table_prefix = $mysql_table_prefix5; } echo " <h1> {$mytitle}<br /><br />" . $sph_messages['SubForm'] . "</h1>\n <br />\n <div class=\"cntr\">\n <p class='advsrch'>" . $sph_messages['SubmitHeadline'] . "</p>\n <p class='advsrch'>( " . $sph_messages['AllFields'] . " ! )</p>\n <br />\n <div class='panel w75'>\n <form class='txt' name='add_url' action='addurl.php' method='post'>\n <table class='searchBox'>\n <tr>\n <td></td>\n <td></td>\n </tr>\n <tr >\n <td class='em evrow'>" . $sph_messages['New_url'] . "</td>\n <td><input type='text' name='url' value='http://' size='60' maxlength='255' /></td>\n </tr>\n <tr>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <td class='em evrow'>" . $sph_messages['Title'] . "</td>\n <td><input type='text' name='title' id='title' size='60' maxlength='100' onkeyup=\"charCounter('title','titleComplete','<br /> " . $sph_messages['still'] . " {CHAR} " . $sph_messages['charLeft'] . " ',100);\" /><div id='titleComplete' class='cntr bd'><span class='em evrow' ><br /> " . $sph_messages['still'] . " 100 " . $sph_messages['charLeft'] . " </span></div></td>\n </tr>\n <tr>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <td class='em evrow'>" . $sph_messages['Description'] . "</td>\n <td><textarea wrap='physical' class='farbig' rows='5' cols='43' name='description' id='description' onkeyup=\"charCounter('description','descriptionComplete','<br /> " . $sph_messages['still'] . " {CHAR} " . $sph_messages['charLeft'] . " ',250);\"></textarea><div id='descriptionComplete' class='cntr bd'><span class='em evrow' ><br /> " . $sph_messages['still'] . " 250 " . $sph_messages['charLeft'] . " </span></div></td>\n </tr>\n <tr>\n <td></td>\n <td></td>\n </tr>\n "; if ($show_categories == '1' && $category != -1) { // if Admin selected, show categories echo " <tr>\n <td class='em evrow'>" . $sph_messages['Category'] . "</td>\n <td><select name=\"category_id\" size=\"1\">\n "; list_categories(0, 0, "white", "", ""); echo " </select>\n </td>\n </tr>\n <tr>\n <td></td>\n <td></td>\n </tr>\n "; } echo " <tr>\n <td class='em evrow'>" . $sph_messages['Account'] . "</td>\n <td><input type='text' name='email' size='60' maxlength='100' value='your@account' /></td>\n </tr>\n <tr>\n <td></td>\n <td></td>\n </tr>\n "; if ($captcha == 1) { // if Admin selected, show Captcha echo " <tr>\n <td class='em evrow'>" . $sph_messages['enterCaptcha'] . "</td>\n <td>\n <br /> <img src='{$include_dir}/make_captcha.php?.png' name='capimage' alt='Captcha' border='1' />\n <br /><br />\n <input type='text' name='captchastring' size='28' value='' />\n <br /><br />\n </td>\n </tr>\n <tr>\n <td></td>\n <td></td>\n </tr>\n "; } $submit = $sph_messages['submit']; echo " <tr>\n <td class='em evrow'></td>\n <td><input class='submit-button' type='submit' value='{$submit}' name='B1' /><br /><br /></td>\n </tr>\n </table>\n </form>\n </div>\n <br />\n "; } footer(); echo "\n </div>\n </body>\n </html>\n "; function list_categories($parent, $lev, $color, $message, $category_id) { global $mysql_table_prefix, $debug, $db_con;