Example #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;
     $record = isset($params[1]) && $params[1] == 'record' ? intval($params[2]) : '';
     $GLOBALS['record'] = $record;
     //for sidebar calendar
     $pageurl = '';
     //page meta
     $site_title = $record . ' - ' . $site_title;
     if (preg_match("/^([\\d]{4})([\\d]{2})\$/", $record, $match)) {
         $days = getMonthDayNum($match[2], $match[1]);
         $record_stime = emStrtotime($record . '01');
         $record_etime = $record_stime + 3600 * 24 * $days;
     } else {
         $record_stime = emStrtotime($record);
         $record_etime = $record_stime + 3600 * 24;
     }
     $sqlSegment = "and date>={$record_stime} and date<{$record_etime} order by date desc";
     $lognum = $Log_Model->getLogNum('n', $sqlSegment);
     $total_pages = ceil($lognum / $index_lognum);
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $start_limit = ($page - 1) * $index_lognum;
     $pageurl .= Url::record($record, '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');
 }
Example #2
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');
 }
Example #3
0
 function display($params)
 {
     $Log_Model = new Log_Model();
     $CACHE = Cache::getInstance();
     $options_cache = Option::getAll();
     extract($options_cache);
     $page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
     $author = isset($params[1]) && $params[1] == 'author' ? intval($params[2]) : '';
     $pageurl = '';
     $user_cache = $CACHE->readCache('user');
     if (!isset($user_cache[$author])) {
         show_404_page();
     }
     $author_name = $user_cache[$author]['name'];
     //page meta
     $site_title = $author_name . ' - ' . $site_title;
     $sqlSegment = "and author={$author} order by date desc";
     $sta_cache = $CACHE->readCache('sta');
     $lognum = $sta_cache[$author]['lognum'];
     $total_pages = ceil($lognum / $index_lognum);
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $start_limit = ($page - 1) * $index_lognum;
     $pageurl .= Url::author($author, 'page');
     $Log_Model = new Log_Model();
     $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');
 }
Example #4
0
 function display($params)
 {
     $Log_Model = new Log_Model();
     $CACHE = Cache::getInstance();
     $options_cache = Option::getAll();
     extract($options_cache);
     $page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
     $sortid = '';
     if (!empty($params[2])) {
         if (is_numeric($params[2])) {
             $sortid = intval($params[2]);
         } else {
             $sort_cache = $CACHE->readCache('sort');
             foreach ($sort_cache as $key => $value) {
                 $alias = addslashes(urldecode(trim($params[2])));
                 if (array_search($alias, $value, true)) {
                     $sortid = $key;
                     break;
                 }
             }
         }
     }
     $pageurl = '';
     $sort_cache = $CACHE->readCache('sort');
     if (!isset($sort_cache[$sortid])) {
         show_404_page();
     }
     $sort = $sort_cache[$sortid];
     $sortName = $sort['sortname'];
     //page meta
     $site_title = $sortName . ' - ' . $site_title;
     if (!empty($sort_cache[$sortid]['description'])) {
         $site_description = $sort_cache[$sortid]['description'];
     }
     if ($sort['pid'] != 0 || empty($sort['children'])) {
         $sqlSegment = "and sortid={$sortid}";
     } else {
         $sortids = array_merge(array($sortid), $sort['children']);
         $sqlSegment = "and sortid in (" . implode(',', $sortids) . ")";
     }
     $sqlSegment .= " order by sortop desc, date desc";
     $lognum = $Log_Model->getLogNum('n', $sqlSegment);
     $total_pages = ceil($lognum / $index_lognum);
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $pageurl .= Url::sort($sortid, 'page');
     $logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
     $page_url = pagination($lognum, $index_lognum, $page, $pageurl);
     $template = !empty($sort['template']) && file_exists(TEMPLATE_PATH . $sort['template'] . '.php') ? $sort['template'] : 'log_list';
     include View::getView('header');
     include View::getView($template);
 }
