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


PHP Posts::getPosts方法代码示例

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


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

示例1: Auth

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/
require_once 'Auth.php';
$auth = new Auth();
try {
    $auth->authenticate();
    require_once 'Comment.php';
    require_once 'Media.php';
    require_once 'Posts.php';
    require_once 'Profile.php';
    require_once 'Skillet.php';
    require_once 'Utils.php';
    if (isset($_GET["get"]) && $_GET["get"] == "posts") {
        $posts = new Posts($auth);
        $posts->getPosts();
        print $posts->printOutput();
    } else {
        if (isset($_GET["get"]) && $_GET["get"] == "media") {
            $media = new Media($auth);
            $media->getMedia();
            print $media->printOutput();
        } else {
            if (isset($_POST['changepass'])) {
                $auth->changePassword();
                print $auth->printOutput();
            } else {
                if (isset($_POST["comment"])) {
                    $posts = new Posts($auth);
                    $posts->post();
                    print $posts->printOutput();
开发者ID:grldchz,项目名称:grldservice,代码行数:31,代码来源:service.php

示例2: setMainImage

 public function setMainImage($image, $id, $overwrite)
 {
     $grldPosts = new Posts($this->auth, $id);
     $grldPosts->getPosts();
     $output = $grldPosts->getOutput();
     $post = $output["msg"]["posts"][0];
     //var_dump($grldPosts->printOutput());
     if ($post["image"] == null || $overwrite == true) {
         $stmt = $this->getDb()->prepare("update contents set\n\t\t\t\timage=:image \n\t\t\t\twhere id=:id");
         $stmt->bindValue(':image', $id . "/img_profile_" . $image . ".jpeg", PDO::PARAM_STR);
         $stmt->bindValue(':id', intval($id), PDO::PARAM_INT);
         $stmt->execute();
         $this->setOutput(self::$SUCCESS, "Set main image: " . $image);
     }
 }
开发者ID:grldchz,项目名称:grldservice,代码行数:15,代码来源:Utils.php

示例3: Posts

<?php

include 'conf/conf.php';
$obj = new Posts();
$postsPDO = $obj->getPosts();
$posts = array();
foreach ($postsPDO as $key => $value) {
    $posts[$key]['id'] = $value['id'];
    $posts[$key]['title'] = $value['title'];
    $posts[$key]['content'] = $value['content'];
}
// pr($posts);
?>

<DOCTYPE! html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Interacting With Database</title>
  </head>

  <body>
    <h1 style="text-align:center">Blog</h1>

    <h2>Post</h2>
    <form action="formcontroller.php" method="POST">
      Title:<br>
      <input type="text" name="post_title" size="102"><br>
      Content:<br>
      <textarea name="post_content" rows="20" cols="100"></textarea>
      <br>
开发者ID:vinacovre,项目名称:web-scripting,代码行数:31,代码来源:form.php

示例4: Posts

<?php

include 'conf/conf.php';
$id = $_GET["id"];
$data["condition"] = "id = {$id}";
$obj = new Posts();
$postsPDO = $obj->getPosts($data);
foreach ($postsPDO as $key => $value) {
    $posts[$key]['id'] = $value['id'];
    $posts[$key]['title'] = $value['title'];
    $posts[$key]['content'] = $value['content'];
}
$post = reset($posts);
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <h1><?php 
echo $post['title'];
?>
</h1>
    <p><?php 
echo $post['content'];
?>
</p>
    <a href="index.php">Back</a>
  </body>
开发者ID:vinacovre,项目名称:web-scripting,代码行数:31,代码来源:post.php


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