本文整理汇总了PHP中find_all_subjects函数的典型用法代码示例。如果您正苦于以下问题:PHP find_all_subjects函数的具体用法?PHP find_all_subjects怎么用?PHP find_all_subjects使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了find_all_subjects函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: navigation
function navigation($subject_array, $page_array)
{
$output = '<ul class="subjects">';
$subject_set = find_all_subjects();
while ($subject = mysqli_fetch_assoc($subject_set)) {
$output .= "<li ";
if ($subject_array && $subject_array['id'] == $subject['id']) {
$output .= "class='selected' ";
}
$output .= "> ";
$output .= "<a href='manage_content.php?subject=" . urlencode($subject['id']) . "'> " . htmlentities($subject['menu_name']) . "</a>";
$pages_set = find_pages_for_subject($subject['id']);
$output .= "<ul class='pages'>";
while ($page = mysqli_fetch_assoc($pages_set)) {
$output .= "<li ";
if ($page_array && $page_array['id'] == $page['id']) {
$output .= "class='selected'";
}
$output .= "> ";
$output .= "<a href='manage_content.php?page=" . urlencode($page['id']) . "'> " . htmlentities($page['menu_name']) . " </a></li> ";
}
$output .= "</ul>\n </li>";
}
mysqli_free_result($subject_set);
mysqli_free_result($pages_set);
$output .= '</ul>';
return $output;
}
开发者ID:bi6o,项目名称:HumanToHuman,代码行数:28,代码来源:functions.php
示例2: navigation
function navigation($subject_array, $page_array)
{
$output = "<ul class=\"subjects\">";
$subject_set = find_all_subjects();
while ($subject = mysqli_fetch_assoc($subject_set)) {
$output .= "<li";
if ($subject_array && $subject["id"] == $subject_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"manage_content.php?subject=";
$output .= urlencode($subject["id"]);
$output .= "\">";
$output .= $subject["menu_name"];
$output .= "</a>";
$page_set = find_pages_for_subject($subject["id"]);
$output .= "<ul class=\"pages\">";
while ($page = mysqli_fetch_assoc($page_set)) {
$output .= "<li";
if ($page_array && $page["id"] == $page_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"manage_content.php?page=";
$output .= urlencode($page["id"]);
$output .= "\">";
$output .= $page["menu_name"];
$output .= "</a></li>";
}
mysqli_free_result($page_set);
$output .= "</ul></li>";
}
mysqli_free_result($subject_set);
$output .= "</ul>";
return $output;
}
开发者ID:asimrafique,项目名称:Examples,代码行数:36,代码来源:functions.php
示例3: urlencode
?>
</h2>
<form action="edit_subject.php?subject=<?php
echo urlencode($current_subject["id"]);
?>
" method="post">
<p>Menu name:
<input type="text" name="menu_name" value="<?php
echo htmlentities($current_subject["menu_name"]);
?>
" />
</p>
<p>Position:
<select name="position">
<?php
$subject_set = find_all_subjects(false);
$subject_count = mysqli_num_rows($subject_set);
for ($count = 1; $count <= $subject_count; $count++) {
echo "<option value=\"{$count}\"";
if ($current_subject["position"] == $count) {
echo " selected";
}
echo ">{$count}</option>";
}
?>
</select>
</p>
<p>Visible:
<input type="radio" name="visible" value="0" <?php
if ($current_subject["visible"] == 0) {
echo "checked";
开发者ID:joyzoso,项目名称:PHP,代码行数:31,代码来源:edit_subject.php
示例4: public_content_navigation
function public_content_navigation($subject_array, $page_array)
{
$output = "<ul class=\"subjects\">";
$subject_set = find_all_subjects();
while ($subject = mysqli_fetch_assoc($subject_set)) {
$output .= "<li";
if ($subject_array && $subject["id"] == $subject_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"index.php?subject=";
$output .= urlencode($subject["id"]);
$output .= "\">";
$output .= htmlentities($subject["menu_name"]);
$output .= "</a>";
if ($subject_array["id"] == $subject["id"] || $page_array["subject_id"] == $subject["id"]) {
$page_set = find_pages_for_subject($subject["id"]);
$output .= "<ul class=\"pages\">";
while ($page = mysqli_fetch_assoc($page_set)) {
$output .= "<li";
if ($page_array && $page["id"] == $page_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"index.php?page=";
$output .= urlencode($page["id"]);
$output .= "\">";
$output .= htmlentities($page["menu_name"]);
$output .= "</a></li>";
}
$output .= "</ul>";
mysqli_free_result($page_set);
}
$output .= "</li>";
// end of the subject li
}
mysqli_free_result($subject_set);
$output .= "</ul>";
return $output;
}
开发者ID:preacher2041,项目名称:digit_ltd,代码行数:40,代码来源:functions.php
示例5: public_navigation
function public_navigation($subject_array, $page_array)
{
$output = "<ul class=\"subjects\">";
$subject_set = find_all_subjects();
// 3. Use returned data (if any)
while ($subject = mysqli_fetch_assoc($subject_set)) {
// output data from each row
$output .= "<li";
if ($subject_array && $subject["id"] == $subject_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"index.php?subject=";
$output .= urlencode($subject["id"]);
$output .= "\">";
$output .= htmlentities($subject["menu_name"]);
$output .= "</a>";
$page_set = find_pages_for_subject($subject["id"]);
$output .= "<ul class=\"pages\">";
// 3. Use returned data (if any)
while ($page = mysqli_fetch_assoc($page_set)) {
// output data from each row
$output .= "<li";
if ($page_array && $page["id"] == $page_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"index.php?page=";
$output .= urlencode($page["id"]);
$output .= "\">";
$output .= htmlentities($page["menu_name"]);
$output .= "</a>";
$output .= "</li>";
}
mysqli_free_result($page_set);
$output .= "</ul>";
$output .= "</li>";
}
// 4. Release returned data
mysqli_free_result($subject_set);
$output .= "</ul>";
return $output;
}
开发者ID:Keav,项目名称:phpcms,代码行数:43,代码来源:functions.php
示例6: find_all_subjects
?>
</h2>
<form action="edit_subject.php?subject=<?php
echo $current_subject["id"];
?>
" method="post">
<p>Menu name:
<input type="text" name="menu_name" value="<?php
echo $current_subject["menu_name"];
?>
" />
</p>
<p>Position:
<select name="position">
<?php
$subject_set = find_all_subjects();
$subject_count = mysqli_num_rows($subject_set);
for ($count = 1; $count <= $subject_count; $count++) {
echo "<option value=\"{$count}\"";
if ($current_subject["position"] == $count) {
echo " selected";
}
echo ">{$count}</option>";
}
?>
</select>
</p>
<p>Visible:
<input type="radio" name="visible" value="0" <?php
if ($current_subject["visible"] == 0) {
echo "checked";
开发者ID:asimrafique,项目名称:Examples,代码行数:31,代码来源:edit_subject.php
示例7: find_all_subjects
echo $subject_title['menu_name'];
?>
</h2>
<form action="create_subject.php" method="post">
<p>
Subject name:
<input type="text" name="menu_name" value="<?php
echo $subject_title['menu_name'];
?>
">
</p>
<p>
Position:
<select name="position">
<?php
$all_subjects = find_all_subjects();
$subject_count = mysqli_num_rows($all_subjects);
for ($count = 1; $count <= $subject_count; $count++) {
echo "<option value=\"{$count}\"";
if ($current_subject["position"] == $count) {
echo " selected";
}
echo ">{$count}</option>";
}
?>
</select>
</p>
<p>
visible:
<input type="radio" name="visible" value="0" <?php
if ($current_subject["visible"] == 0) {
开发者ID:badadiss,项目名称:basic-CMS,代码行数:31,代码来源:edit_subject.php
示例8: public_navigation
function public_navigation($subject_array, $page_array)
{
$output = "<ul class=\"subjects\">";
$subject_set = find_all_subjects();
while ($subject = mysqli_fetch_assoc($subject_set)) {
// this php is for only an <li> tag to either have a class of selected
// or not but I use the php to output everything including the normal
// <li> tag
$output .= "<li";
if ($subject_array && $subject["id"] == $subject_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"index.php?subject=";
$output .= urldecode($subject["id"]);
$output .= "\">";
$output .= htmlentities($subject["menu_name"]);
$output .= "</a>";
if ($subject_array["id"] == $subject["id"] || $page_array["subject_id"] == $subject["id"]) {
$page_set = find_pages_for_subject($subject["id"]);
$output .= "<ul class=\"pages\">";
while ($page = mysqli_fetch_assoc($page_set)) {
$output .= "<li";
if ($page_array && $page["id"] == $page_array["id"]) {
$output .= " class=\"selected\"";
}
$output .= ">";
$output .= "<a href=\"index.php?page=";
$output .= urldecode($page["id"]);
$output .= "\">";
$output .= htmlentities($page["menu_name"]);
$output .= "</a></li>";
}
$output .= "</ul>";
mysqli_free_result($page_set);
}
$output .= "</li>";
// end of subject <li>
}
mysqli_free_result($subject_set);
$output .= "</ul>";
return $output;
}
开发者ID:natac13,项目名称:PHP-Basics-CMS-Project,代码行数:43,代码来源:functions.php
示例9: public_menu
function public_menu($subject_id, $page_id)
{
global $db;
?>
<div id="nav-container">
<ul class="parent-nav nav nav-pills">
<li><a href="http://yodas.brain">Home</a></li>
<?php
$result = find_all_subjects($public = true);
while ($subjects = mysqli_fetch_assoc($result)) {
$safe_subject_id = $db->escape_string($subject_id);
?>
<li class="dropdown" <?php
if ($subject_id && $subjects["id"] == $safe_subject_id) {
?>
class="selected" <?php
}
?>
>
<a class="dropdown-toggle" data-toggle="dropdown" href="<?php
ROOT_PATH;
?>
/index.php?subject=<?php
echo urlencode($subjects["id"]);
?>
" aria-haspopup="true" aria-expanded="false"><?php
echo $subjects["menu_name"];
?>
</a>
<?php
$page_result = find_subject_pages($subjects["id"]);
?>
<ul class="child-nav dropdown-menu">
<?php
// 3. Use returned data (if any)
while ($pages = mysqli_fetch_assoc($page_result)) {
?>
<?php
$safe_page_id = $db->escape_string($page_id);
?>
<li <?php
if ($page_id && $pages["id"] == $safe_page_id) {
?>
class="selected" <?php
}
?>
>
<a href="<?php
ROOT_PATH;
?>
/index.php?page=<?php
echo urlencode($pages["id"]);
?>
"> <?php
echo $pages["menu_name"];
?>
</a>
</li>
<?php
}
mysqli_free_result($page_result);
?>
</ul>
<?php
}
mysqli_free_result($result);
?>
</li>
<?php
if (logged_in()) {
?>
<li><a href="../../admin.php">Admin</a></li>
<?php
}
?>
<?php
if (!logged_in()) {
?>
<li><a href="../../views/actions/login.php">Login</a></li>
<?php
}
?>
<?php
if (logged_in()) {
?>
<li><a href="<?php
ROOT_PATH;
?>
/controller/logout.php">Logout</a></li>
<?php
}
?>
//.........这里部分代码省略.........
开发者ID:rafay826,项目名称:Fywave-CMS,代码行数:101,代码来源:functions.php
示例10: public_navigation
function public_navigation($selected_subject_set, $selected_page_set)
{
$output = "<ul class=\"nav navbar-nav\">";
$subject_set = find_all_subjects();
while ($subject = $subject_set->fetch_assoc()) {
$output .= "<li";
if ($selected_subject_set == $subject['id']) {
$output .= " class=\"active\"";
}
$output .= ">";
$output .= "<a href=\"index.php?subject=";
$output .= $subject['id'];
$output .= "\">";
$output .= $subject['menu_name'];
$output .= "</a>";
$page_set = find_pages_for_subjects($subject['id']);
$output .= "<ul class=\"pages\">";
while ($pages = $page_set->fetch_assoc()) {
$output .= "<li";
if ($selected_page_set == $pages['id']) {
$output .= " class=\"active\"";
}
$output .= ">";
$output .= "<a href=\"index.php?pages=";
$output .= $pages['id'];
$output .= "\">";
$output .= $pages['menu_name'];
$output .= "</a></li>";
}
$output .= "</ul>";
$output .= "</li>";
}
$output .= "</ul>";
mysqli_free_result($page_set);
mysqli_free_result($subject_set);
return $output;
}
开发者ID:Constantine1001,项目名称:microcms,代码行数:37,代码来源:functions.php
注:本文中的find_all_subjects函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论