Пример #1
0
 /**
  * Return all extensions
  *
  * @return array
  */
 public function getExtensionList()
 {
     // Get main instance
     $xoops = Xoops::getInstance();
     $module_handler = $xoops->getHandlerModule();
     $moduleperm_handler = $xoops->getHandlerGroupperm();
     $ret = array();
     $i = 0;
     foreach ($this->modulesList as $file) {
         $file = trim($file);
         if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
             clearstatcache();
             /* @var $module XoopsModule */
             $module = $module_handler->create();
             $module->loadInfoAsVar($file);
             if ($module->getInfo('extension')) {
                 if (in_array($file, $this->modulesDirnames)) {
                     $module->setInfo('install', true);
                     $extension = $module_handler->getByDirname($module->getInfo('dirname'));
                     $module->setInfo('mid', $extension->getVar('mid'));
                     $module->setInfo('update', XoopsLocale::formatTimestamp($extension->getVar('last_update'), 's'));
                     $module->setInfo('hasconfig', $module->getVar('hasconfig'));
                     if (round($module->getInfo('version'), 2) != $extension->getVar('version')) {
                         $module->setInfo('warning_update', true);
                     }
                     $groups = array();
                     if (is_object($xoops->user)) {
                         $groups = $xoops->user->getGroups();
                     }
                     $sadmin = $moduleperm_handler->checkRight('module_admin', $module->getInfo('mid'), $groups);
                     if ($sadmin && ($module->getVar('hasnotification') || is_array($module->getInfo('config')) || is_array($module->getInfo('comments')))) {
                         $module->setInfo('link_pref', \XoopsBaseConfig::get('url') . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $module->getInfo('mid'));
                     }
                 } else {
                     $module->setInfo('install', false);
                 }
                 $module->setInfo('version', round($module->getInfo('version'), 2));
                 if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_small.png')) {
                     $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_small.png');
                 } else {
                     $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/16/default.png');
                 }
                 if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_large.png')) {
                     $module->setInfo('logo_large', \XoopsBaseConfig::get('url') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_large.png');
                 } else {
                     $module->setInfo('logo_large', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/32/default.png');
                 }
                 $module->setInfo('link_admin', \XoopsBaseConfig::get('url') . '/modules/' . $module->getInfo('dirname') . '/' . $module->getInfo('adminindex'));
                 $module->setInfo('options', $module->getAdminMenu());
                 $ret[] = $module;
                 unset($module);
                 ++$i;
             }
         }
     }
     return $ret;
 }
Пример #2
0
 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;
 }
Пример #3
0
/**
 * @return array|bool|string
 */
