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


PHP CriteriaCompo::setOrder方法代码示例

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


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

示例1: about_block_page_edit

function about_block_page_edit($options)
{
    @(include dirname(dirname(__FILE__)) . "/xoops_version.php");
    $page_handler =& xoops_getmodulehandler('page', 'about');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('page_status', 1), 'AND');
    $criteria->add(new Criteria('page_type', 1));
    $criteria->setSort('page_order');
    $criteria->setOrder('ASC');
    $fields = array("page_id", "page_title", "page_image");
    $pages = $page_handler->getAll($criteria, $fields, false);
    $page_title = '';
    foreach ($pages as $k => $v) {
        $page_title = '<a href="' . XOOPS_URL . '/modules/' . $modversion['dirname'] . '/index.php?page_id=' . $k . '" target="_blank">' . $v['page_title'] . '</a>';
        $options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . '<img src="' . XOOPS_URL . '/modules/' . $modversion['dirname'] . '/images/picture.png' . '" />';
    }
    include_once dirname(dirname(__FILE__)) . '/include/xoopsformloader.php';
    $form = new XoopsBlockForm();
    $page_select = new XoopsFormRadio(_MI_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '<br />');
    $page_select->addOptionArray($options_page);
    $form->addElement($page_select);
    $form->addElement(new XoopsFormText(_MI_ABOUT_TEXT_LENGTH, 'options[1]', 5, 5, $options[1]));
    $form->addElement(new XoopsFormText(_MI_ABOUT_VIEW_MORELINKTEXT, 'options[2]', 30, 50, $options[2]));
    $form->addElement(new XoopsFormRadioYN(_MI_ABOUT_DOTITLEIMAGE, 'options[3]', $options[3]));
    return $form->render();
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:26,代码来源:blocks.php

