当前位置: 首页>>代码示例>>PHP>>正文


PHP listCategories函数代码示例

本文整理汇总了PHP中listCategories函数的典型用法代码示例。如果您正苦于以下问题:PHP listCategories函数的具体用法?PHP listCategories怎么用?PHP listCategories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了listCategories函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

        $list["owner"] = $_SESSION["logindetails"]["id"];
    }
    $admins = $GLOBALS["admin_auth"]->listAdmins();
    if (sizeof($admins) > 1) {
        print '<div class="label"><label for="owner">' . $GLOBALS['I18N']->get('Owner') . '</label></div><div class="field"><select name="owner">';
        foreach ($admins as $adminid => $adminname) {
            printf('    <option value="%d" %s>%s</option>', $adminid, $adminid == $list["owner"] ? 'selected="selected"' : '', $adminname);
        }
        print '</select></div>';
    } else {
        print '<input type="hidden" name="owner" value="' . $_SESSION["logindetails"]["id"] . '" />';
    }
} else {
    print '<input type="hidden" name="owner" value="' . $_SESSION["logindetails"]["id"] . '" />';
}
$aListCategories = listCategories();
if (sizeof($aListCategories)) {
    print '<div class="label"><label for="category">' . $GLOBALS['I18N']->get('Category') . '</label></div>';
    print '<div class="field"><select name="category">';
    print '<option value="">-- ' . $GLOBALS['I18N']->get('choose category') . '</option>';
    foreach ($aListCategories as $category) {
        $category = trim($category);
        printf('<option value="%s" %s>%s</option>', $category, $category == $list['category'] ? 'selected="selected"' : '', $category);
    }
    print '</select></div>';
}
### allow plugins to add rows
foreach ($GLOBALS['plugins'] as $plugin) {
    print $plugin->displayEditList($list);
}
?>
开发者ID:narareddy,项目名称:phplist3,代码行数:31,代码来源:editlist.php

示例2: listCategories

			<h3><?php 
    echo $email;
    ?>
</h3>
			<br/>
		</div>
	</div>

	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<?php 
    listCategories($Categories, $SessionPerson->role());
    ?>

	<div class="container col-md-8">
		<?php 
    $posts = $BlogPosts->getAllForUser($id, ITEMS_PER_PAGE, $offset);
    $count = count($posts);
    if ($count > 0) {
        foreach ($posts as $b) {
            $categoryName = $Categories->get($b["category"])["name"];
            $ans = $b["correctAnswerId"] > 0;
            $opened = $b["marked"] == 0;
            if ($opened || $page->isAdmin($Role)) {
                blogPostWithCategory($b["id"], $b["title"], $id, $firstName, $lastName, $b["date_posted"], $b["category"], $categoryName, $ans, $opened);
            }
        }
开发者ID:patrickbraud,项目名称:CapstoneProject,代码行数:31,代码来源:profile.php

示例3: check

            break;
        case 512:
            check($connection, "SELECT mail FROM users WHERE mail='{$textInput}'");
            break;
        case 513:
            check($connection, "SELECT isActivated FROM users WHERE isActivated='\${$textInput}'");
            break;
        case 514:
            check($connection, "SELECT isRetailer FROM users WHERE isRetailer='{$textInput}'");
            break;
        case 521:
            check($connection, "SELECT isActivated FROM notice WHERE isActivated='{$textInput}'");
            break;
        case 531:
            check($connection, "SELECT isActivated FROM rating WHERE isActivated='{$textInput}'");
            break;
        case 541:
            check($connection, "SELECT title FROM categories WHERE title='{$textInput}'");
            break;
        case 550:
            changePasswordBe($connection, $username, $password, $pwOld);
            break;
        case 560:
            listCategories($connection, $textInput);
            break;
    }
    mysqli_close($connection);
} else {
    mysqli_close($connection);
    echo "DB-Connection Failed";
}
开发者ID:g7o,项目名称:sqw,代码行数:31,代码来源:editTest.php