function b_system_newmembers_show($options)
{
    $xoops = Xoops::getInstance();
    $block = array();
    $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
    $limit = !empty($options[0]) ? $options[0] : 10;
    $criteria->setOrder('DESC');
    $criteria->setSort('user_regdate');
    $criteria->setLimit($limit);
    $member_handler = $xoops->getHandlerMember();
    $newmembers = $member_handler->getUsers($criteria);
    $count = count($newmembers);
    for ($i = 0; $i < $count; ++$i) {
        if ($options[1] == 1) {
            $block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') !== 'blank.gif' ? \XoopsBaseConfig::get('uploads-url') . '/' . $newmembers[$i]->getVar('user_avatar') : '';
        } else {
            $block['users'][$i]['avatar'] = '';
        }
        $block['users'][$i]['id'] = $newmembers[$i]->getVar('uid');
        $block['users'][$i]['name'] = $newmembers[$i]->getVar('uname');
        $block['users'][$i]['joindate'] = XoopsLocale::formatTimestamp($newmembers[$i]->getVar('user_regdate'), 's');
    }
    return $block;
}
Пример #4
0
    $tpl->assign('channel_lastbuild', XoopsLocale::formatTimestamp(time(), 'rss'));
    $tpl->assign('channel_webmaster', $xoops->getConfig('adminmail'));
    $tpl->assign('channel_editor', $xoops->getConfig('adminmail'));
    if ($categoryid != -1) {
        $channel_category .= " > " . $categoryObj->getVar('name');
    }
    $tpl->assign('channel_category', htmlspecialchars($channel_category));
    $tpl->assign('channel_generator', $publisher->getModule()->getVar('name'));
    $tpl->assign('channel_language', XoopsLocale::getLangCode());
    $tpl->assign('image_url', \XoopsBaseConfig::get('url') . '/images/logo.gif');
    $dimention = getimagesize(\XoopsBaseConfig::get('root-path') . '/images/logo.gif');
    if (empty($dimention[0])) {
        $width = 140;
        $height = 140;
    } else {
        $width = $dimention[0] > 140 ? 140 : $dimention[0];
        $dimention[1] = $dimention[1] * $width / $dimention[0];
        $height = $dimention[1] > 140 ? $dimention[1] * $dimention[0] / 140 : $dimention[1];
    }
    $tpl->assign('image_width', $width);
    $tpl->assign('image_height', $height);
    $sarray = $publisher->getItemHandler()->getAllPublished(10, 0, $categoryid);
    if (is_array($sarray)) {
        $count = $sarray;
        /* @var $item PublisherItem */
        foreach ($sarray as $item) {
            $tpl->append('items', array('title' => htmlspecialchars($item->title(), ENT_QUOTES), 'link' => $item->getItemUrl(), 'guid' => $item->getItemUrl(), 'pubdate' => XoopsLocale::formatTimestamp($item->getVar('datesub'), 'rss'), 'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES)));
        }
    }
}
$tpl->display('module:publisher/publisher_rss.tpl');
Пример #5
0
$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
//description
$xoTheme->addMeta('meta', 'description', strip_tags($helper->getModule()->name()) . ', ' . implode(',', $keywords));
Пример #6
0
 /**
  * @param string $dateFormat
  * @param string $format
  *
  * @return string
  */
 public function datesub($dateFormat = '', $format = 'S')
 {
     if (empty($dateformat)) {
         $dateFormat = $this->publisher->getConfig('format_date');
     }
     return XoopsLocale::formatTimestamp($this->getVar('datesub', $format), $dateFormat);
 }
Пример #7
0
    $dimension = getimagesize($xoops->path($imgPath));
    $tpl->assign('image_width', $dimension[0]);
    $tpl->assign('image_height', $dimension[1]);
    $items = array();
    if ($xoops->isModule()) {
        /* @var $plugin SystemPluginInterface */
        $plugin = Xoops_Module_Plugin::getPlugin($dirname, 'system');
        $res = $plugin->backend(10);
        if (is_array($res) && count($res) > 0) {
            foreach ($res as $item) {
                $date[] = array('date' => $item['date']);
                $items[] = array('date' => XoopsLocale::formatTimestamp($item['date'], 'rss'), 'title' => XoopsLocale::convert_encoding(htmlspecialchars($item['title'])), 'content' => XoopsLocale::convert_encoding(htmlspecialchars($item['content'])), 'link' => $item['link'], 'guid' => $item['link']);
            }
        }
    } else {
        $plugins = Xoops_Module_Plugin::getPlugins('system');
        /* @var $plugin SystemPluginInterface */
        foreach ($plugins as $plugin) {
            $res = $plugin->backend(10);
            if (is_array($res) && count($res) > 0) {
                foreach ($res as $item) {
                    $date[] = array('date' => $item['date']);
                    $items[] = array('date' => XoopsLocale::formatTimestamp($item['date'], 'rss'), 'title' => XoopsLocale::convert_encoding(htmlspecialchars($item['title'])), 'content' => XoopsLocale::convert_encoding(htmlspecialchars($item['content'])), 'link' => $item['link'], 'guid' => $item['link']);
                }
            }
        }
    }
    array_multisort($date, SORT_DESC, $items);
    $tpl->assign('items', $items);
}
$tpl->display('module:' . $dirname . '/system_rss.tpl');
Пример #8
0
$criteria->add(new Criteria('status', 2), 'AND');
$criteria->add(new Criteria('datesub', time(), '<='), 'AND');
$criteria->setSort('datesub');
$criteria->setOrder('DESC');
//Get all articles dates as an array to save memory
$items = $publisher->getItemHandler()->getAll($criteria, array('datesub'), false);
$itemsCount = count($items);
if (!($itemsCount > 0)) {
    $xoops->redirect(\XoopsBaseConfig::get('url'), 2, _MD_PUBLISHER_NO_TOP_PERMISSIONS);
} else {
    $this_year = 0;
    $years = array();
    $months = array();
    $i = 0;
    foreach ($items as $item) {
        $time = XoopsLocale::formatTimestamp($item['datesub'], 'mysql', $useroffset);
        if (preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})/", $time, $datetime)) {
            $this_year = (int) $datetime[1];
            $this_month = (int) $datetime[2];
            if (empty($lastyear)) {
                $lastyear = $this_year;
            }
            if ($lastmonth == 0) {
                $lastmonth = $this_month;
                $months[$lastmonth]['string'] = $months_arr[$lastmonth];
                $months[$lastmonth]['number'] = $lastmonth;
            }
            if ($lastyear != $this_year) {
                $years[$i]['number'] = $lastyear;
                $years[$i]['months'] = $months;
                $months = array();
Пример #9
0
 /**
  * @param string $dateFormat
  * @param string $format
  *
  * @return string
  */
 public function datesub($dateFormat = 's', $format = "S")
 {
     return XoopsLocale::formatTimestamp($this->getVar('datesub', $format), $dateFormat);
 }
Пример #10
0
 /**
  * init - called by parent::_construct
  *
  * @return void
  */
 protected function init()
 {
     $this->setTemplate('module:xmf/xmf_feed.tpl');
     //$this->disableLogger();
     global $xoopsConfig;
     $this->_title = $xoopsConfig['sitename'];
     $this->_url = \XoopsBaseConfig::get('url');
     $this->_description = $xoopsConfig['slogan'];
     $this->_language = \XoopsLocale::getLangCode();
     $this->_charset = \XoopsLocale::getCharset();
     $this->_pubdate = \XoopsLocale::formatTimestamp(time(), 'short');
     $this->_lastbuild = \XoopsLocale::formatTimestamp(time(), 'D, d M Y H:i:s');
     $this->_webmaster = $xoopsConfig['adminmail'];
     $this->_editor = $xoopsConfig['adminmail'];
     $this->_generator = \Xoops::VERSION;
     $this->_copyright = 'Copyright ' . \XoopsLocale::formatTimestamp(time(), 'Y') . ' ' . $xoopsConfig['sitename'];
     $this->_image_title = $this->_title;
     $this->_image_url = \XoopsBaseConfig::get('url') . '/images/logo.gif';
     $this->_image_link = $this->_url;
 }
Пример #11
0
            }
            unset($pm);
        }
        $xoops->redirect("viewpmsg.php", 1, XoopsLocale::S_YOUR_MESSAGES_DELETED);
    }
    $xoops->header('module:system/system_viewpmsg.tpl');
    $criteria = new Criteria('to_userid', $xoops->user->getVar('uid'));
    $criteria->setSort('msg_time');
    $criteria->setOrder('DESC');
    $pm_arr = $pm_handler->getObjects($criteria);
    $total_messages = count($pm_arr);
    $xoops->tpl()->assign('display', true);
    $xoops->tpl()->assign('anonymous', $xoops->getConfig('anonymous'));
    $xoops->tpl()->assign('uid', $xoops->user->getVar("uid"));
    $xoops->tpl()->assign('total_messages', $total_messages);
    $msg_no = 0;
    foreach (array_keys($pm_arr) as $i) {
        $messages['msg_id'] = $pm_arr[$i]->getVar("msg_id");
        $messages['read_msg'] = $pm_arr[$i]->getVar("read_msg");
        $messages['msg_image'] = $pm_arr[$i]->getVar("msg_image");
        $messages['posteruid'] = $pm_arr[$i]->getVar('from_userid');
        $messages['postername'] = XoopsUser::getUnameFromId($pm_arr[$i]->getVar('from_userid'));
        $messages['subject'] = $pm_arr[$i]->getVar("subject");
        $messages['msg_time'] = XoopsLocale::formatTimestamp($pm_arr[$i]->getVar('msg_time'));
        $messages['msg_no'] = $msg_no;
        $xoops->tpl()->append('messages', $messages);
        ++$msg_no;
    }
    $xoops->tpl()->assign('token', $xoops->security()->getTokenHTML());
    $xoops->footer();
}
Пример #12
0
 /**
  * Get an array with info about the poster
  *
  * @param int $poster_id
  *
  * @return array
  * @access private
  */
 private function getPosterArray($poster_id)
 {
     $xoops = Xoops::getInstance();
     $poster['id'] = (int) $poster_id;
     if ($poster['id'] > 0) {
         $member_handler = $xoops->getHandlerMember();
         $user = $member_handler->getUser($poster['id']);
         if (is_object($user)) {
             $poster['uname'] = XoopsUserUtility::getUnameFromId($poster['id'], false, true);
             $poster_rank = $user->rank();
             $poster['rank_image'] = $poster_rank['image'];
             $poster['rank_title'] = $poster_rank['title'];
             $response = $xoops->service("Avatar")->getAvatarUrl($user);
             $avatar = $response->getValue();
             $avatar = empty($avatar) ? $xoops->url('uploads/blank.gif') : $avatar;
             $poster['avatar'] = $avatar;
             $poster['regdate'] = XoopsLocale::formatTimestamp($user->getVar('user_regdate'), 's');
             $poster['from'] = $user->getVar('user_from');
             $poster['postnum'] = $user->getVar('posts');
             $poster['status'] = $user->isOnline() ? _MD_COMMENTS_ONLINE : '';
             return $poster;
         } else {
             $poster['id'] = 0;
         }
     }
     $poster['uname'] = XoopsUserUtility::getUnameFromId($poster['id'], false, true);
     $poster['rank_title'] = '';
     $poster['avatar'] = $xoops->url('uploads/blank.gif');
     $poster['regdate'] = '';
     $poster['from'] = '';
     $poster['postnum'] = 0;
     $poster['status'] = '';
     return $poster;
 }
