コード例 #1
0
        if ($data['category']) {
            foreach ($data['category'] as $k => $v) {
                if ($v['active'] && $v['srl'] > 0) {
                    $data['category_name'] = $v['name'];
                    break;
                }
            }
        }
        break;
    case 'article':
        // get article
        $data = $api->view(['app_srl' => $pref->json['srl']['app'], 'article_srl' => isset($_params['article']) ? $_params['article'] : null, 'contentType' => $pref->json['article']['type'], 'updateHit' => false, 'print_data' => $_GET['get']]);
        break;
    case 'upLike':
        $srl = isset($_params['article']) ? (int) $_params['article'] : null;
        if ($pref->json['article']['updateLike'] && isCookieKey($pref->json['article']['cookiePrefix'] . 'like-' . $srl, 7)) {
            $data = $api->upLike(['article_srl' => $srl, 'header_key' => isset($pref->json['meta']['headerKey']) ? $pref->json['meta']['headerKey'] : null]);
        } else {
            $data = ['state' => 'error', 'message' => 'exist cookie key'];
        }
        break;
}
// check render type
switch ($_GET['render']) {
    case 'text':
        $header = 'Content-Type: text/plain; charset=utf-8';
        break;
    case 'html':
        $header = 'Content-Type: text/html; charset=utf-8';
        break;
    default:
コード例 #2
0
ファイル: index.php プロジェクト: dev-goose/app-first-gallery
             }
         }
     }
     if ($data->state == 'error') {
         core\Goose::error(101, $data->message, __ROOT_URL__);
     }
     $loc_container = 'pages/index.php';
     break;
 case 'article':
     // set api
     require_once 'lib/ClientAPI.class.php';
     $api = new ClientAPI();
     // set article_srl
     $article_srl = isset($_params['article']) ? (int) $_params['article'] : null;
     // set update hit
     $updateHit = $pref->json['article']['updateHit'] ? isCookieKey($pref->json['article']['cookiePrefix'] . 'hit-' . $article_srl, 7) : false;
     // get article
     $data = $api->view(['app_srl' => $pref->json['srl']['app'], 'article_srl' => $article_srl, 'contentType' => $pref->json['article']['type'], 'updateHit' => $updateHit, 'print_data' => $_GET['get'] ? $_GET['get'] : 'all']);
     if ($data->state == 'error') {
         core\Goose::error(101, $data->message, __ROOT_URL__);
         core\Goose::end();
     }
     $loc_container = 'pages/article.php';
     if ($_GET['popup']) {
         require_once $loc_container;
         core\Goose::end();
     }
     break;
 case 'page':
     $loc_container = 'pages/page.php';
     break;
コード例 #3
0
echo $data->article['json']['like'] ? $data->article['json']['like'] : 0;
?>
</em></span>
		</p>
	</header>

	<div class="body">
		<?php 
echo $data->article['content'];
?>
	</div>

	<nav class="nav-bottom">
		<?php 
if ($pref->json['article']['updateLike']) {
    $disabled = !isCookieKey($pref->json['article']['cookiePrefix'] . 'like-' . $data->article['srl'], 7) ? ' disabled="disabeld"' : '';
    ?>
			<button type="button" class="like" title="Like" data-srl="<?php 
    echo $data->article['srl'];
    ?>
"<?php 
    echo $disabled;
    ?>
>
				<i class="fa fa-heart"></i>
			</button>
			<?php 
}
?>
	</nav>