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


PHP TextCleaner::getInstance方法代码示例

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


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

示例1: showLogs

/**
* @desc Visualiza todos los logs existentes para un determinado software
**/
function showLogs()
{
    global $tpl, $xoopsConfig, $xoopsModule, $functions, $xoopsSecurity;
    define('RMCSUBLOCATION', 'itemlogs');
    $item = isset($_REQUEST['item']) ? intval($_REQUEST['item']) : 0;
    $sw = new DTSoftware($item);
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $tc = TextCleaner::getInstance();
    $tf = new RMTimeFormatter(0, __('%m%-%d%-%Y%', 'dtransport'));
    $sql = "SELECT * FROM " . $db->prefix('dtrans_logs') . " WHERE id_soft={$item}";
    $result = $db->queryF($sql);
    while ($rows = $db->fetchArray($result)) {
        $log = new DTLog();
        $log->assignVars($rows);
        $logs[] = array('id' => $log->id(), 'title' => $log->title(), 'log' => $tc->truncate($tc->clean_disabled_tags($log->log()), 80), 'date' => $tf->format($log->date()));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; <a href='./items.php'>" . sprintf(_AS_DT_SW, $sw->getVar('name')) . "</a> &raquo; " . _AS_DT_LOGS);
    $functions->toolbar();
    $tpl->add_style('admin.css', 'dtransport');
    $tpl->add_local_script('admin.js', 'dtransport');
    $tpl->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    include DT_PATH . '/include/js_strings.php';
    xoops_cp_header();
    include $tpl->get_template('admin/dtrans_logs.php', 'module', 'dtransport');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:29,代码来源:logs.php

示例2: eventCoreIncludeCommonLanguage

 /**
  * To prevent errors when upload images with closed site
  */
 public function eventCoreIncludeCommonLanguage()
 {
     global $xoopsConfig;
     if ($xoopsConfig['cpanel'] != 'redmexico') {
         $db = XoopsDatabaseFactory::getDatabaseConnection();
         $db->queryF("UPDATE " . $db->prefix("config") . " SET conf_value='redmexico' WHERE conf_modid=0 AND conf_catid=1 AND conf_name='cpanel'");
     }
     /**
      * Check before to a rmcommon native module be installed
      */
     $fct = RMHttpRequest::get('fct', 'string', '');
     $op = RMHttpRequest::get('op', 'string', '');
     if ('modulesadmin' == $fct && 'install' == $op) {
         $dirname = RMHttpRequest::get('module', 'string', '');
         if ('' != $dirname) {
             $module = new XoopsModule();
             $module->loadInfoAsVar($dirname);
             if ($module->getInfo('rmnative')) {
                 RMUris::redirect_with_message(__('Please install %s using the modules manager from Common Utilities to prevent errors during install.', 'rmcommon'), RMCURL . '/modules.php?action=install&amp;dir=' . $dirname, RMMSG_WARN);
             }
         }
     }
     if (RMUris::current_url() == RMCURL . '/include/upload.php' && $xoopsConfig['closesite']) {
         $security = rmc_server_var($_POST, 'rmsecurity', 0);
         $data = TextCleaner::getInstance()->decrypt($security, true);
         $data = explode("|", $data);
         // [0] = referer, [1] = session_id(), [2] = user, [3] = token
         $xoopsUser = new XoopsUser($data[0]);
         if ($xoopsUser->isAdmin()) {
             $xoopsConfig['closesite'] = 0;
         }
     }
     RMEvents::get()->run_event('rmcommon.include.common.language');
 }
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:37,代码来源:core.php

示例3: bxpress_recents_show

function bxpress_recents_show($options)
{
    $util = RMUtilities::get();
    $tc = TextCleaner::getInstance();
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $xoopsModuleConfig = $util->module_config('exmbb');
    $mc = RMUtilities::module_config('bxpress');
    $tbl1 = $db->prefix('bxpress_posts');
    $tbl2 = $db->prefix('bxpress_topics');
    $tbl3 = $db->prefix('bxpress_posts_text');
    $tbl4 = $db->prefix('bxpress_forums');
    $sql = "SELECT MAX(id_post) AS id FROM {$tbl1} WHERE approved=1 GROUP BY id_topic ORDER BY MAX(id_post) DESC LIMIT 0,{$options['0']}";
    $result = $db->queryF($sql);
    $topics = array();
    $block = array();
    include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxforum.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxpost.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxtopic.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxfunctions.class.php';
    $post = new bXPost();
    $forum = new bXForum();
    $tf = new RMTimeFormatter(0, '%T%-%d%-%Y% at %h%:%i%');
    while ($row = $db->fetchArray($result)) {
        $post = new bXPost($row['id']);
        $topic = new bXTopic($post->topic());
        $forum = new bXForum($post->forum());
        $ret = array();
        $ret['id'] = $topic->id();
        $ret['post'] = $post->id();
        $ret['link'] = $post->permalink();
        if ($options[2]) {
            $ret['date'] = $tf->format($post->date());
        }
        if ($options[3]) {
            $ret['poster'] = sprintf(__('Posted by: %s', 'bxpress'), "<a href='" . $post->permalink() . "'>" . $post->uname() . "</a>");
        }
        $ret['title'] = $topic->title();
        if ($options[4]) {
            $ret['text'] = $tc->clean_disabled_tags($post->text());
        }
        $ret['forum'] = array('id' => $forum->id(), 'name' => $forum->name(), 'link' => $forum->permalink());
        $topics[] = $ret;
    }
    // Opciones
    $block['showdates'] = $options[2];
    $block['showuname'] = $options[3];
    $block['showtext'] = $options[4];
    $block['topics'] = $topics;
    $block['lang_topic'] = __('Topic', 'bxpress');
    $block['lang_date'] = __('Date', 'bxpress');
    $block['lang_poster'] = __('Poster', 'bxpress');
    return $block;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:53,代码来源:bxpress_recents.php

示例4: savePlatforms

/**
* @desc Almacena la información de las plataformas
**/
function savePlatforms($edit = 0)
{
    global $xoopsSecurity;
    foreach ($_POST as $k => $v) {
        ${$k} = $v;
    }
    if (!$xoopsSecurity->check()) {
        redirectMsg('Session token expired!', 'dtransport');
    }
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $tc = TextCleaner::getInstance();
    $nameid = $tc->sweetstring($name);
    if ($edit) {
        //Verificamos si plataforma es válida
        if ($id <= 0) {
            redirectMsg('platforms.php', __('You must specify a valid platform ID!', 'dtrasnport'), 1);
            die;
        }
        //Verificamos si plataforma existe
        $plat = new DTPlatform($id);
        if ($plat->isNew()) {
            redirectMsg('platforms.php', __('Specified platform does not exists!', 'dtransport'), 1);
            die;
        }
        //Comprueba que la plataforma no exista
        $sql = "SELECT COUNT(*) FROM " . $db->prefix('dtrans_platforms') . " WHERE (name='{$name}' OR nameid='{$nameid}') AND id_platform<>" . $plat->id();
        list($num) = $db->fetchRow($db->queryF($sql));
        if ($num > 0) {
            redirectMsg('platforms.php', __('Another platform with same name already exists!', 'dtransport'), 1);
            die;
        }
    } else {
        //Comprueba que la plataforma no exista
        $sql = "SELECT COUNT(*) FROM " . $db->prefix('dtrans_platforms') . " WHERE name='{$name}' OR nameid='{$nameid}'";
        list($num) = $db->fetchRow($db->queryF($sql));
        if ($num > 0) {
            redirectMsg('platforms.php', __('Another platform with same name already exists!', 'dtransport'), 1);
            die;
        }
        $plat = new DTPlatform();
    }
    $plat->setName($name);
    $plat->setNameId($nameid);
    if (!$plat->save()) {
        redirectMsg('platforms.php', __('Database could not be updated!', 'dtransport') . '<br />' . $plat->errors(), 1);
        die;
    } else {
        redirectMsg('./platforms.php', __('Platform saved successfully!', 'dtransport'), 0);
        die;
    }
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:54,代码来源:platforms.php

示例5: __construct

 /**
  * @param string $caption Texto del campo
  * @param string $name Nombre de este campo
  * @param string $width Ancho del campo. Puede ser el valor en formato pixels (300px) o en porcentaje (100%)
  * @param string $height Alto de campo. El valor debe ser pasado en formato pixels (300px).
  * @param string $default Texto incial al cargar el campo. POr defecto se muestra vaco.
  * @param string $type Tipo de Editor. Posibles valores: FCKeditor, DHTML
  */
 function __construct($caption, $name, $width = '100%', $height = '300px', $default = '', $type = '', $change = 1, $ele = array('op'))
 {
     $rmc_config = RMFunctions::get()->configs();
     $tcleaner = TextCleaner::getInstance();
     $this->setCaption($caption);
     $this->setName($name);
     $this->_width = $width;
     $this->_height = $height;
     $this->_default = isset($_REQUEST[$name]) ? $tcleaner->stripslashes($_REQUEST[$name]) : $tcleaner->stripslashes($default);
     $this->_type = $type == '' ? $rmc_config['editor_type'] : $type;
     $this->_type = strtolower($this->_type);
     $this->_change = $change;
     $this->_eles = $ele;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:22,代码来源:editor.class.php

示例6: eventCoreIncludeCommonLanguage

 /**
  * To prevent errors when upload images with closed site 
  */
 public function eventCoreIncludeCommonLanguage()
 {
     global $xoopsConfig;
     if (RMFunctions::current_url() == RMCURL . '/include/upload.php' && $xoopsConfig['closesite']) {
         $security = rmc_server_var($_POST, 'rmsecurity', 0);
         $data = TextCleaner::getInstance()->decrypt($security, true);
         $data = explode("|", $data);
         // [0] = referer, [1] = session_id(), [2] = user, [3] = token
         $xoopsUser = new XoopsUser($data[0]);
         if ($xoopsUser->isAdmin()) {
             $xoopsConfig['closesite'] = 0;
         }
     }
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:17,代码来源:core.php

示例7: rd_show_page

function rd_show_page()
{
    RMTemplate::get()->assign('xoops_pagetitle', __('Home Page', 'docs'));
    xoops_cp_header();
    include_once RMCPATH . '/class/form.class.php';
    $content = @file_get_contents(XOOPS_CACHE_PATH . '/rd_homepage.html');
    $content = TextCleaner::getInstance()->to_display($content);
    $editor = new RMFormEditor('', 'homepage', '100%', '450px', $content);
    $rmc_config = RMFunctions::configs();
    if ($rmc_config['editor_type'] == 'tiny') {
        $tiny = TinyEditor::getInstance();
        $tiny->add_config('theme_advanced_buttons1', 'res_index');
    }
    include RMEvents::get()->run_event('docs.get.homepage.template', RMTemplate::get()->get_template('admin/rd_homepage.php', 'module', 'docs'));
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:16,代码来源:hpage.php

示例8: mywordsBlockRecent

function mywordsBlockRecent($options)
{
    global $xoopsModuleConfig, $xoopsModule, $xoopsUser;
    $mc = RMSettings::module_settings('mywords');
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $by = '';
    switch ($options[1]) {
        case 'recent':
            $by = 'pubdate';
            break;
        case 'popular':
            $by = "`reads`";
            break;
        case 'comm':
            $by = "`comments`";
            break;
    }
    $posts = MWFunctions::get_posts_by_cat($options[5], 0, $options[0], $by, 'DESC');
    $block = array();
    foreach ($posts as $post) {
        $ret = array();
        $ret['id'] = $post->id();
        $ret['title'] = $post->getVar('title');
        $ret['link'] = $post->permalink();
        // Content
        if ($options[2]) {
            $ret['content'] = TextCleaner::getInstance()->truncate($post->content(true), $options[3]);
        }
        // Pubdate
        if ($options[4]) {
            $ret['date'] = formatTimestamp($post->getVar('pubdate'), 'c');
        }
        // Show reads
        if ($options[1] == 'popular') {
            $ret['hits'] = sprintf(__('%u Reads', 'mywords'), $post->getVar('reads'));
        } elseif ($options[1] == 'comm') {
            $ret['comments'] = sprintf(__('%u Comments', 'mywords'), $post->getVar('comments'));
        }
        $ret['time'] = $post->getVar('pubdate');
        $ret['image'] = RMIMage::get()->load_from_params($post->image);
        $block['posts'][] = $ret;
    }
    RMTemplate::get()->add_style('mwblocks.css', 'mywords');
    return $block;
}
开发者ID:JustineBABY,项目名称:mywords,代码行数:45,代码来源:block.recent.php

示例9: bxpressSearch

/**
* @desc Realiza una búsqueda en el módulo desde EXM
*/
function bxpressSearch($queryarray, $andor, $limit, $offset, $userid = 0)
{
    global $myts, $module;
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $tbl1 = $db->prefix("mod_bxpress_topics");
    $tbl2 = $db->prefix("mod_bxpress_posts_text");
    $tbl3 = $db->prefix("mod_bxpress_posts");
    if ($userid <= 0) {
        $sql = "SELECT a.*,b.*,c.* FROM {$tbl1} a, {$tbl2} b, {$tbl3} c ";
        $sql1 = '';
        foreach ($queryarray as $k) {
            $sql1 .= ($sql1 == '' ? '' : " {$andor} ") . " (\n        \t    (a.title LIKE '%{$k}%' AND a.id_topic=c.id_topic) OR \n        \t     (b.post_text LIKE '%{$k}%' AND b.post_id=c.id_post))";
        }
        $sql .= $sql1 != '' ? "WHERE {$sql1}" : '';
        $sql .= $userid > 0 ? "GROUP BY c.id_topic" : " GROUP BY c.id_topic";
        $sql .= " ORDER BY c.post_time DESC LIMIT {$offset}, {$limit}";
        $result = $db->queryF($sql);
    } else {
        $sql = "SELECT a.*, b.*, c.post_text FROM {$tbl3} a, {$tbl1} b, {$tbl2} c WHERE a.uid='{$userid}' AND b.id_topic=a.id_topic \n                AND c.post_id=a.id_post ";
        $sql1 = '';
        foreach ($queryarray as $k) {
            $sql1 .= ($sql1 == '' ? 'AND ' : " {$andor} ") . "\n                b.title LIKE '%{$k}%' AND c.post_text LIKE '%{$k}%'";
        }
        $sql .= $sql1;
        $sql .= "ORDER BY a.post_time DESC\n                LIMIT {$offset}, {$limit}";
        $result = $db->query($sql);
    }
    include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxpost.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxfunctions.class.php';
    $tc = TextCleaner::getInstance();
    $ret = array();
    while ($row = $db->fetchArray($result)) {
        $post = new bXPost();
        $post->assignVars($row);
        $rtn = array();
        $rtn['image'] = 'images/forum16.png';
        $rtn['link'] = $post->permalink();
        $rtn['title'] = $row['title'];
        $rtn['time'] = $row['post_time'];
        $rtn['uid'] = $row['uid'];
        $rtn['desc'] = substr($tc->clean_disabled_tags($row['post_text']), 0, 150) . '...';
        $ret[] = $rtn;
    }
    return $ret;
}
开发者ID:petitours,项目名称:bxpress,代码行数:48,代码来源:search.php

示例10: xt_show_menus

function xt_show_menus()
{
    global $xtAssembler, $xtFunctions;
    $tc = TextCleaner::getInstance();
    $menus = $xtAssembler->rootMenus();
    if (!$menus) {
        redirectMsg('themes.php', __('This theme does not support xThemes menus!', 'xthemes'), RMMSG_WARN);
    }
    $theme_menu = $xtAssembler->menu();
    $tpl = RMTemplate::get();
    $tpl->add_local_script('jquery.nestedSortable.js', 'xthemes');
    $tpl->add_local_script('json_encode.js', 'xthemes');
    $tpl->add_head_script("var lang_delete = '" . __('Do you really want to delete selected menu?', 'xthemes') . "';");
    $tpl->add_local_script('xthemes.js', 'xthemes');
    $tpl->assign('xoops_pagetitle', __('Theme menus', 'xthemes'));
    xoops_cp_header();
    include $tpl->get_template('xt_navigation.php', 'module', 'xthemes');
    xoops_cp_footer();
}
开发者ID:arab4domin,项目名称:xthemes,代码行数:19,代码来源:navigation.php

示例11: showScreens

/**
* @des Visualiza todas las pantallas existentes
**/
function showScreens()
{
    global $xoopsModule, $xoopsSecurity, $tpl, $functions, $xoopsModule, $xoopsModuleConfig, $xoopsUser, $xoopsConfig;
    define('RMCSUBLOCATION', 'screenshots');
    if ($xoopsConfig['closesite']) {
        showMessage(__('Screenshop uploader does not work when site is closed. Before to start uploding, please change this configuration.', 'rmcommon'), RMMSG_WARN);
    }
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $tc = TextCleaner::getInstance();
    $item = rmc_server_var($_REQUEST, 'item', 0);
    if ($item <= 0) {
        redirectMsg('items.php', __('Download item ID not provided!', 'dtransport'), RMMSG_WARN);
    }
    $sw = new DTSoftware($item);
    $sql = "SELECT * FROM " . $db->prefix('dtrans_screens') . " WHERE id_soft={$item}";
    $result = $db->queryF($sql);
    while ($rows = $db->fetchArray($result)) {
        $sc = new DTScreenshot();
        $sc->assignVars($rows);
        $screens[] = array('id' => $sc->id(), 'title' => $sc->title(), 'desc' => substr($tc->clean_disabled_tags($sc->desc()), 0, 80) . "...", 'image' => XOOPS_UPLOAD_URL . '/screenshots/' . date('Y', $sc->date()) . '/' . date('m', $sc->date()) . '/ths/' . $sc->image());
    }
    // CSS Styles
    $tpl->add_style('admin.css', 'dtransport');
    $tpl->add_style('screens.css', 'dtransport');
    $tpl->add_style('uploadify.css', 'rmcommon');
    // Javascripts
    $tpl->add_local_script('swfobject.js', 'rmcommon', 'include');
    $tpl->add_local_script('jquery.uploadify.js', 'rmcommon', 'include');
    $tpl->add_local_script('screens.js', 'dtransport');
    $tc = TextCleaner::getInstance();
    $rmf = RMFunctions::get();
    ob_start();
    include DT_PATH . '/js/screenshots.js';
    $script = ob_get_clean();
    $tpl->add_head_script($script);
    $functions->toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; <a href='items.php'>" . __('Downloads', 'dtransport') . "</a> &raquo; " . __('Screenshots Management', 'dtransport'));
    $tpl->assign('xoops_pagetitle', sprintf(__("%s Screenshots", 'dtransport'), $sw->getVar('name')));
    include DT_PATH . '/include/js_strings.php';
    xoops_cp_header();
    include $tpl->get_template('admin/dtrans_screens.php', 'module', 'dtransport');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:46,代码来源:screens.php

示例12: __construct

 /**
  * @param string $caption Texto del campo
  * @param string $name Nombre de este campo
  * @param string $width Ancho del campo. Puede ser el valor en formato pixels (300px) o en porcentaje (100%)
  * @param string $height Alto de campo. El valor debe ser pasado en formato pixels (300px).
  * @param string $default Texto incial al cargar el campo. POr defecto se muestra vaco.
  * @param string $type Tipo de Editor. Posibles valores: tiny, html, xoops, simple, markdown
  */
 function __construct($caption, $name = null, $width = '100%', $height = '300px', $default = '', $type = '', $change = 1, $ele = array('op'))
 {
     $rmc_config = RMSettings::cu_settings();
     $tcleaner = TextCleaner::getInstance();
     if (is_array($caption)) {
         parent::__construct($caption);
     } else {
         parent::__construct([]);
         $this->setWithDefaults('caption', $caption, '');
         $this->setWithDefaults('name', $name, '');
         $this->setWithDefaults('id', $tcleaner->sweetstring($name), '');
         $this->setWithDefaults('width', $width, '100%');
         $this->setWithDefaults('height', $height, '300px');
         $this->setWithDefaults('value', isset($_REQUEST[$name]) ? $tcleaner->stripslashes($_REQUEST[$name]) : $tcleaner->stripslashes($default), '');
         $this->setWithDefaults('type', $type, $rmc_config->editor_type);
         $this->setWithDefaults('change', $change, 1);
         $this->setWithDefaults('elements', $ele, array('op'));
     }
     $this->setIfNotSet('type', $type == '' ? $rmc_config->editor_type : $type);
     $this->setIfNotSet('value', '');
 }
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:29,代码来源:editor.class.php

示例13: showAnnounces

/**
* @desc Muestra la lista de los anuncios existentes
*/
function showAnnounces()
{
    global $db, $xoopsModule, $xoopsSecurity;
    $result = $db->query("SELECT * FROM " . $db->prefix("bxpress_announcements") . " ORDER BY date");
    $announcements = array();
    while ($row = $db->fetchArray($result)) {
        $an = new bXAnnouncement();
        $an->assignVars($row);
        $announcements[] = array('id' => $an->id(), 'text' => TextCleaner::getInstance()->truncate($an->text(), 100), 'date' => formatTimestamp($an->date()), 'expire' => formatTimeStamp($an->expire()), 'where' => constant('BX_FWHERE' . $an->where()), 'wherelink' => $an->where() == 1 ? '../forum.php?id=' . $an->forum() : '../', 'by' => $an->byName());
    }
    $announcements = RMEvents::get()->run_event('bxpress.announcements.list', $announcements);
    RMTemplate::get()->set_help('http://www.redmexico.com.mx/docs/bxpress-forums/anuncios/standalone/1/');
    bXFunctions::menu_bar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Announcements Management', 'bxpress'));
    xoops_cp_header();
    RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    RMTemplate::get()->add_style('admin.css', 'bxpress');
    RMTemplate::get()->add_local_script('admin.js', 'bxpress');
    include RMTemplate::get()->get_template("admin/forums_announcements.php", 'module', 'bxpress');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:24,代码来源:announcements.php

示例14: showAnnounces

/**
* @desc Muestra la lista de los anuncios existentes
*/
function showAnnounces()
{
    global $db, $xoopsModule, $xoopsSecurity;
    $result = $db->query("SELECT * FROM " . $db->prefix("mod_bxpress_announcements") . " ORDER BY date");
    $announcements = array();
    while ($row = $db->fetchArray($result)) {
        $an = new bXAnnouncement();
        $an->assignVars($row);
        $announcements[] = array('id' => $an->id(), 'text' => TextCleaner::getInstance()->truncate($an->text(), 100), 'date' => formatTimestamp($an->date()), 'expire' => formatTimeStamp($an->expire()), 'where' => constant('BX_FWHERE' . $an->where()), 'wherelink' => $an->where() == 1 ? '../forum.php?id=' . $an->forum() : '../', 'by' => $an->byName());
    }
    $announcements = RMEvents::get()->run_event('bxpress.announcements.list', $announcements);
    RMTemplate::get()->add_help(__('Announcements Help', 'bxpress'), '#');
    $bc = RMBreadCrumb::get();
    $bc->add_crumb(__('Announcements Management', 'bxpress'));
    xoops_cp_header();
    RMTemplate::get()->add_script('jquery.checkboxes.js', 'rmcommon', array('directory' => 'include'));
    RMTemplate::get()->add_style('admin.css', 'bxpress');
    RMTemplate::get()->add_script('admin.js', 'bxpress');
    include RMTemplate::get()->get_template("admin/forums-announcements.php", 'module', 'bxpress');
    xoops_cp_footer();
}
开发者ID:petitours,项目名称:bxpress,代码行数:24,代码来源:announcements.php

示例15: ahelpSearch

/**
* @desc Realiza una búsqueda en el módulo desde EXM
*/
function ahelpSearch($queryarray, $andor, $limit, $offset, $userid)
{
    global $myts;
    include_once XOOPS_ROOT_PATH . "/modules/docs/class/rdsection.class.php";
    include_once XOOPS_ROOT_PATH . "/modules/docs/class/rdresource.class.php";
    $mc = RMUtilities::module_config('docs');
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $tbl1 = $db->prefix("rd_resources");
    $tbl2 = $db->prefix("rd_sections");
    $sql = "SELECT a.id_res,a.title,a.description,a.created,a.modified,a.public,a.nameid,a.owner,a.owname,a.approved,b.id_sec,b.title AS stitle,b.content,b.id_res AS sid_res,\n\tb.nameid AS snameid,b.uid,b.uname,b.created AS screated FROM {$tbl1} a, {$tbl2} b ";
    $sql1 = '';
    foreach ($queryarray as $k) {
        $sql1 .= ($sql1 == '' ? '' : " {$andor} ") . " (a.id_res=b.id_res) AND (\n        \t (b.title LIKE '%{$k}%' AND b.id_res=a.id_res) OR \n        \t (b.content LIKE '%{$k}%' AND b.id_res=a.id_res))";
    }
    $sql .= $sql1 != '' ? "WHERE {$sql1}" : '';
    $sql .= " AND approved=1 AND public=1 ORDER BY a.modified DESC LIMIT {$offset}, {$limit}";
    $result = $db->queryF($sql);
    $ret = array();
    while ($row = $db->fetchArray($result)) {
        $res = new RDResource();
        $res->assignVars($row);
        $sec = new RDSection();
        $sec->assignVars($row);
        $sec->assignVar('title', $row['stitle']);
        $sec->assignVar('id_res', $row['sid_res']);
        $sec->assignVar('nameid', $row['snameid']);
        $sec->assignVar('created', $row['screated']);
        $rtn = array();
        $rtn['image'] = 'images/result.png';
        $rtn['link'] = $sec->permalink();
        $rtn['title'] = $sec->getVar('title');
        $rtn['time'] = $sec->getVar('created');
        $rtn['uid'] = $sec->getVar('uid');
        $rtn['desc'] = TextCleaner::getInstance()->truncate($sec->getVar('content'), 150);
        $ret[] = $rtn;
    }
    return $ret;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:41,代码来源:search.php


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