Пример #13
0
                    $poster = $member_handler->getUser($comments_arr[$i]->getVar('uid'));
                    if (is_object($poster)) {
                        $comments_poster_uname = '<a href="' . \XoopsBaseConfig::get('url') . '/userinfo.php?uid=' . $comments_arr[$i]->getVar('uid') . '">' . $poster->getVar('uname') . '</a>';
                    }
                }
                $comments_icon = $comments_arr[$i]->getVar('icon') == '' ? '/images/icons/no_posticon.gif' : '/images/subject/' . htmlspecialchars($comments_arr[$i]->getVar('icon'), ENT_QUOTES);
                $comments_icon = '<img src="' . \XoopsBaseConfig::get('url') . $comments_icon . '" alt="" />';
                $comments['comments_id'] = $id;
                $comments['comments_poster'] = $comments_poster_uname;
                $comments['comments_icon'] = $comments_icon;
                $comments['comments_title'] = '<a href="main.php?op=comments_jump&amp;item_id=' . $comments_arr[$i]->getVar("id") . '">' . $comments_arr[$i]->getVar("title") . '</a>';
                $comments['comments_ip'] = $comments_arr[$i]->getVar('ip');
                $comments['comments_date'] = XoopsLocale::formatTimeStamp($comments_arr[$i]->getVar('created'));
                $comments['comments_text'] = $myts->undoHtmlSpecialChars($comments_arr[$i]->getVar('text'));
                $comments['comments_status'] = @$status_array2[$comments_arr[$i]->getVar('status')];
                $comments['comments_date_created'] = XoopsLocale::formatTimestamp($comments_arr[$i]->getVar('created'), 'm');
                $comments['comments_modid'] = @$module_array[$comments_arr[$i]->getVar('modid')];
                //$comments['comments_view_edit_delete'] = '<img class="cursorpointer" onclick="display_dialog('.$id.', true, true, \'slide\', \'slide\', 300, 500);" src="images/icons/view.png" alt="'._AM_COMMENTS_VIEW.'" title="'._AM_COMMENTS_VIEW.'" /><a href="admin/comments/comment_edit.php?id='.$id.'"><img src="./images/icons/edit.png" border="0" alt="'._EDIT.'" title="'._EDIT.'"></a><a href="admin/comments/comment_delete.php?id='.$id.'"><img src="./images/icons/delete.png" border="0" alt="'._DELETE.'" title="'._DELETE.'"></a>';
                $xoops->tpl()->appendByRef('comments', $comments);
                $xoops->tpl()->appendByRef('comments_popup', $comments);
                unset($comments);
            }
            if ($comments_count > $comments_limit) {
                $nav = new XoopsPageNav($comments_count, $comments_limit, $comments_start, 'comments_start', 'comments_module=' . $comments_module . '&amp;comments_status=' . $comments_status);
                $xoops->tpl()->assign('nav', $nav->renderNav());
            }
        }
        break;
}
// Call Footer
$xoops->footer();
Пример #14
0
 $numrows = $listingHandler->getCount();
 $listing_arr = $listingHandler->getall($criteria);
 foreach (array_keys($listing_arr) as $i) {
     $lid = $listing_arr[$i]->getVar('lid');
     $cid = $listing_arr[$i]->getVar('cid');
     $name = $listing_arr[$i]->getVar('name');
     $mname = $listing_arr[$i]->getVar('mname');
     $lname = $listing_arr[$i]->getVar('lname');
     $school = $listing_arr[$i]->getVar('school');
     $year = $listing_arr[$i]->getVar('year');
     $studies = $listing_arr[$i]->getVar('studies');
     $activities = $listing_arr[$i]->getVar('activities');
     $extrainfo = $listing_arr[$i]->getVar('extrainfo');
     $occ = $listing_arr[$i]->getVar('occ');
     $date = $listing_arr[$i]->getVar('date');
     $date = XoopsLocale::formatTimestamp($date, 's');
     $email = $listing_arr[$i]->getVar('email');
     $submitter = $listing_arr[$i]->getVar('submitter');
     $usid = $listing_arr[$i]->getVar('usid');
     $town = $listing_arr[$i]->getVar('town');
     $valid = $listing_arr[$i]->getVar('valid');
     $photo = $listing_arr[$i]->getVar('photo');
     $photo2 = $listing_arr[$i]->getVar('photo2');
     $view = $listing_arr[$i]->getVar('view');
     $recordexist = false;
     if ($lid != 0) {
         $recordexist = true;
         $listingHandler->updateCounter($lid);
     }
     $xoops->tpl()->assign('add_from', AlumniLocale::ALUMNI_LISTINGS . ' ' . $xoopsConfig['sitename']);
     $xoops->tpl()->assign('add_from_title', AlumniLocale::ALUMNI_LISTINGS);
Пример #15
0
/**
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         Comments
 * @author          trabis <*****@*****.**>
 * @author          Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
 * @version         $Id$
 */
function b_comments_show($options)
{
    $xoops = Xoops::getInstance();
    $helper = $xoops->getModuleHelper('comments');
    $block = array();
    $available_modules = \Xoops\Module\Plugin::getPlugins('comments');
    if (empty($available_modules)) {
        return $block;
    }
    $comment_handler = $helper->getHandlerComment();
    $criteria = new CriteriaCompo(new Criteria('status', Comments::STATUS_ACTIVE));
    $criteria->setLimit((int) $options[0]);
    $criteria->setSort('created');
    $criteria->setOrder('DESC');
    // Check modules permissions
    $moduleperm_handler = $xoops->getHandlerGroupPermission();
    $gperm_groupid = $xoops->getUserGroups();
    $criteria1 = new CriteriaCompo(new Criteria('gperm_name', 'module_read', '='));
    $criteria1->add(new Criteria('gperm_groupid', '(' . implode(',', $gperm_groupid) . ')', 'IN'));
    $perms = $moduleperm_handler->getObjects($criteria1, true);
    $modIds = array();
    foreach ($perms as $item) {
        $modIds[] = $item->getVar('gperm_itemid');
    }
    if (count($modIds) > 0) {
        $modIds = array_unique($modIds);
        $criteria->add(new Criteria('modid', '(' . implode(',', $modIds) . ')', 'IN'));
    } else {
        return $block;
    }
    $comments = $comment_handler->getObjects($criteria, true);
    $member_handler = $xoops->getHandlerMember();
    $module_handler = $xoops->getHandlerModule();
    $modules = $module_handler->getObjectsArray(new Criteria('dirname', "('" . implode("','", array_keys($available_modules)) . "')", 'IN'), true);
    $comment_config = array();
    foreach (array_keys($comments) as $i) {
        $mid = $comments[$i]->getVar('modid');
        $com['module'] = '<a href="' . \XoopsBaseConfig::get('url') . '/modules/' . $modules[$mid]->getVar('dirname') . '/">' . $modules[$mid]->getVar('name') . '</a>';
        if (!isset($comment_config[$mid])) {
            $comment_config[$mid] = \Xoops\Module\Plugin::getPlugin($modules[$mid]->getVar('dirname'), 'comments');
        }
        $com['id'] = $i;
        $com['title'] = '<a href="' . \XoopsBaseConfig::get('url') . '/modules/' . $modules[$mid]->getVar('dirname') . '/' . $comment_config[$mid]->pageName() . '?' . $comment_config[$mid]->itemName() . '=' . $comments[$i]->getVar('itemid') . '&amp;com_id=' . $i . '&amp;com_rootid=' . $comments[$i]->getVar('rootid') . '&amp;' . htmlspecialchars($comments[$i]->getVar('exparams')) . '#comment' . $i . '">' . $comments[$i]->getVar('title') . '</a>';
        $com['icon'] = htmlspecialchars($comments[$i]->getVar('icon'), ENT_QUOTES);
        $com['icon'] = $com['icon'] != '' ? $com['icon'] : 'icon1.gif';
        $com['time'] = XoopsLocale::formatTimestamp($comments[$i]->getVar('created'), 'm');
        if ($comments[$i]->getVar('uid') > 0) {
            $poster = $member_handler->getUser($comments[$i]->getVar('uid'));
            if (is_object($poster)) {
                $com['poster'] = '<a href="' . \XoopsBaseConfig::get('url') . '/userinfo.php?uid=' . $comments[$i]->getVar('uid') . '">' . $poster->getVar('uname') . '</a>';
            } else {
                $com['poster'] = $xoops->getConfig('anonymous');
            }
        } else {
            $com['poster'] = $xoops->getConfig('anonymous');
        }
        $block['comments'][] = $com;
        unset($com);
    }
    return $block;
}
Пример #16
0
 /**
  * getModuleList
  *
  * @return array of modules
  */
 public function getModuleList()
 {
     // Get main instance
     $xoops = Xoops::getInstance();
     $module_handler = $xoops->getHandlerModule();
     $moduleperm_handler = $xoops->getHandlerGroupPermission();
     $criteria = new CriteriaCompo();
     $criteria->setSort('weight');
     // Get all installed modules
     $modules = $module_handler->getObjects($criteria, true);
     $list = array();
     /* @var $module XoopsModule */
     foreach ($modules as $module) {
         if (!$module->getInfo('extension')) {
             if ($module->getInfo('dirname') == 'system') {
                 $module->setInfo('can_delete', false);
                 $module->setInfo('can_disable', false);
             } else {
                 $module->setInfo('can_delete', true);
                 $module->setInfo('can_disable', true);
             }
             if (round($module->getInfo('version'), 2) != $module->getVar('version')) {
                 $module->setInfo('warning_update', true);
             }
             if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname') . '/icons/logo_small.png')) {
                 $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/icons/logo_small.png');
             } else {
                 $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/16/default.png');
             }
             $module->setInfo('version', round($module->getVar('version') / 100, 2));
             $module->setInfo('update', XoopsLocale::formatTimestamp($module->getVar('last_update'), 's'));
             $module->setInfo('link_admin', \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/' . $module->getInfo('adminindex'));
             if ($module->getVar('isactive')) {
                 $module->setInfo('options', $module->getAdminMenu());
             }
             $groups = array();
             if (is_object($xoops->user)) {
                 $groups = $xoops->user->getGroups();
             }
             $sadmin = $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $groups);
             if ($sadmin && ($module->getVar('hasnotification') || is_array($module->getInfo('config')) || is_array($module->getInfo('comments')))) {
                 $module->setInfo('link_pref', \XoopsBaseConfig::get('url') . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $module->getVar('mid'));
             }
             $list[] = $module;
         }
     }
     return $list;
 }
