本文整理汇总了PHP中list_categories函数的典型用法代码示例。如果您正苦于以下问题:PHP list_categories函数的具体用法?PHP list_categories怎么用?PHP list_categories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了list_categories函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_categories
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);
}
}
}
示例2: list_categories
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>';
}
}
示例3: list_categories
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);
}
}
}
示例4: list_categories
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);
}
}
}
示例5: list_categories
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);
}
}
}
示例6: list_categories
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);
}
}
}
示例7: collapsCat
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);
}
}
}
示例8: filter_input
} 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();
}
}
}
}
}
}
示例9: list_categories
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);
}
}
}
示例10: the_title
<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';
示例11: list_categories
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);
}
}
}
示例12: list_categories
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>
示例13: lang
<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>
示例14: site_url
<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>
示例15: list_categories
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);
}
}
}