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


PHP page::find_pages_for_subject方法代码示例

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


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

示例1: while

?>
			
			<?php 
// 3. Use returned data (if any)
while ($subject = $dbo->fetch_assoc($subject_set)) {
    ?>
			
				<a href="index.php?subject=<?php 
    echo urlencode($subject["id"]);
    ?>
"><?php 
    echo htmlentities($subject["menu_name"]);
    ?>
</a>
				<?php 
    $page_set = page::find_pages_for_subject($subject["id"]);
    ?>
					
				<ul class="sidemenu">
					<?php 
    while ($page = $dbo->fetch_assoc($page_set)) {
        ?>
					
					<?php 
        echo "<li";
        if ($current_page && $current_page["id"] == $page["id"]) {
            echo " class=\"selected\"";
        }
        echo ">";
        ?>
	
开发者ID:vincentywang,项目名称:simplenote,代码行数:30,代码来源:public_navigation.php

示例2: urlencode

			ID: 	   <?php 
    echo $current_subject["id"];
    ?>
 <br />
			
			<br />
			<a href="edit_subject.php?subject=<?php 
    echo urlencode($current_subject["id"]);
    ?>
">Edit Subject</a>
			<br />
			</p>
			
			<h2>Pages in this subject:</h2>
			<?php 
    $page_set = page::find_pages_for_subject($current_subject["id"], false);
    ?>
			<?php 
    echo page::print_page_tables($page_set);
    ?>
 
			<p><a href="create_page.php?subject=<?php 
    echo urlencode($current_subject["id"]);
    ?>
">+Add a new page to this subject</a>
			</p>
			
			<?php 
} elseif ($current_page) {
    ?>
				<p><h2>Manage Page</h2></p>
开发者ID:vincentywang,项目名称:simplenote,代码行数:31,代码来源:manage_content.php

示例3: delete_subject

 /**
  * delete a subject according user submit
  * @param string $subject_id get from user click delete link 
  */
 public static function delete_subject($subject_id)
 {
     global $dbo;
     $page_set = page::find_pages_for_subject($subject_id, false);
     if ($dbo->count_number_rows($page_set) > 0) {
         // can't delete subject with pages
         $_SESSION["message"] = "can't delete subject with pages.";
         utility::redirect_to("manage_content.php?shubject={$current_subject["id"]}");
         // redirect have exit() affect, will not excuate below code
     }
     $id = $subject_id;
     $query = "DELETE FROM subjects WHERE id = {$id} LIMIT 1";
     $result = $dbo->query($query);
     if (isset($result) && $dbo->affected_rows($result) == 1) {
         // Success
         $_SESSION["message"] = "Subject deletion succeed.";
         utility::redirect_to("manage_content.php");
     } else {
         // Failure
         $_SESSION["message"] = "Subject deletion failed.";
         utility::redirect_to("manage_content.php?shubject={$id}");
     }
 }
开发者ID:vincentywang,项目名称:simplenote,代码行数:27,代码来源:class.subject.inc.php


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