예제 #1
0
 function display($params)
 {
     $Log_Model = new Log_Model();
     $options_cache = Option::getAll();
     extract($options_cache);
     $page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
     $tag = isset($params[1]) && $params[1] == 'tag' ? addslashes(urldecode(trim($params[2]))) : '';
     $pageurl = '';
     //page meta
     $site_title = stripslashes($tag) . ' - ' . $site_title;
     $Tag_Model = new Tag_Model();
     $blogIdStr = $Tag_Model->getTagByName($tag);
     if ($blogIdStr === false) {
         show_404_page();
     }
     $sqlSegment = "and gid IN ({$blogIdStr}) order by date desc";
     $lognum = $Log_Model->getLogNum('n', $sqlSegment);
     $total_pages = ceil($lognum / $index_lognum);
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $pageurl .= Url::tag(urlencode($tag), 'page');
     $logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
     $page_url = pagination($lognum, $index_lognum, $page, $pageurl);
     include View::getView('header');
     include View::getView('log_list');
 }
예제 #2
0
 public static function tags($return2array = false)
 {
     global $post;
     global $_DB_TAGS;
     $tags = $_DB_TAGS->get_by_idpost(array('id_post' => $post['id']));
     if ($return2array) {
         return $tags;
     }
     $html = '<ul>';
     foreach ($tags as $tag) {
         $html .= '<li><a class="tag" href="' . Url::tag($tag['name']) . '">' . $tag['name_human'] . '</a></li>';
     }
     $html .= '</ul>';
     return $html;
 }
예제 #3
0
 private function setData()
 {
     $CACHE = Cache::getInstance();
     $data = array();
     $lastCommentTime = $this->getLastCommentTime();
     $data[] = array('url' => BLOG_URL, 'lastmod' => time(), 'changefreq' => 'always', 'priority' => '1.0');
     //日志
     $query = $this->db->query("SELECT gid,date FROM " . DB_PREFIX . "blog WHERE type='blog' AND hide='n' ORDER BY date DESC");
     while ($row = $this->db->fetch_array($query)) {
         $lastmod = $this->comment_time && isset($lastCommentTime[$row['gid']]) ? $lastCommentTime[$row['gid']] : $row['date'];
         $data[] = array('url' => Url::log($row['gid']), 'lastmod' => $lastmod, 'changefreq' => $this->changefreq[0], 'priority' => $this->priority[0]);
     }
     //页面
     $query = $this->db->query("SELECT gid,date FROM " . DB_PREFIX . "blog WHERE type='page' AND hide='n' ORDER BY date DESC");
     while ($row = $this->db->fetch_array($query)) {
         $lastmod = $this->comment_time && isset($lastCommentTime[$row['gid']]) ? $lastCommentTime[$row['gid']] : $row['date'];
         $data[] = array('url' => Url::log($row['gid']), 'lastmod' => $lastmod, 'changefreq' => $this->changefreq[0], 'priority' => $this->priority[0]);
     }
     //分类
     foreach ($CACHE->readCache('sort') as $value) {
         $data[] = array('url' => Url::sort($value['sid']), 'lastmod' => time(), 'changefreq' => $this->changefreq[2], 'priority' => $this->priority[2]);
     }
     //标签
     foreach ($CACHE->readCache('tags') as $value) {
         $data[] = array('url' => Url::tag($value['tagurl']), 'lastmod' => time(), 'changefreq' => $this->changefreq[3], 'priority' => $this->priority[3]);
     }
     //碎语
     if (Option::get('istwitter') == 'y') {
         $newtws_cache = $CACHE->readCache('newtw');
         $data[] = array('url' => BLOG_URL . 't/', 'lastmod' => $newtws_cache[0]['date'], 'changefreq' => $this->changefreq[4], 'priority' => $this->priority[4]);
     }
     //归档
     foreach ($CACHE->readCache('record') as $value) {
         preg_match("/^([\\d]{4})([\\d]{2})\$/", $value['date'], $match);
         $days = getMonthDayNum($match[2], $match[1]);
         $lastmod = emStrtotime($value['date'] . '01') + 3600 * 24 * $days;
         $data[] = array('url' => Url::record($value['date']), 'lastmod' => $lastmod, 'changefreq' => $this->changefreq[5], 'priority' => $this->priority[5]);
     }
     $this->data = $data;
 }
