: $http_host = explode(':', $_SERVER['HTTP_HOST'] ); if( (!empty( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) != 'off' || isset( $http_host[1] ) && $http_host[1] == 443) && substr( $mosConfig_live_site, 0, 8 ) != 'https://' ) { $mosConfig_live_site = 'https://'.substr( $mosConfig_live_site, 7 ); } require_once( 'includes/joomla.php' ); // displays offline/maintanance page or bar if ($mosConfig_offline == 1) { require( $mosConfig_absolute_path .'/offline.php' ); } // load system bot group $_MAMBOTS->loadBotGroup( 'system' ); // trigger the onStart events $_MAMBOTS->trigger( 'onStart' ); if (file_exists( $mosConfig_absolute_path .'/components/com_sef/sef.php' )) { require_once( $mosConfig_absolute_path .'/components/com_sef/sef.php' ); } else { require_once( $mosConfig_absolute_path .'/includes/sef.php' ); } require_once( $mosConfig_absolute_path .'/includes/frontend.php' ); // retrieve some expected url (or form) arguments $news = intval( mosGetParam( $_REQUEST, 'news' , 0) ) ; $total = intval( mosGetParam( $_REQUEST, 'total', 0 ) ); $option = strval( strtolower( mosGetParam( $_REQUEST, 'option' ) ) ); // mainframe is an API workhorse, lots of 'core' interaction routines $mainframe = new mosMainFrame( $database, $option, '.' ); $mainframe->initSession(); // trigger the onAfterStart events $_MAMBOTS->trigger( 'onAfterStart' ); // get the information about the current user from the sessions table $my = $mainframe->getUser(); // patch to lessen the impact on templates if ($option == 'search') { $option = 'com_search'; } // loads english language file by default if ($mosConfig_lang=='') { $mosConfig_lang = 'english'; } include_once( $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' ); if ($option == 'login') { $mainframe->login(); mosRedirect('index.php'); } else if ($option == 'logout') { $mainframe->logout(); mosRedirect( 'index.php' ); } // detect first visit $mainframe->detect(); // precapture the output of the component require_once( $mosConfig_absolute_path . '/editor/editor.php' ); ob_start(); $_MOS_OPTION['buffer'] = ob_get_contents(); ob_end_clean(); $charset = array( "CHARSET=ISO-8859-1" => "ISO8859-1", "CHARSET=ISO8859-1" => "ISO8859-1", "CHARSET=ISO-8859-15" => "ISO8859-15", "CHARSET=ISO8859-15" => "ISO8859-15", "CHARSET=UTF-8" => "UTF-8", "CHARSET=CP866" => "ibm866", "CHARSET=866" => "ibm866", "CHARSET=IBM866" => "ibm866", "CHARSET=CP1251" => "Windows-1251", "CHARSET=WINDOWS-1251" => "Windows-1251", "CHARSET=WIN-1251" => "Windows-1251", "CHARSET=1251" => "Windows-1251", "CHARSET=CP1252" => "Windows-1252", "CHARSET=WINDOWS-1252" => "Windows-1252", "CHARSET=1252" => "Windows-1252", "CHARSET=KOI8-R" => "koi8-ru", "CHARSET=KOI8-RU" => "koi8-ru", "CHARSET=KOI8R" => "koi8-ru", "CHARSET=BIG5" => "950", "CHARSET=950" => "950", "CHARSET=GB2312" => "936", "CHARSET=936" => "936", "CHARSET=BIG5-HKSCS" => "BIG5-HKSCS", "CHARSET=SHIFT_JIS" => "SJIS", "CHARSET=SJIS" => "SJIS", "CHARSET=932" => "SJIS", "CHARSET=EUC-JP" => "EUCJP", "CHARSET=EUCJP" => "EUCJP" ); $current_charset = isset($charset[strtoupper(_ISO)]) ? $charset[strtoupper(_ISO)] : "ISO8859-1"; $my = $mainframe->getUser(); $gid = intval( $my->gid ); $db = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix ); $query = "SELECT params FROM #__modules WHERE module = 'mod_janewsflash';"; $database->setQuery($query); $params = $database->loadResult(); $params = new mosParameters ($params); function textprocess($string) { global $current_charset; if ($current_charset == "UTF-8") return $string; else if (function_exists("iconv")) return iconv(str_replace("CHARSET=", "", strtoupper(_ISO)), "UTF-8", $string); else if ($current_charset) { $trans_tbl = array("<" => "<", ">" => ">", "&" => "&"); return strtr(htmlentities($string, ENT_NOQUOTES, $current_charset), $trans_tbl); } else return $string; } } else { global $mainframe; global $my, $mosConfig_shownoauth, $mosConfig_offset, $mosConfig_link_titles, $acl, $mosConfig_absolute_path, $delaytime; $splitter = ""; function textprocess($string) { return $string; } } if (!defined( '_JA_NEWSFLASH' )) { /** ensure that functions are declared only once */ define( '_JA_NEWSFLASH', 1 ); function ja_output_newsflash( &$row, &$params, &$access ) { global $mainframe, $_MAMBOTS; $row->text = $row->introtext; $row->groups = ''; $row->readmore = (trim( $row->fulltext ) != '') && ($params->get( 'readmore' )); $row->metadesc = ''; $row->metakey = ''; $row->access = ''; $row->created = ''; $row->modified = ''; $_MAMBOTS->loadBotGroup( 'content' ); $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, null ), true ); $html = ""; ja_linkInfo ($row, $params); if ( $params->get( 'item_title' ) && $row->title) { if ($params->get('link_title')) $html .= "

