コード例 #1
0
$page_num = $_GET["page"];
if (!isset($page_num)) {
    $page_num = 1;
}
$uid = $_GET["uid"];
if (!isset($uid)) {
    $uid = "u1";
}
$start_page = ($page_num - 1) * $per_page;
$end_page = $page_num * $per_page;
//$user_articles_detail = $articles_service->getUserArticleDetail($uid, $start_page, $per_page);
if (empty($_SESSION["user_uid"])) {
    $user_articles_detail = $articles_service->getAllArticles($start_page, $per_page);
} else {
    if ($_SESSION["category_uid"] === "all") {
        $user_articles_detail = $articles_service->getUserArticleDetail($_SESSION["user_uid"], $start_page, $per_page);
    } else {
        $user_articles_detail = $articles_service->getUserArticleCategoryDetail($_SESSION["user_uid"], $_SESSION["category_uid"], $start_page, $per_page);
    }
}
$page_num = $_GET["page"];
?>

<div class="span9">  
          <?php 
foreach ($user_articles_detail as $key => $values) {
    ?>

   				 <div class="row-fluid" id="<?php 
    echo $values["article_uid"];
    ?>