示例#1
0
function getTeamProfileView($target, $mother)
{
    global $entry, $entryView;
    $context = Model_Context::getInstance();
    $data = $context->getProperty('plugin.config');
    getTeamBlogInitConfigVal($data);
    if ($context->getProperty("suri.directive") != "/rss" && $context->getProperty("suri.directive") != "/sync" && $data['p1'] && empty($data['p2'])) {
        $target .= getTeamProfile($entry['userid']);
    }
    if ($context->getProperty("suri.directive") != "/rss" && $context->getProperty("suri.directive") != "/sync" && $data['p1'] && !empty($data['p2'])) {
        Utils_Misc::dress('TeamBlogProfileTag', getTeamProfile($entry['userid']), $entryView);
    }
    return $target;
}
示例#2
0
function _getRecentEntriesView($entries, $template)
{
    $context = Model_Context::getInstance();
    ob_start();
    foreach ($entries as $entry) {
        $view = $template;
        Utils_Misc::dress('rctps_rep_link', $context->getProperty('uri.blog') . "/" . $entry['id'], $view);
        Utils_Misc::dress('rctps_rep_edit_link', $context->getProperty('uri.blog') . "/owner/entry/edit/" . $entry['id'], $view);
        Utils_Misc::dress('rctps_rep_title', htmlspecialchars(Utils_Unicode::lessenAsEm($entry['title'], 30)), $view);
        Utils_Misc::dress('rctps_rep_rp_cnt', "<span id=\"commentCountOnRecentEntries{$entry['id']}\">" . ($entry['comments'] > 0 ? "({$entry['comments']})" : '') . '</span>', $view);
        print $view;
    }
    $view = ob_get_contents();
    ob_end_clean();
    return $view;
}
示例#3
0
function RecentRP_getRecentCommentsView($comments, $template)
{
    global $contentContainer;
    $context = Model_Context::getInstance();
    ob_start();
    foreach ($comments as $comment) {
        $view = "{$template}";
        Utils_Misc::dress('rctrp_rep_link', $context->getProperty('uri.blog') . "/{$comment['entry']}#comment{$comment['id']}", $view);
        $contentContainer["recent_comment_{$comment['id']}"] = htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['comment']), 30));
        Utils_Misc::dress('rctrp_rep_desc', setTempTag("recent_comment_{$comment['id']}"), $view);
        Utils_Misc::dress('rctrp_rep_desc', htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['comment']), 30)), $view);
        Utils_Misc::dress('rctrp_rep_time', fireEvent('ViewRecentCommentDate', Timestamp::format3($comment['written'])), $view);
        Utils_Misc::dress('rctrp_rep_name', htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['name']), 10)) . $comment['secret'] . $comment['replier'], $view);
        print $view;
    }
    $view = ob_get_contents();
    ob_end_clean();
    return $view;
}
 static function getPagingView(&$paging, &$template, &$itemTemplate, $useCache = false, $mode = 'href')
 {
     $ctx = Model_Context::getInstance();
     if ($paging === false || empty($paging['page'])) {
         $paging['url'] = NULL;
         $paging['onclick'] = NULL;
         $paging['prefix'] = NULL;
         $paging['postfix'] = NULL;
         $paging['total'] = NULL;
         $paging['pages'] = 1;
         $paging['page'] = 1;
         $paging['next'] = NULL;
     }
     $url = str_replace('/%3F/', '/?/', URL::encode($paging['url'], $ctx->getProperty('service.useEncodedURL')));
     $prefix = $paging['prefix'];
     $postfix = isset($paging['postfix']) ? $paging['postfix'] : '';
     ob_start();
     if (isset($paging['first'])) {
         $itemView = "{$itemTemplate} <span class=\"interword\">...</span> ";
         Utils_Misc::dress('paging_rep_link_num', '<span>1</span>', $itemView, $useCache);
         Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$paging['first']}{$postfix}'", $itemView, $useCache);
         print $itemView;
     } else {
         if ($paging['page'] > 5) {
             $itemView = "{$itemTemplate} <span class=\"interword\">...</span> ";
             Utils_Misc::dress('paging_rep_link_num', '<span>1</span>', $itemView, $useCache);
             Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}1{$postfix}'", $itemView, $useCache);
             print $itemView;
         }
     }
     if (isset($paging['before'])) {
         $page = $paging['page'] - count($paging['before']);
     } else {
         $page = $paging['page'] < 5 ? 1 : $paging['page'] - 4;
     }
     if (isset($paging['before'])) {
         foreach ($paging['before'] as $value) {
             $itemView = $itemTemplate;
             Utils_Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
             Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$value}{$postfix}'", $itemView, $useCache);
             print $itemView;
             $page++;
         }
     } else {
         for ($i = 0; $i < 4 && $page < $paging['page']; $i++) {
             $itemView = $itemTemplate;
             Utils_Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
             Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$page}{$postfix}'", $itemView, $useCache);
             print $itemView;
             $page++;
         }
     }
     if ($page == $paging['page'] && $page <= $paging['pages']) {
         $itemView = $itemTemplate;
         Utils_Misc::dress('paging_rep_link_num', "<span class=\"selected\" >{$page}</span>", $itemView, $useCache);
         Utils_Misc::dress('paging_rep_link', '', $itemView, $useCache);
         print $itemView;
         $page++;
     }
     if (isset($paging['before'])) {
         foreach ($paging['after'] as $value) {
             $itemView = $itemTemplate;
             Utils_Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
             Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$value}{$postfix}'", $itemView, $useCache);
             print $itemView;
             $page++;
         }
     } else {
         for ($i = 0; $i < 4 && $page <= $paging['pages']; $i++) {
             $itemView = $itemTemplate;
             Utils_Misc::dress('paging_rep_link_num', "<span>{$page}</span>", $itemView, $useCache);
             Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$page}{$postfix}'", $itemView, $useCache);
             print $itemView;
             $page++;
         }
     }
     if (isset($paging['last'])) {
         $itemView = " <span class=\"interword\">...</span> {$itemTemplate}";
         Utils_Misc::dress('paging_rep_link_num', "<span>{$paging['pages']}</span>", $itemView, $useCache);
         Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$paging['last']}{$postfix}'", $itemView, $useCache);
         print $itemView;
     } else {
         if ($paging['pages'] - $paging['page'] > 4) {
             $itemView = " <span class=\"interword\">...</span> {$itemTemplate}";
             Utils_Misc::dress('paging_rep_link_num', "<span>{$paging['pages']}</span>", $itemView, $useCache);
             Utils_Misc::dress('paging_rep_link', ($mode == 'href' ? "href='" : "href='#' onclick='") . "{$url}{$prefix}{$paging['pages']}{$postfix}'", $itemView, $useCache);
             print $itemView;
         }
     }
     $itemsView = ob_get_contents();
     ob_end_clean();
     $view = $template;
     Utils_Misc::dress('prev_page', isset($paging['prev']) ? ($mode == 'href' ? "href=\"" : "href=\"#\" onclick=\"") . "{$url}{$prefix}{$paging['prev']}{$postfix}\" rel=\"prev\"" : '', $view, $useCache);
     Utils_Misc::dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view, $useCache);
     Utils_Misc::dress('paging_rep', $itemsView, $view, $useCache);
     Utils_Misc::dress('next_page', isset($paging['next']) ? ($mode == 'href' ? "href=\"" : "href=\"#\" onclick=\"") . "{$url}{$prefix}{$paging['next']}{$postfix}\" rel=\"next\"" : '', $view, $useCache);
     Utils_Misc::dress('next_page_title', isset($paging['next_title']) ? $paging['next'] : '', $view, $useCache);
     Utils_Misc::dress('no_more_prev', isset($paging['prev']) ? '' : 'no-more-prev', $view, $useCache);
     Utils_Misc::dress('no_more_next', isset($paging['next']) ? '' : 'no-more-next', $view, $useCache);
     return $view;
 }