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


PHP Paging::getPagingView方法代码示例

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


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

示例1: getPagingView

function getPagingView(&$paging, &$template, &$itemTemplate, $useSkinCache = false)
{
    return Paging::getPagingView($paging, $template, $itemTemplate, $useSkinCache);
}
开发者ID:webhacking,项目名称:Textcube,代码行数:4,代码来源:paging.php

示例2: _t

									</div>

									<hr class="hidden" />

									<div id="page-section" class="section">
										<h2><?php 
echo _t('페이지 네비게이션');
?>
</h2>

										<div id="page-navigation">
											<span id="page-list">
<?php 
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
echo str_repeat("\t", 12) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false) . CRLF;
?>
											</span>
											<span id="total-count"><?php 
echo _f('총 %1건', empty($paging['total']) ? "0" : $paging['total']);
?>
</span>
										</div>
										<div class="page-count">
											<?php 
echo Utils_Misc::getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 0);
?>

											<select name="perPage" onchange="document.getElementById('list-form').page.value=1; document.getElementById('list-form').submit()">
<?php 
for ($i = 10; $i <= 30; $i += 5) {
开发者ID:Avantians,项目名称:Textcube,代码行数:31,代码来源:index.php

示例3: array

    }
}
?>
			</tbody>
		</table>
	</div>
<?php 
$paging = array('url' => "", 'prefix' => '?page=', 'postfix' => '', 'total' => 0, 'pages' => 0, 'page' => 0);
$paging['pages'] = $pages;
$paging['page'] = $page;
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
?>
	<div id="page-navigation">
		<span id="page-list"><?php 
echo Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate);
?>
</span>
		<span id="total-count"><?php 
echo _f('총 %1개의 블로그', $blogcount);
?>
</span>
	</div>