Пример #17
0
}
$xoops->tpl()->assign('display', $total_messages > 0);
$xoops->tpl()->assign('anonymous', $xoops->getConfig('anonymous'));
if (count($pm_arr) > 0) {
    foreach (array_keys($pm_arr) as $i) {
        if (isset($_REQUEST['op']) && $_REQUEST['op'] == "out") {
            $uids[] = $pm_arr[$i]['to_userid'];
        } else {
            $uids[] = $pm_arr[$i]['from_userid'];
        }
    }
    $member_handler = $xoops->getHandlerMember();
    $senders = $member_handler->getUserList(new Criteria('uid', "(" . implode(", ", array_unique($uids)) . ")", "IN"));
    foreach (array_keys($pm_arr) as $i) {
        $message = $pm_arr[$i];
        $message['msg_time'] = XoopsLocale::formatTimestamp($message["msg_time"]);
        if (isset($_REQUEST['op']) && $_REQUEST['op'] == "out") {
            $message['postername'] = $senders[$pm_arr[$i]['to_userid']];
            $message['posteruid'] = $pm_arr[$i]['to_userid'];
        } else {
            $message['postername'] = $senders[$pm_arr[$i]['from_userid']];
            $message['posteruid'] = $pm_arr[$i]['from_userid'];
        }
        $message['msg_no'] = $i;
        $xoops->tpl()->append('messages', $message);
    }
}
$send_button = new Xoops\Form\Button('', 'send', XoopsLocale::A_SEND);
$send_button->setExtra("onclick='javascript:openWithSelfMain(\"" . \XoopsBaseConfig::get('url') . "/modules/pm/pmlite.php?send=1\", \"pmlite\", 750,720);'");
$delete_button = new Xoops\Form\Button('', 'delete_messages', XoopsLocale::A_DELETE, 'submit');
$move_button = new Xoops\Form\Button('', 'move_messages', $_REQUEST['op'] == 'save' ? _PM_UNSAVE : _PM_TOSAVE, 'submit');
Пример #18
0
/**
 * @deprecated
 * @param int $time
 * @param string $format
 * @param string $timeoffset
 * @return string
 */
