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

PHP find_page_by_id函数代码示例

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

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



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

示例1: find_selected_pages

function find_selected_pages($public = false)
{
    global $current_subject;
    global $current_page;
    if (isset($_GET["subject"])) {
        //use get request to get my subject id
        $selected_subject_id = $_GET["subject"];
        //get my subject details by id from the database
        $current_subject = find_subject_by_id($selected_subject_id, $public);
        $selected_page_id = null;
        if ($current_subject && $public) {
            $current_page = find_default_page_for_subject($current_subject["id"]);
        } else {
            $current_page = null;
        }
    } elseif (isset($_GET["page"])) {
        $selected_subject_id = null;
        $current_subject = null;
        $selected_page_id = $_GET["page"];
        $current_page = find_page_by_id($selected_page_id);
    } else {
        $selected_subject_id = null;
        $current_subject = null;
        $selected_page_id = null;
        $current_page = null;
    }
}
开发者ID:AhmedMedo,项目名称:Content,代码行数:27,代码来源:functions.php


示例2: find_selected_page

function find_selected_page()
{
    global $current_subject;
    global $current_page;
    if (isset($_GET["subject"])) {
        $current_subject = find_subject_by_id($_GET["subject"]);
        $current_page = null;
    } elseif (isset($_GET["page"])) {
        $current_subject = null;
        $current_page = find_page_by_id($_GET["page"]);
    } else {
        $current_subject = null;
        $current_page = null;
    }
}
开发者ID:asimrafique,项目名称:Examples,代码行数:15,代码来源:functions.php


示例3: find_selected_page

function find_selected_page($public = false)
{
    global $current_subject;
    global $current_page;
    if (isset($_GET["subject"])) {
        $current_subject = find_subject_by_id($_GET["subject"], $public);
        if ($current_subject && $public) {
            $current_page = find_default_page_for_subject($current_subject["id"]);
        } else {
            $current_page = null;
        }
    } elseif (isset($_GET["page"])) {
        $current_page = find_page_by_id($_GET["page"], $public);
        $current_subject = null;
    } else {
        $current_subject = null;
        $current_page = null;
    }
}
开发者ID:regexpressyourself,项目名称:TurboPupSite,代码行数:19,代码来源:functions.php


示例4: logged_in

<?php

require_once "../../includes/sessions.php";
require_once "../../includes/db_connect.php";
require_once "../../includes/functions.php";
logged_in();
$current_page = find_page_by_id($_GET["page"]);
if (!$current_page) {
    redirect_to("manage_content.php");
} else {
    $id = $current_page["id"];
    $delete_query = "DELETE FROM pages ";
    $delete_query .= "WHERE id = {$id} ";
    $delete_query .= "LIMIT 1";
    $result = mysqli_query($connection, $delete_query);
    if ($result && mysqli_affected_rows($connection) == 1) {
        $_SESSION["message"] = "Subject deletion success.";
        redirect_to("manage_content.php");
    } else {
        $_SESSION["message"] = "Subject deletion failed.";
        redirect_to("manage_content.php?page={$id}");
    }
}
//if (!$current_subject) {
开发者ID:noican,项目名称:CMS_Sample,代码行数:24,代码来源:delete_page.php


示例5: 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_page = find_page_by_id($_GET["page"], false);
if (!$current_page) {
    // page ID was missing or invalid or
    // page couldn't be found in database
    redirect_to("manage_content.php");
}
$id = $current_page["id"];
$query = "DELETE FROM pages WHERE id = {$id} LIMIT 1";
$result = mysqli_query($connection, $query);
if ($result && mysqli_affected_rows($connection) == 1) {
    // Success
    $_SESSION["message"] = "Page deleted.";
    redirect_to("manage_content.php");
} else {
    // Failure
    $_SESSION["message"] = "Page deletion failed.";
    redirect_to("manage_content.php?page={$id}");
}
开发者ID:joyzoso,项目名称:PHP,代码行数:27,代码来源:delete_page.php


示例6: find_page_by_id

<?php

require_once "../includes/session.php";
require_once "../includes/dbconnect.php";
require_once "../includes/functions.php";
?>

<?php 
$current_page = find_page_by_id($_GET["page"], $public = false);
if (!$current_page) {
    // if current subject was null or invalid
    redirect_to("manage_content.php");
}
$id = $current_page["id"];
$query = "DELETE FROM pages WHERE id = {$id} LIMIT 1";
$result = mysqli_query($connection, $query);
if ($result && mysqli_affected_rows($connection) == 1) {
    // Success
    $_SESSION["message"] = "page Deleted .";
    redirect_to("manage_content.php");
} else {
    // failure
    $_SESSION["message"] = "page Deletion failed .";
    redirect_to("manage_content.php?page={$id}");
}
?>