Example #5
0
 /**
  * 单例
  * @return Log_Model
  */
 public static function &instance()
 {
     if (!is_object(Log_Model::$instances)) {
         // Create a new instance
         Log_Model::$instances = new Log_Model();
     }
     return Log_Model::$instances;
 }
Example #6
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;
     $keyword = isset($params[1]) && $params[1] == 'keyword' ? trim($params[2]) : '';
     $keyword = addslashes(htmlspecialchars(urldecode($keyword)));
     $keyword = str_replace(array('%', '_'), array('\\%', '\\_'), $keyword);
     $pageurl = '';
     $sqlSegment = "and title like '%{$keyword}%' order by date desc";
     $lognum = $Log_Model->getLogNum('n', $sqlSegment);
     $total_pages = ceil($lognum / $index_lognum);
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $pageurl .= BLOG_URL . '?keyword=' . urlencode($keyword) . '&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');
 }
Example #7
0
            if ($action == 'add') {
                emDirect("./page.php?active_hide_n=1");
                //页面发布成功
            } else {
                emDirect("./page.php?active_savepage=1");
                //页面保存成功
            }
            break;
    }
}
//操作页面
if ($action == 'operate_page') {
    $operate = isset($_POST['operate']) ? $_POST['operate'] : '';
    $pages = isset($_POST['page']) ? array_map('intval', $_POST['page']) : array();
    LoginAuth::checkToken();
    $emPage = new Log_Model();
    switch ($operate) {
        case 'del':
            foreach ($pages as $value) {
                $emPage->deleteLog($value);
                unset($navibar[$value]);
            }
            $navibar = addslashes(serialize($navibar));
            Option::updateOption('navibar', $navibar);
            $CACHE->updateCache(array('options', 'sta', 'comment', 'logalias'));
            emDirect("./page.php?active_del=1");
            break;
        case 'hide':
        case 'pub':
            $ishide = $operate == 'hide' ? 'y' : 'n';
            foreach ($pages as $value) {
Example #8
0
 function displayContent($params)
 {
     $comment_page = isset($params[4]) && $params[4] == 'comment-page' ? intval($params[5]) : 1;
     $Log_Model = new Log_Model();
     $CACHE = Cache::getInstance();
     $options_cache = $CACHE->readCache('options');
     extract($options_cache);
     $logid = 0;
     if (isset($params[1])) {
         if ($params[1] == 'post') {
             $logid = isset($params[2]) ? intval($params[2]) : 0;
         } elseif (is_numeric($params[1])) {
             $logid = intval($params[1]);
         } else {
             $logalias_cache = $CACHE->readCache('logalias');
             if (!empty($logalias_cache)) {
                 $alias = addslashes(urldecode(trim($params[1])));
                 $logid = array_search($alias, $logalias_cache);
                 if (!$logid) {
                     show_404_page();
                 }
             }
         }
     }
     $Comment_Model = new Comment_Model();
     $logData = $Log_Model->getOneLogForHome($logid);
     if ($logData === false) {
         show_404_page();
     }
     extract($logData);
     if (!empty($password)) {
         $postpwd = isset($_POST['logpwd']) ? addslashes(trim($_POST['logpwd'])) : '';
         $cookiepwd = isset($_COOKIE['em_logpwd_' . $logid]) ? addslashes(trim($_COOKIE['em_logpwd_' . $logid])) : '';
         $Log_Model->AuthPassword($postpwd, $cookiepwd, $password, $logid);
     }
     //meta
     switch ($log_title_style) {
         case '0':
             $site_title = $log_title;
             break;
         case '1':
             $site_title = $log_title . ' - ' . $blogname;
             break;
         case '2':
             $site_title = $log_title . ' - ' . $site_title;
             break;
     }
     $site_description = extractHtmlData($log_content, 90);
     $log_cache_tags = $CACHE->readCache('logtags');
     if (!empty($log_cache_tags[$logid])) {
         foreach ($log_cache_tags[$logid] as $value) {
             $site_key .= ',' . $value['tagname'];
         }
     }
     //comments
     $verifyCode = ISLOGIN == false && $comment_code == 'y' ? "<img src=\"" . BLOG_URL . "include/lib/checkcode.php\" align=\"absmiddle\" /><input name=\"imgcode\" type=\"text\" class=\"input\" size=\"5\" tabindex=\"5\" />" : '';
     $ckname = isset($_COOKIE['commentposter']) ? htmlspecialchars(stripslashes($_COOKIE['commentposter'])) : '';
     $ckmail = isset($_COOKIE['postermail']) ? htmlspecialchars($_COOKIE['postermail']) : '';
     $ckurl = isset($_COOKIE['posterurl']) ? htmlspecialchars($_COOKIE['posterurl']) : '';
     $comments = $Comment_Model->getComments(0, $logid, 'n', $comment_page);
     include View::getView('header');
     if ($type == 'blog') {
         $Log_Model->updateViewCount($logid);
         $neighborLog = $Log_Model->neighborLog($timestamp);
         $tb = array();
         $tb_url = '';
         //兼容未删除引用模板
         include View::getView('echo_log');
     } elseif ($type == 'page') {
         $template = !empty($template) && file_exists(TEMPLATE_PATH . $template . '.php') ? $template : 'page';
         include View::getView($template);
     }
 }
Example #9
0
<?php

/**
 * 保存文章(增加、修改)
 * @copyright (c) Emlog All Rights Reserved
 */
require_once 'globals.php';
$Log_Model = new Log_Model();
$Tag_Model = new Tag_Model();
$title = isset($_POST['title']) ? addslashes(trim($_POST['title'])) : '';
$postDate = isset($_POST['postdate']) ? trim($_POST['postdate']) : '';
$date = isset($_POST['date']) ? addslashes($_POST['date']) : '';
//修改前的文章时间
$sort = isset($_POST['sort']) ? intval($_POST['sort']) : '';
$tagstring = isset($_POST['tag']) ? addslashes(trim($_POST['tag'])) : '';
$content = isset($_POST['content']) ? addslashes(trim($_POST['content'])) : '';
$excerpt = isset($_POST['excerpt']) ? addslashes(trim($_POST['excerpt'])) : '';
$author = isset($_POST['author']) && ROLE == ROLE_ADMIN ? intval(trim($_POST['author'])) : UID;
$blogid = isset($_POST['as_logid']) ? intval(trim($_POST['as_logid'])) : -1;
//如被自动保存为草稿则有blog id号
$alias = isset($_POST['alias']) ? addslashes(trim($_POST['alias'])) : '';
$top = isset($_POST['top']) ? addslashes(trim($_POST['top'])) : 'n';
$sortop = isset($_POST['sortop']) ? addslashes(trim($_POST['sortop'])) : 'n';
$allow_remark = isset($_POST['allow_remark']) ? addslashes(trim($_POST['allow_remark'])) : 'n';
$ishide = isset($_POST['ishide']) && !empty($_POST['ishide']) && !isset($_POST['pubdf']) ? addslashes($_POST['ishide']) : 'n';
$password = isset($_POST['password']) ? addslashes(trim($_POST['password'])) : '';
$postTime = $Log_Model->postDate(Option::get('timezone'), $postDate, $date);
LoginAuth::checkToken();
//check alias
if (!empty($alias)) {
    $logalias_cache = $CACHE->readCache('logalias');
Example #10
0
function widget_random_log($title)
{
    $index_randlognum = Option::get('index_randlognum');
    $Log_Model = new Log_Model();
    $randLogs = $Log_Model->getRandLog($index_randlognum);
    ?>
	<li>
	<h3><span><?php 
    echo $title;
    ?>
</span></h3>
	<ul id="randlog">
	<?php 
    foreach ($randLogs as $value) {
        ?>
	<li><a href="<?php 
        echo Url::log($value['gid']);
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
	<?php 
    }
    ?>
	</ul>
	</li>
<?php 
}
Example #11
0
<?php

/**
 * 管理文章
 * @copyright (c) Emlog All Rights Reserved
 */
require_once 'globals.php';
$Log_Model = new Log_Model();
//显示文章(草稿)管理页面
if ($action == '') {
    $Tag_Model = new Tag_Model();
    $User_Model = new User_Model();
    $pid = isset($_GET['pid']) ? $_GET['pid'] : '';
    $tagId = isset($_GET['tagid']) ? intval($_GET['tagid']) : '';
    $sid = isset($_GET['sid']) ? intval($_GET['sid']) : '';
    $uid = isset($_GET['uid']) ? intval($_GET['uid']) : '';
    $keyword = isset($_GET['keyword']) ? addslashes($_GET['keyword']) : '';
    $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
    $checked = isset($_GET['checked']) ? addslashes($_GET['checked']) : '';
    $sortView = isset($_GET['sortView']) && $_GET['sortView'] == 'ASC' ? 'DESC' : 'ASC';
    $sortComm = isset($_GET['sortComm']) && $_GET['sortComm'] == 'ASC' ? 'DESC' : 'ASC';
    $sortDate = isset($_GET['sortDate']) && $_GET['sortDate'] == 'DESC' ? 'ASC' : 'DESC';
    $sqlSegment = '';
    if ($tagId) {
        $blogIdStr = $Tag_Model->getTagById($tagId);
        $sqlSegment = "and gid IN ({$blogIdStr})";
    } elseif ($sid) {
        $sqlSegment = "and sortid={$sid}";
    } elseif ($uid) {
        $sqlSegment = "and author={$uid}";
    } elseif ($checked) {
Example #12
0
/**
 * 读取文章信息
 */
function mw_getPost($args)
{
    global $options_cache;
    escape($args);
    $post_ID = intval($args[0]);
    $username = $args[1];
    $password = $args[2];
    $user = login($username, $password);
    $Log_Model = new Log_Model();
    define('UID', $user['uid']);
    $post = $Log_Model->getOneLogForAdmin($post_ID);
    if (empty($post)) {
        return error_message(404, '对不起,您访问的文章不存在');
    }
    $log_cache_tags = Cache::getInstance()->readCache('logtags');
    $tags = '';
    if (!empty($log_cache_tags[$post['gid']])) {
        foreach ($log_cache_tags[$post['gid']] as $tag) {
            $tags[] = $tag['tagname'];
        }
        $tags = implode(',', $tags);
    }
    $Sort_Model = new Sort_Model();
    $sort_name = $Sort_Model->getSortName($post['sortid']);
    $post['date'] = getIso($post['date']);
    $xml = "\n\t<struct>\n\t\t<member>\n\t\t\t<name>categories</name>\n\t\t\t\t<value>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<data>\n\t\t\t\t\t\t\t<value>{$sort_name}</value>\n\t\t\t\t\t\t</data>\n\t\t\t\t\t</array>\n\t\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>mt_keywords</name>\n\t\t\t<value>\n\t\t\t\t<string>{$tags}</string>\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>dateCreated</name>\n\t\t\t<value>\n\t\t\t\t<dateTime.iso8601>{$post['date']}</dateTime.iso8601>\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>description</name>\n\t\t\t<value>\n\t\t\t\t{$post['content']}\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>link</name>\n\t\t\t<value>{$options_cache['blogurl']}index.php?post={$post['gid']}</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>postid</name>\n\t\t\t<value>\n\t\t\t\t<string>{$post['gid']}</string>\n\t\t\t</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>title</name>\n\t\t\t<value>{$post['title']}</value>\n\t\t</member>\n\t\t<member>\n\t\t\t<name>publish</name>\n\t\t\t<value>\n\t\t\t\t<boolean>1</boolean>\n\t\t\t</value>\n\t\t</member>\n\t</struct>\n\t";
    response($xml);
}
Example #13
0
        $title = '';
        $sortid = -1;
        $content = '';
        $excerpt = '';
        $tagStr = '';
        $logid = -1;
        $author = UID;
        $date = '';
    }
    include View::getView('header');
    include View::getView('write');
    include View::getView('footer');
    View::output();
}
if (ISLOGIN === true && $action == 'savelog') {
    $Log_Model = new Log_Model();
    $Tag_Model = new Tag_Model();
    LoginAuth::checkToken();
    $title = isset($_POST['title']) ? addslashes(trim($_POST['title'])) : '';
    $sort = isset($_POST['sort']) ? intval($_POST['sort']) : '';
    $content = isset($_POST['content']) ? addslashes(trim($_POST['content'])) : '';
    $excerpt = isset($_POST['excerpt']) ? addslashes(trim($_POST['excerpt'])) : '';
    $tagstring = isset($_POST['tag']) ? addslashes(trim($_POST['tag'])) : '';
    $blogid = isset($_POST['gid']) ? intval(trim($_POST['gid'])) : -1;
    $date = isset($_POST['date']) ? addslashes($_POST['date']) : '';
    $author = isset($_POST['author']) ? intval(trim($_POST['author'])) : UID;
    $postTime = $Log_Model->postDate(Option::get('timezone'), $date);
    $logData = array('title' => $title, 'content' => $content, 'excerpt' => $excerpt, 'author' => $author, 'sortid' => $sort, 'date' => $postTime, 'allow_remark' => 'y', 'hide' => 'n', 'password' => '', 'checked' => $user_cache[UID]['ischeck'] == 'y' ? 'n' : 'y');
    if ($blogid > 0) {
        $Log_Model->updateLog($logData, $blogid);
        $Tag_Model->updateTag($tagstring, $blogid);
Example #14
0
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;
    }
}
Example #15
0
<?php

if (!defined('EMLOG_ROOT')) {
    exit('error!');
}
$Log_Model = new Log_Model();
?>
<div class="left">
<?php 
//新闻动态
$sortid = 4;
?>
<div class="title"><a href="<?php 
echo Url::sort($sortid);
?>
">最新动态</a>
    <?php 
$Sort_Model = new Sort_Model();
$sorts = $Sort_Model->getChildSorts($sortid);
$sort_ids_str = $sortid;
foreach ($sorts as $val) {
    $sort_ids_str .= ',' . $val['sid'];
    echo " | <a class=\"title_1\" href=\"" . Url::sort($val['sid']) . "\">{$val['sortname']}</a>";
}
?>
</div>
<div class="more"><a href="<?php 
echo Url::sort($sortid);
?>
">更多></a></div>
<div style="clear:both; height:10px; line-height:1%;"></div>
Example #16
0
function widget_hotlog($title)
{
    $index_hotlognum = Option::get('index_hotlognum');
    $Log_Model = new Log_Model();
    $hotLogs = $Log_Model->getHotLog($index_hotlognum);
    ?>
    <h4><?php 
    echo $title;
    ?>
</h4>
    <ul class="list-unstyled">
        <?php 
    foreach ($hotLogs as $value) {
        ?>
        <li><a href="<?php 
        echo Url::log($value['gid']);
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
        <?php 
    }
    ?>
    </ul>
<?php 
}
Example #17
0
function widget_newlog($title)
{
    ?>
<div id="tab-title"><h3><span class="">最新文章</span><span class="">热门文章</span><span class="selected">随机文章</span></h3>
	<div id="tab-content">
		<?php 
    global $CACHE;
    $newLogs_cache = $CACHE->readCache('newlog');
    ?>
		<ul class="hide" style="display: none; ">
		<?php 
    foreach ($newLogs_cache as $value) {
        ?>
			<li><a href="<?php 
        echo Url::log($value['gid']);
        ?>
" rel="bookmark" title="详细阅读<?php 
        echo $value['title'];
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
		<?php 
    }
    ?>
		</ul>
		<?php 
    $index_hotlognum = Option::get('index_hotlognum');
    $Log_Model = new Log_Model();
    $randLogs = $Log_Model->getHotLog($index_hotlognum);
    ?>
		<ul class="hide" style="display: none; ">
		<?php 
    foreach ($randLogs as $value) {
        ?>
			<li><a href="<?php 
        echo Url::log($value['gid']);
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
		<?php 
    }
    ?>
		</ul>
		<?php 
    $index_randlognum = Option::get('index_randlognum');
    $Log_Model = new Log_Model();
    $randLogs = $Log_Model->getRandLog($index_randlognum);
    ?>
		<ul class="hide" style="display: block; ">
		<?php 
    foreach ($randLogs as $value) {
        ?>
			<li><a href="<?php 
        echo Url::log($value['gid']);
        ?>
" rel="bookmark" title="详细阅读 <?php 
        echo $value['title'];
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
		<?php 
    }
    ?>
		</ul>
	</div>
</div>
<?php 
}
Example #18
0
<?php

/**
 * 链接管理
 * @copyright (c) Emlog All Rights Reserved
 */
require_once 'globals.php';
$Navi_Model = new Navi_Model();
if ($action == '') {
    $emPage = new Log_Model();
    $navis = $Navi_Model->getNavis();
    $sorts = $CACHE->readCache('sort');
    $pages = $emPage->getAllPageList();
    include View::getView('header');
    require_once View::getView('navbar');
    include View::getView('footer');
    View::output();
}
if ($action == 'taxis') {
    $navi = isset($_POST['navi']) ? $_POST['navi'] : '';
    if (!empty($navi)) {
        foreach ($navi as $key => $value) {
            $value = intval($value);
            $key = intval($key);
            $Navi_Model->updateNavi(array('taxis' => $value), $key);
        }
        $CACHE->updateCache('navi');
        emDirect("./navbar.php?active_taxis=1");
    } else {
        emDirect("./navbar.php?error_b=1");
    }
Example #19
0
File: module.php Project: jnan77/J2
function widget_random_log($title)
{
    $index_randlognum = Option::get('index_randlognum');
    $Log_Model = new Log_Model();
    $randLogs = $Log_Model->getRandLog($index_randlognum);
    ?>
	<div class="widget widget_random_log widget_log_list">
		<h3><span><?php 
    echo $title;
    ?>
</span></h3>
		<ul class="J_log_list">
			<?php 
    foreach ($randLogs as $value) {
        ?>
			<li><i class="fa fa-list"></i> <a href="<?php 
        echo Url::log($value['gid']);
        ?>
" title="<?php 
        echo $value['title'];
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
			<?php 
    }
    ?>
		</ul>
	</div>
<?php 
}
Example #20
0
//显示撰写文章页面
if ($action == '') {
    $Tag_Model = new Tag_Model();
    $Sort_Model = new Sort_Model();
    $sorts = $CACHE->readCache('sort');
    $tags = $Tag_Model->getTag();
    $localtime = time() + Option::get('timezone') * 3600;
    $postDate = gmdate('Y-m-d H:i:s', $localtime);
    include View::getView('header');
    require_once View::getView('add_log');
    include View::getView('footer');
    View::output();
}
//显示编辑文章页面
if ($action == 'edit') {
    $Log_Model = new Log_Model();
    $Tag_Model = new Tag_Model();
    $Sort_Model = new Sort_Model();
    $logid = isset($_GET['gid']) ? intval($_GET['gid']) : '';
    $blogData = $Log_Model->getOneLogForAdmin($logid);
    extract($blogData);
    $orig_date = $date - Option::get('timezone') * 3600;
    $sorts = $CACHE->readCache('sort');
    //log tag
    $tags = array();
    foreach ($Tag_Model->getTag($logid) as $val) {
        $tags[] = $val['tagname'];
    }
    $tagStr = implode(',', $tags);
    //old tag
    $tags = $Tag_Model->getTag();
Example #21
0
$user_cache = $CACHE->readCache('user');
$tag_cache = $CACHE->readCache('tags');
$sort_cache = $CACHE->readCache('sort');
$newtws_cache = $CACHE->readCache('newtw');
$com_cache = $CACHE->readCache('comment');
$newLogs_cache = $CACHE->readCache('newlog');
$record_cache = $CACHE->readCache('record');
// 文章所属分类
$log_cache_sort = $CACHE->readCache('logsort');
// 文章标签
$log_cache_tags = $CACHE->readCache('logtags');
$istwitter = Option::get('istwitter');
// 热门文章 && 随机文章
$index_hotlognum = Option::get('index_hotlognum');
$index_randlognum = Option::get('index_randlognum');
$Log_Model = new Log_Model();
$hotLogs = $Log_Model->getHotLog($index_hotlognum);
$randLogs = $Log_Model->getRandLog($index_randlognum);
global $widgets_exist;
global $widgets_num;
global $widgets_arr;
$widgets_exist = array();
$widgets_num = 0;
$widgets_arr = array('home');
// 个人资料
function widget_blogger($title, $exists = true)
{
    global $widgets_exist;
    $widgets_exist['blogger']['title'] = $title;
    $widgets_exist['blogger']['exists'] = $exists;
}
Example #22
0
function widget_random_log($title)
{
    $index_randlognum = Option::get('index_randlognum');
    $Log_Model = new Log_Model();
    $randLogs = $Log_Model->getRandLog($index_randlognum);
    ?>
	<aside id="tag_cloud-4" class="widget widget_tag_cloud">
	<h3 class="panel-heading widget-title"><?php 
    echo $title;
    ?>
</h3>
	<ul id="newcomment">
	<?php 
    foreach ($randLogs as $value) {
        ?>
	<li><a href="<?php 
        echo Url::log($value['gid']);
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
	<?php 
    }
    ?>
	</ul>
	</aside>
<?php 
}
Example #23
0
/**
 * 附件处理 11
 * @copyright (c) Emlog All Rights Reserved
 */
require_once 'globals.php';
require_once "qiniu/io.php";
require_once "qiniu/rs.php";
$DB = Database::getInstance();
//上传表单显示
if ($action == 'selectFile') {
    $attachnum = 0;
    $logid = isset($_GET['logid']) ? intval($_GET['logid']) : '';
    $multi = isset($_GET['multi']) ? intval($_GET['multi']) : 0;
    if ($logid) {
        $Log_Model = new Log_Model();
        $row = $Log_Model->getOneLogForAdmin($logid);
        $attachnum = (int) $row['attnum'];
    }
    $maxsize = changeFileSize(Option::getAttMaxSize());
    //允许附件类型
    $att_type_str = '';
    $att_type_for_muti = '';
    foreach (Option::getAttType() as $val) {
        $att_type_str .= " {$val}";
        $att_type_for_muti .= '*.' . $val . ';';
    }
    $view_tpl = $multi ? 'upload_multi' : 'upload';
    require_once View::getView($view_tpl);
    View::output();
}
Example #24
0
 public function __construct()
 {
     parent::__construct();
     $this->model = Log_Model::instance();
 }
Example #25
0
function widget_random_log($title)
{
    $index_randlognum = Option::get('index_randlognum');
    $Log_Model = new Log_Model();
    $randLogs = $Log_Model->getRandLog($index_randlognum);
    ?>
		<aside class="widget clearfix widget_recent_entries" id="recent-posts">
		<h3 class="widget-title"><?php 
    echo $title;
    ?>
</h3>
		<ul>
		<?php 
    foreach ($randLogs as $value) {
        ?>
		<li><a title="<?php 
        echo $value['title'];
        ?>
" href="<?php 
        echo Url::log($value['gid']);
        ?>
"><?php 
        echo $value['title'];
        ?>
</a></li>
		<?php 
    }
    ?>
		</ul>
	</aside>
<?php 
}