本文整理汇总了PHP中MyTextSanitizer类的典型用法代码示例。如果您正苦于以下问题:PHP MyTextSanitizer类的具体用法?PHP MyTextSanitizer怎么用?PHP MyTextSanitizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MyTextSanitizer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: load
/**
* @param MyTextSanitizer $ts
* @param string $text
* @param bool $force
* @return mixed
*/
public function load(MyTextSanitizer &$ts, $text, $force = false)
{
$xoops = Xoops::getInstance();
if (empty($force) && $xoops->userIsAdmin) {
return $text;
}
// Built-in fitlers for XSS scripts
// To be improved
$text = $ts->filterXss($text);
if (XoopsLoad::load("purifier", "framework")) {
$text = XoopsPurifier::purify($text);
return $text;
}
$tags = array();
$search = array();
$replace = array();
$config = parent::loadConfig(__DIR__);
if (!empty($config["patterns"])) {
foreach ($config["patterns"] as $pattern) {
if (empty($pattern['search'])) {
continue;
}
$search[] = $pattern['search'];
$replace[] = $pattern['replace'];
}
}
if (!empty($config["tags"])) {
$tags = array_map("trim", $config["tags"]);
}
// Set embedded tags
$tags[] = "SCRIPT";
$tags[] = "VBSCRIPT";
$tags[] = "JAVASCRIPT";
foreach ($tags as $tag) {
$search[] = "/<" . $tag . "[^>]*?>.*?<\\/" . $tag . ">/si";
$replace[] = " [!" . strtoupper($tag) . " FILTERED!] ";
}
// Set meta refresh tag
$search[] = "/<META[^>\\/]*HTTP-EQUIV=(['\"])?REFRESH(\\1)[^>\\/]*?\\/>/si";
$replace[] = "";
// Sanitizing scripts in IMG tag
//$search[]= "/(<IMG[\s]+[^>\/]*SOURCE=)(['\"])?(.*)(\\2)([^>\/]*?\/>)/si";
//$replace[]="";
// Set iframe tag
$search[] = "/<IFRAME[^>\\/]*SRC=(['\"])?([^>\\/]*)(\\1)[^>\\/]*?\\/>/si";
$replace[] = " [!IFRAME FILTERED! \\2] ";
$search[] = "/<IFRAME[^>]*?>([^<]*)<\\/IFRAME>/si";
$replace[] = " [!IFRAME FILTERED! \\1] ";
// action
$text = preg_replace($search, $replace, $text);
return $text;
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:58,代码来源:textfilter.php
示例2: 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&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
示例3: b_sitemap_xpwiki
function b_sitemap_xpwiki($mydirname)
{
global $sitemap_configs;
(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || ($myts =& MyTextSanitizer::getInstance());
$ret = array();
include_once dirname(dirname(__FILE__)) . '/include.php';
$xpwiki =& XpWiki::getInitedSingleton($mydirname);
$result = $xpwiki->func->get_existpages(FALSE, '', array('limit' => 5, 'order' => ' ORDER BY editedtime DESC', 'select' => array('title'), 'nolisting' => TRUE));
$ret = array();
// Recent Changes
$show_cat = @$sitemap_configs['show_subcategoris'] ? 'child' : 'parent';
if ($show_cat === 'child') {
$ret['id'] = 0;
$ret['title'] = $xpwiki->root->_LANG['skin']['recent'];
$ret['url'] = '?' . rawurlencode($xpwiki->root->whatsnew);
}
foreach ($result as $_res) {
$pgid = $_res['pgid'];
$page = $_res['name'];
$title = $_res['title'];
$title = $xpwiki->root->pagename_num2str ? preg_replace('/\\/(?:[0-9\\-]+|[B0-9][A-Z0-9]{9})$/', '/' . $xpwiki->func->get_heading($page), $page) : $page;
$ret[$show_cat][] = array("id" => intval($pgid), "title" => $myts->makeTboxData4Show($title), "url" => $xpwiki->func->get_page_uri($page), 'image' => 2);
}
if ($show_cat === 'child') {
$ret = array('parent' => array($ret));
}
// Other menus
$ret['parent'][] = array('id' => 0, 'title' => $xpwiki->root->_LANG['skin']['list'], 'url' => '?cmd=list');
$ret['parent'][] = array('id' => 0, 'title' => $xpwiki->root->_attach_messages['msg_list'], 'url' => '?plugin=attach&pcmd=list');
$ret['parent'][] = array('id' => 0, 'title' => $xpwiki->root->_LANG['skin']['help'], 'url' => '?Help');
return $ret;
}
开发者ID:nao-pon,项目名称:xpWiki,代码行数:32,代码来源:sitemap.plugin.php
示例4: b_mylinks_top_show
function b_mylinks_top_show($options)
{
global $xoopsDB;
$block = array();
$myts =& MyTextSanitizer::getInstance();
$result = $xoopsDB->query("SELECT lid, cid, title, date, hits FROM " . $xoopsDB->prefix("mylinks_links") . " WHERE status>0 ORDER BY " . $options[0] . " DESC", $options[1], 0);
while ($myrow = $xoopsDB->fetchArray($result)) {
$link = 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)) . "...";
}
}
$link['id'] = $myrow['lid'];
$link['cid'] = $myrow['cid'];
$link['title'] = $title;
if ($options[0] == "date") {
$link['date'] = formatTimestamp($myrow['date'], 's');
} elseif ($options[0] == "hits") {
$link['hits'] = $myrow['hits'];
}
$block['links'][] = $link;
}
return $block;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:26,代码来源:mylinks_top.php
示例5: wp_dropdown_cats
function wp_dropdown_cats($currentcat, $currentparent = 0, $parent = 0, $level = 0, $categories = 0)
{
$myts =& MyTextSanitizer::getInstance();
if (!$categories) {
$categoryHandler =& wp_handler('Category');
$categories =& $categoryHandler->getObjects();
}
if ($categories) {
foreach ($categories as $category) {
$cat_ID = $category->getVar('cat_ID');
if ($currentcat != $cat_ID && $parent == $category->getVar('category_parent')) {
$cat_name = $myts->makeTareaData4Show($category->getVar('cat_name'));
$pad = str_repeat('– ', $level);
?>
<option value='<?php
echo $cat_ID;
?>
'<?php
selected($currentparent, $cat_ID);
?>
><?php
echo "{$pad}{$cat_name}";
?>
</option>
<?php
wp_dropdown_cats($currentcat, $currentparent, $cat_ID, $level + 1, $categories);
}
}
} else {
return false;
}
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:32,代码来源:admin-functions.php
示例6: search
/**
* search - search
*
* @param string[] $queryArray search terms
* @param string $andor and/or how to treat search terms
* @param integer $limit max number to return
* @param integer $offset offset of first row to return
* @param integer $userid a specific user id to limit the query
*
* @return array of result items
* 'title' => the item title
* 'content' => brief content or summary
* 'link' => link to visit item
* 'time' => time modified (unix timestamp)
* 'uid' => author uid
* 'image' => icon for search display
*
*/
public function search($queryArray, $andor, $limit, $offset, $userid)
{
$andor = strtolower($andor) == 'and' ? 'and' : 'or';
$qb = \Xoops::getInstance()->db()->createXoopsQueryBuilder();
$eb = $qb->expr();
$qb->select('DISTINCT *')->fromPrefix('page_content')->where($eb->neq('content_status', '0'))->orderBy('content_create', 'DESC')->setFirstResult($offset)->setMaxResults($limit);
if (is_array($queryArray) && !empty($queryArray)) {
$queryParts = array();
foreach ($queryArray as $i => $q) {
$qterm = ':qterm' . $i;
$qb->setParameter($qterm, '%' . $q . '%', \PDO::PARAM_STR);
$queryParts[] = $eb->orX($eb->like('content_title', $qterm), $eb->like('content_text', $qterm), $eb->like('content_shorttext', $qterm));
}
if ($andor == 'and') {
$qb->andWhere(call_user_func_array(array($eb, "andX"), $queryParts));
} else {
$qb->andWhere(call_user_func_array(array($eb, "orX"), $queryParts));
}
} else {
$qb->setParameter(':uid', (int) $userid, \PDO::PARAM_INT);
$qb->andWhere($eb->eq('content_author', ':uid'));
}
$myts = MyTextSanitizer::getInstance();
$items = array();
$result = $qb->execute();
while ($myrow = $result->fetch(\PDO::FETCH_ASSOC)) {
$content = $myrow["content_shorttext"] . "<br /><br />" . $myrow["content_text"];
$content = $myts->xoopsCodeDecode($content);
$items[] = array('title' => $myrow['content_title'], 'content' => Metagen::getSearchSummary($content, $queryArray), 'link' => "viewpage.php?id=" . $myrow["content_id"], 'time' => $myrow['content_create'], 'uid' => $myrow['content_author'], 'image' => 'images/logo_small.png');
}
return $items;
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:50,代码来源:search.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: b_mylinks_top_show
function b_mylinks_top_show($options)
{
global $xoopsDB;
$block = array();
//ver2.5
$modulename = basename(dirname(dirname(__FILE__)));
$myts =& MyTextSanitizer::getInstance();
$result = $xoopsDB->query("SELECT lid, cid, title, date, hits FROM " . $xoopsDB->prefix("mylinks_links") . " WHERE status>0 ORDER BY " . $options[0] . " DESC", $options[1], 0);
while ($myrow = $xoopsDB->fetchArray($result)) {
$link = array();
$title = $myts->htmlSpecialChars($myrow['title']);
// if ( !XOOPS_USE_MULTIBYTES ) {
if (mb_strlen($myrow['title']) >= $options[2]) {
$title = $myts->htmlSpecialChars(mb_substr($myrow['title'], 0, $options[2] - 1)) . "...";
}
// }
$link['id'] = $myrow['lid'];
$link['cid'] = $myrow['cid'];
$link['title'] = $title;
if ($options[0] == "date") {
$link['date'] = formatTimestamp($myrow['date'], 's');
} elseif ($options[0] == "hits") {
$link['hits'] = $myrow['hits'];
}
$block['links'][] = $link;
}
if (!empty($block)) {
// only show block if there's data to display
$block['mylinks_weburl'] = XOOPS_URL . "/modules/{$modulename}";
}
return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:32,代码来源:mylinks_top.php
示例9: b_shortcut_show
function b_shortcut_show($options)
{
global $xoopsDB, $xoopsUser, $xoopsModule;
$myts =& MyTextSanitizer::getInstance();
include_once dirname(dirname(__FILE__)) . "/functions.php";
$mydirname = basename(dirname(dirname(__FILE__)));
$block = array();
$action = '';
if ($options[0]) {
if (!is_object($xoopsUser)) {
return $block;
}
$uid = $xoopsUser->getVar('uid');
if (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $mydirname) {
$module =& $xoopsModule;
} else {
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname($mydirname);
}
if ($xoopsUser->isAdmin($module->getVar('mid'))) {
$action = XOOPS_URL . "/modules/{$mydirname}/register.php";
}
} else {
$uid = 0;
$action = XOOPS_URL . "/modules/{$mydirname}/admin/index.php?op=edit";
}
$block['links'] = shortcut_links($uid, $thispage);
$block['action'] = $action;
$block['thispage'] = htmlspecialchars($thispage);
return $block;
}
开发者ID:nbuy,项目名称:xoops-modules-shortcut,代码行数:31,代码来源:shortcut_block.php
示例10: 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&storyid='.$article->getVar('storyid') ,
'guid' => XOOPS_URL.'/modules/'.$this->mydirname.'/index.php?page=article&storyid='.$article->getVar('storyid') ,
'description' => bulletin_utf8_encode(htmlspecialchars(strip_tags($myts->xoopsCodeDecode($hometext)), ENT_QUOTES)),
) ;
}
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:33,代码来源:preload.php
示例11: 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> ' . formatTimestamp($msg_time) . ' | <b>' . _MP_FROM2 . '</b>: ' . XoopsUser::getUnameFromId($from_userid) . ' | <b>' . _MP_SUBJECT . '</b> ' . $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
示例12: 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
示例13: 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
示例14: 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
示例15: 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
示例16: b_cjaycontent_show
function b_cjaycontent_show($options)
{
global $xoopsDB, $xoopsConfig;
$myts =& MyTextSanitizer::getInstance();
$block = array();
$block['title'] = _FC_BLOCK_TITLE;
$block['content'] = "<small>";
// Query Database for link generation
$result = $xoopsDB->query("SELECT id, title, hits, weight FROM " . $xoopsDB->prefix() . "_cjaycontent WHERE hide=0 ORDER BY weight");
// generate links
while ($fc_item = $xoopsDB->fetchArray($result)) {
$fc_title = $myts->makeTboxData4Show($fc_item['title']);
// shorten linktitles to fit into the block
if (!XOOPS_USE_MULTIBYTES) {
if (strlen($fc_title) >= 40) {
$fc_title = substr($fc_title, 0, 39) . "...";
}
}
if (substr($fc_title, 0, 2) != "..") {
$block['content'] .= " <strong><big>·</big></strong> <a href=\"" . XOOPS_URL . "/modules/cjaycontent/index.php?id=" . $fc_item['id'] . "\">" . $fc_title . "</a>";
} else {
$block['content'] .= "<strong>" . substr($fc_title, 2, strlen($fc_title) - 2) . "</strong> ";
}
// there will be an hits-display coded in later versions
//
$block['content'] .= "<br />";
}
$block['content'] .= "</small>";
return $block;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:30,代码来源:cjaycontent.php
示例17: adminMenu
function adminMenu($currentoption = 0)
{
/* Nice buttons styles */
global $xoopsConfig, $xoopsModule;
$module_handler =& xoops_gethandler('module');
$xoopsModule = $module_handler->getByDirname('xcurl');
$dirname = $xoopsModule->getVar('dirname');
echo "\r\n \t<style type='text/css'>\r\n\t\t#form {float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/{$dirname}/images/bg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-bottom: 1px solid black; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black;}\r\n\t\t \t#buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; }\r\n \t#buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/{$dirname}/images/bg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 0px; border-bottom: 1px solid black; }\r\n \t#buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }\r\n\t\t #buttonbar li { display:inline; margin:0; padding:0; }\r\n\t\t #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/{$dirname}/images/left_both.gif') no-repeat left top; margin:0; padding:0 0 0 9px; text-decoration:none; }\r\n\t\t #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/{$dirname}/images/right_both.gif') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }\r\n\t\t /* Commented Backslash Hack hides rule from IE5-Mac \\*/\r\n\t\t #buttonbar a span {float:none;}\r\n\t\t /* End IE5-Mac hack */\r\n\t\t #buttonbar a:hover span { color:#333; }\r\n\t\t #buttonbar #current a { background-position:0 -150px; border-width:0; }\r\n\t\t #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; }\r\n\t\t #buttonbar a:hover { background-position:0% -150px; }\r\n\t\t #buttonbar a:hover span { background-position:100% -150px; }\r\n\t\t </style>";
// global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
$myts =& MyTextSanitizer::getInstance();
$tblColors = array();
// $adminmenu=array();
if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) {
include_once XOOPS_ROOT_PATH . '/modules/xcurl/language/' . $xoopsConfig['language'] . '/modinfo.php';
} else {
include_once XOOPS_ROOT_PATH . '/modules/xcurl/language/english/modinfo.php';
}
echo "<table width=\"100%\" border='0'><tr><td>";
echo "<div id='buttontop'>";
echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>";
echo "<td style=\"width: 45%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"" . XOOPS_URL . "/modules/system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "\">" . _PREFERENCES . "</a></td>";
echo "<td style='font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;'><b>" . $myts->displayTarea($xoopsModule->name()) . "</td>";
echo "</tr></table>";
echo "</div>";
echo "<div id='buttonbar'>";
echo "<ul>";
foreach ($xoopsModule->getAdminMenu() as $key => $value) {
$tblColors[$key] = '';
$tblColors[$currentoption] = 'current';
echo "<li id='" . $tblColors[$key] . "'><a href=\"" . XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/" . $value['link'] . "\"><span>" . $value['title'] . "</span></a></li>";
}
echo "</ul></div>";
echo "</td></tr>";
echo "<tr'><td><div id='form'>";
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:35,代码来源:functions.php
示例18: publisher_date_to_date_show
function publisher_date_to_date_show($options)
{
$myts = MyTextSanitizer::getInstance();
$publisher = PublisherPublisher::getInstance();
$block = array();
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('datesub', strtotime($options[0]), '>'));
$criteria->add(new Criteria('datesub', strtotime($options[1]), '<'));
$criteria->setSort('datesub');
$criteria->setOrder('DESC');
// creating the ITEM objects that belong to the selected category
$itemsObj = $publisher->getHandler('item')->getObjects($criteria);
$totalItems = count($itemsObj);
if ($itemsObj) {
for ($i = 0; $i < $totalItems; $i++) {
$newItems['itemid'] = $itemsObj[$i]->itemid();
$newItems['title'] = $itemsObj[$i]->title();
$newItems['categoryname'] = $itemsObj[$i]->getCategoryName();
$newItems['categoryid'] = $itemsObj[$i]->categoryid();
$newItems['date'] = $itemsObj[$i]->datesub();
$newItems['poster'] = $itemsObj[$i]->linkedPosterName();
$newItems['itemlink'] = $itemsObj[$i]->getItemLink(false, isset($options[3]) ? $options[3] : 65);
$newItems['categorylink'] = $itemsObj[$i]->getCategoryLink();
$block['items'][] = $newItems;
}
$block['lang_title'] = _MB_PUBLISHER_ITEMS;
$block['lang_category'] = _MB_PUBLISHER_CATEGORY;
$block['lang_poster'] = _MB_PUBLISHER_POSTEDBY;
$block['lang_date'] = _MB_PUBLISHER_DATE;
$modulename = $myts->displayTarea($publisher->getModule()->getVar('name'));
$block['lang_visitItem'] = _MB_PUBLISHER_VISITITEM . " " . $modulename;
$block['lang_articles_from_to'] = sprintf(_MB_PUBLISHER_ARTICLES_FROM_TO, $options[0], $options[1]);
}
return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:35,代码来源:date_to_date.php
示例19: webshow_iteminfo
function webshow_iteminfo($items, $limit = 0, $offset = 0)
{
global $xoopsDB;
$ret = array();
$URL_MOD = XOOPS_URL . "/modules/webshow";
$sql = "SELECT l.lid, l.title as ltitle, l.date, l.cid, l.submitter, l.hits, l.comments, t.description, c.cattitle as ctitle\r\n FROM " . $xoopsDB->prefix("webshow_links") . " l, " . $xoopsDB->prefix("webshow_text") . " t, " . $xoopsDB->prefix("webshow_cat") . " c\r\n WHERE l.lid IN (" . implode(',', $items) . ")\r\n AND t.lid=l.lid\r\n AND l.cid=c.cid\r\n AND l.status>0\r\n ORDER BY l.date DESC";
$result = $xoopsDB->query($sql, $limit, $offset);
$i = 0;
while ($row = $xoopsDB->fetchArray($result)) {
$ret[$i]['link'] = $URL_MOD . "/singlelink.php?lid=" . $row['lid'];
$ret[$i]['cat_link'] = $URL_MOD . "/viewcat.php?cid=" . $row['cid'];
$ret[$i]['title'] = $row['ltitle'];
$ret[$i]['time'] = $row['date'];
$ret[$i]['id'] = $row['lid'];
// uid
$ret[$i]['uid'] = $row['submitter'];
// category
$ret[$i]['cat_name'] = $row['ctitle'];
// counter
$ret[$i]['hits'] = $row['hits'];
// comments
$ret[$i]['replies'] = $row['comments'];
// description
$myts =& MyTextSanitizer::getInstance();
$html = 1;
$smiley = 1;
$xcodes = 1;
$ret[$i]['description'] = $myts->displayTarea($row['description'], $html, $smiley, $xcodes);
$i++;
}
return $ret;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:32,代码来源:webshow.php
示例20: genPathCheckHtml
/**
* @param $path
* @param $valid
*
* @return string
*/
function genPathCheckHtml($path, $valid)
{
$myts = MyTextSanitizer::getInstance(
|
请发表评论