示例4: get_lang

            $class = "add";
            $text = get_lang('AddCategory');
            $form->setDefaults(array('auth_course_child' => 'TRUE'));
            $form->addButtonCreate($text);
        }
        $form->display();
    } elseif (api_get_multiple_access_url() && api_get_current_access_url_id() != 1) {
        // If multiple URLs and not main URL, prevent edition and inform user
        Display::display_warning_message(get_lang('CourseCategoriesAreGlobal'));
    }
} else {
    // If multiple URLs and not main URL, prevent deletion and inform user
    if ($action == 'delete' && api_get_multiple_access_url() && api_get_current_access_url_id() != 1) {
        Display::display_warning_message(get_lang('CourseCategoriesAreGlobal'));
    }
    echo '<div class="actions">';
    $link = null;
    if (!empty($parentInfo)) {
        $parentCode = $parentInfo['parent_id'];
        echo Display::url(Display::return_icon('back.png', get_lang("Back"), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?category=' . $parentCode);
    }
    if (empty($parentInfo) || $parentInfo['auth_cat_child'] == 'TRUE') {
        echo Display::url(Display::return_icon('new_folder.png', get_lang("AddACategory"), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?action=add&category=' . Security::remove_XSS($category));
    }
    echo '</div>';
    if (!empty($parentInfo)) {
        echo Display::page_subheader($parentInfo['name'] . ' (' . $parentInfo['code'] . ')');
    }
    echo listCategories($category);
}
Display::display_footer();
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:31,代码来源:course_category.php

示例5: Sql_Affected_Rows

    $done = Sql_Affected_Rows();
    if ($done) {
        $result = Sql_query('delete from ' . $tables['listuser'] . " where listid = {$delete}");
        $result = Sql_query('delete from ' . $tables['listmessage'] . " where listid = {$delete}");
    }
    $actionresult .= '..' . $GLOBALS['I18N']->get('Done') . "<br /><hr /><br />\n";
    $_SESSION['action_result'] = $actionresult;
    Redirect('list');
    return;
    #  print ActionResult($actionresult);
}
if (!empty($_POST['importcontent'])) {
    include dirname(__FILE__) . '/importsimple.php';
}
$html = '';
$aConfiguredListCategories = listCategories();
$aListCategories = array();
$req = Sql_Query(sprintf('select distinct category from %s where category != "" %s ', $tables['list'], $subselect_and));
while ($row = Sql_Fetch_Row($req)) {
    array_push($aListCategories, $row[0]);
}
array_push($aListCategories, s('Uncategorised'));
if (sizeof($aListCategories)) {
    if (isset($_GET['tab']) && in_array($_GET['tab'], $aListCategories)) {
        $current = $_GET['tab'];
    } elseif (isset($_SESSION['last_list_category']) && in_array($_SESSION['last_list_category'], $aListCategories)) {
        $current = $_SESSION['last_list_category'];
    } else {
        $current = '';
    }
    if (stripos($current, strtolower(s('Uncategorised'))) !== false) {
开发者ID:juvenal,项目名称:PHPlist,代码行数:31,代码来源:list.php

示例6: getUserClubsApplied

								
								//display all the supplements this user is working on
								$styleClubsApplied = getUserClubsApplied($_SESSION['user_id']);
		
								echo "<ul>";
								foreach($styleClubsApplied as $styleItem) {
									$style_club_id = $styleItem[0];
									$style_club_name = $styleItem[1];
									echo "<li class=\"sidenav1\"><a href=\"app.php?club_id=$style_club_id&action=view\">$style_club_name</a></li>";
								}
								echo "</ul>";
							} else if(substr($side_display[$i], 0, 4) == "base" && isset($_SESSION['user_id'])) {
								//display the general application categories
								include_once($basePath . "/include/apply_submit.php");
								if(isApplicationStarted($_SESSION['user_id'], 0)) {
									$styleCategoryList = listCategories();
			
									echo "<ul>";
									foreach($styleCategoryList as $styleItem) {
										$style_cat_id = $styleItem[0];
										$style_cat_name = $styleItem[1];
										echo "<li class=\"sidenav1\"><a href=\"app.php?club_id=0&cat_id=$style_cat_id&action=view\">$style_cat_name</a></li>";
									}
									echo "</ul>";
								}
							} else if(substr($side_display[$i], 0, 17) == "root_cat.php?cat=") {
								$nav_cat = urldecode(substr($side_display[$i], 17));
							}

							if(isset($nav_cat)) {
								echo "<ul>";
开发者ID:uakfdotb,项目名称:oneapp,代码行数:30,代码来源:header.php

示例7: makeURL

                    $breadcrumbs->addElement($mv['name'], makeURL($mod, array('categoryid' => $categoryid, 'movieid' => $movieid)));
                    $smarty->assign('movie', $mv);
                    $smarty->assign('path', $template_dir . "/movie.tpl");
                    if ($login->currentUser() !== false) {
                        $smarty->assign('loggedin', true);
                        if (isset($_POST['add'])) {
                            $comments->add($mod . '-movie', $login->currentUserID(), $_POST['comment'], $movieid);
                        }
                    }
                    $smarty->assign('comments', $comments->get($mod . '-movie', $movieid));
                } else {
                    $notify->add($lang->get('media'), $lang->get('access_denied'));
                }
                $showcategories = false;
            }
            if ($showcategories == true) {
                $list = listCategories($categoryid);
                $smarty->assign('list', $list);
                $smarty->assign('hide_submedia', $config->get('media', 'hide-submedia'));
                $smarty->assign('downloads', listDownloads($categoryid));
                $img = listPictures($categoryid);
                $smarty->assign('pictures', $img);
                $smarty->assign('movies', listMovies($categoryid));
                @($category['folder'] = $category['uniqid']);
                $smarty->assign('category', $category);
                $smarty->assign('path', $template_dir . "/list.tpl");
            }
        } else {
            $notify->add($lang->get('media'), $lang->get('access_denied'));
        }
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:31,代码来源:media.mod.php

示例8: listCategories

        </div>
        <!-- Move Modal -->
        <div class="modal hide" id="moveModal">
          <form action="index.php?action=moveContent&categoryId=<?php 
echo $_GET['categoryId'];
?>
" method="post" id="moveContent" name="moveContent">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">X</button>
              <h3>Move Content</h3>
            </div>
            <div class="modal-body" id="move_modal_body">
              <p>Select the location where you wish to move the content from the dropdwon below... </p>
              <select id="moveId" name="moveId">
                <option value="0">Top</option>
                <?php 
echo listCategories(0, 1);
?>
              </select>
            </div>
            <div class="modal-footer">
              <a href="#" class="btn" data-dismiss="modal">Close</a>
              <button class="btn btn-primary" type="submit" name="saveChanges">Save Changes</button>
            </div>
          </form>
        </div>
      </div><!--/span-->
    </div><!--/row-->
    <!-- needed for page sorting -->
    <div id="info"></div>
开发者ID:sabasco,项目名称:gnscms,代码行数:30,代码来源:listContent.php

示例9: switch

	}*/
//echo "<p>".$name."</p>";
//echo "<p>q : ".$q."</p>";
//@$q = explode('/', $q);
//echo "<h1>q[0] : ".$q[0]."</h1>";
//echo "<p>Some stuff and q is : ".$q."</p>";
@session_start();
switch ($q) {
    //case 'test': test(); break;
    case 'addCategory':
        addCategory();
        break;
        //send a post to the EditCategories.php
    //send a post to the EditCategories.php
    case 'listCategories':
        listCategories($r);
        break;
    case 'getCategoryList':
        getCategoryList($r);
        break;
    case 'changeCategory':
        changeCategory($q[1]);
        break;
    case 'removeCategory':
        removeCategory($r);
        break;
    case 'getCategory':
        getCategory(intval($r), $s);
        break;
    case 'getProduct':
        getProduct(intval($r), $s);
开发者ID:croberson2014,项目名称:Umbrella,代码行数:31,代码来源:product_functions.php

示例10: listCategories

 function listCategories($parent_id, $level)
 {
     global $connection, $list_categories_defined, $classB_divider, $classC_divider, $product_list, $where_producer_pending, $where_confirmed, $where_auth_type, $where_unlisted_producer, $where_zero_inventory, $where_order_by;
     $list_categories_defined = true;
     $query = '
       SELECT *
       FROM
         ' . TABLE_CATEGORY . '
       WHERE
         parent_id = ' . $parent_id . '
       ORDER BY
         category_name;';
     $sql = @mysql_query($query, $connection) or die(debug_print("ERROR: 579302 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
     if (mysql_affected_rows($connection) > 0) {
         //There are more categories (or subcategories) to look at
         if ($level <= $_GET['depth']) {
             $list_markup .= '<ul class="list-markup' . $level . '">';
         }
         $total = 0;
         $total_new = 0;
         while ($row = mysql_fetch_array($sql)) {
             $category_id = $row['category_id'];
             $category_name = $row['category_name'];
             $category_desc = $row['category_desc'];
             $parent_id = $row['parent_id'];
             $return_value = listCategories($category_id, $level + 1);
             $subtotal = $return_value[0];
             $subtotal_new = $return_value[1];
             $sublist_markup = $return_value[2];
             $total = $total + $subtotal;
             $total_new = $total_new + $subtotal_new;
             if ($level <= $_GET['depth']) {
                 //Prepare output formatting
                 if ($total > 1) {
                     $plural = 's';
                 } else {
                     $plural = '';
                 }
                 $item_count_markup = $subtotal . '&nbsp;item' . $plural;
                 if ($subtotal_new > 0) {
                     $item_new_count_markup = '(' . $subtotal_new . '&nbsp;new)';
                 } else {
                     $item_new_count_markup = "";
                 }
                 //$list_markup .= '<li class="cat'.$level.'"><a href="'.$_SERVER['SCRIPT_NAME'].'?category_id='.$category_id.'">'.$category_name."</a>$item_count_markup $item_new_count_markup</li>\n";
                 //Only display if there are items in the category
                 if ($subtotal > 0) {
                     $list_markup .= '<li>
                       <a href="category_list2.php?category_id=' . $category_id . '&offset=' . $level . '">' . $category_name . '</a>' . $classB_divider . '<span class="levelY">
                       <a href="product_list.php?type=full&category_id=' . $category_id . '">' . $item_count_markup . '</a>
                       <a href="product_list.php?type=new&category_id=' . $category_id . '">' . $item_new_count_markup . "</a>\n                          </span>\n";
                     $list_markup .= $sublist_markup . "</li>\n";
                 }
             }
         }
         if ($level <= $_GET['depth']) {
             $list_markup .= "</ul>\n";
         }
     } else {
         //There are no more "categories", so call the subcategories and see how many items are in each
         $query2 = '
           SELECT
             ' . TABLE_SUBCATEGORY . '.*,
             ' . NEW_TABLE_PRODUCTS . '.subcategory_id,
             ' . NEW_TABLE_PRODUCTS . '.listing_auth_type,
             COUNT(DISTINCT(' . NEW_TABLE_PRODUCTS . '.product_id)) AS qty_of_items,
             SUM(IF(DATEDIFF(NOW(), ' . NEW_TABLE_PRODUCTS . '.created) < ' . DAYS_CONSIDERED_NEW . ', 1, 0)) AS qty_of_new_items
           FROM
             ' . TABLE_SUBCATEGORY . '
           LEFT JOIN
             ' . NEW_TABLE_PRODUCTS . ' USING(subcategory_id)
           LEFT JOIN
             ' . TABLE_PRODUCER . ' USING(producer_id)
           LEFT JOIN ' . TABLE_INVENTORY . ' ON ' . NEW_TABLE_PRODUCTS . '.inventory_id = ' . TABLE_INVENTORY . '.inventory_id
           WHERE
             ' . TABLE_SUBCATEGORY . '.category_id = "' . $parent_id . '"' . $where_producer_pending . $where_auth_type . $where_unlisted_producer . $where_confirmed . $where_zero_inventory . '
           GROUP BY
             ' . NEW_TABLE_PRODUCTS . '.subcategory_id
           ORDER BY
             subcategory_name';
         $sql2 = @mysql_query($query2, $connection) or die(debug_print("ERROR: 905656 ", array($query2, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
         if ($level <= $_GET['depth']) {
             $list_markup .= '<ul class="list-markup' . $level . '">';
         }
         while ($row2 = mysql_fetch_array($sql2)) {
             $subcategory_id = $row2['subcategory_id'];
             $subcategory_name = $row2['subcategory_name'];
             $subtotal = $row2['qty_of_items'];
             $subtotal_new = $row2['qty_of_new_items'];
             $total = $total + $subtotal;
             $total_new = $total_new + $subtotal_new;
             if ($level <= $_GET['depth']) {
                 //Prepare output formatting
                 if ($total > 1) {
                     $plural = 's';
                 } else {
                     $plural = '';
                 }
                 $item_count_markup = $subtotal . '&nbsp;item' . $plural;
                 if ($subtotal_new > 0) {
//.........这里部分代码省略.........
开发者ID:vanboingy,项目名称:OFS_trunk,代码行数:101,代码来源:category_list2.php

示例11: SEC_createToken

    case "saveCategory":
        if ($mode == $LANG_DLM['save'] && SEC_checkToken()) {
            $display = $dlcat->saveCategory();
        }
        if ($mode == $LANG_DLM['delete'] && SEC_checkToken()) {
            $display = $dlcat->deleteCategory($cid);
        }
        break;
    case "listCategories":
        $DLM_CSRF_TOKEN = SEC_createToken();
        $display .= showMessage();
        $display .= listCategories();
        $display = DLM_createHTMLDocument($display, array('pagetitle' => $LANG_DLM['manager']));
        break;
    case "move":
        DLM_moveCategory();
        $DLM_CSRF_TOKEN = SEC_createToken();
        $display .= showMessage();
        $display .= listCategories();
        $display = DLM_createHTMLDocument($display, array('pagetitle' => $LANG_DLM['manager']));
        break;
    case "listDownloads":
    default:
        $DLM_CSRF_TOKEN = SEC_createToken();
        $display .= DLM_updatePlugin();
        $display .= showMessage();
        $display .= listDownloads();
        $display = DLM_createHTMLDocument($display, array('pagetitle' => $LANG_DLM['manager']));
        break;
}
COM_output($display);
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:31,代码来源:index.php

示例12: login

     login();
     break;
 case 'logout':
     logout();
     break;
 case 'newArticle':
     newArticle();
     break;
 case 'editArticle':
     editArticle();
     break;
 case 'deleteArticle':
     deleteArticle();
     break;
 case 'listCategories':
     listCategories();
     break;
 case 'newCategory':
     newCategory();
     break;
 case 'editCategory':
     editCategory();
     break;
 case 'deleteCategory':
     deleteCategory();
     break;
 case 'newSortiment':
     newSortiment();
     break;
 case 'editSortiment':
     editSortiment();
开发者ID:sabrinamiao,项目名称:projectSystembolaget,代码行数:31,代码来源:admin.php

示例13: _editBookmark

 function _editBookmark($post)
 {
     $retval = true;
     require_once './include/spCategory.inc.php';
     require_once './include/spBookmark.inc.php';
     if ($post) {
         $this->_ajaxResult = editBookmark($this->_db, $this->_action);
     } else {
         listCategories($this->_db);
         if ($this->_action !== ACT_BMARK_ADD) {
             getBookmark($this->_db, $GLOBALS[ARG_BMARK_ID]);
         }
         $this->_theme->render('dlgBmEdit.tpl');
     }
 }
开发者ID:spremi,项目名称:spmarks,代码行数:15,代码来源:spApplication.inc.php

示例14: listCategories

<?php

include "../include/common.php";
include "../config.php";
include "../include/db_connect.php";
include "../include/session.php";
include "../include/apply_gen.php";
include "../include/apply_submit.php";
if (isset($_SESSION['user_id'])) {
    if (isApplicationStarted($_SESSION['user_id'], 0)) {
        $categoryList = listCategories();
        get_page_advanced("base", "apply", array("categories" => $categoryList));
    } else {
        if (isset($_REQUEST['action']) && $_REQUEST['action'] == "start") {
            $result = startApplication($_SESSION['user_id'], 0);
            if ($result == 0) {
                get_page_advanced("message", "apply", array("title" => "General application started", "message" => "You have started the general application. Please <a href=\"base.php\">click here</a> to continue.", "redirect" => "base.php"));
            } else {
                get_page_advanced("message", "apply", array("title" => "Error", "message" => "There was an error while starting your general application. Please <a href=\"base.php\">click here</a> to continue."));
            }
        } else {
            get_page_advanced("base_notstarted", "apply");
        }
    }
} else {
    get_page_advanced("message", "apply", array("title" => "Not Logged In", "message" => "You cannot access the application because you are not logged in. Please <a href=\"../login.php\">login first</a>."));
}
开发者ID:uakfdotb,项目名称:oneapp,代码行数:27,代码来源:base.php


注:本文中的listCategories函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。