function formatTimestamp($time, $format = 'l', $timeoffset = '')
{
    $xoops = Xoops::getInstance();
    $xoops->deprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__);
    return XoopsLocale::formatTimestamp($time, $format, $timeoffset);
}
Пример #19
0
     } else {
         if ($pm_arr[0]->getVar('read_msg') == 0) {
             $pm_handler->setRead($pm_arr[0]);
         }
         $poster = new XoopsUser($pm_arr[0]->getVar("from_userid"));
         if (!is_object($poster)) {
             $xoops->tpl()->assign('poster', false);
             $xoops->tpl()->assign('anonymous', $xoopsConfig['anonymous']);
         } else {
             $xoops->tpl()->assign('poster', $poster);
             $avatar = $xoops->service('avatar')->getAvatarUrl($poster)->getValue();
             $xoops->tpl()->assign('poster_avatar', $avatar);
         }
         $xoops->tpl()->assign('msg_id', $pm_arr[0]->getVar("msg_id"));
         $xoops->tpl()->assign('subject', $pm_arr[0]->getVar("subject"));
         $xoops->tpl()->assign('msg_time', XoopsLocale::formatTimestamp($pm_arr[0]->getVar("msg_time")));
         $xoops->tpl()->assign('msg_image', $pm_arr[0]->getVar("msg_image", "E"));
         $xoops->tpl()->assign('msg_text', $pm_arr[0]->getVar("msg_text"));
         $xoops->tpl()->assign('previous', $start - 1);
         $xoops->tpl()->assign('next', $start + 1);
         $xoops->tpl()->assign('total_messages', $total_messages);
         $xoops->tpl()->assign('read', true);
         $xoops->tpl()->assign('token', $xoops->security()->getTokenHTML());
     }
     break;
 case 'delete':
     $obj = $pm_handler->get($id);
     if (isset($_POST["ok"]) && $_POST["ok"] == 1) {
         if (!$xoops->security()->check()) {
             $xoops->redirect("viewpmsg.php", 3, implode(",", $xoops->security()->getErrors()));
         }
Пример #20
0
                $plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'search');
                /* @var $plugin SearchPluginInterface */
                $results = $plugin->search('', '', 5, 0, $thisUser->getVar('uid'));
                $count = count($results);
                if (is_array($results) && $count > 0) {
                    for ($i = 0; $i < $count; ++$i) {
                        if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
                            $results[$i]['image'] = \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname', 'n') . '/' . $results[$i]['image'];
                        } else {
                            $results[$i]['image'] = \XoopsBaseConfig::get('url') . '/images/icons/posticon2.gif';
                        }
                        if (!preg_match("/^http[s]*:\\/\\//i", $results[$i]['link'])) {
                            $results[$i]['link'] = \XoopsBaseConfig::get('url') . "/modules/" . $module->getVar('dirname', 'n') . "/" . $results[$i]['link'];
                        }
                        $results[$i]['title'] = $myts->htmlSpecialChars($results[$i]['title']);
                        $results[$i]['time'] = $results[$i]['time'] ? XoopsLocale::formatTimestamp($results[$i]['time']) : '';
                    }
                    if ($count == 5) {
                        $showall_link = '<a href="' . \XoopsBaseConfig::get('url') . '/search.php?action=showallbyuser&amp;mid=' . $mid . '&amp;uid=' . $thisUser->getVar('uid') . '">' . XoopsLocale::SHOW_ALL . '</a>';
                    } else {
                        $showall_link = '';
                    }
                    $xoops->tpl()->append('modules', array('name' => $module->getVar('name'), 'results' => $results, 'showall_link' => $showall_link));
                }
                unset($modules[$mid], $module);
            }
        }
    }
}
//User info
$xoops->tpl()->assign('uname', $thisUser->getVar('uname'));
Пример #21
0
    $description = htmlspecialchars($description, ENT_QUOTES);
    $uname = htmlspecialchars($uid ? $uname : XoopsLocale::GUESTS, ENT_QUOTES);
    // make agents shorter
    if (preg_match('/MSIE\\s+([0-9.]+)/', $agent, $regs)) {
        $agent_short = 'IE ' . $regs[1];
    } else {
        if (stristr($agent, 'Gecko') !== false) {
            $agent_short = strrchr($agent, ' ');
        } else {
            $agent_short = substr($agent, 0, strpos($agent, ' '));
        }
    }
    $agent4disp = htmlspecialchars($agent, ENT_QUOTES);
    $agent_desc = $agent == $agent_short ? $agent4disp : htmlspecialchars($agent_short, ENT_QUOTES) . "<img src='../images/dotdotdot.gif' alt='{$agent4disp}' title='{$agent4disp}' />";
    $log_arr['lid'] = $lid;
    $log_arr['date'] = XoopsLocale::formatTimestamp($timestamp);
    $log_arr['uname'] = $uname;
    $log_arr['ip'] = $ip;
    $log_arr['agent_desc'] = $agent_desc;
    $log_arr['type'] = $type;
    $log_arr['description'] = $description;
    $xoops->tpl()->appendByRef('log', $log_arr);
    unset($table_arr);
}
$xoops->footer();
function protector_ip_cmp($a, $b)
{
    $as = explode('.', $a);
    $aval = @$as[0] * 167777216 + @$as[1] * 65536 + @$as[2] * 256 + @$as[3];
    $bs = explode('.', $b);
    $bval = @$bs[0] * 167777216 + @$bs[1] * 65536 + @$bs[2] * 256 + @$bs[3];
Пример #22
0
             $users['checkbox_user'] = false;
         } else {
             $users['group'] = system_AdminIcons('xoops/group_2.png');
             //$users['icon'] = '<img src="'.\XoopsBaseConfig::get('url').'/modules/system/images/icons/user.png" alt="'._AM_SYSTEM_USERS_USER.'" title="'._AM_SYSTEM_USERS_USER.'" />';
             $users['checkbox_user'] = true;
         }
         $users['name'] = $user->getVar("uid");
         $users['name'] = $user->getVar("name");
         $users['uname'] = $user->getVar("uname");
         $users['email'] = $user->getVar("email");
         $users['url'] = $user->getVar("url");
         $avatar = $xoops->service('avatar')->getAvatarUrl($user)->getValue();
         $users['user_avatar'] = empty($avatar) ? system_AdminIcons('anonymous.png') : $avatar;
         $users['reg_date'] = XoopsLocale::formatTimestamp($user->getVar("user_regdate"), "m");
         if ($user->getVar("last_login") > 0) {
             $users['last_login'] = XoopsLocale::formatTimestamp($user->getVar("last_login"), "m");
         } else {
             $users['last_login'] = SystemLocale::NEVER_CONNECTED;
         }
         $users['user_level'] = $user->getVar("level");
         $users['user_icq'] = $user->getVar("user_icq");
         $users['user_aim'] = $user->getVar("user_aim");
         $users['user_yim'] = $user->getVar("user_yim");
         $users['user_msnm'] = $user->getVar("user_msnm");
         $users['posts'] = $user->getVar("posts");
         $xoops->tpl()->appendByRef('users', $users);
         $xoops->tpl()->appendByRef('users_popup', $users);
         unset($users, $user);
     }
 } else {
     $xoops->tpl()->assign('users_no_found', true);
Пример #23
0
$modversion['adminmenu'] = "admin/menu.php";
// database
$modversion['schema'] = "sql/schema.yml";
$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
// Tables created by sql file (without prefix!)
$modversion['tables'] = array("publisher_categories", "publisher_items", "publisher_files", "publisher_meta", "publisher_mimetypes", "publisher_rating");
// Menu
$modversion['hasMain'] = 1;
$modversion['blocks'] = array();
$modversion['blocks'][] = array('file' => "items_new.php", 'name' => _MI_PUBLISHER_ITEMSNEW, 'description' => _MI_PUBLISHER_ITEMSNEW_DSC, 'show_func' => "publisher_items_new_show", 'edit_func' => "publisher_items_new_edit", 'options' => "0|datesub|0|5|65|none", 'template' => "publisher_items_new.tpl");
$modversion['blocks'][] = array('file' => "items_recent.php", 'name' => _MI_PUBLISHER_RECENTITEMS, 'description' => _MI_PUBLISHER_RECENTITEMS_DSC, 'show_func' => "publisher_items_recent_show", 'edit_func' => "publisher_items_recent_edit", 'options' => "0|datesub|5|65", 'template' => "publisher_items_recent.tpl");
$modversion['blocks'][] = array('file' => "items_spot.php", 'name' => _MI_PUBLISHER_ITEMSPOT, 'description' => _MI_PUBLISHER_ITEMSPOT_DSC, 'show_func' => "publisher_items_spot_show", 'edit_func' => "publisher_items_spot_edit", 'options' => "1|5|0|0|1|1|bullet|0|0", 'template' => "publisher_items_spot.tpl");
$modversion['blocks'][] = array('file' => "items_random_item.php", 'name' => _MI_PUBLISHER_ITEMSRANDOM_ITEM, 'description' => _MI_PUBLISHER_ITEMSRANDOM_ITEM_DSC, 'show_func' => "publisher_items_random_item_show", 'template' => "publisher_items_random_item.tpl");
$modversion['blocks'][] = array('file' => "items_menu.php", 'name' => _MI_PUBLISHER_ITEMSMENU, 'description' => _MI_PUBLISHER_ITEMSMENU_DSC, 'show_func' => "publisher_items_menu_show", 'edit_func' => "publisher_items_menu_edit", 'options' => "0|datesub|5", 'template' => "publisher_items_menu.tpl");
$modversion['blocks'][] = array('file' => "latest_files.php", 'name' => _MI_PUBLISHER_LATESTFILES, 'description' => _MI_PUBLISHER_LATESTFILES_DSC, 'show_func' => "publisher_latest_files_show", 'edit_func' => "publisher_latest_files_edit", 'options' => "0|datesub|5|0", 'template' => "publisher_latest_files.tpl");
$modversion['blocks'][] = array('file' => "date_to_date.php", 'name' => _MI_PUBLISHER_DATE_TO_DATE, 'description' => _MI_PUBLISHER_DATE_TO_DATE_DSC, 'show_func' => "publisher_date_to_date_show", 'edit_func' => "publisher_date_to_date_edit", 'options' => XoopsLocale::formatTimestamp(time(), 'm/j/Y') . "|" . XoopsLocale::formatTimestamp(time(), 'm/j/Y'), 'template' => "publisher_date_to_date.tpl");
$modversion['blocks'][] = array('file' => "items_columns.php", 'name' => _MI_PUBLISHER_COLUMNS, 'description' => _MI_PUBLISHER_COLUMNS_DSC, 'show_func' => "publisher_items_columns_show", 'edit_func' => "publisher_items_columns_edit", 'options' => "2|0|4|256|normal", 'template' => "publisher_items_columns.tpl");
$modversion['blocks'][] = array('file' => "latest_news.php", 'name' => _MI_PUBLISHER_LATEST_NEWS, 'description' => _MI_PUBLISHER_LATEST_NEWS_DSC, 'show_func' => "publisher_latest_news_show", 'edit_func' => "publisher_latest_news_edit", 'options' => "0|6|2|300|0|0|100|30|published|1|120|120|1|dcdcdc|RIGHT|1|1|1|1|1|1|1|1|1|1|1|1|1|extended|", 'template' => 'publisher_latest_news.tpl');
$modversion['blocks'][] = array('file' => "search.php", 'name' => _MI_PUBLISHER_SEARCH, 'description' => _MI_PUBLISHER_SEARCH_DSC, 'show_func' => "publisher_search_show", 'template' => 'publisher_search_block.tpl');
$modversion['blocks'][] = array('file' => "category_items_sel.php", 'name' => _MI_PUBLISHER_CATEGORY_ITEMS_SEL, 'description' => _MI_PUBLISHER_CATEGORY_ITEMS_SEL_DSC, 'show_func' => "publisher_category_items_sel_show", 'edit_func' => "publisher_category_items_sel_edit", 'options' => "0|datesub|5|65", 'template' => "publisher_category_items_sel.tpl");
// Config categories
$modversion['configcat'] = array();
$modversion['configcat']['seo'] = array('name' => _MI_PUBLISHER_CONFCAT_SEO, 'description' => _MI_PUBLISHER_CONFCAT_SEO_DSC);
$modversion['configcat']['indexcat'] = array('name' => _MI_PUBLISHER_CONFCAT_INDEXCAT, 'description' => _MI_PUBLISHER_CONFCAT_INDEXCAT_DSC);
$modversion['configcat']['index'] = array('name' => _MI_PUBLISHER_CONFCAT_INDEX, 'description' => _MI_PUBLISHER_CONFCAT_INDEX_DSC);
$modversion['configcat']['category'] = array('name' => _MI_PUBLISHER_CONFCAT_CATEGORY, 'description' => _MI_PUBLISHER_CONFCAT_CATEGORY_DSC);
$modversion['configcat']['item'] = array('name' => _MI_PUBLISHER_CONFCAT_ITEM, 'description' => _MI_PUBLISHER_CONFCAT_ITEM_DSC);
$modversion['configcat']['print'] = array('name' => _MI_PUBLISHER_CONFCAT_PRINT, 'description' => _MI_PUBLISHER_CONFCAT_PRINT_DSC);
$modversion['configcat']['search'] = array('name' => _MI_PUBLISHER_CONFCAT_SEARCH, 'description' => _MI_PUBLISHER_CONFCAT_SEARCH_DSC);
$modversion['configcat']['submit'] = array('name' => _MI_PUBLISHER_CONFCAT_SUBMIT, 'description' => _MI_PUBLISHER_CONFCAT_SUBMIT_DSC);
$modversion['configcat']['permissions'] = array('name' => _MI_PUBLISHER_CONFCAT_PERMISSIONS, 'description' => _MI_PUBLISHER_CONFCAT_PERMISSIONS_DSC);
Пример #24
0
     if (!preg_match("/^http[s]*:\\/\\//i", $results[$i]['link'])) {
         $res[$i]['link'] = $xoops->url('modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']);
     } else {
         $res[$i]['link'] = $results[$i]['link'];
     }
     $res[$i]['title'] = $myts->htmlSpecialChars($results[$i]['title']);
     if (isset($queries_pattern)) {
         $res[$i]['title_highligh'] = preg_replace($queries_pattern, "<span class='searchHighlight'>\$1</span>", $myts->htmlSpecialChars($results[$i]['title']));
     } else {
         $res[$i]['title_highligh'] = $myts->htmlSpecialChars($results[$i]['title']);
     }
     if (!empty($results[$i]['uid'])) {
         $res[$i]['uid'] = @(int) $results[$i]['uid'];
         $res[$i]['uname'] = XoopsUser::getUnameFromId($results[$i]['uid'], true);
     }
     $res[$i]['time'] = !empty($results[$i]['time']) ? " (" . XoopsLocale::formatTimestamp((int) $results[$i]['time']) . ")" : "";
     $res[$i]['content'] = empty($results[$i]['content']) ? "" : preg_replace($queries_pattern, "<span class='searchHighlight'>\$1</span>", $results[$i]['content']);
 }
 if (count($res) > 0) {
     $modules_result[$mid]['result'] = $res;
 }
 $search_url = $search->url('index.php?query=' . urlencode(stripslashes(implode(' ', $queries))));
 $search_url .= "&mid={$mid}&action={$action}&andor={$andor}";
 if ($action === 'showallbyuser') {
     $search_url .= "&uid={$uid}";
 }
 if ($start > 0) {
     $prev = $start - 20;
     $search_url_prev = $search_url . "&start={$prev}";
     $modules_result[$mid]['prev'] = htmlspecialchars($search_url_prev);
 }