开发者ID:VishnuArukat,项目名称:phpcodepool,代码行数:26,代码来源:delete_page.php


示例7: find_selected_page

function find_selected_page($public = false)
{
    global $current_page;
    global $current_subject;
    if (isset($_GET["subject"])) {
        //  This is an associative array with all the database info
        $current_subject = find_subject_by_id($_GET["subject"], $public);
        if ($current_subject && $public) {
            $current_page = find_default_page_for_subject($current_subject["id"]);
        } else {
            $current_page = null;
        }
    } elseif (isset($_GET["page"])) {
        $current_subject = null;
        $current_page = find_page_by_id($_GET["page"], $public);
    } else {
        $current_page = null;
        $current_subject = null;
    }
}
开发者ID:natac13,项目名称:PHP-Basics-CMS-Project,代码行数:20,代码来源:functions.php


示例8: find_subject_by_id

    ?>
	    <h2>Manage Subject</h2>
			<?php 
    $current_subject = find_subject_by_id($selected_subject_id);
    ?>
			Menu name: <?php 
    echo $current_subject["menu_name"];
    ?>
<br />
			
		<?php 
} elseif ($selected_page_id) {
    ?>
			<h2>Manage Page</h2>
			<?php 
    $current_page = find_page_by_id($selected_page_id);
    ?>
			Menu name: <?php 
    echo $current_page["menu_name"];
    ?>
<br />
			
		<?php 
} else {
    ?>
			Please select a subject or a page.
		<?php 
}
?>
  </div>
</div>
开发者ID:asimrafique,项目名称:Examples,代码行数:31,代码来源:manage_content.php


示例9: find_selected_page_edit

function find_selected_page_edit()
{
    global $current_subject;
    global $current_page;
    if (isset($_GET['page'])) {
        $current_page = find_page_by_id($_GET['page']);
        $current_subject = null;
    } else {
        $current_subject = null;
        $current_page = null;
    }
}
开发者ID:bi6o,项目名称:HumanToHuman,代码行数:12,代码来源:functions.php


示例10: find_page_by_id

<?php

require_once "includes/functions.php";
//Functions files
require_once "includes/db_connection.php";
//Including the database connection file
$sp = find_page_by_id($_GET["id"]);
$pages = find_pages();
?>
      <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
          <!-- sidebar menu: : style can be found in sidebar.less -->
          <ul class="sidebar-menu">
            <?php 
//  Navigation: left bar - Complex!
while ($subject = mysqli_fetch_assoc($pages)) {
    $output = " <li";
    // start: li
    if ($subject["id"] == $_GET["id"]) {
        $output .= " class=\"active\"";
    }
    $output .= ">";
    $output .= "<a href=\"";
    $output .= urlencode($subject["page"]);
    $output .= "?id=";
    $output .= urlencode($subject["id"]);
    $output .= "\">";
    $output .= "<i class=\"";
    $output .= $subject["icon"];
    $output .= "\"></i>";
开发者ID:aabdelfa,项目名称:ezzy-statistics,代码行数:31,代码来源:sidebar.php


示例11: find_selected_page

function find_selected_page($public = false)
{
    global $current_subject;
    global $current_page;
    //instead of returning we can make it as a global variable
    if (isset($_GET["subject"])) {
        $current_subject = find_subject_by_id($_GET["subject"], $public);
        if ($current_subject && $public) {
            $current_page = default_page_for_subject($current_subject["id"]);
            # default page for subject		}
        } else {
            $current_page = null;
        }
    } elseif (isset($_GET["page"])) {
        $current_page = find_page_by_id($_GET["page"], $public);
        # for not displaying the invisible pages
        $current_subject = null;
    } else {
        # for coming from admin page
        $current_subject = null;
        $current_page = null;
    }
}
开发者ID:VishnuArukat,项目名称:phpcodepool,代码行数:23,代码来源:functions.php


示例12: find_selected_page

function find_selected_page()
{
    global $current_subject;
    // creating them in the global scope
    global $current_page;
    // creating them in the global scope
    if (isset($_GET["subject"])) {
        $current_subject = find_subject_by_id($_GET["subject"]);
        $current_page = null;
    } elseif (isset($_GET["page"])) {
        $current_page = find_page_by_id($_GET["page"]);
        $current_subject = null;
    } else {
        $current_subject = null;
        $current_page = null;
    }
}
开发者ID:vpandichi,项目名称:wcorp,代码行数:17,代码来源:functions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP find_pages_for_subject函数代码示例发布时间:2022-05-15
下一篇:
PHP find_max函数代码示例发布时间: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