예제 #4
0
파일: module.php 프로젝트: szshenjian/JIEWU
function blog_tag($blogid)
{
    global $CACHE;
    $log_cache_tags = $CACHE->readCache('logtags');
    if (!empty($log_cache_tags[$blogid])) {
        $tag = '标签:';
        foreach ($log_cache_tags[$blogid] as $value) {
            $tag .= "\t<a href=\"" . Url::tag($value['tagurl']) . "\">" . $value['tagname'] . '</a>';
        }
        echo $tag;
    }
}
예제 #5
0
파일: module.php 프로젝트: jjonline/J4
function blog_tag($blogid)
{
    global $CACHE;
    $log_cache_tags = $CACHE->readCache('logtags');
    $denlySpider = !_g('allow_tags_spider');
    $nofollow = $denlySpider ? ' rel="nofollow"' : '';
    if (!empty($log_cache_tags[$blogid])) {
        $tag = '标签:';
        foreach ($log_cache_tags[$blogid] as $key => $value) {
            $tag .= ' <a href="' . Url::tag($value['tagurl']) . '" class="article_tag article_tag' . $key . '"' . $nofollow . '>' . $value['tagname'] . '</a>';
        }
        return $tag;
    }
    return '';
}
예제 #6
0
function sheli_Tags($num)
{
    global $CACHE;
    $tag_cache = $CACHE->readCache('tags');
    foreach ($tag_cache as $key => $value) {
        if ($key < $num) {
            ?>
<span style="font-size:<?php 
            echo rand(10, 15);
            ?>
pt; line-height:30px;"><a href="<?php 
            echo Url::tag($value['tagurl']);
            ?>
" title="<?php 
            echo $value['usenum'];
            ?>
 篇文章"><?php 
            echo $value['tagname'];
            ?>
</a></span>
<?php 
        }
    }
}
예제 #7
0
파일: module.php 프로젝트: jnan77/J2
function blog_tag($blogid)
{
    global $CACHE;
    $log_cache_tags = $CACHE->readCache('logtags');
    if (!empty($log_cache_tags[$blogid])) {
        $tag = '继续浏览有关 ';
        foreach ($log_cache_tags[$blogid] as $key => $value) {
            $tag .= ' <a href="' . Url::tag($value['tagurl']) . '" class="article_tag article_tag' . $key . '" rel="nofollow">' . $value['tagname'] . '</a>';
        }
        return $tag . ' 的文章';
    }
    return '';
}
예제 #8
0
파일: module.php 프로젝트: flyysr/emlog
function blog_tag($blogid)
{
    global $CACHE;
    $tag_model = new Tag_Model();
    $log_cache_tags = $CACHE->readCache('logtags');
    if (!empty($log_cache_tags[$blogid])) {
        $tag = '标签:';
        foreach ($log_cache_tags[$blogid] as $value) {
            $tag .= "\t<a href=\"" . Url::tag($value['tagurl']) . "\">" . $value['tagname'] . '</a>';
        }
        echo $tag;
    } else {
        $tag_ids = $tag_model->getTagIdsFromBlogId($blogid);
        $tag_names = $tag_model->getNamesFromIds($tag_ids);
        if (!empty($tag_names)) {
            $tag = '标签:';
            foreach ($tag_names as $key => $value) {
                $tag .= "\t<a href=\"" . Url::tag(rawurlencode($value)) . "\">" . htmlspecialchars($value) . '</a>';
            }
            echo $tag;
        }
    }
}
예제 #9
0
" target="_blank">编辑</a>
                                <?php 
        }
        ?>
                            </div>
                            <div class="margin-vertical-sm">
                                <div class="tag" style="display: inline-block;">
                                    <span class="light red-text text-lighten-2">标签: &nbsp;</span>
                                    <?php 
        if (!empty($log_cache_tags[$value['logid']])) {
            ?>
                                        <?php 
            foreach ($log_cache_tags[$value['logid']] as $tag) {
                ?>
                                            <a class="light" href="<?php 
                echo Url::tag($tag['tagurl']);
                ?>
">
                                                <span class="tag-badge">
                                                    <?php 
                echo $tag['tagname'];
                ?>
                                                </span>
                                            </a>
                                        <?php 
            }
            ?>
                                    <?php 
        }
        ?>
                                </div>
