• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP find_pages_for_subject函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了find_pages_for_subject函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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_id, $page_id)
{
    $output = "<ul class = \"subjects\">";
    $subject_set = find_all_subjects();
    while ($subjects = mysqli_fetch_assoc($subject_set)) {
        $output .= "<li";
        if ($subjects["id"] == $subject_id) {
            $output .= " class=\"selected\"";
        }
        $output .= ">";
        $output .= "<a href=\"manage_content.php?subject=";
        $output .= urlencode($subjects["id"]);
        $output .= "\">";
        $output .= $subjects['menu_name'];
        $output .= "</a>";
        $page_set = find_pages_for_subject($subjects["id"]);
        $output .= "<ul class = \"pages\">";
        while ($pages = mysqli_fetch_assoc($page_set)) {
            $output .= "<li";
            if ($pages["id"] == $page_id) {
                $output .= " class=\"selected\"";
            }
            $output .= ">";
            $output .= "<a href = \"manage_content.php?page=";
            $output .= urlencode($pages["id"]);
            $output .= "\">";
            $output .= $pages['menu_name'];
            $output .= "</a> </li>";
        }
        mysqli_free_result($page_set);
        $output .= "</ul></li>";
    }
    mysqli_free_result($subject_set);
    $output .= "</ul>";
    return $output;
}
开发者ID:ravitejachebrolu,项目名称:CMS,代码行数:36,代码来源:functions.php


示例3: urlencode

            Visible: <?php 
    echo $current_subject["visible"] == 1 ? 'Yes' : 'No';
    ?>
<br />
            <br />
        <a href="edit_subject.php?subject=<?php 
    echo urlencode($current_subject["id"]);
    ?>
">Edit Subject</a>
        <br />
        <br />
        <div class="page-info">
            <h3>Pages in this subject</h3>
            <ul>
                <?php 
    $subject_pages = find_pages_for_subject($current_subject["id"], false);
    while ($page = mysqli_fetch_assoc($subject_pages)) {
        echo "<li>";
        $safe_page_id = urlencode($page["id"]);
        echo "<a href=\"manage_content.php?page={$safe_page_id}\">";
        echo htmlentities($page["menu_name"]);
        echo "</a>";
        echo "</li>";
    }
    ?>
            </ul>
            <br />
            + <a href="new_page.php?subject=<?php 
    echo urlencode($current_subject["id"]);
    ?>
">Add a new page to this subject</a>
开发者ID:preacher2041,项目名称:digit_ltd,代码行数:31,代码来源:manage_content.php


示例4: urlencode

</h2>
        <form action="edit_page.php?page=<?php 
echo urlencode($current_page["id"]);
?>
" method="post" accept-charset="utf-8">
            <p>Menu Name:<input type="text" name="menu_name" value="<?php 
echo htmlentities($current_page["menu_name"]);
?>
"></p>
            <p>Position:
                <select name="position">
                <?php 
//  so I find all the data from the database with my function
//  then get the number of rows to have a max value for the for loop
//  the for loop is going to make a bunch of option tags for the selection tag
$page_set = find_pages_for_subject($current_page["subject_id"]);
$page_count = mysqli_num_rows($page_set);
for ($count = 1; $count <= $page_count; $count++) {
    echo "<option value=\"{$count}\"";
    if ($current_page["position"] == $count) {
        echo " selected";
    }
    echo ">{$count}</option>";
}
?>
                </select>
            </p>
            <p>Visible:
                <input type="radio" name="visible" value="0" <?php 
