示例#1
0
 function setContent($isreturn = false)
 {
     global $jieqiTpl;
     include_once JIEQI_ROOT_PATH . '/class/userlink.php';
     $userlink_handler =& JieqiUserlinkHandler::getInstance('JieqiUserlinkHandler');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('userid', $this->blockvars['cacheid']));
     if ($this->exevars['istop'] == 1) {
         $criteria->add(new Criteria('toptime', 0, '>'));
     } elseif ($this->exevars['istop'] == 2) {
         $criteria->add(new Criteria('toptime', 0));
     }
     $criteria->setSort($this->exevars['field']);
     if ($this->exevars['asc'] == 1) {
         $criteria->setOrder('ASC');
     } else {
         $criteria->setOrder('DESC');
     }
     $criteria->setLimit($this->exevars['listnum']);
     $criteria->setStart(0);
     $userlink_handler->queryObjects($criteria);
     $linkrows = array();
     $k = 0;
     while ($v = $userlink_handler->getObject()) {
         $linkrows[$k]['ulid'] = $v->getVar('ulid');
         $linkrows[$k]['ultitle'] = $v->getVar('ultitle');
         $linkrows[$k]['ulurl'] = $v->getVar('ulurl');
         $linkrows[$k]['ulinfo'] = $v->getVar('ulinfo');
         $linkrows[$k]['userid'] = $v->getVar('userid');
         $linkrows[$k]['username'] = $v->getVar('username');
         $linkrows[$k]['score'] = $v->getVar('score');
         $linkrows[$k]['weight'] = $v->getVar('weight');
         $linkrows[$k]['toptime'] = $v->getVar('toptime');
         $linkrows[$k]['addtime'] = $v->getVar('addtime');
         $linkrows[$k]['allvisit'] = $v->getVar('allvisit');
         $k++;
     }
     $jieqiTpl->assign_by_ref('linkrows', $linkrows);
     $jieqiTpl->assign('ownerid', $this->blockvars['cacheid']);
     $jieqiTpl->assign('url_more', JIEQI_URL . '/userlink.php?uid=' . $this->blockvars['cacheid']);
 }
示例#2
0
文件: mylink.php 项目: thu0ng91/jmc
jieqi_getconfigs('system', 'configs');
if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) {
    $_REQUEST['page'] = 1;
}
//页码
//获得允许链接数和现有链接数
jieqi_getconfigs('system', 'honors');
jieqi_getconfigs(JIEQI_MODULE_NAME, 'right');
$maxuserlink = isset($jieqiConfigs['system']['maxuserlink']) ? intval($jieqiConfigs['system']['maxuserlink']) : 0;
$honorid = jieqi_gethonorid($_SESSION['jieqiUserScore'], $jieqiHonors);
if ($honorid && isset($jieqiRight['system']['maxuserlink']['honors'][$honorid]) && is_numeric($jieqiRight['system']['maxuserlink']['honors'][$honorid])) {
    $maxuserlink = intval($jieqiRight['system']['maxuserlink']['honors'][$honorid]);
}
//根据头衔设置的消息数
include_once JIEQI_ROOT_PATH . '/class/userlink.php';
$userlink_handler =& JieqiUserlinkHandler::getInstance('JieqiUserlinkHandler');
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case 'add':
            $errtext = '';
            if (!empty($maxuserlink)) {
                $nowlink = $userlink_handler->getCount(new Criteria('userid', $_SESSION['jieqiUserId']));
                if ($nowlink >= $maxuserlink) {
                    $errtext .= sprintf($jieqiLang['system']['userlink_maxnum_limit'], $maxuserlink) . '<br />';
                }
            }
            if (strlen($_POST['ultitle']) == 0) {
                $errtext .= $jieqiLang['system']['userlink_need_ultitle'] . '<br />';
            }
            if (strlen($_POST['ulurl']) == 0) {
                $errtext .= $jieqiLang['system']['userlink_need_ulurl'] . '<br />';