예제 #10
0
 public static function url($row)
 {
     $url = Url::tag($row);
     return $url;
 }
예제 #11
0
파일: SiteMap.php 프로젝트: jjonline/J4
    $cache['changefreq'] = 'daily';
    $cache['priority'] = $row['views'] <= 500 || $row['comnum'] < 1 ? '0.9' : '1.0';
    $XMLData[] = $cache;
}
#归档
foreach ($RecordArr as $key => $value) {
    $cache = array();
    $cache['loc'] = Url::record($value['date']);
    $cache['changefreq'] = 'Weekly';
    $cache['priority'] = '0.3';
    $XMLData[] = $cache;
}
#关键词
foreach ($TagsArr as $key => $value) {
    $cache = array();
    $cache['loc'] = Url::tag($value['tagurl']);
    $cache['changefreq'] = 'Weekly';
    $cache['priority'] = '0.3';
    $XMLData[] = $cache;
}
#分类
foreach ($SortArr as $key => $value) {
    $cache = array();
    $cache['loc'] = Url::sort($key);
    $cache['changefreq'] = 'Weekly';
    $cache['priority'] = '0.3';
    $XMLData[] = $cache;
}
#输出
$XmlString = '';
#字符串变量收集之后再输出主要是为了适配静态化该xml
예제 #12
0
function blog_tag($blogid)
{
    global $CACHE;
    $log_cache_tags = $CACHE->readCache('logtags');
    if (!empty($log_cache_tags[$blogid])) {
        $tag = ' ';
        foreach ($log_cache_tags[$blogid] as $key => $value) {
            $tag .= "<a href=\"" . Url::tag($value['tagurl']) . "\" class=\"tag" . $key . "\">" . $value['tagname'] . ' </a>';
        }
        echo $tag . ' ';
    } else {
        echo '暂无标签';
    }
}
예제 #13
0
function blog_tag($blogid)
{
    global $CACHE;
    $log_cache_tags = $CACHE->readCache('logtags');
    if (!empty($log_cache_tags[$blogid])) {
        $tag = '<span class="tag-icon">';
        foreach ($log_cache_tags[$blogid] as $value) {
            $tag .= "<a class=\"margin-right\" href=\"" . Url::tag($value['tagurl']) . "\">" . $value['tagname'] . '</a>';
        }
        $tag .= "</span>";
        echo $tag;
    }
}
예제 #14
0
</h5>
<div id="blogtags" class="padding-bottom padding-horizontal">
<?php 
$i = 0;
foreach ($tag_cache as $value) {
    ?>
    <?php 
    $i++;
    if ($i < 16) {
        ?>
    <span style="font-size:<?php 
        echo $value['fontsize'];
        ?>
pt; line-height:30px;">
        <a class="light red-text text-lighten-2 padding-horizontal-xs" href="<?php 
        echo Url::tag($value['tagurl']);
        ?>
" title="<?php 
        echo $value['usenum'];
        ?>
 篇文章">
            <?php 
        echo $value['tagname'];
        ?>
        </a>
    </span>
    <?php 
    }
}
?>
</div>