Example #1
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 #2
0
<?php

/**
 * 分类管理
 * @copyright (c) Emlog All Rights Reserved
 */
require_once 'globals.php';
$Sort_Model = new Sort_Model();
$sorts = $CACHE->readCache('sort');
if ($action == '') {
    include View::getView('header');
    require_once View::getView('sort');
    include View::getView('footer');
    View::output();
}
if ($action == 'taxis') {
    $sort = isset($_POST['sort']) ? $_POST['sort'] : '';
    if (!empty($sort)) {
        foreach ($sort as $key => $value) {
            $value = intval($value);
            $key = intval($key);
            $Sort_Model->updateSort(array('taxis' => $value), $key);
        }
        $CACHE->updateCache('sort');
        emDirect("./sort.php?active_taxis=1");
    } else {
        emDirect("./sort.php?error_b=1");
    }
}
if ($action == 'add') {
    $taxis = isset($_POST['taxis']) ? intval(trim($_POST['taxis'])) : 0;
Example #3
0
    <?php 
}
?>
</ul>

<?php 
//对外合作
$sortid = 5;
?>
<div style="clear:both; height:1px; line-height:1%;"></div>
<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>
<ul class="left_4">
    <?php 
Example #4
0
        authPassword($postpwd, $cookiepwd, $password, $logid);
    }
    // comments
    $commentPage = isset($_GET['comment-page']) ? intval($_GET['comment-page']) : 1;
    $verifyCode = ISLOGIN == false && Option::get('comment_code') == 'y' ? "<img src=\"../include/lib/checkcode.php\" /><br /><input name=\"imgcode\" type=\"text\" />" : '';
    $comments = $Comment_Model->getComments(2, $logid, 'n', $commentPage);
    extract($comments);
    $Log_Model->updateViewCount($logid);
    include View::getView('header');
    include View::getView('single');
    include View::getView('footer');
    View::output();
}
if (ISLOGIN === true && $action == 'write') {
    $logid = isset($_GET['id']) ? intval($_GET['id']) : '';
    $Sort_Model = new Sort_Model();
    $sorts = $Sort_Model->getSorts();
    if ($logid) {
        $Log_Model = new Log_Model();
        $Tag_Model = new Tag_Model();
        $blogData = $Log_Model->getOneLogForAdmin($logid);
        extract($blogData);
        $tags = array();
        foreach ($Tag_Model->getTag($logid) as $val) {
            $tags[] = $val['tagname'];
        }
        $tagStr = implode(',', $tags);
    } else {
        $title = '';
        $sortid = -1;
        $content = '';
Example #5
0
 /**
  * Methode : sauver les données d'un user et de ses sorts
  */
 public function save_sorts($idUser)
 {
     $this->auto_render = FALSE;
     if (!request::is_ajax()) {
         return false;
     }
     if (($value = $this->input->post('sort')) !== FALSE) {
         $sort = Sort_Model::instance();
         $sort->user_delete_all($idUser);
         foreach ($value as $key => $row) {
             if ($row) {
                 $sort->insert_user($idUser, $key);
             }
         }
     }
 }