当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsUser::getUnameFromId方法代码示例

本文整理汇总了PHP中XoopsUser::getUnameFromId方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsUser::getUnameFromId方法的具体用法?PHP XoopsUser::getUnameFromId怎么用?PHP XoopsUser::getUnameFromId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsUser的用法示例。


在下文中一共展示了XoopsUser::getUnameFromId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: b_marquee_xfsection

function b_marquee_xfsection($limit, $dateformat, $itemssize)
{
    $block = array();
    global $xoopsDB;
    if (!function_exists('xfblock_checkAccess')) {
        include_once XOOPS_ROOT_PATH . "/modules/xfsection/include/xfblock_groupaccess.php";
    }
    $myts =& MyTextSanitizer::getInstance();
    $sql = "SELECT articleid, title, published, expired, counter, groupid, uid FROM " . $xoopsDB->prefix("xfs_article") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") AND noshowart = 0 AND offline = 0 ORDER BY published DESC";
    $result = $xoopsDB->query($sql, $limit, 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (xfblock_checkAccess($myrow["groupid"])) {
            $wfs = array();
            $title = $myts->htmlSpecialChars($myrow["title"]);
            if (!XOOPS_USE_MULTIBYTES) {
                if ($itemssize > 0) {
                    $title = $myts->htmlSpecialChars(substr($myrow['title'], 0, $itemssize - 1));
                } else {
                    $title = $myts->htmlSpecialChars($myrow['title']);
                }
            }
            $block[] = array('date' => formatTimestamp($myrow['published'], $dateformat), 'category' => '', 'author' => XoopsUser::getUnameFromId($myrow['uid']), 'title' => $title, 'link' => "<a href='" . XOOPS_URL . '/modules/xfsection/article.php?articleid=' . $myrow['articleid'] . "'>" . $title . '</a>');
        }
    }
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:26,代码来源:xfsection.php

示例2: tadgallery_show_re

function tadgallery_show_re($options)
{
    global $xoopsDB;
    $limit = empty($options[0]) ? 10 : intval($options[0]);
    $userinfo = empty($options[1]) ? 0 : intval($options[1]);
    $showall = empty($options[2]) ? 0 : intval($options[2]);
    $modhandler =& xoops_gethandler('module');
    $xoopsModule =& $modhandler->getByDirname("tadgallery");
    $com_modid = $xoopsModule->getVar('mid');
    $sql = "select a.com_id,a.com_text,a.com_itemid,a.com_uid,b.title,b.filename,b.uid from " . $xoopsDB->prefix("xoopscomments") . " as a left join " . $xoopsDB->prefix("tad_gallery") . " as b on a.com_itemid=b.sn where a.com_modid='{$com_modid}' order by a.com_modified desc limit 0,{$limit}";
    $result = $xoopsDB->query($sql);
    $block = $comment = "";
    $i = 0;
    while (list($com_id, $txt, $nsn, $uid, $title, $filename, $poster_uid) = $xoopsDB->fetchRow($result)) {
        $uid_name = XoopsUser::getUnameFromId($uid, 1);
        $poster_uid_name = XoopsUser::getUnameFromId($poster_uid, 1);
        $comment[$i]['uid'] = $uid;
        $comment[$i]['uid_name'] = empty($uid_name) ? XoopsUser::getUnameFromId($uid, 0) : $uid_name;
        $comment[$i]['poster_uid'] = $poster_uid;
        $comment[$i]['poster_uid_name'] = empty($poster_uid_name) ? XoopsUser::getUnameFromId($poster_uid, 0) : $poster_uid_name;
        $comment[$i]['nsn'] = $nsn;
        $comment[$i]['com_id'] = $com_id;
        $comment[$i]['txt'] = $txt;
        $comment[$i]['title'] = empty($title) ? $filename : $title;
        $i++;
    }
    $block['showall'] = $showall;
    $block['userinfo'] = $userinfo;
    $block['comment'] = $comment;
    return $block;
}
开发者ID:geek01,项目名称:tadgallery,代码行数:31,代码来源:tadgallery_re_block.php

示例3: getValues

 public function getValues($keys = null, $format = null, $maxDepth = null)
 {
     $page = Page::getInstance();
     $ret = parent::getValues($keys, $format, $maxDepth);
     $ret['rating'] = number_format($this->getVar('content_rating'), 1);
     // these next two lines are rather silly
     $ret['content_authorid'] = $this->getVar('content_author');
     $ret['content_author'] = XoopsUser::getUnameFromId($this->getVar('content_author'), true);
     $ret['content_date'] = XoopsLocale::formatTimestamp($this->getVar('content_create'), $page->getConfig('page_dateformat'));
     $ret['content_time'] = XoopsLocale::formatTimestamp($this->getVar('content_create'), $page->getConfig('page_timeformat'));
     $ret['content_rating'] = number_format($this->getVar('content_rating'), 2);
     return $ret;
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:13,代码来源:page_content.php

示例4: addOptionUsers

 function addOptionUsers($gid = 0)
 {
     list($cuid) = $this->getValue();
     $max = _CC_MAX_USERS;
     $start = isset($_REQUEST['start']) ? intval($_REQUEST['start']) : 0;
     $users = cc_group_users($gid, $max, $start);
     $opts = $this->getOptions();
     // force insert current if none
     if ($cuid && !isset($users[$cuid]) && !isset($opts[$cuid])) {
         $users[$cuid] = XoopsUser::getUnameFromId($cuid);
     }
     $this->addOptionArray($users);
     $this->setPageNav($gid);
 }
开发者ID:nbuy,项目名称:xoops-modules-ccenter,代码行数:14,代码来源:myformselect.php

示例5: yogurt_iteminfo

function yogurt_iteminfo($category, $item_id)
{
    $module_handler =& xoops_gethandler('module');
    $module =& $module_handler->getByDirname('yogurt');
    if ($category == 'global') {
        $item['name'] = '';
        $item['url'] = '';
        return $item;
    }
    global $xoopsDB;
    if ($category == 'picture') {
        $sql = 'SELECT title,uid_owner,url FROM ' . $xoopsDB->prefix('yogurt_images') . ' WHERE uid_owner = ' . $item_id . ' LIMIT 1';
        $result = $xoopsDB->query($sql);
        $result_array = $xoopsDB->fetchArray($result);
        /**
         * Let's get the user name of the owner of the album
         */
        $owner = new XoopsUser();
        $identifier = $owner->getUnameFromId($result_array['uid_owner']);
        $item['name'] = $identifier . "'s Album";
        $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/album.php?uid=' . $result_array['uid_owner'];
        return $item;
    }
    if ($category == 'video') {
        $sql = 'SELECT video_id,uid_owner,video_desc,youtube_code, mainvideo FROM ' . $xoopsDB->prefix('yogurt_images') . ' WHERE uid_owner = ' . $item_id . ' LIMIT 1';
        $result = $xoopsDB->query($sql);
        $result_array = $xoopsDB->fetchArray($result);
        /**
         * Let's get the user name of the owner of the album
         */
        $owner = new XoopsUser();
        $identifier = $owner->getUnameFromId($result_array['uid_owner']);
        $item['name'] = $identifier . "'s Videos";
        $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/seutubo.php?uid=' . $result_array['uid_owner'];
        return $item;
    }
    if ($category == 'scrap') {
        $sql = 'SELECT scrap_id, scrap_from, scrap_to, scrap_text FROM ' . $xoopsDB->prefix('yogurt_scraps') . ' WHERE scrap_from = ' . $item_id . ' LIMIT 1';
        $result = $xoopsDB->query($sql);
        $result_array = $xoopsDB->fetchArray($result);
        /**
         * Let's get the user name of the owner of the album
         */
        $owner = new XoopsUser();
        $identifier = $owner->getUnameFromId($result_array['scrap_from']);
        $item['name'] = $identifier . "'s Scraps";
        $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/scrapbook.php?uid=' . $result_array['scrap_from'];
        return $item;
    }
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:50,代码来源:notification.inc.php

示例6: uname

 /**
  * Returns the user name for the current keyword (if the parameter is null)
  */
 function uname($uid = 0)
 {
     global $xoopsConfig;
     static $tblusers = array();
     $option = -1;
     if (empty($uid)) {
         $uid = $this->getVar('uid');
     }
     if (is_array($tblusers) && array_key_exists($uid, $tblusers)) {
         return $tblusers[$uid];
     }
     $tblusers[$uid] = XoopsUser::getUnameFromId($uid);
     return $tblusers[$uid];
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:17,代码来源:searches.php

示例7: b_marquee_xfaq

function b_marquee_xfaq($limit, $dateformat, $itemssize)
{
    include_once XOOPS_ROOT_PATH . '/modules/marquee/include/functions.php';
    $block = array();
    $myts =& MyTextSanitizer::getInstance();
    $db =& Database::getInstance();
    $result = $db->query("SELECT f.*, t.topic_title, t.topic_submitter FROM " . $db->prefix("xfaq_faq") . " f, " . $db->prefix("xfaq_topic") . " t WHERE f.faq_online>0 AND (f.faq_topic=t.topic_id) ORDER BY faq_date_created DESC", $limit, 0);
    while ($myrow = $db->fetchArray($result)) {
        $title = $myts->htmlSpecialChars($myrow["faq_question"]);
        if ($itemssize > 0) {
            $title = xoops_substr($title, 0, $itemssize + 3);
        }
        $block[] = array('date' => formatTimestamp($myrow['faq_date_created'], $dateformat), 'category' => $myts->htmlSpecialChars($myrow['topic_title']), 'author' => XoopsUser::getUnameFromId(intval($myrow['topic_submitter'])), 'title' => $title, 'link' => "<a href='" . XOOPS_URL . "/modules/xfaq/faq.php?faq_id=" . $myrow['faq_id'] . "'>{$title}</a>");
    }
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:16,代码来源:xfaq.php

示例8: b_marquee_catads

function b_marquee_catads($limit, $dateformat, $itemssize)
{
    global $xoopsModule, $xoopsModuleConfig, $xoopsDB;
    include_once XOOPS_ROOT_PATH . '/modules/catads/class/cat.php';
    $block = array();
    if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'catads') {
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname('catads');
        $config_handler =& xoops_gethandler('config');
        $config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
    } else {
        $module =& $xoopsModule;
        $config =& $xoopsModuleConfig;
    }
    //echo '<br />ok';
    $ads_hnd =& xoops_getmodulehandler('ads', 'catads');
    $criteria = new CriteriaCompo(new Criteria('waiting', '0'));
    $criteria->add(new Criteria('published', time(), '<'));
    $criteria->add(new Criteria('expired', time(), '>'));
    $criteria->setSort('published');
    $criteria->setOrder('DESC');
    $criteria->setLimit($options[0]);
    $nbads = $ads_hnd->getCount($criteria);
    $a_item = array();
    $cat_buffer = array();
    if ($nbads > 0) {
        $ads = $ads_hnd->getObjects($criteria);
        $ts =& MyTextSanitizer::getInstance();
        foreach ($ads as $oneads) {
            if ($itemssize > 0) {
                $title = xoops_substr($oneads->getVar('ads_title'), 0, $itemssize);
            } else {
                $title = $oneads->getVar('ads_title');
            }
            if (!isset($cat_buffer[$oneads->getVar('cat_id')])) {
                $tmpcat = new AdsCategory($oneads->getVar('cat_id'));
                $cat_buffer[$oneads->getVar('cat_id')] = $tmpcat->title();
                $cat_title = $tmpcat->title();
            } else {
                $cat_title = $cat_buffer[$oneads->getVar('cat_id')];
            }
            $block[] = array('date' => formatTimestamp($oneads->getVar('published'), $dateformat), 'category' => '', 'author' => XoopsUser::getUnameFromId($oneads->getVar('uid')), 'title' => $title, 'link' => "<a href='" . XOOPS_URL . '/modules/catads/adsitem.php?ads_id=' . $oneads->getVar('ads_id') . "'>" . $title . '</a>');
            unset($a_item);
        }
    }
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:47,代码来源:catads.php

示例9: mypics_iteminfo

function mypics_iteminfo($category, $item_id)
{
    $item['name'] = '';
    $item['url'] = '';
    if ($category == 'picture') {
        global $xoopsDB;
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname('mypics');
        $sql = 'SELECT title, uid, url FROM ' . $xoopsDB->prefix('yogurt_images') . ' WHERE uid = ' . $item_id . ' LIMIT 1';
        $result = $xoopsDB->query($sql);
        $result_array = $xoopsDB->fetchArray($result);
        $owner = new XoopsUser();
        $identifier = $owner->getUnameFromId($result_array['uid']);
        $item['name'] = $identifier . "'s Album";
        $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/index.php?uid=' . $result_array['uid'];
    }
    return $item;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:18,代码来源:notification.inc.php

示例10: b_mp_new_show

function b_mp_new_show($options)
{
    global $xoopsDB, $xoopsUser, $xoopsModule, $HTTP_SERVER_VARS;
    $module_handler =& xoops_gethandler('module');
    $newbb = $module_handler->getByDirname('mpmanager');
    if (!isset($xoopsModuleConfig)) {
        $config_handler =& xoops_gethandler('config');
        $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $newbb->getVar('mid'));
    }
    if (is_object($xoopsUser)) {
        $uid = $xoopsUser->getVar('uid');
        $uname = $xoopsUser->getVar('uname');
    } else {
        $uid = 0;
        $uname = '';
    }
    $block = array();
    $news_messages = 0;
    $old_messages = 0;
    $myts =& MyTextSanitizer::getInstance();
    $mp = array();
    if (!is_object($xoopsUser)) {
        $block['lang_none'] = _MP_BL_YOUDONTHAVE;
    } else {
        $pm_handler =& xoops_gethandler('priv_msgs');
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
        $criteria->add(new Criteria('cat_msg', 1));
        $criteria->setLimit($options[0]);
        $criteria->setSort("msg_time");
        $criteria->setOrder("DESC");
        $pm_arr =& $pm_handler->getObjects($criteria);
        $total_messages = count($pm_arr);
        $block['total'] = $total_messages;
        if ($total_messages == 0) {
            $block['lang_none'] = _MP_BL_YOUDONTHAVE;
        } else {
            $block['disp_mode'] = $options[2];
        }
        foreach (array_keys($pm_arr) as $i) {
            if ($pm_arr[$i]->getVar('read_msg') == 1) {
                $mp['list'] = "<li>";
                $mp['img'] = "<a href='" . XOOPS_URL . "/modules/mpmanager/viewbox.php?op=view&searchmsg=" . $pm_arr[$i]->getVar('msg_id') . "#" . $pm_arr[$i]->getVar('msg_id') . "'><img src='" . XOOPS_URL . "/modules/mpmanager/images/lus.png' width='20px' height='20px' alt='Lu' /></a>";
                $old_messages++;
            } else {
                $mp['img'] = "<a href='" . XOOPS_URL . "/modules/mpmanager/viewbox.php?op=view&searchmsg=" . $pm_arr[$i]->getVar('msg_id') . "#" . $pm_arr[$i]->getVar('msg_id') . "'><img src='" . XOOPS_URL . "/modules/mpmanager/images/new.png' width='20px' height='20px' alt='Non Lu' /></a>";
                $mp['list'] = '<li style="color:  ' . $xoopsModuleConfig["cssbtext"] . ';>';
                $news_messages++;
            }
            $postername = XoopsUser::getUnameFromId($pm_arr[$i]->getVar("from_userid"));
            // no need to show deleted users
            if ($postername) {
                $mp['from'] = "<a href=" . XOOPS_URL . "/userinfo.php?uid=" . $pm_arr[$i]->getVar("from_userid") . ">" . $postername . "</a>";
            } else {
                $mp['from'] = $xoopsConfig['anonymous'];
            }
            if ($options[2] == 1) {
                $mp['date'] = formatTimestamp($pm_arr[$i]->getVar("msg_time"), "s");
            } else {
                $mp['date'] = formatTimestamp($pm_arr[$i]->getVar("msg_time"));
            }
            if (strlen($pm_arr[$i]->getVar("subject")) >= $options[1]) {
                $mp['subject'] = "<a href='" . XOOPS_URL . "/modules/mpmanager/viewbox.php?op=view&searchmsg=" . $pm_arr[$i]->getVar('msg_id') . "#" . $pm_arr[$i]->getVar('msg_id') . "'>" . $myts->displayTarea(substr($pm_arr[$i]->getVar("subject"), 0, $options[1] - 1)) . "...</a>";
            } else {
                $mp['subject'] = "<a href='" . XOOPS_URL . "/modules/mpmanager/viewbox.php?op=view&searchmsg=" . $pm_arr[$i]->getVar('msg_id') . "#" . $pm_arr[$i]->getVar('msg_id') . "'>" . $pm_arr[$i]->getVar("subject") . "</a>";
            }
            if ($options[2] == 2) {
                $pm_handler =& xoops_gethandler('priv_msgs');
                $newcriteria = new CriteriaCompo();
                $newcriteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
                $newcriteria->add(new Criteria('cat_msg', 1));
                $newcriteria->add(new Criteria('read_msg', 0));
                $block['news'] =& $pm_handler->getCount($newcriteria);
                $readcriteria = new CriteriaCompo();
                $readcriteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
                $readcriteria->add(new Criteria('cat_msg', 1));
                $readcriteria->add(new Criteria('read_msg', 1));
                $block['read'] =& $pm_handler->getCount($readcriteria);
                $allcriteria = new CriteriaCompo();
                $allcriteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
                $allcriteria->add(new Criteria('cat_msg', 1));
                $block['all'] =& $pm_handler->getCount($allcriteria);
                return $block;
            }
            $block['manager'][] = $mp;
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:89,代码来源:mp_new.php

示例11: printf

     printf(_SR_SHOWING, $start + 1, $start + $count);
     echo "<h5>" . $myts->makeTboxData4Show($module->getVar('name')) . "</h5>";
     for ($i = 0; $i < $count; $i++) {
         if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
             echo "<img src='modules/" . $module->getVar('dirname') . "/" . $results[$i]['image'] . "' alt='" . $myts->makeTboxData4Show($module->getVar('name')) . "' />&nbsp;";
         } else {
             echo "<img src='images/icons/posticon2.gif' alt='" . $myts->makeTboxData4Show($module->name()) . "' width='26' height='26' />&nbsp;";
         }
         if (!preg_match("/^http[s]*:\\/\\//i", $results[$i]['link'])) {
             $results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link'];
         }
         echo "<b><a href='" . $results[$i]['link'] . "'>" . $myts->makeTboxData4Show($results[$i]['title']) . "</a></b><br />\n";
         echo "<small>";
         $results[$i]['uid'] = intval($results[$i]['uid']);
         if (!empty($results[$i]['uid'])) {
             $uname = XoopsUser::getUnameFromId($results[$i]['uid']);
             echo "&nbsp;&nbsp;<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "'>" . $uname . "</a>\n";
         }
         echo $results[$i]['time'] ? " (" . formatTimestamp(intval($results[$i]['time'])) . ")" : "";
         echo "</small><br />\n";
     }
     echo '
 <table>
   <tr>
 ';
     $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries)));
     $search_url .= "&mid={$mid}&action={$action}&andor={$andor}";
     if ($action == 'showallbyuser') {
         $search_url .= "&uid={$uid}";
     }
     if ($start > 0) {
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:search.php

示例12: intval

    } else {
        $com_mode = $xoopsConfig['com_mode'];
    }
}
if (!isset($_GET['com_order'])) {
    if (is_object($xoopsUser)) {
        $com_order = $xoopsUser->getVar('uorder');
    } else {
        $com_order = $xoopsConfig['com_order'];
    }
} else {
    $com_order = intval($_GET['com_order']);
}
$comment_handler =& xoops_gethandler('comment');
$comment =& $comment_handler->get($com_id);
$r_name = XoopsUser::getUnameFromId($comment->getVar('com_uid'));
$r_text = _CM_POSTER . ': <b>' . $r_name . '</b>&nbsp;&nbsp;' . _CM_POSTED . ': <b>' . formatTimestamp($comment->getVar('com_created')) . '</b><br /><br />' . $comment->getVar('com_text');
$com_title = $comment->getVar('com_title', 'E');
if (!preg_match("/^re:/i", $com_title)) {
    $com_title = "Re: " . xoops_substr($com_title, 0, 56);
}
$com_pid = $com_id;
$com_text = '';
$com_id = 0;
$dosmiley = 1;
$dohtml = 0;
$doxcode = 1;
$dobr = 1;
$doimage = 1;
$com_icon = '';
$com_rootid = $comment->getVar('com_rootid');
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:comment_reply.php

示例13: elseif

             $accesserror = 1;
         }
     } elseif ($forumdata['forum_access'] == 1 && !$xoopsUser) {
         $accesserror = 1;
     }
     if ($accesserror == 1) {
         redirect_header("viewtopic.php?topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_NORIGHTTOPOST);
         exit;
     }
 }
 include XOOPS_ROOT_PATH . '/header.php';
 include_once 'class/class.forumposts.php';
 $forumpost = new ForumPosts($post_id);
 $r_message = $forumpost->text();
 $r_date = formatTimestamp($forumpost->posttime());
 $r_name = $forumpost->uid() != 0 ? XoopsUser::getUnameFromId($forumpost->uid()) : $xoopsConfig['anonymous'];
 $r_content = _MD_BY . " " . $r_name . " " . _MD_ON . " " . $r_date . "<br /><br />";
 $r_content .= $r_message;
 $r_subject = $forumpost->subject();
 if (!preg_match("/^Re:/i", $r_subject)) {
     $subject = 'Re: ' . $myts->htmlSpecialChars($r_subject);
 } else {
     $subject = $myts->htmlSpecialChars($r_subject);
 }
 $q_message = $forumpost->text("Quotes");
 $hidden = "[quote]\n";
 $hidden .= sprintf(_MD_USERWROTE, $r_name);
 $hidden .= "\n" . $q_message . "[/quote]";
 $message = "";
 themecenterposts($r_subject, $r_content);
 echo "<br />";
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:reply.php

示例14: array

// Criteria
$content_count = $content_Handler->getCountPublished();
$content_arr = $content_Handler->getPagePublished($start, $nb_limit);
// Assign Template variables
$xoops->tpl()->assign('content_count', $content_count);
$keywords = array();
if ($content_count > 0) {
    //Cleaning the content of $content, they are assign by blocks and mess the output
    $xoops->tpl()->assign('content', array());
    foreach (array_keys($content_arr) as $i) {
        $content_id = $content_arr[$i]->getVar('content_id');
        $content['id'] = $content_id;
        $content['title'] = $content_arr[$i]->getVar('content_title');
        $content['shorttext'] = $content_arr[$i]->getVar('content_shorttext');
        $content['authorid'] = $content_arr[$i]->getVar('content_author');
        $content['author'] = XoopsUser::getUnameFromId($content_arr[$i]->getVar('content_author'));
        $content['date'] = XoopsLocale::formatTimestamp($content_arr[$i]->getVar('content_create'), $helper->getConfig('page_dateformat'));
        $content['time'] = XoopsLocale::formatTimestamp($content_arr[$i]->getVar('content_create'), $helper->getConfig('page_timeformat'));
        $xoops->tpl()->appendByRef('content', $content);
        $keywords[] = $content_arr[$i]->getVar('content_title');
        unset($content);
    }
    // Display Page Navigation
    if ($content_count > $nb_limit) {
        $nav = new XoopsPageNav($content_count, $nb_limit, $start, 'start');
        $xoops->tpl()->assign('nav_menu', $nav->renderNav(4));
    }
} else {
    $xoops->tpl()->assign('error_message', PageLocale::E_NO_CONTENT);
}
// Metas
开发者ID:RanLee,项目名称:XoopsCore,代码行数:31,代码来源:index.php

示例15: edit_eventdata

function edit_eventdata(&$data)
{
    global $xoopsModuleConfig, $xoopsUser;
    $myts =& MyTextSanitizer::getInstance();
    $str = $pat = array();
    $pat[] = '{X_DATE}';
    $str[] = $data['ldate'] = empty($data['exdate']) ? $data['edate'] : $data['exdate'];
    if (isset($data['closetime'])) {
        $data['closedate'] = $data['ldate'] - $data['closetime'];
        $data['dispclose'] = eventdate($data['closedate'], _MD_TIME_FMT);
    }
    $data['date'] = eventdate($data['ldate']);
    $pat[] = '{X_TIME}';
    $str[] = $data['time'] = eventdate($data['ldate'], _MD_STIME_FMT);
    $post = isset($data['cdate']) ? $data['cdate'] : time();
    $data['postdate'] = formatTimestamp($post, _MD_POSTED_FMT);
    $data['uname'] = isset($data['uid']) ? XoopsUser::getUnameFromId($data['uid']) : $xoopsUser->getVar('uname');
    $data['hits'] = sprintf(_MD_REFER, $data['counter']);
    $br = 0;
    $html = 1;
    switch ($data['style']) {
        case 2:
            $html = 0;
        case 1:
            $br = 1;
    }
    $data['disp_summary'] = empty($data['summary']) ? '' : str_replace($pat, $str, xss_filter($myts->displayTarea($data['summary'], $html, 0, 1, 1, $br)));
    $data['disp_body'] = empty($data['body']) ? '' : str_replace($pat, $str, xss_filter($myts->displayTarea($data['body'], $html, 0, 1, 1, $br)));
    $data['title'] = $myts->htmlSpecialChars($data['title']);
    // fill of seat
    if (!empty($data['persons'])) {
        $data['reserv_num'] = sprintf(_MD_RESERV_NUM, $data['persons']);
        $data['reserv_reg'] = sprintf(_MD_RESERV_REG, $data['reserved']);
        $marker = preg_split('/,|[\\r\\n]+/', $xoopsModuleConfig['maker_set']);
        $fill = $data['fill'] = intval($data['reserved'] / $data['persons'] * 100);
        if ($data['closedate'] < time()) {
            $fill = -1;
        }
        while (list($k, $v) = array_splice($marker, 0, 2)) {
            if ($fill < $k) {
                $data['fill_mark'] = $v;
                break;
            }
        }
    }
    $catlist = get_eguide_category();
    if (isset($data['topicid'])) {
        $cid = $data['topicid'];
        if (isset($catlist[$cid])) {
            $data['catid'] = $cid;
            $data['catname'] = $catlist[$cid]['name'];
            $data['catimg'] = $catlist[$cid]['image'];
            $data['catgory'] = $catlist[$cid];
        }
    }
    return $data;
}
开发者ID:nbuy,项目名称:xoops-modules-eguide,代码行数:57,代码来源:functions.php


注:本文中的XoopsUser::getUnameFromId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。