當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。