<?php 
require ROOT . '/interface/common/control/footer.php';
?>
<script type="text/javascript">
//<![CDATA[
	try {
		document.getElementById("suggestContainer").innerHTML = '';
		var ctlUserSuggestObj = new ctlUserSuggest(document.getElementById("suggestContainer"),  false);
开发者ID:Avantians,项目名称:Textcube,代码行数:31,代码来源:index.php

示例4: showEmoticons_getEmoticons

function showEmoticons_getEmoticons($target)
{
    global $blogURL, $pluginURL, $__HCEMO;
    requireModel('reader.common');
    requireComponent('Textcube.Model.Paging');
    requireComponent('Textcube.Function.misc');
    require_once 'emoticons.inc.php';
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="<?php 
    echo $pluginURL;
    ?>
/styles/default.css" />
    </head>
    <script type="text/javascript">
    //<![CDDA[
        function insertHCEMO(_emoticons, _imagessrc){
            var emoTag = '<img src="'+_imagessrc+'" border="0" alt="'+_emoticons+'" longdesc="[##_HCEMO_'+_emoticons+'_##]" />';

            var isWYSIWYG = false;
            try{
                if(parent.editor.editMode == 'WYSIWYG')
                    isWYSIWYG = true;
            }
            catch(e){ }
            if(isWYSIWYG) {
                parent.editor.command('Raw', emoTag);
            }else{
                parent.insertTag(parent.editor.textarea, emoTag);
            }
        }
    //]]>
    </script>
    <body style="margin:0;padding:0;border:none;background-color:#ffffff;">
    <div id="emoticonsBody" style="height:200px;width:100%;overflow-x:hidden;overflow-y:auto;background-color:#fff;">
    <?php 
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    $items = isset($__HCEMO) ? count($__HCEMO) : 0;
    $listLength = 33;
    $paging = HCEMO_getFetchWithPaging($items, $page, $listLength, "{$blogURL}/plugin/getEmoticons");
    $pagingTemplate = '[##_paging_rep_##]';
    $pagingItemTemplate = '<a [##_paging_rep_link_##] class="num">[##_paging_rep_link_num_##]</a>';
    if ($items > 0) {
        $counter['start'] = ($page - 1) * $listLength;
        $counter['end'] = $page * $listLength - 1;
        $counter['step'] = 0;
        foreach ($__HCEMO as $key => $images) {
            if ($counter['step'] >= $counter['start'] && $counter['step'] <= $counter['end']) {
                echo "<img class=\"emoticons\" src=\"{$pluginURL}/emoticons/{$images}\" border=\"0\" alt=\"{$key}\" onclick=\"insertHCEMO('{$key}','{$pluginURL}/emoticons/{$images}'); return false\" />";
            }
            $counter['step']++;
        }
    } else {
        echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">No emoticons installed.</p>';
    }
    $prev_page = isset($paging['prev']) ? " href='?page={$paging['prev']}' " : '';
    $next_page = isset($paging['next']) ? " href='?page={$paging['next']}' " : '';
    $no_more_prev = isset($paging['prev']) ? '' : 'no-more-prev';
    $no_more_next = isset($paging['next']) ? '' : 'no-more-next';
    $target = '<div class="paging-list"><a ' . $prev_page . ' class="prev ' . $no_more_prev . '">prev </a>';
    $target .= '<span class="numbox">' . str_repeat("\t", 12) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . '</span>';
    $target .= '<a ' . $next_page . ' class="next ' . $no_more_next . '"> next</a>';
    $target .= '<div class="totalResults">';
    $target .= 'Total ' . $items . ' icons.';
    $target .= '</div></div>';
    echo $target;
    ?>
    </div>
    </body>
    </html>
    <?php 
}
开发者ID:hinablue,项目名称:TextCube,代码行数:75,代码来源:index.php

示例5: getCommentView


//.........这里部分代码省略.........
                    } else {
                        $rp_class .= ' hiddenComment';
                        $commentItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentItem) ? ' ' . $commentItem['name'] : '');
                    }
                }
            }
            dress($prefix1 . '_rep_class', $rp_class, $commentItemView);
            if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentItem['id'], $commentItemView) == false) {
                $commentItemView = "<a id=\"comment{$commentItem['id']}\"></a>" . $commentItemView;
            }
            if (empty($commentItem['homepage']) || $commentItem['secret'] == 1 && !doesHaveOwnership()) {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentItem['name'] . "</span>", $commentItem), $commentItemView);
            } else {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentItem['name'] . '</a>', $commentItem), $commentItemView);
            }
            $contentContainer["{$prefix1}_{$commentItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentItem);
            dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentItem['id']}"), $commentItemView);
            dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentItem['written']), $commentItem['written']), $commentItemView);
            if (!$context->getProperty('blog.acceptComments', true) || $prefix1 == 'guest' && $authorized != true && $context->getProperty('blog.allowWriteDblCommentOnGuestbook') == 0) {
                $doubleCommentPermissionScript = 'alert(\'' . _text('댓글을 사용할 수 없습니다.') . '\'); return false;';
            } else {
                $doubleCommentPermissionScript = '';
            }
            dress($prefix1 . '_rep_onclick_reply', $doubleCommentPermissionScript . "commentComment({$commentItem['id']}); return false", $commentItemView);
            dress($prefix1 . '_rep_onclick_delete', "deleteComment({$commentItem['id']});return false", $commentItemView);
            dress($prefix1 . '_rep_link', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "?commentId=" . $commentItem['id'] . "#comment{$commentItem['id']}"), $commentItemView);
            $commentItemsView .= $commentItemView;
        }
        /// Merging comments with its paging links.
        $commentContainer = $isComment ? $skin->commentContainer : $skin->guestContainer;
        dress($isComment ? 'rp_rep' : 'guest_rep', $commentItemsView, $commentContainer);
        if (count($comments) > 0) {
            if ($isComment && $useAjaxBlock) {
                $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem, false, 'onclick');
            } else {
                $pagingView = '';
            }
            dress($prefix1 . '_container', "<div id=\"entry" . $entry['id'] . "CommentList\">" . $commentContainer . $pagingView . "</div>", $commentView);
        }
    } else {
        dress($prefix1 . '_container', '', $commentView);
    }
    /// Comment write block
    if ($inputBlock == true) {
        if (!empty($entry['acceptcomment'])) {
            $acceptcomment = $entry['acceptcomment'];
        } else {
            $pool = DBModel::getInstance();
            $pool->reset('Entries');
            $pool->setQualifier('blogid', 'equals', $blogid);
            $pool->setQualifier('id', 'equals', $entry['id']);
            $pool->setQualifier('draft', 'equals', 0);
            $acceptcomment = $pool->getCell('acceptcomment');
        }
        $useForm = false;
        $openid_identity = Acl::getIdentity('openid');
        if ($isComment) {
            if (!($skin->commentForm == '')) {
                $commentRrevView = $commentView;
                /// Comment Lists.
                $commentView = $skin->commentForm;
                /// Comment write block.
                $useForm = true;
            }
        } else {
            if (!($skin->guestForm == '')) {
开发者ID:Avantians,项目名称:Textcube,代码行数:67,代码来源:view.php

示例6: PN_Referer_Default


//.........这里部分代码省略.........
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("리퍼러 로그");
    ?>
</span></h2>
							
							<table class="data-inbox" cellspacing="0" cellpadding="0">
								<thead>
									<tr>
										<th class="number"><span class="text">날짜</span></th>
										<th class="site"><span class="text">주소</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    $more = false;
    list($referers, $paging) = Statistics::getRefererLogsWithPage($_GET['page'], $perPage);
    for ($i = 0; $i < count($referers); $i++) {
        $record = $referers[$i];
        $className = $i % 2 == 1 ? 'even-line' : 'odd-line';
        $className .= $i == sizeof($referers) - 1 ? ' last-line' : '';
        ?>
									<tr class="<?php 
        echo $className;
        ?>
 inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')">
										<td class="date"><?php 
        echo Timestamp::formatDate($record['referred']);
        ?>
</td>
										<td class="address"><a href="<?php 
        echo Utils_Misc::escapeJSInAttribute($record['url']);
        ?>
" onclick="window.open(this.href); return false;" title="<?php 
        echo htmlspecialchars($record['url']);
        ?>
"><?php 
        echo fireEvent('ViewRefererURL', htmlspecialchars(Utils_Unicode::lessenAsEm($record['url'], 70)), $record);
        ?>
</a></td>
									</tr>
<?php 
    }
    ?>
								</tbody>
							</table>
							
							<div class="data-subbox">
								<div id="page-section" class="section">
									<div id="page-navigation">
										<span id="page-list">
<?php 
    $paging['prefix'] = $pluginSelfParam . '&page=';
    $pagingTemplate = '[##_paging_rep_##]';
    $pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
    echo str_repeat("\t", 8) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . CRLF;
    ?>
										</span>
									</div>
									<div class="page-count">
										<?php 
    echo Utils_Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 0);
    ?>
										<select name="perPage" onchange="document.getElementById('part-statistics-log').submit()">					
<?php 
    for ($i = 10; $i <= 30; $i += 5) {
        if ($i == $perPage) {
            ?>
											<option value="<?php 
            echo $i;
            ?>
" selected="selected"><?php 
            echo $i;
            ?>
</option>
<?php 
        } else {
            ?>
											<option value="<?php 
            echo $i;
            ?>
"><?php 
            echo $i;
            ?>
</option>
<?php 
        }
    }
    ?>
										</select>
										<?php 
    echo Utils_Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 1);
    ?>
									</div>
								</div>
							</div>
						</form>
						
						<div class="clear"></div>
<?php 
}
开发者ID:Avantians,项目名称:Textcube,代码行数:101,代码来源:index.php

