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


PHP post::all方法代码示例

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


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

示例1: die

                if ($note['imp'] == 1) {
                    $content .= '<span class="imp">Imp</span>';
                }
                $content .= '
						</h5>
						<span>' . $note['class'] . ' | ' . $note['facultyName'] . ' | ' . $note['subjectName'] . '</span>
					</div>
					<div class="cleaner"></div>
				</div>
			</a>';
            }
        }
    }
} else {
    //$notes = getPostList($postTypId);
    $notes = post::all(1, $postTypId);
    if (!$notes) {
        die($e);
    } else {
        if ($notes == 'empty') {
            $title = 'No Note posted';
            $titleBar = 'Notes';
            $content = '<center><img src="' . $website . 'assets/img/smile_face.png" /><br /><p style="color:#AAA;font-size:1.5em;">No Notes to Show</p></center>';
        } else {
            $title = 'Notes';
            $titleBar = $title;
            $content = '';
            foreach ($notes as $note) {
                $dateArray = getdate(strtotime($note['postDate']));
                $content .= '
			<a href="' . generate_link($note['postTitle'], $note['postId']) . '" class="pl-anchor">
开发者ID:amriterry,项目名称:ptn,代码行数:31,代码来源:index.php

示例2: get_admin_info

<?php

require_once "../../includes/conf.inc.php";
require_once "../../includes/functions.inc.php";
if (isset($_SESSION['login'])) {
    $adminId = $_SESSION['adminId'];
    $admin = get_admin_info($adminId);
    $postTrash = post::all(3);
    if ($postTrash == 'empty') {
        echo "<center><img src=\"../../assets/img/smile_face.png\" /><h4 style=\"color:#AAA;\">Yay! No posts in trash.</h4></center>";
    } else {
        echo '
	<table class="tbl_list" cellspacing="0">
		<tr>
		<td>Id</td>
		<td width="200">Title</td>
		<td>Date</td>
		<td>Class</td>
		<td>Faculty</td>
		<td>Subject</td>
		<td>Category</td>
		<td>File</td>
		<td>Posted By</td>
		<td>Imp?</td>
		<td>Actions</td>
	</tr>';
        foreach ($postTrash as $post) {
            echo '
		<tr data-postId="' . $post['postId'] . '" data-postTypId="' . $post['postTypId'] . '">
		<td>' . $post['postId'] . '</td>
		<td>' . $post['postTitle'] . '</td>
开发者ID:amriterry,项目名称:ptn,代码行数:31,代码来源:renderPostsTrash.php

示例3: get_admin_info

<?php

require_once "../../includes/conf.inc.php";
require_once "../../includes/functions.inc.php";
if (isset($_SESSION['login'])) {
    $adminId = $_SESSION['adminId'];
    $admin = get_admin_info($adminId);
    $posts = post::all();
    if ($posts == 'empty') {
        echo "<center><img src=\"../../assets/img/smile_face.png\" /><h4 style=\"color:#AAA;\">There are no posts yet.</h4></center>";
    } else {
        echo '
	<table class="tbl_list" cellspacing="0">
		<tr>
		<td>Id</td>
		<td width="200">Title</td>
		<td>Date</td>
		<td>Class</td>
		<td>Faculty</td>
		<td>Subject</td>
		<td>Category</td>
		<td>File</td>
		<td>Posted By</td>
		<td>Imp?</td>
		<td>Actions</td>
		<td width="80">Status</td>
	</tr>';
        //while($post = mysql_fetch_array($selResult)){
        foreach ($posts as $post) {
            if ($post['statusId'] == 1) {
                $status = "Posted";
开发者ID:amriterry,项目名称:ptn,代码行数:31,代码来源:renderPostList.php

示例4: array

<?php

require "../includes/conf.inc.php";
require "../includes/functions.inc.php";
if (isset($_GET['limitStart'], $_GET['numPosts'])) {
    $limitStart = $_GET['limitStart'];
    $numPosts = $_GET['numPosts'];
    $posts = post::all(1, 0, 0, $limitStart, $numPosts);
    if (!$posts) {
        $postList['success'] = 0;
        $postList['message'] = 'Whoops! Something Went Wrong';
    } else {
        if ($posts == 'empty') {
            $postList['success'] = 0;
            $postList['message'] = 'Post Not Found';
        } else {
            $postList['success'] = 1;
            $postList['posts'] = array();
            $postList['posts'] = $posts;
        }
    }
    echo json_encode($postList);
}
开发者ID:amriterry,项目名称:ptn,代码行数:23,代码来源:postsList.php

示例5: intval

<?php

require "../includes/conf.inc.php";
require "../includes/functions.inc.php";
$syllabus = 'empty';
$postTypId = 3;
if (isset($_GET['subjectId'])) {
    $subId = intval($_GET['subjectId']);
    $syllabus = post::all(1, $postTypId, $subId);
    if (!$syllabus) {
        die($e);
    } else {
        if ($syllabus != 'empty') {
            $class = $syllabus[0]['class'];
            $facultyName = $syllabus[0]['facultyName'];
            $subjectName = $syllabus[0]['subjectName'];
            $content = '';
            foreach ($syllabus as $syll) {
                $dateArray = getdate(strtotime($syll['postDate']));
                $content .= '
			<a href="' . generate_link($syll['postTitle'], $syll['postId']) . '" class="pl-anchor">
				<div class="pl">
					<div class="plDate">
						<span>' . $dateArray['mday'] . '</span>
						<span>' . $dateArray['month'] . '</span>
					</div>
					<div class="plDetail">
						<h5>' . $syll['postTitle'];
                if ($syll['imp'] == 1) {
                    $content .= '<span class="imp">Imp</span>';
                }
开发者ID:amriterry,项目名称:ptn,代码行数:31,代码来源:index.php


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