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


PHP MyTextSanitizer::getInstance方法代码示例

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


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

示例1: fetch

 function fetch()
 {
     parent::fetch();
     $t_queries = array();
     $myts =& MyTextSanitizer::getInstance();
     if ($this->get('andor') == 'exact' && strlen($this->get('query')) >= $this->_mKeywordMin) {
         $this->mQueries[] = $myts->addSlashes($this->get('query'));
     } else {
         $query = $this->get('query');
         if (defined('XOOPS_USE_MULTIBYTES')) {
             $query = xoops_trim($query);
         }
         $separator = '/[\\s,]+/';
         if (defined('_MD_LEGACY_FORMAT_SEARCH_SEPARATOR')) {
             $separator = _MD_LEGACY_FORMAT_SEARCH_SEPARATOR;
         }
         $tmpArr = preg_split($separator, $query);
         foreach ($tmpArr as $tmp) {
             if (strlen($tmp) >= $this->_mKeywordMin) {
                 $this->mQueries[] = $myts->addSlashes($tmp);
             }
         }
     }
     $this->set('query', implode(" ", $this->mQueries));
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:25,代码来源:SearchResultsForm.class.php

示例2: b_mylinks_random_show

/**
 * Mylinks Random Term Block
 *
 * Xoops Mylinks - a links module
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright::  © The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license::    http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package::    mylinks
 * @subpackage:: blocks
 * @author::     hsalazar
 * @author::     zyspec (owners@zyspec)
 * @version::    $Id$
 * @since::      File available since Release 3.11
 */
function b_mylinks_random_show()
{
    global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsUser;
    $mylinksDir = basename(dirname(dirname(__FILE__)));
    xoops_load('mylinksUtility', $mylinksDir);
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $result = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM " . $xoopsDB->prefix("mylinks_links") . " l, " . $xoopsDB->prefix("mylinks_text") . " t WHERE l.lid=t.lid AND status>0 ORDER BY RAND() LIMIT 0,1");
    if ($result) {
        list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result);
        $link = $myts->displayTarea(ucfirst($ltitle));
        $description = $myts->displayTarea(mb_substr($description, 0, 100)) . "...";
        $mylinksCatHandler = xoops_getmodulehandler('category', $mylinksDir);
        $catObj = $mylinksCatHandler->get($cid);
        if (is_object($catObj) && !empty($catObj)) {
            $categoryName = $catObj->getVar('title');
            $categoryName = $myts->displayTarea($categoryName);
        } else {
            $cid = 0;
            $categoryName = '';
        }
        $block['title'] = _MB_MYLINKS_RANDOMTITLE;
        $block['content'] = "<div style=\"font-size: 12px; font-weight: bold; background-color: #ccc; padding: 4px; margin: 0;\"><a href=\"" . XOOPS_URL . "/modules/{$mylinksDir}/category.php?cid={$cid}\">{$categoryName}</a></div>";
        $block['content'] .= "<div style=\"padding: 4px 0 0 0; color: #456;\"><h5 style=\"margin: 0;\"><a href=\"" . XOOPS_URL . "/modules/{$mylinksDir}/entry.php?lid={$lid}\">{$link}</a></h5><div>{$description}</div>";
        unset($catObj, $mylinksCatHandler);
        $block['content'] .= "<div style=\"text-align: right; font-size: x-small;\"><a href=\"" . XOOPS_URL . "/modules/{$mylinksDir}/index.php\">" . _MB_MYLINKS_SEEMORE . "</a></div>";
    }
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:50,代码来源:mylinks_rand.php

示例3: XortifySignupForm

function XortifySignupForm()
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsThemeForm(_AM_SPIDERS_FRM_TITLE, "xortify_member", "", "post");
    $form->addElement(new XoopsFormText(_AM_SPIDERS_FRM_UNAME, "uname", 35, 128, $_REQUEST['uname']));
    $form->addElement(new XoopsFormPassword(_AM_SPIDERS_FRM_PASS, "pass", 35, 128, $_REQUEST['pass']), false);
    $form->addElement(new XoopsFormPassword(_AM_SPIDERS_FRM_VPASS, "vpass", 35, 128, $_REQUEST['vpass']), false);
    $form->addElement(new XoopsFormText(_AM_SPIDERS_FRM_EMAIL, "email", 35, 128, $_REQUEST['email']));
    $form->addElement(new XoopsFormText(_AM_SPIDERS_FRM_URL, "url", 35, 128, $_REQUEST['url']));
    $form->addElement(new XoopsFormRadioYN(_AM_SPIDERS_FRM_VIEWEMAIL, "viewemail", $_REQUEST['viewemail']));
    $form->addElement(new XoopsFormSelectTimezone(_AM_SPIDERS_FRM_TIMEZONE, "timezone", $_REQUEST['timezone']));
    $xortifyAuth =& XortifyAuthFactory::getAuthConnection(false, apimethod());
    $myts =& MyTextSanitizer::getInstance();
    $disclaimer = $xortifyAuth->network_disclaimer();
    if (strlen(trim($disclaimer)) == 0) {
        $disclaimer = _AM_SPIDERS_FRM_NOSOAP_DISCLAIMER;
    }
    $form->addElement(new XoopsFormLabel(_AM_SPIDERS_FRM_DISCLAIMER, $myts->nl2br($disclaimer)));
    $form->addElement(new XoopsFormRadioYN(_AM_SPIDERS_FRM_DISCLAIMER_AGREE, "agree", false));
    $form->addElement(new XoopsFormCaptcha(_AM_SPIDERS_FRM_PUZZEL, 'xoopscaptcha', false), true);
    $form->addElement(new XoopsFormHidden('op', 'signup'));
    $form->addElement(new XoopsFormHidden('fct', 'save'));
    if ($disclaimer != _AM_SPIDERS_FRM_NOSOAP_DISCLAIMER) {
        $form->addElement(new XoopsFormButton('', 'submit', _AM_SPIDERS_FRM_REGISTER, 'submit'));
    }
    return $form->render();
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:27,代码来源:forms.php

示例4: genPathCheckHtml

/**
 * @param $path
 * @param $valid
 *
 * @return string
 */
function genPathCheckHtml($path, $valid)
{
    $myts = MyTextSanitizer::getInstance();
    if ($valid) {
        switch ($path) {
            case 'lib':
            case 'data':
            default:
                $msg = XOOPS_PATH_FOUND;
                break;
        }
        $msg = $myts->htmlspecialchars($msg, ENT_QUOTES, _UPGRADE_CHARSET, false);
        return '<span class="result-y">y</span> ' . $msg;
    } else {
        switch ($path) {
            case 'lib':
            case 'data':
            default:
                $msg = ERR_COULD_NOT_ACCESS;
                break;
        }
        $msg = $myts->htmlspecialchars($msg, ENT_QUOTES, _UPGRADE_CHARSET, false);
        return '<span class="result-x">x</span> ' . $msg;
    }
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:settings_path.php

示例5: store

 function store()
 {
     $myts =& MyTextSanitizer::getInstance();
     $title = "";
     $imgurl = "";
     $insert = false;
     if (isset($this->topic_title) && $this->topic_title != "") {
         $title = $myts->addSlashes($this->topic_title);
     }
     if (isset($this->topic_imgurl) && $this->topic_imgurl != "") {
         $imgurl = $myts->addSlashes($this->topic_imgurl);
     }
     if (!isset($this->topic_pid) || !is_numeric($this->topic_pid)) {
         $this->topic_pid = 0;
     }
     if (empty($this->topic_id)) {
         $insert = true;
         $this->topic_id = $this->db->genId($this->table . "_topic_id_seq");
         $sql = sprintf("INSERT INTO %s (topic_id, topic_pid, topic_imgurl, topic_title, banner, banner_inherit, forum_id, weight) VALUES (%u, %u, '%s', '%s', '%s', %u, %u, %u)", $this->table, $this->topic_id, $this->topic_pid, $imgurl, $title, $myts->addSlashes($this->banner), $this->banner_inherit, $this->forum_id, $this->weight);
     } else {
         $sql = sprintf("UPDATE %s SET topic_pid = %u, topic_imgurl = '%s', topic_title = '%s', banner='%s', banner_inherit=%u, forum_id=%u, weight=%u WHERE topic_id = %u", $this->table, $this->topic_pid, $imgurl, $title, $myts->addSlashes($this->banner), $this->banner_inherit, $this->forum_id, $this->weight, $this->topic_id);
     }
     if (!$this->db->query($sql)) {
         return false;
     }
     //Added in AMS 2.50 Final.  Fix bug permission not set at add topic
     //if ADD TOPIC
     if ($insert) {
         $this->topic_id = $this->db->getInsertId();
     }
     return true;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:32,代码来源:class.newstopic.php

示例6: b_news_top_show

function b_news_top_show($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $sql = "SELECT storyid, title, published, expired, counter FROM " . $xoopsDB->prefix("stories") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") ORDER BY " . $options[0] . " DESC";
    $result = $xoopsDB->query($sql, $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $news = array();
        $title = $myts->makeTboxData4Show($myrow["title"]);
        if (!XOOPS_USE_MULTIBYTES) {
            if (strlen($myrow['title']) >= $options[2]) {
                $title = $myts->makeTboxData4Show(substr($myrow['title'], 0, $options[2] - 1)) . "...";
            }
        }
        $news['title'] = $title;
        $news['id'] = $myrow['storyid'];
        if ($options[0] == "published") {
            $news['date'] = formatTimestamp($myrow['published'], "s");
        } elseif ($options[0] == "counter") {
            $news['hits'] = $myrow['counter'];
        }
        $block['stories'][] = $news;
    }
    return $block;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:26,代码来源:news_top.php

示例7: smartsection_seo_title

function smartsection_seo_title($title = '', $withExt = true)
{
    /**
     * if XOOPS ML is present, let's sanitize the title with the current language
     */
    $myts = MyTextSanitizer::getInstance();
    if (method_exists($myts, 'formatForML')) {
        $title = $myts->formatForML($title);
    }
    // Transformation de la chaine en minuscule
    // Codage de la chaine afin d'éviter les erreurs 500 en cas de caractères imprévus
    $title = rawurlencode(strtolower($title));
    // Transformation des ponctuations
    //                 Tab     Space      !        "        #        %        &        '        (        )        ,        /        :        ;        <        =        >        ?        @        [        \        ]        ^        {        |        }        ~       .
    $pattern = array("/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/", "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/", "/%7C/", "/%7D/", "/%7E/", "/\\./");
    $rep_pat = array("-", "-", "", "", "", "-100", "", "-", "", "", "", "-", "", "", "", "-", "", "", "-at-", "", "-", "", "-", "", "-", "", "-", "");
    $title = preg_replace($pattern, $rep_pat, $title);
    // Transformation des caractères accentués
    //                  è        é        ê        ë        ç        à        â        ä        î        ï        ù        ü        û        ô        ö
    $pattern = array("/%B0/", "/%E8/", "/%E9/", "/%EA/", "/%EB/", "/%E7/", "/%E0/", "/%E2/", "/%E4/", "/%EE/", "/%EF/", "/%F9/", "/%FC/", "/%FB/", "/%F4/", "/%F6/");
    $rep_pat = array("-", "e", "e", "e", "e", "c", "a", "a", "a", "i", "i", "u", "u", "u", "o", "o");
    $title = preg_replace($pattern, $rep_pat, $title);
    if (sizeof($title) > 0) {
        if ($withExt) {
            $title .= '.html';
        }
        return $title;
    } else {
        return '';
    }
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:seo_functions.php

示例8: PrintDouble

function PrintDouble($msg_id)
{
    global $xoopsDB, $xoopsConfig, $xoopsModule, $story, $xoops_meta_keywords, $xoops_meta_description;
    $myts =& MyTextSanitizer::getInstance();
    $size = count($msg_id);
    $msg =& $msg_id;
    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
    echo '<html><head>';
    echo "<title>" . $xoopsConfig['sitename'] . "</title>\n";
    echo '<meta http-equiv="Content-Type" content="text/html; charset=' . _CHARSET . '" />';
    echo '<meta name="AUTHOR" content="' . $xoopsConfig['sitename'] . '" />';
    echo "<meta name='COPYRIGHT' content='Copyright (c) " . date('Y') . " by " . $xoopsConfig['sitename'] . "' />\n";
    echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n";
    echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n";
    echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'>\r\n    <div style='width: 750px; border: 1px solid #000; padding: 20px;'>\r\n\t \t  <div style='text-align: center; display: block; margin: 0 0 6px 0;'>\r\n\t\t  <img src='" . XOOPS_URL . "/modules/mpmanager/images/mp_logo.png' border='0' alt='' />\r\n\t\t  <br />\r\n\t\t  <br />\r\n\t\t  ";
    for ($i = 0; $i < $size; $i++) {
        $res = $xoopsDB->query("SELECT subject, from_userid, to_userid, msg_time, msg_text from " . $xoopsDB->prefix("priv_msgsave") . " where msg_id= '" . $msg_id[$i] . "'");
        list($subject, $from_userid, $to_userid, $msg_time, $msg_text) = $xoopsDB->fetchRow($res);
        echo '<h3 style=\'margin: 0;\'>' . $subject . '</h3> 
    <div align=\'center\'><small><b>' . _MP_POSTED . '</b>&nbsp;' . formatTimestamp($msg_time) . ' |  <b>' . _MP_FROM2 . '</b>: ' . XoopsUser::getUnameFromId($from_userid) . ' |  <b>' . _MP_SUBJECT . '</b>&nbsp;' . $myts->htmlSpecialChars($subject) . '</small></div><br /><br />
	<div style=\'text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0;\'></div>
	<div style=\'text-align: left\'><tr valign="top" style="font:12px;"><td>' . $msg_text . '</div><br />
	<div style=\'padding-top: 12px; border-top: 2px solid #ccc;\'></div><br />
	<br /><br />';
    }
    printf(_MP_THISCOMESFROM, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
    echo '<br /><a href="' . XOOPS_URL . '/">' . XOOPS_URL . '</a><br />
    	</div></div>
    	</body>
    	</html>
    	';
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:32,代码来源:printsav.php

示例9: getRSSItems

	function getRSSItems( &$items )
	{
		// check module_read permission
		$module_handler =& xoops_gethandler( 'module' ) ;
		$module =& $module_handler->getByDirname( $this->mydirname ) ;
		$gperm_handler =& xoops_gethandler( 'groupperm' ) ;
		$can_read = $gperm_handler->checkRight( 'module_read' , $module->getVar('mid') , XOOPS_GROUP_ANONYMOUS ) ;
		if( ! $can_read ) return ;

		// check config (feed_as_backend)
		$config_handler =& xoops_gethandler( 'config' ) ;
		$mod_config =& $config_handler->getConfigsByCat( 0 , $module->getVar( 'mid' ) ) ;
		if( empty( $mod_config['feed_as_backend'] ) ) {
			return ;
		}

		$myts =& MyTextSanitizer::getInstance();
		$articles = Bulletin::getAllPublished( $this->mydirname , 10 , 0 , 0 , 1 , true, true, true) ;//ver3.0 changed
		foreach( $articles as $article ) {
			$hometext = $article->getVar('hometext','n') ;
			if( function_exists( 'easiestml' ) ) {
				$hometext = easiestml( $hometext ) ;
			}
			$items[] = array(
				'pubdate' => $article->getVar('published') ,
				'title' => htmlspecialchars(bulletin_utf8_encode($article->getVar('title', 'n')), ENT_QUOTES),
				'category' => htmlspecialchars(bulletin_utf8_encode($article->newstopic->topic_title), ENT_QUOTES),
				'link' => XOOPS_URL.'/modules/'.$this->mydirname.'/index.php?page=article&amp;storyid='.$article->getVar('storyid') ,
				'guid' => XOOPS_URL.'/modules/'.$this->mydirname.'/index.php?page=article&amp;storyid='.$article->getVar('storyid') ,
				'description' => bulletin_utf8_encode(htmlspecialchars(strip_tags($myts->xoopsCodeDecode($hometext)), ENT_QUOTES)),
			) ;
		}
	}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:33,代码来源:preload.php

示例10: array

 function &art_getWriterNameFromIds($writer_ids, $linked = false)
 {
     if (!is_array($writer_ids)) {
         $writer_ids = array($writer_ids);
     }
     $userid = array_map("intval", array_filter($writer_ids));
     $myts =& MyTextSanitizer::getInstance();
     $users = array();
     if (count($userid) > 0) {
         $sql = 'SELECT writer_id, writer_name FROM ' . art_DB_prefix("writer") . ' WHERE writer_id IN(' . implode(",", array_unique($userid)) . ')';
         if (!($result = $GLOBALS['xoopsDB']->query($sql))) {
             //xoops_error("writer query error: " . $sql);
             return $users;
         }
         mod_loadFunctions("url", $GLOBALS["artdirname"]);
         while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) {
             $uid = $row["writer_id"];
             $users[$uid] = $myts->htmlSpecialChars($row["writer_name"]);
             if ($linked) {
                 $users[$uid] = '<a href="' . art_buildUrl(XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/view.writer.php", array("writer" => $uid)) . '">' . $users[$uid] . '</a>';
             }
         }
     }
     return $users;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:25,代码来源:functions.author.php

示例11: b_sitemap_soapbox

function b_sitemap_soapbox()
{
    global $xoopsUser;
    $ret = array();
    $db =& Database::getInstance();
    $myts =& MyTextSanitizer::getInstance();
    //get soapbox module object for readable columnIDs check
    $module_handler =& xoops_gethandler('module');
    $soapbox = $module_handler->getByDirname('soapbox');
    if (!is_object($soapbox)) {
        return $sitemap;
    }
    $module_mid = $soapbox->getVar('mid');
    //groups for readable columnIDs check
    $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
    //get readable columnIDs
    $gperm_handler =& xoops_gethandler('groupperm');
    $gperm_name = 'Column Permissions';
    $i = 0;
    $url = 'column.php?columnID=';
    $sql = 'SELECT columnID, name FROM ' . $db->prefix('sbcolumns') . ' ORDER BY weight';
    if (!($result = $db->query($sql))) {
        return $sitemap;
    }
    while (list($columnID, $name) = $db->fetchRow($result)) {
        $columnID = intval($columnID);
        if ($gperm_handler->checkRight($gperm_name, $columnID, $groups, $module_mid)) {
            $ret["parent"][] = array("id" => $columnID, "title" => $myts->makeTboxData4Show($name), "url" => $url . $columnID);
        }
    }
    return $ret;
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:32,代码来源:soapbox.php

示例12: 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

示例13: fetchSummary

 function fetchSummary($external_link_id)
 {
     global $xoopsDB, $xoopsConfig, $xoopsUser;
     $myts =& MyTextSanitizer::getInstance();
     $module_handler =& xoops_gethandler('module');
     $module =& $module_handler->getByDirname($this->mydirname);
     $eventcomment_id = intval($external_link_id);
     $mydirname = $this->mydirname;
     if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) {
         die('Invalid mydirname');
     }
     $mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
     $table_event = $xoopsDB->prefix("pical{$mydirnumber}_event");
     $MOD_PATH = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
     if (!class_exists('piCal_xoops')) {
         require_once $MOD_PATH . '/class/piCal.php';
         require_once $MOD_PATH . '/class/piCal_xoops.php';
     }
     $cal = new piCal_xoops('', $xoopsConfig['language'], true);
     include $MOD_PATH . '/include/read_configs.php';
     $whr_categories = $cal->get_where_about_categories();
     $whr_class = $cal->get_where_about_class();
     $content_row = $xoopsDB->fetchArray($xoopsDB->query("SELECT id, summary, description FROM {$table_event} WHERE id={$eventcomment_id} AND ({$whr_categories}) AND ({$whr_class})"));
     if (empty($content_row)) {
         redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM);
         exit;
     }
     $subject = $myts->makeTboxData4Show($content_row['summary']);
     //HACK by domifara
     //			$uri = XOOPS_URL.'/modules/'.$mydirname.'/index.php?action=View&amp;event_id='.$eventcomment_id;
     $uri = XOOPS_URL . '/modules/' . $mydirname . '/index.php?action=View&event_id=' . $eventcomment_id;
     $str = strip_tags($myts->displayTarea(strip_tags($content_row['description'])));
     $summary = xoops_substr($str, 0, 255);
     return array('dirname' => $mydirname, 'module_name' => $module->getVar('name'), 'subject' => $subject, 'uri' => $uri, 'summary' => $summary);
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:35,代码来源:piCalD3commentContent.class.php

示例14: pico_smiley

function pico_smiley($mydirname, $text, $content4assign)
{
    $myts =& MyTextSanitizer::getInstance();
    // html=on, smiley=0, xcode=1, $image=1, $br=0
    $text = $myts->smiley($text);
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:7,代码来源:pico_smiley.php

示例15: smarty_function_pico_category_search

function smarty_function_pico_category_search($params, &$smarty)
{
    $dir = @$params['dir'] . @$params['dirname'];
    $cat_title = @$params['title'] . @$params['cat_title'];
    $var_name = @$params['item'] . @$params['assign'];
    if (empty($var_name)) {
        echo 'error ' . __FUNCTION__ . ' [specify item]';
        return;
    }
    if (empty($dir)) {
        $dir = $smarty->get_template_vars('mydirname');
    }
    if (empty($dir)) {
        echo 'error ' . __FUNCTION__ . ' [specify dirname]';
        return;
    }
    $mydirnames = explode(',', $dir);
    $db =& Database::getInstance();
    $myts =& MyTextSanitizer::getInstance();
    $module_handler =& xoops_gethandler('module');
    $config_handler =& xoops_gethandler('config');
    $categories4assign = array();
    foreach ($mydirnames as $mydirname) {
        $module =& $module_handler->getByDirname($mydirname);
        $configs = $config_handler->getConfigList($module->getVar('mid'));
        $sql = "SELECT * FROM " . $db->prefix($mydirname . "_categories") . " c WHERE c.cat_title='" . mysql_real_escape_string($cat_title) . "'";
        $result = $db->query($sql);
        while ($cat_row = $db->fetchArray($result)) {
            $category4assign = array('mod_mid' => $module->getVar('mid'), 'mod_dirname' => $mydirname, 'mod_name' => $module->getVar('name'), 'id' => intval($cat_row['cat_id']), 'link' => pico_common_make_category_link4html($configs, $cat_row), 'title' => $myts->makeTboxData4Show($cat_row['cat_title']), 'desc' => $myts->displayTarea($cat_row['cat_desc'], 1), 'paths_raw' => pico_common_unserialize($cat_row['cat_path_in_tree']), 'paths_value' => array_values(pico_common_unserialize($cat_row['cat_path_in_tree'])), 'redundants' => pico_common_unserialize($cat_row['cat_redundants'])) + $cat_row;
            $categories4assign[] = $category4assign;
        }
    }
    $smarty->assign($var_name, $categories4assign);
}
开发者ID:nouphet,项目名称:rata,代码行数:34,代码来源:function.pico_category_search.php


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