if ($current_page["visible"] == 0) {
    echo "checked";
开发者ID:natac13,项目名称:PHP-Basics-CMS-Project,代码行数:31,代码来源:edit_page.php


示例5: 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


示例6: 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


示例7: confirm_logged_in

<?php

require_once "../includes/session.php";
require_once "../includes/db_connection.php";
require_once "../includes/functions.php";
confirm_logged_in();
?>

<?php 
$current_subject = find_subject_by_id($_GET["subject"], false);
if (!$current_subject) {
    // subject ID was missing or invalid or
    // subject couldn't be found in database
    redirect_to("manage_contenct.php");
}
$pages_set = find_pages_for_subject($current_subject["id"]);
if (mysqli_num_rows($pages_set) > 0) {
    $_SESSION["message"] = "Can't delete a subject with pages.";
    redirect_to("manage_content.php?subject={$current_subject["id"]}");
}
$id = $current_subject["id"];
$query = "DELETE FROM subjects WHERE id = {$id} LIMIT 1";
$result = mysqli_query($connection, $query);
if ($result && mysqli_affected_rows($connection) == 1) {
    // Success
    $_SESSION["message"] = "Subject deleted.";
    redirect_to("manage_content.php");
} else {
    // Failure
    $_SESSION["message"] = "Subject deletion failed.";
    redirect_to("manage_content.php?subject={$id}");
开发者ID:Keav,项目名称:phpcms,代码行数:31,代码来源:delete_subject.php


示例8: find_pages_for_subject

    if ($subject["id"] == $selected_subject_id) {
        echo " class=\"selected\"";
    }
    echo ">";
    ?>

      <a href="manage_content.php?subject=<?php 
    echo $subject["id"];
    ?>
">
        <?php 
    echo $subject["menu_name"];
    ?>
      </a><ul class="pages">
          <?php 
    $pages = find_pages_for_subject($subject["id"]);
    while ($page = mysqli_fetch_assoc($pages)) {
        ?>
              <?php 
        echo "<li";
        if ($page["id"] == $selected_page_id) {
            echo " class=\"selected\"";
        }
        echo ">";
        ?>

              <a href="manage_content.php?page=<?php 
        echo $page["id"];
        ?>
">
              <?php 
开发者ID:badadiss,项目名称:basic-CMS,代码行数:31,代码来源:edit_subject.php


示例9: form_errors

    <?php 
echo form_errors($errors);
?>
    
    <h2>Create Page</h2>
    <form action="new_page.php?subject=<?php 
echo urlencode($current_subject["id"]);
?>
" method="post">
      <p>Menu name:
        <input type="text" name="menu_name" value="" />
      </p>
      <p>Position:
        <select name="position">
        <?php 
$page_set = find_pages_for_subject($current_subject["id"], false);
$page_count = mysqli_num_rows($page_set);
for ($count = 1; $count <= $page_count + 1; $count++) {
    echo "<option value=\"{$count}\">{$count}</option>";
}
?>
        </select>
      </p>
      <p>Visible:
        <input type="radio" name="visible" value="0" /> No
        &nbsp;
        <input type="radio" name="visible" value="1" /> Yes
      </p>
      <p>Content:<br />
        <textarea name="content" rows="20" cols="80"></textarea>
      </p>
开发者ID:preacher2041,项目名称:digit_ltd,代码行数:31,代码来源:new_page.php


示例10: find_default_page_for_subject

function find_default_page_for_subject($subject_id)
{
    $page_set = find_pages_for_subject($subject_id);
    if ($first_page = mysqli_fetch_assoc($page_set)) {
        return $first_page;
    }
    return null;
}
开发者ID:natac13,项目名称:PHP-Basics-CMS-Project,代码行数:8,代码来源:functions.php


示例11: navigation

function navigation($subject_array, $page_array)
{
    //current_subject/page = array or null
    $output = "<ul class=\"subjects\">";
    $subject_set = find_all_subjects(false);
    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 .= htmlentities($subject["menu_name"]);
        $output .= "</a>";
        $page_set = find_pages_for_subject($subject["id"], false);
        $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 .= htmlentities($page["menu_name"]);
            $output .= "</a>";
            $output .= "</li>";
        }
        $output .= "</ul>";
        mysqli_free_result($page_set);
        $output .= "</li>";
    }
    mysqli_free_result($subject_set);
    $output .= "</ul>";
    return $output;
}
开发者ID:regexpressyourself,项目名称:TurboPupSite,代码行数:39,代码来源:functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP find_posts_div函数代码示例发布时间:2022-05-15
下一篇:
PHP find_page_by_id函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap