clear(self::CACHETAG, true); return $this; } public function upgradeThemeCode($text) { $search = array(); $replace = array(); $search[0] = '$HEADER '; $replace[0] = '$HEADER["default"] '; $search[1] = '$FOOTER '; $replace[1] = '$FOOTER["default"] '; // Early 0.6 and 0.7 Themes $search[2] = '$CUSTOMHEADER '; $replace[2] = '$HEADER["custom"] '; $search[3] = '$CUSTOMFOOTER '; $replace[3] = '$FOOTER["custom"] '; //TODO Handle v1.x style themes. eg. $CUSTOMHEADER['something']; $text = str_replace($_SESSION['themebulder-remove'],"",$text); $text = str_replace($search, $replace, $text); return $text; } /** * Get a list of all themes in theme folder and its data. * @param bool|false xml|false * @param bool|false $force force a refresh ie. ignore cached list. * @return array */ public static function getThemeList($mode = false, $force = false) { $themeArray = array(); $tloop = 1; $array = scandir(e_THEME); if($force === false && $tmp = e107::getCache()->retrieve(self::CACHETAG, self::CACHETIME, true, true)) { return e107::unserialize($tmp); } foreach($array as $file) { if(($mode == 'xml') && !is_readable(e_THEME.$file."/theme.xml")) { continue; } if($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && is_readable(e_THEME.$file."/theme.php")) { if($mode == "id") { $themeArray[$tloop] = $file; } else { $themeArray[$file] = self::getThemeInfo($file); $themeArray[$file]['id'] = $tloop; } $tloop++; } } $cacheSet = e107::serialize($themeArray,'json'); e107::getCache()->set(self::CACHETAG,$cacheSet,true,true,true); return $themeArray; } public static function getThemeInfo($file) { $reject = array('e_.*'); $handle2 = e107::getFile()->get_files(e_THEME.$file."/", "\.php|\.css|\.xml|preview\.jpg|preview\.png", $reject, 1); $themeArray = array(); foreach ($handle2 as $fln) { $file2 = str_replace(e_THEME.$file."/", "", $fln['path']).$fln['fname']; $themeArray[$file]['files'][] = $file2; if(strstr($file2, "preview.")) { $themeArray[$file]['preview'] = e_THEME.$file."/".$file2; } // ---------------- get information string for css file - Legacy mode (no theme.xml) if(strstr($file2, ".css") && !strstr($file2, "menu.css") && strpos($file2, "e_") !== 0) { if($cssContents = file_get_contents(e_THEME.$file."/".$file2)) { $nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false; preg_match('/\* info:(.*?)\*\//', $cssContents, $match); $match[1] = varset($match[1], ''); $scope = ($nonadmin == true) ? 'front' : ''; $themeArray[$file]['css'][] = array("name"=>$file2, "info"=>$match[1], "scope"=>$scope, "nonadmin"=>$nonadmin); } else { // $mes->addDebug("Couldn't read file: ".e_THEME.$file."/".$file2); } } } // end foreach // Load Theme information and merge with existing array. theme.xml (v2.x theme) is given priority over theme.php (v1.x). if(in_array("theme.xml", $themeArray[$file]['files'])) { $themeArray[$file] = array_merge($themeArray[$file], self::parse_theme_xml($file)); } elseif(in_array("theme.php", $themeArray[$file]['files'])) { $themeArray[$file] = array_merge($themeArray[$file], self::parse_theme_php($file)); } if(!empty($themeArray[$file]['css']) && count($themeArray[$file]['css']) > 1) { $themeArray[$file]['multipleStylesheets'] = true; } return $themeArray[$file]; } public static function parse_theme_php($path) { $CUSTOMPAGES = ""; $tp = e107::getParser(); $fp = fopen(e_THEME.$path."/theme.php", "r"); $themeContents = fread($fp, filesize(e_THEME.$path."/theme.php")); fclose($fp); preg_match('/themename(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['name'] = varset($match[3], ''); preg_match('/themeversion(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['version'] = varset($match[3], ''); preg_match('/themeauthor(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['author'] = varset($match[3], ''); preg_match('/themeemail(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['email'] = varset($match[3], ''); preg_match('/themewebsite(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['website'] = varset($match[3], ''); preg_match('/themedate(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['date'] = varset($match[3], ''); preg_match('/themeinfo(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['info'] = varset($match[3], ''); preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); $xhtml = strtolower($match[2]); $themeArray['xhtmlcompliant'] = ($xhtml == "true" ? "1.1" : false); preg_match('/csscompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); $css = strtolower($match[2]); $themeArray['csscompliant'] = ($css == "true" ? "2.1" : false); $themeArray['version'] = str_replace(array('
','
','
'),' ',$themeArray['version']); /* preg_match('/CUSTOMPAGES(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); $themeArray['custompages'] = array_filter(explode(" ",$match[3]));*/ $themeContentsArray = explode("\n", $themeContents); preg_match_all("#\\$"."CUSTOMHEADER\[(\"|')(.*?)('|\")\].*?#",$themeContents,$match); $customHeaderArray = $match[2]; preg_match_all("#\\$"."CUSTOMFOOTER\[(\"|')(.*?)('|\")\].*?#",$themeContents,$match); $customFooterArray = $match[2]; if(!$themeArray['name']) { unset($themeArray); } $lays['legacyDefault']['@attributes'] = array('title'=>'Default', 'plugins'=>'', 'default'=>'true'); // load custompages from theme.php only when theme.xml doesn't exist. if(!file_exists(e_THEME.$path."theme.xml")) { foreach ($themeContentsArray as $line) { if(strstr($line, "CUSTOMPAGES")) { eval(str_replace("$", "\$", $line)); // detect arrays also. } } if(is_array($CUSTOMPAGES)) { foreach ($CUSTOMPAGES as $key=>$val) { $themeArray['custompages'][$key] = explode(" ", trim($val)); $lays[$key]['custompages'] = trim($val); } } elseif($CUSTOMPAGES) { $themeArray['custompages']['legacyCustom'] = explode(" ", $CUSTOMPAGES); $lays['legacyCustom']['@attributes'] = array('title'=>'Custom', 'plugins'=>''); } foreach($customHeaderArray as $tm) { $lays[$tm]['@attributes'] = array('title'=>str_replace("_"," ",$tm), 'plugins'=>''); } foreach($customFooterArray as $tm) { $lays[$tm]['@attributes'] = array('title'=>str_replace("_"," ",$tm), 'plugins'=>''); } } $themeArray['path'] = $path; $themeArray['layouts'] = $lays; $themeArray['description'] = $themeArray['info']; if(file_exists(e_THEME.$path."/preview.jpg")) { $themeArray['preview'] = array("preview.jpg"); $themeArray['thumbnail'] = "preview.jpg"; } if(file_exists(e_THEME.$path."/preview.png")) { $themeArray['preview'] = array("preview.png"); $themeArray['thumbnail'] = "preview.png"; } // echo "

".$themeArray['name']."

"; // print_a($lays); return $themeArray; } public static function parse_theme_xml($path) { $tp = e107::getParser(); $xml = e107::getXml(); // loadLanFiles($path, 'admin'); // Look for LAN files on default paths // layout should always be an array. $xml->setOptArrayTags('layout,screenshots/image,plugins/plugin'); $xml->setOptStringTags('menuPresets,customPages,custompages'); // // $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true); // $oldvars = $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', 'advanced', true); // must be 'advanced' if($path == "bootstrap3" ) { // echo " // //
oldnew parser
".print_a($oldvars,true)."".print_a($vars,true)."
"; } $vars['name'] = varset($vars['@attributes']['name']); $vars['version'] = varset($vars['@attributes']['version']); $vars['date'] = varset($vars['@attributes']['date']); $vars['compatibility'] = varset($vars['@attributes']['compatibility']); $vars['releaseUrl'] = varset($vars['@attributes']['releaseUrl']); $vars['email'] = varset($vars['author']['@attributes']['email']); $vars['website'] = varset($vars['author']['@attributes']['url']); $vars['author'] = varset($vars['author']['@attributes']['name']); $vars['info'] = varset($vars['description']); $vars['category'] = self::getThemeCategory(varset($vars['category'])); $vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']); $vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']); $vars['path'] = $path; $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0; $vars['preview'] = varset($vars['screenshots']['image']); $vars['thumbnail'] = isset($vars['preview'][0]) && file_exists(e_THEME.$path.'/'.$vars['preview'][0]) ? $vars['preview'][0] : ''; if(!empty($vars['themePrefs'])) { foreach($vars['themePrefs']['pref'] as $k=>$val) { $name = $val['@attributes']['name']; $vars['preferences'][$name] = $val['@value']; } } unset($vars['authorEmail'], $vars['authorUrl'], $vars['xhtmlCompliant'], $vars['cssCompliant'], $vars['screenshots']); // Compile layout information into a more usable format. $custom = array(); /* foreach ($vars['layouts'] as $layout) { foreach ($layout as $key=>$val) { $name = $val['@attributes']['name']; unset($val['@attributes']['name']); $lays[$name] = $val; if(isset($val['customPages'])) { $cusArray = explode(" ", $val['customPages']); $custom[$name] = array_filter($cusArray); } if(isset($val['custompages'])) { $cusArray = explode(" ", $val['custompages']); $custom[$name] = array_filter(explode(" ", $val['custompages'])); } } } */ $lays = array(); foreach($vars['layouts']['layout'] as $k=>$val) { $name = $val['@attributes']['name']; unset($val['@attributes']['name']); $lays[$name] = $val; if(isset($val['custompages'])) { if(is_string($val['custompages'])) { $custom[$name] = array_filter(explode(" ", $val['custompages'])); } elseif(is_array($val['custompages'])) { $custom[$name] = $val['custompages']; } } } $vars['layouts'] = $lays; $vars['path'] = $path; $vars['custompages'] = $custom; if(!empty($vars['stylesheets']['css'])) { $vars['css'] = array(); foreach($vars['stylesheets']['css'] as $val) { // $notadmin = vartrue($val['@attributes']['admin']) ? false : true; $notadmin = (varset($val['@attributes']['scope']) !== 'admin') ? true : false; $vars['css'][] = array("name" => $val['@attributes']['file'], "info"=> $val['@attributes']['name'], "nonadmin"=>$notadmin, 'scope'=> vartrue($val['@attributes']['scope'])); } unset($vars['stylesheets']); } $vars['glyphs'] = array(); if(!empty($vars['glyphicons']['glyph'])) { foreach($vars['glyphicons']['glyph'] as $val) { $vars['glyphs'][] = array( 'name' => $val['@attributes']['name'], 'pattern' => $val['@attributes']['pattern'], 'path' => $val['@attributes']['path'], 'prefix' => $val['@attributes']['prefix'], 'tag' => $val['@attributes']['tag'], ); } unset($vars['glyphicons']); } if($path == "landingzero" ) { // e107::getMessage()->addDebug("

".$path."

"); // e107::getMessage()->addDebug(print_a($vars,true)); // $mes->addDebug("
"); } if($path == "bootstrap3" ) { // print_a($vars); // echo "
".print_a($vars,true)."".print_a($adv,true)."
"; } return $vars; } /** * Validate and return the name of the categories. * * @param string [optional] $categoryfromXML * @return string */ private static function getThemeCategory($categoryfromXML = '') { if(!$categoryfromXML) { return 'generic'; } $tmp = explode(",", $categoryfromXML); $category = array(); foreach ($tmp as $cat) { $cat = trim($cat); if(in_array($cat, self::$allowedCategories)) { $category[] = $cat; } else { $category[] = 'generic'; } } return implode(', ', $category); } } class themeHandler { var $themeArray; var $action; var $id; var $frm; var $fl; var $themeConfigObj = null; var $noLog = FALSE; private $curTheme = null; private $approvedAdminThemes = array('bootstrap','bootstrap3'); public $allowedCategories = array('generic', 'adult', 'blog', 'clan', 'children', 'corporate', 'forum', 'gaming', 'gallery', 'news', 'social', 'video', 'multimedia'); /** * Marketplace handler instance * @var e_marketplace */ protected $mp; const RENDER_THUMBNAIL = 0; const RENDER_SITEPREFS = 1; const RENDER_ADMINPREFS = 2; /* constructor */ function __construct() { global $e107cache,$pref; $mes = e107::getMessage(); /* if(deftrue('e_BOOTSTRAP3_ADMIN')) { $this->approvedAdminThemes[] = 'bootstrap3'; } */ require_once (e_HANDLER."form_handler.php"); //enable inner tabindex counter if(!deftrue("E107_INSTALL")) { $this->frm = new e_form(); } $this->fl = e107::getFile(); if(!empty($_POST['upload'])) { $unzippedTheme = $this->themeUpload(); } if(!empty($_POST['curTheme'])) { $this->curTheme = e107::getParser()->filter($_POST['curTheme'],'file'); } if(!empty($_POST['setUploadTheme']) && !empty($unzippedTheme)) { $themeArray = $this->getThemes(); $this->id = $themeArray[$unzippedTheme]['id']; if($this->setTheme()) { $mes->addSuccess(TPVLAN_3); } else { $mes->addError(TPVLAN_86); } } if(!empty($_POST['installContent'])) { $this->installContent($_POST['installContent']); } $this->themeArray = (defined('E107_INSTALL')) ? $this->getThemes('xml') : $this->getThemes(); // print_a($this -> themeArray); foreach ($_POST as $key=>$post) { if(strstr($key, "preview")) { // $this -> id = str_replace("preview_", "", $key); $this->id = key($post); $this->themePreview(); } if(strstr($key, "selectmain")) { // $this -> id = str_replace("selectmain_", "", $key); $this->id = key($post); if($this->setTheme()) { $mes->addSuccess(TPVLAN_3); } else { $mes->addError(TPVLAN_3); } } if(strstr($key, "selectadmin")) { $this->id = key($post); $this->setAdminTheme(); $this->refreshPage('admin'); } } if(isset($_POST['submit_adminstyle'])) { $this->id = $this->curTheme; if($this->setAdminStyle()) { eMessage::getInstance()->add(TPVLAN_43, E_MESSAGE_SUCCESS); } e107::getConfig()->save(true); } if(isset($_POST['submit_style'])) { $this->id = $this->curTheme; $this->setLayouts(); // Update the layouts in case they have been manually changed. $this->SetCustomPages($_POST['custompages']); $this->setStyle(); e107::getConfig()->save(true); } if(!empty($_POST['git_pull'])) { $return = e107::getFile()->gitPull($this->curTheme, 'theme'); $mes->addSuccess($return); } if(isset($_POST['installplugin'])) { $key = key($_POST['installplugin']); e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_plugin.php"); require_once (e_HANDLER."plugin_class.php"); $eplug = new e107plugin; $message = $eplug->install_plugin($key); $mes->add($message, E_MESSAGE_SUCCESS); } if(isset($_POST['setMenuPreset'])) { $key = key($_POST['setMenuPreset']); e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php"); require_once (e_HANDLER."menumanager_class.php"); $men = new e_menuManager(); $men->curLayout = $key; //menu_layout is left blank when it's default. $men->dbLayout = ($men->curLayout != $pref['sitetheme_deflayout']) ? $men->curLayout : ""; if($areas = $men->menuSetPreset()) { foreach ($areas as $val) { $ar[$val['menu_location']][] = $val['menu_name']; } foreach ($ar as $k=>$v) { $message .= MENLAN_14." ".$k." : ".implode(", ", $v)."
"; } $mes->add(MENLAN_43." : ".$key."
".$message, E_MESSAGE_SUCCESS); } } } function getThemes($mode = FALSE) { $themeArray = array(); $tloop = 1; $fl = e107::getFile(); $array = $fl->get_dirs(e_THEME); foreach($array as $file) { if(($mode == 'xml') && !is_readable(e_THEME.$file."/theme.xml")) { continue; } if($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && is_readable(e_THEME.$file."/theme.php")) { if($mode == "id") { $themeArray[$tloop] = $file; } else { $themeArray[$file] = $this->getThemeInfo($file); $themeArray[$file]['id'] = $tloop; } $tloop++; } } // echo "
";
	//	 print_r($themeArray);
	//	 echo "
"; return $themeArray; } function getThemeInfo($file) { // return e_theme::getThemeInfo($file); $mes = e107::getMessage(); $reject = array('e_.*'); $handle2 = e107::getFile()->get_files(e_THEME.$file."/", "\.php|\.css|\.xml|preview\.jpg|preview\.png", $reject, 1); foreach ($handle2 as $fln) { $file2 = str_replace(e_THEME.$file."/", "", $fln['path']).$fln['fname']; $themeArray[$file]['files'][] = $file2; if(strstr($file2, "preview.")) { $themeArray[$file]['preview'] = e_THEME.$file."/".$file2; } // ---------------- get information string for css file - Legacy mode (no theme.xml) if(strstr($file2, ".css") && !strstr($file2, "menu.css") && strpos($file2, "e_") !== 0) { if($cssContents = file_get_contents(e_THEME.$file."/".$file2)) { $nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false; preg_match('/\* info:(.*?)\*\//', $cssContents, $match); $match[1] = varset($match[1], ''); $scope = ($nonadmin == true) ? 'front' : ''; $themeArray[$file]['css'][] = array("name"=>$file2, "info"=>$match[1], "scope"=>$scope, "nonadmin"=>$nonadmin); } else { // $mes->addDebug("Couldn't read file: ".e_THEME.$file."/".$file2); } } } // end while.. // Load Theme information and merge with existing array. theme.xml (v2.x theme) is given priority over theme.php (v1.x). if(in_array("theme.xml", $themeArray[$file]['files'])) { $themeArray[$file] = array_merge($themeArray[$file], $this->parse_theme_xml($file)); } elseif(in_array("theme.php", $themeArray[$file]['files'])) { $themeArray[$file] = array_merge($themeArray[$file], $this->parse_theme_php($file)); } if(!empty($themeArray[$file]['css']) && count($themeArray[$file]['css']) > 1) { $themeArray[$file]['multipleStylesheets'] = true; } return $themeArray[$file]; } /** * Validate and return the name of the categories. * * @param string [optional] $categoryfromXML * @return string */ function getThemeCategory($categoryfromXML = '') { if(!$categoryfromXML) { return 'generic'; } $tmp = explode(",", $categoryfromXML); $category = array(); foreach ($tmp as $cat) { $cat = trim($cat); if(in_array($cat, $this->allowedCategories)) { $category[] = $cat; } else { $category[] = 'generic'; } } return implode(', ', $category); } function themeUpload() { if(!$_POST['ac'] == md5(ADMINPWCHANGE)) { exit; } $mes = e107::getMessage(); $ns = e107::getRender(); // extract($_FILES); //print_a($_FILES); if(!is_writable(e_TEMP)) { $mes->addInfo(TPVLAN_20); return FALSE; } $fl = e107::getFile(); $mp = $this->getMarketplace(); $status = $fl->getUploaded(e_TEMP); if(!empty($status[0]['error'])) { $mes->addError($status[0]['message']); return; } $mes->addSuccess($status[0]['message']); return $fl->unzipArchive($status[0]['name'],'theme'); // else /* { // FIXME - temporary fixes to upload process, check required. // Probably in need of a rewrite to use process_uploaded_files(); require_once (e_HANDLER."upload_handler.php"); $fileName = $_FILES['file_userfile']['name'][0]; $fileSize = $_FILES['file_userfile']['size'][0]; $fileType = $_FILES['file_userfile']['type'][0]; // type is returned as mime type (application/octet-stream) not as zip/rar // There may be a better way to do this.. MIME may not be secure enough // process_uploaded_files() ? $mime_zip = array("application/octet-stream", "application/zip", "multipart/x-zip"); $mime_gzip = array("application/x-gzip", "multipart/x-gzip"); // rar? if(in_array($fileType, $mime_zip)) { $fileType = "zip"; } elseif(in_array($fileType, $mime_gzip)) { $fileType = "gzip"; } else { $mes->addError(TPVLAN_17); return FALSE; } if($fileSize) { $uploaded = file_upload(e_THEME); $archiveName = $uploaded[0]['name']; if($fileType == "zip") { require_once (e_HANDLER."pclzip.lib.php"); $archive = new PclZip(e_THEME.$archiveName); $unarc = ($fileList = $archive->extract(PCLZIP_OPT_PATH, e_THEME, PCLZIP_OPT_SET_CHMOD, 0666)); // FIXME - detect folder structure similar to 'Find themes' } else { require_once (e_HANDLER."pcltar.lib.php"); $unarc = ($fileList = PclTarExtract($archiveName, e_THEME)); // FIXME - detect folder structure similar to 'Find themes' } if(!$unarc) { if($fileType == "zip") { $error = TPVLAN_46." '".$archive->errorName(TRUE)."'"; } else { $error = TPVLAN_47.PclErrorString().", ".TPVLAN_48.intval(PclErrorCode()); } $mes->addError(TPVLAN_18." ".$archiveName." ".$error); return FALSE; } $folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/"))); $mes->addSuccess(TPVLAN_19); if(varset($_POST['setUploadTheme'])) { $themeArray = $this->getThemes(); $this->id = $themeArray[$folderName]['id']; if($this->setTheme()) { $mes->addSuccess(TPVLAN_3); } else { $mes->addError("Could not change site theme."); // TODO LAN } } @unlink(e_THEME.$archiveName); } } * */ } private function search($name, $searchVal, $submitName, $filterName='', $filterArray=false, $filterVal=false) { $frm = e107::getForm(); return $frm->search($name, $searchVal, $submitName, $filterName, $filterArray, $filterVal); $text = ' '.$frm->text($name, $searchVal,20,'class=search-query').' '; // $text .= $this->admin_button($submitName,LAN_SEARCH,'search'); return $text; } /** * Temporary, e107::getMarketplace() coming soon * @return e_marketplace */ public function getMarketplace() { if(null === $this->mp) { require_once(e_HANDLER.'e_marketplace.php'); $this->mp = new e_marketplace(); // autodetect the best method } return $this->mp; } function renderOnline($ajax=false) { global $e107SiteUsername, $e107SiteUserpass; $xml = e107::getXml(); $mes = e107::getMessage(); $frm = e107::getForm(); $ns = e107::getRender(); $mp = $this->getMarketplace(); $from = intval(varset($_GET['frm'])); $limit = 96; // FIXME - ajax pages load $srch = preg_replace('/[^\w]/','', vartrue($_GET['srch'])); // check for cURL if(!function_exists('curl_init')) { $mes->addWarning(TPVLAN_79); } // auth $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); // do the request, retrieve and parse data $xdata = $mp->call('getList', array( 'type' => 'theme', 'params' => array('limit' => $limit, 'search' => $srch, 'from' => $from) )); $total = $xdata['params']['count']; // OLD BIT OF CODE -------------------------------> /*$file = "http://e107.org/feed?type=theme&frm=".$from."&srch=".$srch."&limit=".$limit; $mes->addDebug("File = ".$file); $xml->setOptArrayTags('theme,screenshots/image'); // make sure 'theme' tag always returns an array // $xdata = $xml->loadXMLfile($file,'advanced',true); $xdata = $xml->loadXMLfile($file,true,false); $total = $xdata['@attributes']['total'];*/ // OLD BIT OF CODE -------------------------------> $amount =$limit; /* if($total > $amount) { //$parms = $total.",".$amount.",".$from.",".e_SELF.'?mode='.$_GET['mode'].'&frm=[FROM]'; $url = rawurlencode(e_SELF.'?mode='.$_GET['mode'].'&frm=[FROM]'); $parms = "total=".$total."&amount=".$amount."¤t=".$from."&url=".$url."&caption=off&tmpl=basic&navcount=4&glyphs=1"; $text .= "
".$tp->parseTemplate("{NEXTPREV=$parms}",TRUE)."
"; } */ // print_a($xdata); $c = 1; $text = "