示例7: _t

										<input type="submit" class="revert-button input-button" value="<?php 
echo _t('복구');
?>
" onclick="revertComments(); return false;" />
									</div>

									<div id="page-section" class="section">
										<div id="page-navigation">
											<span id="page-list">
<?php 
//$paging['url'] = 'document.getElementById('list-form').page.value=';
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false);
?>
											</span>
											<span id="total-count"><?php 
echo _f('총 %1건', empty($paging['total']) ? "0" : $paging['total']);
?>
</span>
										</div>
										<div class="page-count">
											<?php 
echo Utils_Misc::getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 0);
?>
											<select name="perPage" onchange="document.getElementById('list-form').page.value=1; document.getElementById('list-form').submit()">
<?php 
for ($i = 10; $i <= 30; $i += 5) {
    if ($i == $perPage) {
开发者ID:Avantians,项目名称:Textcube,代码行数:31,代码来源:index.php

示例8: MT_Cover_getRecentEntries


//.........这里部分代码省略.........
        @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/", 0777);
    }
    $page = $data['paging'] == '1' && !empty($_GET['page']) ? intval($_GET['page']) : 1;
    $cache = new PageCache();
    $cache->name = 'MT_Cover_RecentPS';
    if ($cache->load()) {
        //If successful loads
        $cache->contents = unserialize($cache->contents);
        // If coverpage is single mode OR coverpage is coverblog and cache is not expired, return cache contents.
        if (($data['coverMode'] == 1 || $data['coverMode'] == 2) && array_key_exists($page, $cache->contents) && Timestamp::getUNIXtime() - $cache->dbContents < 300) {
            return $cache->contents[$page];
        }
    }
    $pool = DBModel::getInstance();
    $pool->reset("BlogSettings");
    $pool->setQualifier("name", "eq", 'visibility', true);
    $pool->setQualifier("value", "<", 2);
    $privateBlogId = $pool->getCell("blogid");
    $pool->reset("Entries");
    $pool->join("Categories", "left", array(array("e.blogid", "eq", "c.blogid"), array("e.category", "eq", "c.id")));
    $pool->setQualifier("e.draft", "eq", 0);
    $pool->setQualifier("e.category", "beq", 0);
    if ($privateBlogId) {
        $pool->setQualifier("e.blogid", "hasnoneof", $privateBlogId);
    }
    if (Utils_Misc::isMetaBlog() == true && doesHaveOwnership() && $context->getProperty('service.type', 'single') != 'single') {
        $pool->setQualifier("e.visibility", ">", 1);
        $pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0));
    } else {
        if (!doesHaveOwnership()) {
            $pool->setQualifier("e.visibility", ">", 1);
            $pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0));
        }
    }
    if ($data['coverMode'] != 2) {
        $pool->setQualifier("e.blogid", "eq", $context->getProperty("blog.id"));
    }
    list($entries, $paging) = Paging::fetch($pool, $page, $entryLength);
    $html = '';
    foreach ((array) $entries as $entry) {
        $tagLabelView = "";
        $blogid = $data['coverMode'] == 2 ? $entry['blogid'] : $context->getProperty('blog.id');
        $entryTags = getTags($blogid, $entry['id']);
        $defaultURL = getDefaultURL($blogid);
        if (sizeof($entryTags) > 0) {
            $tags = array();
            foreach ($entryTags as $entryTag) {
                $tags[$entryTag['name']] = "<a href=\"{$defaultURL}/tag/" . (Setting::getBlogSettingGlobal('useSloganOnTag', true) ? URL::encode($entryTag['name'], $service['useEncodedURL']) : $entryTag['id']) . '">' . htmlspecialchars($entryTag['name']) . '</a>';
            }
            $tagLabelView = "<div class=\"post_tags\"><span>TAG : </span>" . implode(",\r\n", array_values($tags)) . "</div>";
        }
        if (empty($entry['category'])) {
            $entry['label'] = _text('분류없음');
            $entry['link'] = "{$defaultURL}/category";
        } else {
            $entry['link'] = "{$defaultURL}/category/" . (Setting::getBlogSettingGlobal('useSloganOnCategory', true) ? URL::encode($entry['label'], $service['useEncodedURL']) : $entry['category']);
        }
        $permalink = "{$defaultURL}/" . (Setting::getBlogSettingGlobal('useSloganOnPost', true) ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL', false)) : $entry['id']);
        $html .= '<div class="coverpost">' . CRLF;
        if ($imageName = MT_Cover_getAttachmentExtract($entry['content'])) {
            if (($tempImageSrc = MT_Cover_getImageResizer($blogid, $imageName, $data['screenshotSize'])) && $data['screenshot'] == 1) {
                $html .= '<div class="img_preview"><a href="' . $permalink . '"><img src="' . $tempImageSrc . '" alt="" /></a></div>' . CRLF;
            }
        }
        $html .= '	<div class="content_box">';
        $html .= '		<h2><a href="' . $permalink . '">' . htmlspecialchars($entry['title']) . '</a></h2>' . CRLF;
        $html .= '		<div class="post_info">' . CRLF;
        $html .= '			<span class="category"><a href="' . htmlspecialchars($entry['link']) . '">' . htmlspecialchars($entry['label']) . '</a></span>' . CRLF;
        $html .= '			<span class="date">' . Timestamp::format5($entry['published']) . '</span>' . CRLF;
        $html .= '			<span class="author"><span class="preposition">by </span>' . User::getName($entry['userid']) . '</span>' . CRLF;
        $html .= '		</div>' . CRLF;
        $html .= '		<div class="post_content">' . htmlspecialchars(Utils_Unicode::lessenAsEm(removeAllTags(stripHTML($entry['content'])), $data['contentLength'])) . '</div>' . CRLF;
        $html .= $tagLabelView;
        $html .= '		<div class="clear"></div>' . CRLF;
        $html .= '	</div>';
        $html .= '</div>' . CRLF;
    }
    if ($data['paging'] == '1') {
        $paging['page'] = $page;
        $paging['total'] = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries e WHERE {$multiple} e.draft = 0 {$visibility} AND e.category >= 0");
        $html .= Paging::getPagingView($paging, $skin->paging, $skin->pagingItem) . CRLF;
        $html .= '<script type="text/javascript">' . CRLF;
        $html .= '//<![CDATA[' . CRLF;
        if ($paging['page'] > 1) {
            $html .= 'var prevURL = "' . $paging['url'] . '?page=' . ($paging['page'] - 1) . '"' . CRLF;
        }
        if ($paging['page'] < $paging['total']) {
            $html .= 'var nextURL = "' . $paging['url'] . '?page=' . ($paging['page'] + 1) . '"' . CRLF;
        }
        $html .= '//]]>' . CRLF;
        $html .= '</script>';
    }
    $target = $html;
    $cache->contents[$page] = $target;
    $cache->contents = serialize($cache->contents);
    $cache->dbContents = Timestamp::getUNIXtime();
    $cache->update();
    unset($cache);
    return $target;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:101,代码来源:index.php

示例9: dress

}
if (preg_match("@\\[##_link_list_##\\]@iU", $view)) {
    dress('link_list', getLinkListView(getLinks($blogid)), $view, false, true);
}
if (preg_match("@\\[##_paging_##\\]@iU", $view)) {
    if (isset($paging)) {
        if (isset($cache) && strpos($cache->name, 'Paging') !== false) {
            if ($cache->load()) {
                $pagingView = $cache->contents;
            } else {
                $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem);
                $cache->contents = $pagingView;
                $cache->update();
            }
        } else {
            $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem);
        }
        dress('paging_list', $pagingView, $view, false, true);
        if (!empty($entries) || $suri['directive'] == '/guestbook') {
            dress('paging', $pagingView, $view, false, true);
        }
        $url = URL::encode($paging['url'], $service['useEncodedURL']);
        $prefix = $paging['prefix'];
        $postfix = isset($paging['postfix']) ? $paging['postfix'] : '';
        // prev_page, next_page for legacy support.
        dress('prev_page', isset($paging['prev']) ? "href='{$url}{$prefix}{$paging['prev']}{$postfix}'" : '', $view);
        dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view);
        dress('next_page', isset($paging['next']) ? "href='{$url}{$prefix}{$paging['next']}{$postfix}'" : '', $view);
        dress('next_page_title', isset($paging['next_title']) ? $paging['next_title'] : '', $view);
    } else {
        if (isset($cache) && strpos($cache->name, 'Paging') !== false && $cache->load()) {
开发者ID:webhacking,项目名称:Textcube,代码行数:31,代码来源:end.php

示例10: getFlickrPhotos


//.........这里部分代码省略.........
    $photoSets = isset($_GET['photoSets']) && !empty($_GET['photoSets']) ? $_GET['photoSets'] : "";
    $personMode = isset($_GET['person']) ? $_GET['person'] : "my";
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    $zoomStyle = "flickr";
    ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="<?php 
    echo $pluginURL;
    ?>
/style/default.css" />
	</head>
	<script type="text/javascript">
	//<![CDDA[
		function insertPhoto(_link, _src_m, _src_l, _title, _style){
			var linkTag_A = '', linkTag_B = '', imgTag = '';
			linkTag_A = '<a href="' + _link + '" title="' + _title + '" target="_blank">'; 
			linkTag_B = '</a>';
			imgTag	= '<img src="' + _src_m + '" border="0" />';

			var isWYSIWYG = false;
			try{
				if(parent.editor.editMode == 'WYSIWYG')
					isWYSIWYG = true;
			}
			catch(e){ }
			if(isWYSIWYG) {
				parent.editor.command('Raw', (linkTag_A + imgTag), linkTag_B);
			}else{
				parent.insertTag(parent.editor.textarea, (linkTag_A + imgTag), linkTag_B);
			}
		}
	//]]>
	</script>
	<body style="margin:0;padding:0;border:none;background-color:#ffffff;">
	<div id="photosBody" style="height:200px;width:100%;overflow-x:hidden;overflow-y:auto;background-color:#fff;">
	<?php 
    if ($personMode == "my" && !empty($flickruserid) && empty($searchKey)) {
        if (!empty($photoSets)) {
            $photoset = $f->photosets_getPhotos($photoSets, "owner_name", NULL, $listLength, $page);
            $photos['photos'] = $photoset['photoset'];
        } else {
            $photos = $f->people_getPublicPhotos($flickruserid, NULL, NULL, $listLength, $page);
        }
        foreach ($photos['photos']['photo'] as $photo) {
            $_output = getFlickrPhotosInfo($photo, $zoomStyle, $flickruserid);
            echo $_output;
        }
    } else {
        if (($personMode == "my" || $personMode == "all") && !empty($searchKey)) {
            if ($personMode == "my" && !empty($flickruserid)) {
                $searchArray = array("user_id" => $flickruserid, "text" => $searchKey, "sort" => "date-posted-desc", "per_page" => $listLength, "page" => $page);
            } else {
                $searchArray = array("text" => $searchKey, "sort" => "date-posted-desc", "per_page" => $listLength, "page" => $page);
            }
            $photos['photos'] = $f->photos_search($searchArray);
            if ($photos['photos']['total'] > 0) {
                foreach ($photos['photos']['photo'] as $photo) {
                    $_output = getFlickrPhotosInfo($photo, $zoomStyle);
                    echo $_output;
                }
            } else {
                echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">Flickr did not find any photos. Please input title, description or tags.</p>';
            }
        } else {
            if ($personMode == "all" && empty($searchKey)) {
                $photos['photos'] = $f->photos_getRecent(NULL, $listLength, $page);
                foreach ($photos['photos']['photo'] as $photo) {
                    $_output = getFlickrPhotosInfo($photo, $zoomStyle);
                    echo $_output;
                }
            } else {
                echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">Flickr did not find any photos.', !$nickName ? '(Input title, description or tags.)' : '', '</p>';
            }
        }
    }
    $pageLink = '?person=' . $personMode . '&photoSets=' . $photoSets . '&length=' . $listLength . '&search=' . rawurlencode($searchKey);
    //$photos['total'] = $photos['total'] > 996 ? 996 : $photos['total'];
    $paging = HC_getFetchWithPaging($photos['photos']['total'], $page, $listLength, "{$blogURL}/plugin/flickrPhotos", $pageLink . "&page=");
    $pagingTemplate = '[##_paging_rep_##]';
    $pagingItemTemplate = '<a [##_paging_rep_link_##] class="num">[##_paging_rep_link_num_##]</a>';
    $prev_page = isset($paging['prev']) ? " href=\"{$pageLink}&page={$paging['prev']}\" " : '';
    $next_page = isset($paging['next']) ? " href=\"{$pageLink}&page={$paging['next']}\" " : '';
    $no_more_prev = isset($paging['prev']) ? '' : 'no-more-prev';
    $no_more_next = isset($paging['next']) ? '' : 'no-more-next';
    $target = '<div class="paging-list"><a ' . $prev_page . ' class="prev ' . $no_more_prev . '">prev </a>';
    $target .= '<span class="numbox">' . str_repeat("\t", 12) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . '</span>';
    $target .= '<a ' . $next_page . ' class="next ' . $no_more_next . '"> next</a>';
    $target .= '<div class="totalResults">';
    $target .= 'Total ' . $photos['photos']['total'] . ' photos.';
    $target .= '</div></div>';
    echo $target;
    ?>
	</div>
	</body>
	</html>
	<?php 
}
开发者ID:hinablue,项目名称:TextCube,代码行数:101,代码来源:index.php


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