link_on."\" title=\"".$row->title."\">".$row->title."

\n"; else $html .= "

".$row->title."

\n"; } $html .= $row->introtext; if ($row->readmore ) { $html.="\nlink_on."\" title=\"".$row->link_text."\">".$row->link_text.""; } echo $html; //HTML_content::show( $row, $params, $access, 0 ); } function ja_linkInfo( &$row, &$params ) { global $my; $row->link_on = ''; $row->link_text = ''; if ($params->get( 'readmore' ) || $params->get( 'link_titles' )) { if ( $params->get( 'intro_only' ) ) { // checks if the item is a public or registered/special item if ( $row->access <= $my->gid ) { $row->link_on = sefRelToAbs( 'index.php?option=com_content&task=view&id=' . $row->id . $row->Itemid_link ); if ( isset($row->readmore) && @$row->readmore) { // text for the readmore link $row->link_text = _READ_MORE; } } else { $row->link_on = sefRelToAbs( 'index.php?option=com_registration&task=register' ); if ( isset($row->readmore) && @$row->readmore ) { // text for the readmore link if accessible only if registered $row->link_text = _READ_MORE_REGISTER; } } } } } } require_once( $mainframe->getPath( 'front_html', 'com_content') ); // Disable edit ability icon $access = new stdClass(); $access->canEdit = 0; $access->canEditOwn = 0; $access->canPublish = 0; $now = _CURRENT_SERVER_TIME; $noauth = !$mainframe->getCfg( 'shownoauth' ); $nullDate = $database->getNullDate(); $catid = intval( $params->get( 'catid' ) ); $delaytime = intval( $params->get( 'delaytime', 0 ) ); $moduleclass_sfx = $params->get( 'moduleclass_sfx' ); $link_titles = $params->get( 'link_titles', $mosConfig_link_titles ); $params->set( 'intro_only', 1 ); $params->set( 'hide_author', 1 ); $params->set( 'hide_createdate', 0 ); $params->set( 'hide_modifydate', 1 ); $params->set( 'link_titles', $link_titles ); // query to determine article count $query = "SELECT a.id, a.introtext, a.fulltext , a.images, a.attribs, a.title, a.state" ."\n FROM #__content AS a" ."\n INNER JOIN #__categories AS cc ON cc.id = a.catid" ."\n INNER JOIN #__sections AS s ON s.id = a.sectionid" ."\n WHERE a.state = 1" . ( $noauth ? "\n AND a.access <= " . (int) $my->gid . " AND cc.access <= " . (int) $my->gid . " AND s.access <= " . (int) $my->gid : '' ) ."\n AND (a.publish_up = " . $database->Quote( $nullDate ) . " OR a.publish_up <= " . $database->Quote( $now ) . " ) " ."\n AND (a.publish_down = " . $database->Quote( $nullDate ) . " OR a.publish_down >= " . $database->Quote( $now ) . " )" ."\n AND a.catid = " . (int) $catid ."\n AND cc.published = 1" ."\n AND s.published = 1" ."\n ORDER BY a.ordering" ; $database->setQuery( $query, 0, $items ); $rows = $database->loadObjectList(); $numrows = count( $rows ); // check if any results returned if ( $numrows ) { $curnews = intval( mosGetParam( $_REQUEST, 'curnews' ) ); srand ((double) microtime() * 1000000); while (true) { $flashnum = rand( 0, $numrows-1 ); if ($flashnum != $curnews) break; } $row = $rows[$flashnum]; } $Itemid = $mainframe->getItemid( $firstnew->id, 0, 0, 1, 1, 1 ); $row->introtext = textprocess($row->introtext); $row->fulltext = textprocess($row->fulltext); if(!$splitter) { echo "
"; ja_output_newsflash( $row, $params, $access ); echo "
"; } else { ja_output_newsflash( $row, $params, $access ); echo $splitter.$flashnum; } ?>