本文整理汇总了PHP中Url::log方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::log方法的具体用法?PHP Url::log怎么用?PHP Url::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: JA_content_f
function JA_content_f($arr)
{
$blogname = Option::get('blogname');
//$url = BLOG_URL."?post=".$arr['logid'];
$url = Url::log($arr['logid']);
$name = "<a style=\"color:red;\" href=\"" . BLOG_URL . "\">" . $blogname . "</a>";
?>
<p>
版权所有:《<?php
echo $name;
?>
》 => 《<a href="<?php
echo $url;
?>
"><?php
echo $arr['log_title'];
?>
</a>》<br />
本文地址:<a href="<?php
echo $url;
?>
"><?php
echo $url;
?>
</a><br />
除非注明,文章均为 《<?php
echo $name;
?>
》 原创,欢迎转载!转载请注明本文地址,谢谢。<br />
</p>
<?php
}
示例2: sitemap_update_on_comment
function sitemap_update_on_comment()
{
global $sitemap_name;
if (Option::get('ischkcomment') == 'n') {
return;
}
$gid = isset($_POST['gid']) ? intval($_POST['gid']) : -1;
$url = Url::log($gid);
$lastmod = gmdate('c');
$file = EMLOG_ROOT . '/' . $sitemap_name;
$xml = file_get_contents($file);
$xml = preg_replace("|<loc>" . preg_quote($url) . "<\\/loc>\n<lastmod>(.*?)<\\/lastmod>|i", "<loc>{$url}</loc>\n<lastmod>{$lastmod}</lastmod>", $xml);
file_put_contents($file, $xml);
}
示例3: archiver_db
function archiver_db($condition = '')
{
$DB = Database::getInstance();
$sql = "SELECT gid, title, comnum, views FROM " . DB_PREFIX . "blog WHERE type='blog' and hide='n' {$condition}";
$result = $DB->query($sql);
$output = '';
while ($row = $DB->fetch_array($result)) {
$log_url = Url::log($row['gid']);
$output .= '<li><a href="' . $log_url . '">' . $row['title'] . '</a> <span>(' . $row['comnum'] . '/' . $row['views'] . ')</span></li>';
}
$output = empty($output) ? '<li>暂无日志</li>' : $output;
$output = '<ol class="archiver_item">' . $output . '</ol>';
return $output;
}
示例4: getBlog
/**
* 获取文章信息
*
* @return array
*/
function getBlog($sortid = null)
{
$rss_output_num = Option::get('rss_output_num');
if ($rss_output_num == 0) {
return array();
}
$DB = Database::getInstance();
$sorts = Cache::getInstance()->readCache('sort');
if (isset($sorts[$sortid])) {
$sort = $sorts[$sortid];
if ($sort['pid'] != 0 || empty($sort['children'])) {
$subsql = "and sortid={$sortid}";
} else {
$sortids = array_merge(array($sortid), $sort['children']);
$subsql = "and sortid in (" . implode(',', $sortids) . ")";
}
} else {
$subsql = $sortid ? "and sortid={$sortid}" : '';
}
$sql = "SELECT * FROM " . DB_PREFIX . "blog WHERE hide='n' and type='blog' {$subsql} ORDER BY date DESC limit 0," . $rss_output_num;
$result = $DB->query($sql);
$blog = array();
while ($re = $DB->fetch_array($result)) {
$re['id'] = $re['gid'];
$re['title'] = htmlspecialchars($re['title']);
$re['date'] = $re['date'];
$re['content'] = $re['content'];
if (!empty($re['password'])) {
$re['content'] = '<p>[该文章已设置加密]</p>';
} elseif (Option::get('rss_output_fulltext') == 'n') {
if (!empty($re['excerpt'])) {
$re['content'] = $re['excerpt'];
} else {
$re['content'] = extractHtmlData($re['content'], 330);
}
$re['content'] .= ' <a href="' . Url::log($re['id']) . '">阅读全文>></a>';
}
$blog[] = $re;
}
return $blog;
}
示例5: setData
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;
}
示例6: getLogsForHome
/**
* 前台获取文章列表
*
* @param string $condition
* @param int $page
* @param int $perPageNum
* @return array
*/
function getLogsForHome($condition = '', $page = 1, $perPageNum)
{
$start_limit = !empty($page) ? ($page - 1) * $perPageNum : 0;
$limit = $perPageNum ? "LIMIT {$start_limit}, {$perPageNum}" : '';
$sql = "SELECT * FROM " . DB_PREFIX . "blog WHERE type='blog' and hide='n' and checked='y' {$condition} {$limit}";
$res = $this->db->query($sql);
$logs = array();
while ($row = $this->db->fetch_array($res)) {
$row['log_title'] = htmlspecialchars(trim($row['title']));
$row['log_url'] = Url::log($row['gid']);
$row['logid'] = $row['gid'];
$cookiePassword = isset($_COOKIE['em_logpwd_' . $row['gid']]) ? addslashes(trim($_COOKIE['em_logpwd_' . $row['gid']])) : '';
if (!empty($row['password']) && $cookiePassword != $row['password']) {
$row['excerpt'] = '<p>[该文章已设置加密,请点击标题输入密码访问]</p>';
} else {
if (!empty($row['excerpt'])) {
$row['excerpt'] .= '<p class="readmore"><a href="' . Url::log($row['logid']) . '">阅读全文>></a></p>';
}
}
$row['log_description'] = empty($row['excerpt']) ? breakLog($row['content'], $row['gid']) : $row['excerpt'];
$row['attachment'] = '';
$row['tag'] = '';
$row['tbcount'] = 0;
//兼容未删除引用的模板
$logs[] = $row;
}
return $logs;
}
示例7: navi
/**
* 获取导航链接
*/
static function navi($type, $typeId, $url)
{
$sorts = Cache::getInstance()->readCache('sort');
switch ($type) {
case Navi_Model::navitype_custom:
case Navi_Model::navitype_home:
case Navi_Model::navitype_t:
case Navi_Model::navitype_admin:
$url = $url;
break;
case Navi_Model::navitype_sort:
$url = Url::sort($typeId);
break;
case Navi_Model::navitype_page:
$url = Url::log($typeId);
break;
default:
$url = (strpos($url, 'http') === 0 ? '' : BLOG_URL) . $url;
break;
}
return $url;
}
示例8: neighbor_log
function neighbor_log($neighborLog)
{
extract($neighborLog);
?>
<?php
if ($prevLog) {
?>
<span class="article_prev_log">上一篇 <a href="<?php
echo Url::log($prevLog['gid']);
?>
"><?php
echo $prevLog['title'];
?>
</a></span>
<?php
}
?>
<?php
if ($nextLog) {
?>
<span class="article_next_log"><a href="<?php
echo Url::log($nextLog['gid']);
?>
"><?php
echo $nextLog['title'];
?>
</a> 下一篇</span>
<?php
}
}
示例9: neighbor_log
function neighbor_log($neighborLog)
{
extract($neighborLog);
?>
<?php
if ($prevLog) {
?>
<i class="fa fa-long-arrow-left fa-lg"></i> <a href="<?php
echo Url::log($prevLog['gid']);
?>
"><?php
echo $prevLog['title'];
?>
</a>
<?php
}
?>
<?php
if ($nextLog && $prevLog) {
?>
|
<?php
}
?>
<?php
if ($nextLog) {
?>
<a href="<?php
echo Url::log($nextLog['gid']);
?>
"><?php
echo $nextLog['title'];
?>
</a><i class="fa fa-long-arrow-right fa-lg"></i>
<?php
}
}
示例10: foreach
<form action="page.php?action=operate_page" method="post" name="form_page" id="form_page">
<table class="table table-striped table-bordered table-hover dataTable no-footer">
<thead>
<tr>
<th width="461" colspan="2"><b>标题</b></th>
<th width="140"><b>模板</b></th>
<th width="50" class="tdcenter"><b>评论</b></th>
<th width="140"><b>时间</b></th>
</tr>
</thead>
<tbody>
<?php
if ($pages) {
foreach ($pages as $key => $value) {
if (empty($navibar[$value['gid']]['url'])) {
$navibar[$value['gid']]['url'] = Url::log($value['gid']);
}
$isHide = $value['hide'] == 'y' ? '<font color="red"> - 草稿</font>' : '<a href="' . $navibar[$value['gid']]['url'] . '" target="_blank" title="查看页面"><img src="./views/images/vlog.gif" align="absbottom" border="0" /></a>';
?>
<tr>
<td width="21"><input type="checkbox" name="page[]" value="<?php
echo $value['gid'];
?>
" class="ids" /></td>
<td width="440">
<a href="page.php?action=mod&id=<?php
echo $value['gid'];
?>
"><?php
echo $value['title'];
?>
示例11:
<span class="right hide-on-small-only">|</span>
<?php
}
?>
<?php
}
?>
</div>
<div class="col s12 m6 truncate right-align">
<?php
if ($nextLog) {
?>
<i>下一篇: </i>
<a class="light teal-text text-darken-2" href="<?php
echo Url::log($nextLog['gid']);
?>
">
<?php
echo $nextLog['title'];
?>
</a>
<?php
}
?>
</div>
</div>
<div class="comments padding-top">
<?php
include View::getView('modules/comments');
?>
示例12: neighbor_log
function neighbor_log($neighborLog)
{
extract($neighborLog);
?>
<?php
if ($prevLog) {
?>
« <a href="<?php
echo Url::log($prevLog['gid']);
?>
"><?php
echo $prevLog['title'];
?>
</a>
<?php
}
?>
<?php
if ($nextLog && $prevLog) {
?>
|
<?php
}
?>
<?php
if ($nextLog) {
?>
<a href="<?php
echo Url::log($nextLog['gid']);
?>
"><?php
echo $nextLog['title'];
?>
</a>»
<?php
}
}
示例13: while
$Sql = "SELECT `gid`,`date`,`comnum`,`views` FROM `" . DB_PREFIX . "blog` WHERE `type` = 'blog' AND `hide` = 'n'";
$res = $DbModel->query($Sql);
while ($row = $DbModel->fetch_array($res)) {
$cache = array();
$cache['loc'] = Url::log($row['gid']);
$cache['lastmod'] = date('Y-m-d', $row['date']);
$cache['changefreq'] = 'daily';
$cache['priority'] = $row['views'] <= 500 || $row['comnum'] < 1 ? '0.9' : '1.0';
$XMLData[] = $cache;
}
#独立页面
$Sql = "SELECT `gid`,`date`,`comnum`,`views` FROM `" . DB_PREFIX . "blog` WHERE `type` = 'page' AND `hide` = 'n'";
$res = $DbModel->query($Sql);
while ($row = $DbModel->fetch_array($res)) {
$cache = array();
$cache['loc'] = Url::log($row['gid']);
$cache['lastmod'] = date('Y-m-d', $row['date']);
$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) {
示例14: neighbor_log
function neighbor_log($neighborLog)
{
extract($neighborLog);
?>
<div class="zan-page bs-example">
<ul class="pager">
<?php
if ($prevLog) {
?>
<li class="previous"><a href="<?php
echo Url::log($prevLog['gid']);
?>
" title="上一篇《<?php
echo $prevLog['title'];
?>
》">上一篇</a></li><br/>
<?php
} else {
?>
<li class="previous"><a title="上一篇:噢~这是最新的文章了">下一篇</a></li><br/>
<?php
}
if ($nextLog && $prevLog) {
}
if ($nextLog) {
?>
<li class="next"><a href="<?php
echo Url::log($nextLog['gid']);
?>
" title="下一篇《<?php
echo $nextLog['title'];
?>
》">下一篇</a></li>
<?php
} else {
?>
<li class="next"><a title="下一篇:没错,这就是小站第一篇文章">下一篇</a></li>
<?php
}
?>
</ul>
</div>
<?php
}
示例15: kl_sendmail_put_reply_mail
function kl_sendmail_put_reply_mail($commentId, $reply)
{
global $userData;
include EMLOG_ROOT . '/content/plugins/kl_sendmail/kl_sendmail_config.php';
if (KL_IS_REPLY_MAIL == 'Y') {
$DB = Database::getInstance();
$blogname = Option::get('blogname');
$Comment_Model = new Comment_Model();
$commentArray = $Comment_Model->getOneComment($commentId);
extract($commentArray);
$subject = "您在【{$blogname}】发表的评论收到了回复";
if (strpos($mail, '@139.com') === false) {
$emBlog = new Log_Model();
$logData = $emBlog->getOneLogForHome($gid);
$log_title = $logData['log_title'];
$content = "{$poster},您好:<br /><br />您之前在《{$log_title}》发表的的评论:<br />{$comment}<br /><br />{$userData['username']}给您的回复:<br />{$reply}<br /><br /><strong>您可以点击<a href=\"" . Url::log($gid) . "#{$cid}\" target=\"_blank\">查看该日志</a></strong><br /><br /><strong>感谢您对<a href=\"" . BLOG_URL . "\" target=\"_blank\">{$blogname}</a>的关注,欢迎<a href=\"" . BLOG_URL . "rss.php\">订阅本站</a></strong><br /><br />";
} else {
$content = $reply;
}
if ($mail != '') {
kl_sendmail_do(KL_MAIL_SMTP, KL_MAIL_PORT, KL_MAIL_SENDEMAIL, KL_MAIL_PASSWORD, $mail, $subject, $content, $blogname);
}
} else {
return;
}
}