示例2: XoopsFormSelectUser

 /**
  * Constructor
  *
  * @param string $caption
  * @param string $name
  * @param mixed $value Pre-selected value (or array of them).
  *                                                 For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param bool $include_anon Include user "anonymous"?
  * @param int $size Number or rows. "1" makes a drop-down-list.
  * @param bool $multiple Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new XoopsFormSelect('', $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS['xoopsConfig']['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         $this->XoopsFormElementTray($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage('findusers');
     $js_addusers = "<script type='text/javascript'>\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(':'));\r\n                opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                var sel = xoopsGetElementById('" . $name . "');\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&amp;multiple=' . $multiple . '&amp;token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers));
     $this->XoopsFormElementTray($caption, '<br /><br />', $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:46,代码来源:formselectuser.php

示例3: XoopsFormSelectUser

 /**
  * Constructor
  * 
  * @param	string	$caption	
  * @param	string	$name
  * @param	mixed	$value	    	Pre-selected value (or array of them).
  *									For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param	bool	$include_anon	Include user "anonymous"?
  * @param	int		$size	        Number or rows. "1" makes a drop-down-list.
  * @param	bool    $multiple       Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $value = array(), $include_anon = false, $size = 1, $multiple = false)
 {
     $this->XoopsFormElementTray($caption, "<br /><br />", $name);
     $select_form = new XoopsFormSelect("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_form->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $criteria = new CriteriaCompo();
     if (!is_array($value)) {
         $value = array($value);
     }
     if (is_array($value) && count($value) > 0) {
         $id_in = "(" . implode(",", $value) . ")";
         $criteria->add(new Criteria("uid", $id_in, "IN"));
         $criteria->setSort('name');
         $criteria->setOrder('ASC');
         $users = $member_handler->getUserList($criteria);
         $select_form->addOptionArray($member_handler->getUserList($criteria));
     }
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/system/include/userselect.php?action=1&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _LIST . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/system/include/userselect.php?action=0&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _SEARCH . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='var sel = xoopsGetElementById(\"" . $name . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (sel.options[i].selected) {sel.options[i] = null;}}'>" . _REMOVE . "</a>" . "<script type=\"text/javascript\">\n\t\t    function addusers(opts){\n\t\t\t    var num = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n        \t\tvar sel = xoopsGetElementById(\"" . $name . "\");\n\t\t\t    var arr = new Array(num);\n\t\t\t    for(var n=0; n<num; n++){\n\t\t\t    \tvar nm = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    \topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n\t\t\t    \tvar val = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    \topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n\t\t\t    \tvar txt = opts.substring(0, nm - val.length);\n\t\t\t    \topts = opts.substring(nm - val.length, opts.length);\n\t\t\t\t\tvar added = false;\n\t\t\t\t\tfor (var k = 0; k < sel.options.length; k++) {\n\t\t\t\t\t\tif(sel.options[k].value == val){\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added==false){\n\t\t\t\t\t\tappendSelectOption(\"" . $name . "\",txt, val);\n\t        \t\t}\n\t\t\t    }\n\t\t\t\treturn true;\n\t\t    }\n\t\t\t</script>"));
     $this->addElement($select_form);
     $this->addElement($action_tray);
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:38,代码来源:formselectuser.php

示例4: array

 /**
  * Constructor
  *
  * @param    string    $caption
  * @param    string    $name
  * @param    mixed    $value            Pre-selected value (or array of them).
  *                                    For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param    bool    $include_anon    Include user "anonymous"?
  * @param    int        $size            Number or rows. "1" makes a drop-down-list.
  * @param    bool    $multiple       Allow multiple selections?
  */
 function __construct($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new Xmf_Form_Element_Select("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria("uid", "(" . implode(",", $value) . ")", "IN"));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         parent::__construct($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage("findusers");
     $js_addusers = "<script type=\"text/javascript\">\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(\":\"));\r\n                opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new Xmf_Form_Element_Tray("", " | ");
     $action_tray->addElement(new Xmf_Form_Element_Label('', "<a href='#' onclick='var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;'>" . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new Xmf_Form_Element_Label('', "<a href='#' onclick='openWithSelfMain(\"" . XOOPS_URL . "/include/findusers.php?target={$name}&amp;multiple={$multiple}&amp;token={$token}\", \"userselect\", 800, 600, null); return false;' >" . _MA_USER_MORE . "</a>" . $js_addusers));
     parent::__construct($caption, "<br /><br />", $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:46,代码来源:User.php

示例5: flash3ComponentsShow

function flash3ComponentsShow($options)
{
    global $xoopsModuleConfig;
    include_once dirname(__FILE__) . "/config.php";
    $sp_handler =& xoops_getmodulehandler('spotlight', 'spotlight');
    $page_handler =& xoops_getmodulehandler('page', 'spotlight');
    // spotlight object
    $sp_obj = $sp_handler->get($options[0]);
    if (!is_object($sp_obj) || empty($options[0])) {
        trigger_error("spotlight is not object ", E_USER_WARNING);
    } else {
        //spotlight name
        $block['sp_name'] = $sp_obj->getVar('sp_name');
    }
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('sp_id', $options[0]));
    $criteria->setLimit(5);
    $criteria->setSort('page_order');
    $criteria->setOrder('ASC');
    $pages = $page_handler->getAll($criteria, array('page_id', 'page_title', 'page_link', 'page_image', 'page_desc'), false);
    foreach ($pages as $k => $v) {
        $block['title'][] = $v['page_title'];
        $block['url'][] = $v['page_link'];
        $block['images'][] = XOOPS_UPLOAD_URL . '/spotlight/' . 'thumb_' . $v['page_image'];
    }
    $block['catid'] = $options[0];
    $block['catname'] = $block['sp_name'];
    $block['type'] = 3;
    $block['title'] = implode('|', $block['title']);
    $block['url'] = implode('|', $block['url']);
    $block['images'] = implode('|', $block['images']);
    $block['component'] = $sp_obj->getVar('component_name');
    // xoops_result($block);
    return $block;
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:35,代码来源:show.php

示例6: xoopsfaq_search

/**
 * xoopsfaq_search()
 *
 * @param mixed $queryarray
 * @param mixed $andor
 * @param mixed $limit
 * @param mixed $offset
 * @param mixed $userid
 * @return
 */
function xoopsfaq_search($queryarray, $andor, $limit, $offset, $userid)
{
    global $xoopsDB;
    $ret = array();
    if ($userid != 0) {
        return $ret;
    }
    $xfDir = basename(dirname(dirname(__FILE__)));
    $xfContentsHandler =& xoops_getmodulehandler('contents', $xfDir);
    $contentFields = array('contents_id', 'contents_cid', 'contents_title', 'contents_contents', 'contents_publish');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('contents_active', 1, '='));
    $criteria->setSort('contents_id');
    $criteria->setOrder('DESC');
    $criteria->setLimit(intval($limit));
    $criteria->setStart(intval($offset));
    if (is_array($queryarray) && !empty($queryarray)) {
        $criteria->add(new Criteria('contents_title', "%{$queryarray[0]}%", 'LIKE'));
        $criteria->add(new Criteria('contents_contents', "%{$queryarray[0]}%", 'LIKE'), 'OR');
        array_shift($queryarray);
        //get rid of first element
        foreach ($queryarray as $query) {
            $criteria->add(new Criteria('contents_title', "%{$query}%", 'LIKE'), $andor);
            $criteria->add(new Criteria('contents_contents', "%{$query}%", 'LIKE'), 'OR');
        }
    }
    $contentArray = $xfContentsHandler->getAll($criteria, $contentFields, false);
    foreach ($contentArray as $content) {
        $ret[] = array('image' => 'images/question2.gif', 'link' => "index.php?cat_id=" . $content['contents_cid'] . "#" . $content['contents_id'], 'title' => $content['contents_title'], 'time' => $content['contents_publish']);
    }
    unset($contentArray);
    return $ret;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:43,代码来源:search.inc.php

示例7: showcaseComponentsShow

function showcaseComponentsShow($options)
{
    include XOOPS_ROOT_PATH . "/modules/spotlight/components/showcase/config.php";
    $sp_handler =& xoops_getmodulehandler('spotlight', 'spotlight');
    $page_handler =& xoops_getmodulehandler('page', 'spotlight');
    // spotlight object
    $sp_obj = $sp_handler->get($options[0]);
    if (!is_object($sp_obj) || empty($options[0])) {
        trigger_error("spotlight is not object ", E_USER_WARNING);
    } else {
        //spotlight name
        $block['sp_name'] = $sp_obj->getVar('sp_name');
        // page list
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('sp_id', $options[0]));
        $criteria->setLimit($config['limit']);
        $criteria->setSort($config['sort']);
        $criteria->setOrder('ASC');
        $pages = $page_handler->getAll($criteria, array('page_id', 'page_title', 'page_link', 'page_image', 'page_desc', 'published'), false);
        $myts = MyTextSanitizer::getInstance();
        foreach ($pages as $k => $v) {
            $block['news'][$k] = $v;
            $block['news'][$k]['images'] = XOOPS_UPLOAD_URL . '/spotlight/image_' . $v['page_image'];
            $block['news'][$k]['thumbs'] = XOOPS_UPLOAD_URL . '/spotlight/thumb_' . $v['page_image'];
            $page_desc = strip_tags($myts->undoHtmlSpecialChars(strip_tags($v['page_desc'])));
            $block['news'][$k]['page_desc'] = xoops_substr($page_desc, '', $config['page_desc_substr']);
            $block['news'][$k]['page_title'] = xoops_substr($v['page_title'], '', $config['page_title_substr']);
            $block['news'][$k]['published'] = formatTimestamp($v['published'], $config['timeformat']);
        }
        // component name
        $block['component'] = $sp_obj->getVar('component_name');
        return $block;
    }
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:34,代码来源:show.php

示例8: getCategoryList

 public function getCategoryList($uid = 0)
 {
     $criteria = new CriteriaCompo();
     if (!empty($uid)) {
         $criteria->add(new Criteria("uid", $uid));
     }
     $criteria->setOrder("ASC");
     $criteria->setSort("cat_id");
     $categories = $this->getAll($criteria);
     $catarr = array();
     if ($this->getCount($criteria)) {
         unset($criteria);
         $topic_handler = xoops_getmodulehandler("topics", "press");
         $criteria = new CriteriaCompo(new Criteria("cat_id", "(" . implode(",", array_keys($categories)) . ")", "in"));
         if (!empty($uid)) {
             $criteria->add(new Criteria("uid", $uid));
         }
         $criteria->setGroupby("cat_id");
         $counts = $topic_handler->getCounts($criteria);
         foreach ($categories as $key => $obj) {
             $catarr[$key]["cat_name"] = $obj->getVar("cat_name");
             $catarr[$key]["cat_id"] = $key;
             if (!empty($uid)) {
                 $catarr[$key]["uid"] = $uid;
             }
             $catarr[$key]["cat_topics"] = isset($counts[$key]) ? $counts[$key] : 0;
         }
         return $catarr;
     }
 }
开发者ID:yunsite,项目名称:xoopsdc,代码行数:30,代码来源:category.php

示例9: publisher_date_to_date_show

function publisher_date_to_date_show($options)
{
    $myts = MyTextSanitizer::getInstance();
    $publisher = PublisherPublisher::getInstance();
    $block = array();
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('datesub', strtotime($options[0]), '>'));
    $criteria->add(new Criteria('datesub', strtotime($options[1]), '<'));
    $criteria->setSort('datesub');
    $criteria->setOrder('DESC');
    // creating the ITEM objects that belong to the selected category
    $itemsObj = $publisher->getHandler('item')->getObjects($criteria);
    $totalItems = count($itemsObj);
    if ($itemsObj) {
        for ($i = 0; $i < $totalItems; $i++) {
            $newItems['itemid'] = $itemsObj[$i]->itemid();
            $newItems['title'] = $itemsObj[$i]->title();
            $newItems['categoryname'] = $itemsObj[$i]->getCategoryName();
            $newItems['categoryid'] = $itemsObj[$i]->categoryid();
            $newItems['date'] = $itemsObj[$i]->datesub();
            $newItems['poster'] = $itemsObj[$i]->linkedPosterName();
            $newItems['itemlink'] = $itemsObj[$i]->getItemLink(false, isset($options[3]) ? $options[3] : 65);
            $newItems['categorylink'] = $itemsObj[$i]->getCategoryLink();
            $block['items'][] = $newItems;
        }
        $block['lang_title'] = _MB_PUBLISHER_ITEMS;
        $block['lang_category'] = _MB_PUBLISHER_CATEGORY;
        $block['lang_poster'] = _MB_PUBLISHER_POSTEDBY;
        $block['lang_date'] = _MB_PUBLISHER_DATE;
        $modulename = $myts->displayTarea($publisher->getModule()->getVar('name'));
        $block['lang_visitItem'] = _MB_PUBLISHER_VISITITEM . " " . $modulename;
        $block['lang_articles_from_to'] = sprintf(_MB_PUBLISHER_ARTICLES_FROM_TO, $options[0], $options[1]);
    }
    return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:35,代码来源:date_to_date.php

示例10: b_user_topusers_show

function b_user_topusers_show($options)
{
    $block = array();
    $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
    $limit = (!empty($options[0])) ? $options[0] : 10;
    $size = count($options);
    for ( $i = 2; $i < $size; $i++) {
        $criteria->add(new Criteria('rank', $options[$i], '<>'));
    }
    $criteria->setOrder('DESC');
    $criteria->setSort('posts');
    $criteria->setLimit($limit);
    $member_handler =& xoops_gethandler('member');
    $topposters =& $member_handler->getUsers($criteria);
    $count = count($topposters);
    for ($i = 0; $i < $count; $i++) {
        $block['users'][$i]['rank'] = $i+1;
        if ( $options[1] == 1 ) {
            $block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$topposters[$i]->getVar('user_avatar') : '';
        } else {
            $block['users'][$i]['avatar'] = '';
        }
        $block['users'][$i]['id'] = $topposters[$i]->getVar('uid');
        $block['users'][$i]['name'] = $topposters[$i]->getVar('uname');
        $block['users'][$i]['posts'] = $topposters[$i]->getVar('posts');
    }
    return $block;
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:28,代码来源:user_topusers.php

示例11: links_block_edit

function links_block_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/links/include/xoopsformloader.php";
    $form = new XoopsBlockForm("", "", "");
    $categories = new XoopsFormSelect(_MB_LINKS_SHOWCAT, 'options[0]', $options[0]);
    $categories->addOption(0, _MB_LINKS_ALL);
    $cat_handler = xoops_getmodulehandler('category', 'links');
    $criteria = new CriteriaCompo();
    $criteria->setSort('cat_order');
    $criteria->setOrder('ASC');
    $category = $cat_handler->getList($criteria);
    foreach ($cat_handler->getList($criteria) as $k => $v) {
        $categories->addOption($k, $v);
    }
    $form->addElement($categories, true);
    $sort = new XoopsFormSelect(_MB_LINKS_SORTWAY, 'options[1]', $options[1]);
    $sort->addOption('published', _MB_LINKS_PUBLISHTIME);
    $sort->addOption('datetime', _MB_LINKS_UPDATETIME);
    $sort->addOption('link_order', _MB_LINKS_DEFAULT);
    $form->addElement($sort, true);
    $form->addElement(new XoopsFormText(_MB_LINKS_SHOWHOWLIK, "options[2]", 5, 2, $options[2]), true);
    $form->addElement(new XoopsFormText(_MB_LINKS_LIKTITLEMAX, "options[3]", 5, 2, $options[3]), true);
    $form->addElement(new XoopsFormRadioYN(_MB_LINKS_SHOWCATTITLE, 'options[4]', $options[4]), true);
    $display = new XoopsFormSelect(_MB_LINKS_BYSHOW, 'options[5]', $options[5]);
    $display->addOption('1', _MB_LINKS_LOGOHOR);
    $display->addOption('2', _MB_LINKS_LOGOVER);
    $display->addOption('3', _MB_LINKS_TITLEHOR);
    $display->addOption('4', _MB_LINKS_TITLEVER);
    $form->addElement($display, true);
    return $form->render();
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:31,代码来源:blocks.php

示例12: alumniCategoryDisplayChildren

 function alumniCategoryDisplayChildren($cid = 0, $categoryArray, $prefix = '', $order = '', &$class)
 {
     $xoops = Xoops::getInstance();
     $moduleDirName = basename(dirname(__DIR__));
     $prefix = $prefix . '<img src=\'' . XOOPS_URL . "/modules/{$moduleDirName}/images/arrow.gif'>";
     foreach (array_keys($categoryArray) as $i) {
         $cid = $categoryArray[$i]->getVar('cid');
         $pid = $categoryArray[$i]->getVar('pid');
         $title = $categoryArray[$i]->getVar('title');
         $img = $categoryArray[$i]->getVar('img');
         $order = $categoryArray[$i]->getVar('ordre');
         echo '<tr class="' . $class . '">';
         echo '<td align="left">' . $prefix . '&nbsp;' . $categoryArray[$i]->getVar('title') . '</td>';
         echo '<td align="center"><img src="' . XOOPS_URL . "/modules/{$moduleDirName}/images/cat/" . $categoryArray[$i]->getVar('img') . '" height="16px" title="img" alt="img"></td>';
         echo '<td align="center">' . $categoryArray[$i]->getVar('ordre') . '</td>';
         echo "<td align='center' width='10%'>\n\t\t\t\t\t\t<a href='category.php?op=edit_category&cid=" . $categoryArray[$i]->getVar('cid') . "'><img src='../images/edit.gif' alt='" . XoopsLocale::A_EDIT . "' title='" . XoopsLocale::A_EDIT . "'></a>\n\t\t\t\t\t\t<a href='category.php?op=delete_category&cid=" . $categoryArray[$i]->getVar('cid') . "'><img src='../images/dele.gif' alt='" . XoopsLocale::A_DELETE . "' title='" . XoopsLocale::A_DELETE . "'></a></td></tr>";
         $class = $class == "even" ? "odd" : "even";
         $categoriesHandler = $xoops->getModuleHandler('category', 'alumni');
         $criteria2 = new CriteriaCompo();
         $criteria2->add(new Criteria('pid', $categoryArray[$i]->getVar('cid')));
         $criteria2->setSort('title');
         $criteria2->setOrder('ASC');
         $cat_pid = $categoriesHandler->getAll($criteria2);
         $num_pid = $categoriesHandler->getCount();
         if ($num_pid != 0) {
             alumniCategoryDisplayChildren($cid, $cat_pid, $prefix, $order, $class);
         }
     }
 }
开发者ID:jlm69,项目名称:alumni-26x,代码行数:29,代码来源:category.php

示例13: alumni_show

/**
 * @param $options
 * @return array
 */
function alumni_show($options)
{
    $block = array();
    $myts = MyTextSanitizer::getInstance();
    $xoops = Xoops::getInstance();
    $helper = $xoops->getModuleHelper('alumni');
    $module_id = $helper->getModule()->getVar('mid');
    $listingHandler = $helper->getHandler('listing');
    $groups = $xoops->getUserGroups();
    $alumni_ids = $xoops->getHandlerGroupPermission()->getItemIds('alumni_view', $groups, $module_id);
    $all_ids = implode(', ', $alumni_ids);
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('valid', 1, '='));
    $criteria->add(new Criteria('cid', '(' . $all_ids . ')', 'IN'));
    $criteria->setLimit($options[1]);
    $criteria->setSort('date');
    $criteria->setOrder('DESC');
    $block_listings = $listingHandler->getall($criteria);
    foreach (array_keys($block_listings) as $i) {
        $name = $block_listings[$i]->getVar('name');
        $mname = $block_listings[$i]->getVar('mname');
        $lname = $block_listings[$i]->getVar('lname');
        $school = $block_listings[$i]->getVar('school');
        $year = $block_listings[$i]->getVar('year');
        $view = $block_listings[$i]->getVar('view');
        $a_item = array();
        $a_item['school'] = $school;
        $a_item['link'] = '<a href="' . XOOPS_URL . "/modules/alumni/listing.php?lid=" . addslashes($block_listings[$i]->getVar('lid')) . "\"><b>{$year}&nbsp;-&nbsp;{$name} {$mname} {$lname}</b><br /></a>";
        $block['items'][] = $a_item;
    }
    $block['lang_title'] = AlumniLocale::BLOCKS_ITEM;
    $block['lang_date'] = AlumniLocale::BLOCKS_DATE;
    $block['link'] = "<a href=\"" . XOOPS_URL . "/modules/alumni/index.php\"><b>" . AlumniLocale::BLOCKS_ALL_LISTINGS . "</b></a></div>";
    return $block;
}
开发者ID:jlm69,项目名称:alumni-26x,代码行数:39,代码来源:alumni.php

示例14: ifocusComponentsShow

function ifocusComponentsShow($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/spotlight/components/ifocus/config.php";
    $sp_handler =& xoops_getmodulehandler('spotlight', 'spotlight');
    $page_handler =& xoops_getmodulehandler('page', 'spotlight');
    // spotlight object
    $sp_obj = $sp_handler->get($options[0]);
    if (!is_object($sp_obj) || empty($options[0])) {
        trigger_error("spotlight is not object ", E_USER_WARNING);
    } else {
        //spotlight name
        $block['sp_name'] = $sp_obj->getVar('sp_name');
        // page list
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('sp_id', $options[0]));
        $criteria->setLimit($config['limit']);
        $criteria->setSort($config['sort']);
        $criteria->setOrder('ASC');
        $pages = $page_handler->getAll($criteria, array('page_id', 'page_title', 'page_link', 'page_image', 'page_desc'), false);
        foreach ($pages as $k => $v) {
            $block['news'][$k] = $v;
            $block['news'][$k]['images'] = XOOPS_UPLOAD_URL . '/spotlight/image_' . $v['page_image'];
            $block['news'][$k]['thumbs'] = XOOPS_UPLOAD_URL . '/spotlight/thumb_' . $v['page_image'];
        }
        // component name
        $block['component'] = $sp_obj->getVar('component_name');
        return $block;
    }
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:29,代码来源:show.php

示例15: b_categories_list_show

function b_categories_list_show($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/smartpartner/include/common.php";
    $smartpartner_category_handler =& smartpartner_gethandler('category');
    $criteria = new CriteriaCompo();
    $criteria->setSort(isset($options[0]) ? $options[0] : 'name');
    $criteria->setOrder(isset($options[1]) ? $options[1] : 'ASC');
    $catsObj =& $smartpartner_category_handler->getobjects($criteria, true);
    $catArray = get_content(0, $catsObj, $options[2]);
    $block = array();
    $block['categories'] = $catArray;
    $block['displaysubs'] = $options[2];
    if (isset($_GET['view_category_id'])) {
        $current_id = $_GET['view_category_id'];
        $block['current'] = $catsObj[$current_id]->getVar('parentid') == 0 ? $current_id : $catsObj[$current_id]->getVar('parentid');
    } elseif (isset($_GET['id'])) {
        $smartpartner_partner_handler =& smartpartner_gethandler('partner');
        $partnerObj = $smartpartner_partner_handler->get($_GET['id']);
        if (is_object($partnerObj)) {
            $parent = $partnerObj->getVar('categoryid');
            $block['current'] = $catsObj[$parent]->getVar('parentid') == 0 ? $parent : $catsObj[$parent]->getVar('parentid');
        }
    }
    return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:25,代码来源:categories_list.php


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