コード例 #1
0
 /**
  * Build an URL with the specified request params
  *
  * By calling $xoops->buildUrl
  */
 function art_buildUrl($url, $params = array())
 {
     $url = $GLOBALS["xoops"]->buildUrl($url);
     if (!empty($params)) {
         $args = array_flip($GLOBALS["art_args"]);
         foreach ($params as $k => $v) {
             if (isset($args[$k])) {
                 $params[$k] = $args[$k] . rawurlencode($v);
             } else {
                 $params[$k] = rawurlencode($v);
             }
         }
         art_define_url_delimiter();
         $url .= URL_DELIMITER . implode('&', $params);
     }
     return $url;
 }
コード例 #2
0
function b_marquee_article($limit, $dateformat, $itemsize)
{
    global $xoopsDB;
    include_once XOOPS_ROOT_PATH . '/modules/marquee/include/functions.php';
    require_once XOOPS_ROOT_PATH . "/modules/article/include/functions.php";
    $block = array();
    $myts =& MyTextSanitizer::getInstance();
    static $access_cats;
    $artConfig = art_load_config();
    art_define_url_delimiter();
    $select = "art_id";
    $disp_tag = "";
    $from = "";
    $where = "";
    $order = "art_time_publish DESC";
    $select .= ", cat_id, art_title, uid, art_time_publish";
    if (!isset($access_cats)) {
        $permission_handler =& xoops_getmodulehandler("permission", "article");
        $access_cats =& $permission_handler->getCategories("access");
    }
    $allowed_cats = $access_cats;
    $query = "SELECT {$select} FROM " . art_DB_prefix("article") . $from;
    $query .= " WHERE cat_id IN (" . implode(",", $allowed_cats) . ") AND art_time_publish >0 " . $where;
    $query .= " ORDER BY " . $order;
    $query .= " LIMIT 0, " . $limit;
    if (!($result = $xoopsDB->query($query))) {
        return false;
    }
    $rows = array();
    $author = array();
    while ($row = $xoopsDB->fetchArray($result)) {
        $rows[] = $row;
        $author[$row["uid"]] = 1;
    }
    if (count($rows) < 1) {
        return false;
    }
    $author_name = XoopsUser::getUnameFromId(array_keys($author));
    $arts = array();
    $uids = array();
    $cids = array();
    $article_handler =& xoops_getmodulehandler("article", "article");
    foreach ($rows as $row) {
        $article =& $article_handler->create(false);
        $article->assignVars($row);
        $_art = array();
        foreach ($row as $tag => $val) {
            $_art[$tag] = @$article->getVar($tag);
        }
        $_art["author"] = $author_name[$row["uid"]];
        $_art["date"] = $article->getTime($dateformat);
        $titlelength = $itemsize + 3;
        $_art["title"] = xoops_substr($_art["art_title"], 0, $titlelength);
        $_art["category"] = '';
        $delimiter = "/";
        $_art["link"] = "<a href=\"" . XOOPS_URL . "modules/article/view.article.php{$delimiter}" . $_art["art_id"] . "/c" . $_art["cat_id"] . "\"><strong>" . $_art["art_title"] . "</strong></a>";
        $arts[] = $_art;
        unset($article, $_art);
        $cids[$row["cat_id"]] = 1;
    }
    $block = $arts;
    return $block;
}
コード例 #3
0
ファイル: header.php プロジェクト: trabisdementia/xuups
<?php

/**
 * Article module for XOOPS
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <*****@*****.**>
 * @version         $Id: header.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "../../../include/cp_header.php";
require XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
require_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/functions.php";
include_once XOOPS_ROOT_PATH . "/Frameworks/art/functions.admin.php";
xoops_loadLanguage("main", $xoopsModule->getVar("dirname"));
art_define_url_delimiter();
$myts =& MyTextSanitizer::getInstance();