function show_category($category, $id, $type, $pname = '', $num) { $cate = $category->group_items[$id]; $count = count($cate); if ($count == 0) { return; } else { $num2 = $num; for ($i = 0; $i < $count; $i++) { $record = $category->find($cate[$i]); if (!$pname) { $str = "<tr class='tr3' id='{$record->id}'>"; } else { $str = "<tr class='tr3' style='display:none' name='{$pname}' img_name='{$record->id}' id='{$record->id}'>"; } $str .= "<td style='text-align:left; text-indent:120px;'>"; for ($j = 0; $j < $num2; $j++) { $str .= " "; } $child = $category->group_items[$record->id]; if (count($child) > 0) { $ids = $category->children_map($record->id, false); $id2 = $ids[0]; for ($m = 1; $m < count($ids); $m++) { $id2 .= ',' . $ids[$m]; } $str .= "<img class='img_plus middle' style='cursor:pointer' name='{$record->name}' img_name='{$id2}' src='/images/admin/plus.gif'>{$record->name}</td>"; } else { $str .= "<img name='{$record->name}' src='/images/admin/moners.gif'>{$record->name}</td>"; } $str .= "<td><input type='text' style='width:80px' class='priority' name='{$record->id}' value='"; if ($record->priority != 100) { $str .= $record->priority; } $str .= "' style='width:30px;'></td>"; $str .= "<td>{$record->level}</td>"; $level = $record->level + 1; $str .= "<td><a title='添加子类别' href='category_edit.php?parent_id={$record->id}&type={$type}&level={$level}'><img src='/images/btn_add.png' border='0'></a> "; $str .= "<a href='category_edit.php?id={$record->id}&type={$type}' title='编辑' target='admin_iframe'><img src='/images/btn_edit.png' border='0'></a> "; $str .= "<a class='del_cate' name='{$record->id}' title='删除' style='cursor:pointer'><img src='/images/btn_delete.png' border='0'></a></td>"; $str .= "</tr>"; echo $str; $num = $num2 + 1; show_category($category, $record->id, $type, $record->name, $num); } return; } }
<div id="top-cateogry"> <?php echo show_category(1); ?> <?php echo show_category(2); ?> <?php echo show_category(3); ?> <?php echo show_category(4); ?> </div> <?php function show_category($cid = 1) { $args = array('showposts' => 4, 'cat' => $cid, 'orderby' => 'post_date', 'order' => 'desc'); query_posts($args); global $the_post; $category = ''; while (have_posts()) { the_post(); $cat = get_the_category(get_the_ID()); $link = get_permalink(get_the_ID()); $src = get_the_post_thumbnail(get_the_ID(), 'index_thumb'); $c_name = $cat[0]->name; $title = get_the_title(); echo $category .= <<<EOF
<h2>Dodajanje filmov in oddaj</h2> <form enctype="multipart/form-data" name="epg_add_movie" method="post" action=""> <label for="epg_movie_show">Naslov:<br><input name="movie_show" type="text" value="" class="regular-text" /></label><br><br> <label for"epg_movie_show_type">Vrsta programa: <select name="type"> <?php show_type(); ?> </select></label> <label for="epg_category">Kategorija: <select name ="cat"> <?php show_category(); ?> </select> <label for="epg_duration">Trajanje (v minutah): <input type="text" class="small-text" name="duration_movie_show" /><br></label><br> <label>Opis:</label><br> <textarea name="description_movie_show" rows="10" cols="69"></textarea> <br> </form> <input class="button-primary" type="submit" name="epg_add_movie_show_submit" value="Shrani" />
switch (@$this->currentdirectorylevel) { case 'directory': if ($this->params->get('showdirectory')) { $n = $this->numsections; $p = $this->percent; $directory = $this->directory; $c = $this->numcols; $cs = $this->colspan; show_directory($n, $p, $c, $cs, $url, $directory, $this->params, $this->menuid); } break; case 'section': show_section($url, $this->directory, $this->params, $this->menuid); break; case 'category': show_category($url, $this->directory, $this->params, $this->menuid, $this->pagination); break; } if ($this->contentdescriptiondirectory && $this->params->get('positiondescription') == '1' && @$this->currentdirectorylevel == 'directory') { ?> <div id="descriptiondirectory"> <p> <?php echo JHTML::_('content.prepare', $this->contentdescriptiondirectory); ?> </p> </div> <?php } // if you don't want the search box on main directory, just uncomment the code below and comment the following code... /*
while ($row = $row = mysqli_fetch_assoc($sql_query)) { ?> <a style="display:inline-block; width:100%;" class="chef-panel panel-heading panel-title" data-toggle="collapse" data-parent="#accordion" href="#<?php echo $row['id']; ?> "> <i class="fa fa-hand-o-right"></i> <?php echo $row['menu_name']; ?> </a> <div id="<?php echo $row['id']; ?> " class="panel-collapse collapse"> <?php $qu = show_category($row['id']); while ($sub = mysqli_fetch_assoc($qu)) { ?> <div class="panel-body"> <ul class="list-unstyled"> <li><a href="#"><?php echo $sub['cat_name']; ?> </a></li> </ul> </div> <?php } ?>