Пример #25
0
    $pmform->addElement(new Xoops\Form\Button('', 'move_message', $_REQUEST['op'] == 'save' ? _PM_UNSAVE : _PM_TOSAVE, 'submit'));
    $pmform->addElement(new Xoops\Form\Button('', 'email_message', _PM_EMAIL, 'submit'));
    $pmform->addElement(new Xoops\Form\Hidden('msg_id', $pm->getVar("msg_id")));
    $pmform->addElement(new Xoops\Form\Hidden('op', $_REQUEST['op']));
    $pmform->addElement(new Xoops\Form\Hidden('action', 1));
    $pmform->assign($xoops->tpl());
    if ($pm->getVar("from_userid") == $xoops->user->getVar("uid")) {
        $poster = new XoopsUser($pm->getVar("to_userid"));
    } else {
        $poster = new XoopsUser($pm->getVar("from_userid"));
    }
    if (!is_object($poster)) {
        $xoops->tpl()->assign('poster', false);
        $xoops->tpl()->assign('anonymous', $xoopsConfig['anonymous']);
    } else {
        $xoops->tpl()->assign('poster', $poster);
        $avatar = $xoops->service('avatar')->getAvatarUrl($poster)->getValue();
        $xoops->tpl()->assign('poster_avatar', $avatar);
    }
    if ($pm->getVar("to_userid") == $xoops->user->getVar("uid") && $pm->getVar('read_msg') == 0) {
        $pm_handler->setRead($pm);
    }
    $message = $pm->getValues();
    $message['msg_time'] = XoopsLocale::formatTimestamp($pm->getVar("msg_time"));
}
$xoops->tpl()->assign('message', $message);
$xoops->tpl()->assign('op', $_REQUEST['op']);
$xoops->tpl()->assign('previous', $start - 1);
$xoops->tpl()->assign('next', $start + 1);
$xoops->tpl()->assign('total_messages', $total_messages);
$xoops->footer();
Пример #26
0
 $system_breadcrumb->render();
 $criteria = new CriteriaCompo();
 $criteria->setOrder('weight');
 // Get all installed modules
 $installed_mods = $xoops->getHandlerModule()->getObjectsArray($criteria);
 $listed_mods = array();
 $i = 0;
 $j = 0;
 foreach ($installed_mods as $module) {
     /* @var $module XoopsModule */
     $list_help = array();
     $listed_mods[$i] = $module->getValues();
     $listed_mods[$i]['image'] = $module->getInfo('image');
     $listed_mods[$i]['adminindex'] = $module->getInfo('adminindex');
     $listed_mods[$i]['version'] = round($module->getVar('version') / 100, 2);
     $listed_mods[$i]['last_update'] = XoopsLocale::formatTimestamp($module->getVar('last_update'), 'm');
     $listed_mods[$i]['author'] = $module->getInfo('author');
     $listed_mods[$i]['credits'] = $module->getInfo('credits');
     $listed_mods[$i]['license'] = $module->getInfo('license');
     $listed_mods[$i]['description'] = $module->getInfo('description');
     if ($module->getVar('dirname', 'e') == 'system') {
         $admin_dir = \XoopsBaseConfig::get('root-path') . '/modules/system/admin';
         $dirlist = XoopsLists::getDirListAsArray($admin_dir);
         foreach ($dirlist as $directory) {
             if (XoopsLoad::fileExists($file = $admin_dir . '/' . $directory . '/xoops_version.php')) {
                 require $file;
                 unset($file);
                 if ($modversion['help']) {
                     $list_help[$j]['name'] = system_adminVersion($directory, 'name');
                     $list_help[$j]['link'] = 'help.php?mid=' . $module->getVar('mid', 'e') . '&amp;' . system_adminVersion($directory, 'help');
                 }
Пример #27
0
 /**
  * Send a message to user's email
  *
  * @param XoopsObject|PmMessage $pm
  * @param null|XoopsUser $user
  * @return bool
  */
 public function sendEmail(PmMessage $pm, XoopsUser $user = null)
 {
     $xoops = Xoops::getInstance();
     if (!is_object($user)) {
         $user = $xoops->user;
     }
     $msg = sprintf(_PM_EMAIL_DESC, $user->getVar("uname"));
     $msg .= "\n\n";
     $msg .= XoopsLocale::formatTimestamp($pm->getVar("msg_time"));
     $msg .= "\n";
     $from = new XoopsUser($pm->getVar("from_userid"));
     $to = new XoopsUser($pm->getVar("to_userid"));
     $msg .= sprintf(_PM_EMAIL_FROM, $from->getVar("uname") . " (" . \XoopsBaseConfig::get('url') . "/userinfo.php?uid=" . $pm->getVar("from_userid") . ")");
     $msg .= "\n";
     $msg .= sprintf(_PM_EMAIL_TO, $to->getVar("uname") . " (" . \XoopsBaseConfig::get('url') . "/userinfo.php?uid=" . $pm->getVar("to_userid") . ")");
     $msg .= "\n";
     $msg .= _PM_EMAIL_MESSAGE . ":\n";
     $msg .= "\n" . $pm->getVar("subject") . "\n";
     $msg .= "\n" . strip_tags(str_replace(array("<p>", "</p>", "<br />", "<br />"), "\n", $pm->getVar("msg_text"))) . "\n\n";
     $msg .= "--------------\n";
     $msg .= $xoops->getConfig('sitename') . ": " . \XoopsBaseConfig::get('url') . "\n";
     $xoopsMailer = $xoops->getMailer();
     $xoopsMailer->useMail();
     $xoopsMailer->setToEmails($user->getVar("email"));
     $xoopsMailer->setFromEmail($xoops->getConfig('adminmail'));
     $xoopsMailer->setFromName($xoops->getConfig('sitename'));
     $xoopsMailer->setSubject(sprintf(_PM_EMAIL_SUBJECT, $pm->getVar("subject")));
     $xoopsMailer->setBody($msg);
     return $xoopsMailer->send();
 }
Пример #28
0
         } else {
             $img = '<div id="xo-bannerfix">';
             if (stristr($imageurl, '.swf')) {
                 $img .= '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>';
             } else {
                 $img .= '<img src="' . $imageurl . '" alt="" />';
             }
             $img .= '</div>';
         }
         $banner_finish['bid'] = $bid;
         $banner_finish['impressions'] = $impressions;
         $banner_finish['clicks'] = $clicks;
         $banner_finish['percent'] = $percent;
         $banner_finish['imageurl'] = $img;
         $banner_finish['datestart'] = XoopsLocale::formatTimestamp($banner_finish_arr[$i]->getVar("banner_datestart"), "m");
         $banner_finish['dateend'] = XoopsLocale::formatTimestamp($banner_finish_arr[$i]->getVar("banner_dateend"), "m");
         $name_client = $client_Handler->get($banner_finish_arr[$i]->getVar("banner_cid"));
         $name = '';
         if (is_object($name_client)) {
             $name = $name_client->getVar("bannerclient_name");
         }
         $banner_finish['name'] = $name;
         $xoops->tpl()->appendByRef('banner_finish', $banner_finish);
         $xoops->tpl()->appendByRef('popup_banner_finish', $banner_finish);
         unset($banner_finish);
     }
 }
 // Display Page Navigation
 if ($banner_finish_count > $nb_banners) {
     $nav = new XoopsPageNav($banner_finish_count, $nb_banners, $startF, 'startF', 'start=' . $start);
     $xoops->tpl()->assign('nav_menu_bannerF', $nav->renderNav(4));
Пример #29
0
 /**
  * Render about page
  *
  * @param bool $logo_xoops show logo
  *
  * @return bool|mixed|string
  */
 public function renderAbout($logo_xoops = true)
 {
     $xoops = \Xoops::getInstance();
     $date = explode('/', $this->module->getInfo('release_date'));
     $author = explode(',', $this->module->getInfo('author'));
     $nickname = explode(',', $this->module->getInfo('nickname'));
     $release_date = \XoopsLocale::formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's');
     $author_list = '';
     foreach (array_keys($author) as $i) {
         $author_list .= $author[$i];
         if (isset($nickname[$i]) && $nickname[$i] != '') {
             $author_list .= " (" . $nickname[$i] . "), ";
         } else {
             $author_list .= ", ";
         }
     }
     $changelog = '';
     $language = $xoops->getConfig('locale');
     if (!is_file(\XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt")) {
         $language = 'en_US';
     }
     $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt";
     if (is_readable($file)) {
         $changelog = utf8_encode(implode("<br />", file($file))) . "\n";
     } else {
         $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/docs/changelog.txt";
         if (is_readable($file)) {
             $changelog = utf8_encode(implode("<br />", file($file))) . "\n";
         }
     }
     $author_list = substr($author_list, 0, -2);
     $this->module->setInfo('release_date', $release_date);
     $this->module->setInfo('author_list', $author_list);
     if (is_array($this->module->getInfo('paypal'))) {
         $this->module->setInfo('paypal', $this->module->getInfo('paypal'));
     }
     $this->module->setInfo('changelog', $changelog);
     $xoops->tpl()->assign('module', $this->module);
     $this->addInfoBox(\XoopsLocale::MODULE_INFORMATION, 'info', 'id="xo-about"');
     $this->addInfoBoxLine(\XoopsLocale::C_DESCRIPTION . ' ' . $this->module->getInfo("description"), 'info');
     $this->addInfoBoxLine(\XoopsLocale::C_UPDATE_DATE . ' <span class="bold">' . \XoopsLocale::formatTimestamp($this->module->getVar("last_update"), "m") . '</span>', 'info');
     $this->addInfoBoxLine(\XoopsLocale::C_WEBSITE . ' <a class="xo-tooltip" href="http://' . $this->module->getInfo("module_website_url") . '" rel="external" title="' . $this->module->getInfo("module_website_name") . ' - ' . $this->module->getInfo("module_website_url") . '">' . $this->module->getInfo("module_website_name") . '</a>', 'info');
     $xoops->tpl()->assign('xoops_logo', $logo_xoops);
     $xoops->tpl()->assign('xo_admin_box', $this->itemInfoBox);
     return $xoops->tpl()->fetch($this->getTplPath('about'));
 }
Пример #30
0
 public function renderHeader($title, $text, $uid, $timestamp)
 {
     $ret = '<table cellpadding="4" cellspacing="1" width="98%" class="outer">
   <tr><td class="head">' . $title . '</td></tr><tr><td><br />';
     if ($uid) {
         $ret .= _MD_COMMENTS_POSTER . ': <strong>' . XoopsUser::getUnameFromId($uid) . '</strong>&nbsp;&nbsp;';
     }
     $ret .= _MD_COMMENTS_POSTED . ': <strong>' . XoopsLocale::formatTimestamp($timestamp) . '</strong><br /><br />' . $text . '<br /></td></tr>';
     $ret .= '</table>';
     return $ret;
 }