commit e149b35fcc6a882ad812d9a7ca9c4b7cf4cfd0f7 Author: mcfly Date: Sat Dec 2 04:36:16 2006 +0000 new module creation diff --git a/article.php b/article.php new file mode 100644 index 000000000..a816d88f0 --- /dev/null +++ b/article.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/backend.php b/backend.php new file mode 100644 index 000000000..ccef7f324 --- /dev/null +++ b/backend.php @@ -0,0 +1,105 @@ + + + + ".SITENAME." + ".SITEURL." + ".SITEDESCRIPTION." + en-gb + ".SITEDISCLAIMER." + ".SITEADMIN." + ".SITEADMINEMAIL." + {$pubdate} + {$pubdate} + http://backend.userland.com/rss + + + e107 website system (http://e107.org) + 60 + + + ".SITENAME." + ".SITEBUTTON." + ".SITEURL." + 88 + 31 + ".SITETAG." + + + + Search + Search ".SITENAME." + query + ".SITEURL."search.php + + "; + +$sql2 = new db; +$sql->db_Select("news", "*", "news_class=0 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC LIMIT 0, 10"); +while ($row = $sql->db_Fetch()) { + extract($row); + + $sql2->db_Select("news_category", "*", "category_id='{$news_category}'"); + $row = $sql->db_Fetch(); + extract($row); + + $sql2->db_Select("user", "user_name", "user_id='{$news_author}' "); + $row = $sql->db_Fetch(); + extract($row); + + + $tmp = explode(" ", $news_body); + unset($nb); + for($a = 0; $a <= 100; $a++) { + $nb .= $tmp[$a]." "; + } + $nb = htmlspecialchars($nb); + $wlog .= $news_title."\n".SITEURL."/comment.php?comment.news.".$news_id."\n\n"; + + $itemdate = strftime("%a, %d %b %Y %I:%M:00 GMT", $news_datestamp); + + + + + $rss .= " + $news_title + http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id." + $nb + $category_name + http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id." + $user_name + $itemdate + http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id." + + "; + +} + + +$rss .= " + "; + + +echo $rss; + +?> \ No newline at end of file diff --git a/banner.php b/banner.php new file mode 100644 index 000000000..35070fce6 --- /dev/null +++ b/banner.php @@ -0,0 +1,125 @@ +db_Select("banner", "*", "banner_id = '{$query_string}' "); + $row = $sql->db_Fetch(); + $ip = $e107->getip(); + $newip = (strpos($row['banner_ip'], "{$ip}^") !== FALSE) ? $row['banner_ip'] : "{$row['banner_ip']}{$ip}^"; + $sql->db_Update("banner", "banner_clicks = banner_clicks + 1, `banner_ip` = '{$newip}' WHERE `banner_id` = '{$query_string}'"); + header("Location: {$row['banner_clickurl']}"); + exit; +} + +require_once(HEADERF); + +if (isset($_POST['clientsubmit'])) { + + $clean_login = $tp -> toDB($_POST['clientlogin']); + $clean_password = $tp -> toDB($_POST['clientpassword']); + + if (!$sql->db_Select("banner", "*", "`banner_clientlogin` = '{$clean_login}' AND `banner_clientpassword` = '{$clean_password}'")) { + $ns->tablerender(BANNERLAN_38, "
".BANNERLAN_20."

"); + require_once(FOOTERF); + exit; + } + + $row = $sql->db_Fetch(); + $banner_total = $sql->db_Select("banner", "*", "`banner_clientname` = '{$row['banner_clientname']}'"); + + if (!$banner_total) { + $ns->tablerender(BANNERLAN_38, "
".BANNERLAN_29."

"); + require_once(FOOTERF); + exit; + } else { + while ($row = $sql->db_Fetch()) { + + $start_date = ($row['banner_startdate'] ? strftime("%d %B %Y", $row['banner_startdate']) : BANNERLAN_31); + $end_date = ($row['banner_enddate'] ? strftime("%d %B %Y", $row['banner_enddate']) : BANNERLAN_31); + + $BANNER_TABLE_CLICKPERCENTAGE = ($row['banner_clicks'] && $row['banner_impressions'] ? round(($row['banner_clicks'] / $row['banner_impressions']) * 100)."%" : "-"); + $BANNER_TABLE_IMPRESSIONS_LEFT = ($row['banner_impurchased'] ? $row['banner_impurchased'] - $row['banner_impressions'] : BANNERLAN_30); + $BANNER_TABLE_IMPRESSIONS_PURCHASED = ($row['banner_impurchased'] ? $row['banner_impurchased'] : BANNERLAN_30); + $BANNER_TABLE_CLIENTNAME = $row['banner_clientname']; + $BANNER_TABLE_BANNER_ID = $row['banner_id']; + $BANNER_TABLE_BANNER_CLICKS = $row['banner_clicks']; + $BANNER_TABLE_BANNER_IMPRESSIONS = $row['banner_impressions']; + $BANNER_TABLE_ACTIVE = BANNERLAN_36.($row['banner_active'] != "255" ? BANNERLAN_32 : "".BANNERLAN_33.""); + $BANNER_TABLE_STARTDATE = BANNERLAN_37." ".$start_date; + $BANNER_TABLE_ENDDATE = BANNERLAN_34." ".$end_date; + + if ($row['banner_ip']) { + $tmp = explode("^", $row['banner_ip']); + $BANNER_TABLE_IP_LAN = BANNERLAN_35.": ".(count($tmp)-1); + for($a = 0; $a <= (count($tmp)-2); $a++) { + $BANNER_TABLE_IP .= $tmp[$a]."
"; + } + } + + if (!$BANNER_TABLE) { + if (file_exists(THEME."banner_template.php")) { + require_once(THEME."banner_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); + } + } + $textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE); + } + } + + if (!$BANNER_TABLE) { + if (file_exists(THEME."banner_template.php")) { + require_once(THEME."banner_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); + } + } + $textstart = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_START); + $textend = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_END); + $text = $textstart.$textstring.$textend; + + echo $text; + + require_once(FOOTERF); + exit; +} + + +$BANNER_LOGIN_TABLE_LOGIN = $rs->form_text("clientlogin", 30, $id, 20, "tbox"); +$BANNER_LOGIN_TABLE_PASSW = $rs->form_password("clientpassword", 30, "", 20, "tbox"); +$BANNER_LOGIN_TABLE_SUBMIT = $rs->form_button("submit", "clientsubmit", BANNERLAN_18); + +if (!$BANNER_LOGIN_TABLE) { + if (file_exists(THEME."banner_template.php")) { + require_once(THEME."banner_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); + } +} +$text = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_LOGIN_TABLE); +$ns->tablerender(BANNERLAN_19, $text); + + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/class2.php b/class2.php new file mode 100644 index 000000000..3152857d7 --- /dev/null +++ b/class2.php @@ -0,0 +1,1612 @@ + $pref_name) { + $retrieve_prefs[$key] = preg_replace("/\W/", '', $pref_name); + } +} else { + unset($retrieve_prefs); +} + +define("MAGIC_QUOTES_GPC", (ini_get('magic_quotes_gpc') ? TRUE : FALSE)); +$srvtmp = explode(".",$_SERVER['HTTP_HOST']); +define("e_SUBDOMAIN", (count($srvtmp)>2 && $srvtmp[2] ? $srvtmp[0] : FALSE)); // needs to be available to e107_config. + +// Ensure thet '.' is the first part of the include path +$inc_path = explode(PATH_SEPARATOR, ini_get('include_path')); +if($inc_path[0] != ".") { + array_unshift($inc_path, "."); + $inc_path = implode(PATH_SEPARATOR, $inc_path); + e107_ini_set("include_path", $inc_path); +} +unset($inc_path); + +// +// F: Grab e107_config, get directory paths and create $e107 object +// +@include_once(realpath(dirname(__FILE__).'/e107_config.php')); +if(!isset($ADMIN_DIRECTORY)){ + // e107_config.php is either empty, not valid or doesn't exist so redirect to installer.. + header("Location: install.php"); +} + +// +// clever stuff that figures out where the paths are on the fly.. no more need fo hard-coded e_HTTP :) +// +e107_require_once(realpath(dirname(__FILE__).'/'.$HANDLERS_DIRECTORY).'/e107_class.php'); +$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY'); +$e107 = new e107($e107_paths, realpath(dirname(__FILE__))); + +$inArray = array("'", ";", "/**/", "/UNION/", "/SELECT/", "AS "); +if (strpos($_SERVER['PHP_SELF'], "trackback") === false) { + foreach($inArray as $res) { + if(stristr($_SERVER['QUERY_STRING'], $res)) { + die("Access denied."); + } + } +} + +// +// G: Retrieve Query data from URI +// (Until this point, we have no idea what the user wants to do) +// +if (preg_match("#\[(.*?)](.*)#", $_SERVER['QUERY_STRING'], $matches)) { + define("e_MENU", $matches[1]); + $e_QUERY = $matches[2]; + + if(strlen(e_MENU) == 2) // language code ie. [fr] + { + require_once(e_HANDLER."language_class.php"); + $lng = new language; + define("e_LANCODE",TRUE); + $_GET['elan'] = $lng->convert(e_MENU); + } + +}else { + define("e_MENU", ""); + $e_QUERY = $_SERVER['QUERY_STRING']; + define("e_LANCODE", ""); +} + +// +// Start the parser; use it to grab the full query string +// + +e107_require_once(e_HANDLER.'e_parse_class.php'); +$tp = new e_parse; + +//define("e_QUERY", $matches[2]); +//define("e_QUERY", $_SERVER['QUERY_STRING']); +$e_QUERY = $tp->post_toForm($e_QUERY); +define("e_QUERY", $e_QUERY); +//$e_QUERY = e_QUERY; + +define("e_TBQS", $_SERVER['QUERY_STRING']); +$_SERVER['QUERY_STRING'] = e_QUERY; + +define("e_UC_PUBLIC", 0); +define("e_UC_MAINADMIN", 250); +define("e_UC_READONLY", 251); +define("e_UC_GUEST", 252); +define("e_UC_MEMBER", 253); +define("e_UC_ADMIN", 254); +define("e_UC_NOBODY", 255); +define("ADMINDIR", $ADMIN_DIRECTORY); + +// +// H: Initialize debug handling +// (NO E107 DEBUG CONSTANTS OR CODE ARE AVAILABLE BEFORE THIS POINT) +// All debug objects and constants are defined in the debug handler +// i.e. from here on you can use E107_DEBUG_LEVEL or any +// E107_DBG_* constant for debug testing. +// + require_once(e_HANDLER.'debug_handler.php'); + +if(E107_DEBUG_LEVEL && isset($db_debug) && is_object($db_debug)) { + $db_debug->Mark_Time('Start: Init ErrHandler'); +} + +// +// I: Sanity check on e107_config.php +// e107_config.php upgrade check +if (!$ADMIN_DIRECTORY && !$DOWNLOADS_DIRECTORY) { + message_handler("CRITICAL_ERROR", 8, ": generic, ", "e107_config.php"); + exit; +} + +// +// J: MYSQL INITIALIZATION +// +@require_once(e_HANDLER.'traffic_class.php'); +$eTraffic=new e107_traffic; // We start traffic counting ASAP +$eTraffic->Calibrate($eTraffic); + +define("MPREFIX", $mySQLprefix); + +e107_require_once(e_HANDLER."mysql_class.php"); + +$sql =& new db; +$sql2 =& new db; + +$sql->db_SetErrorReporting(FALSE); + +$sql->db_Mark_Time('Start: SQL Connect'); +$merror=$sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb); +$sql->db_Mark_Time('Start: Prefs, misc tables'); + +require_once(e_HANDLER.'admin_log_class.php'); +$admin_log = new e_admin_log(); + +if ($merror == "e1") { + message_handler("CRITICAL_ERROR", 6, ": generic, ", "class2.php"); + exit; +} +else if ($merror == "e2") { + message_handler("CRITICAL_ERROR", 7, ": generic, ", "class2.php"); + exit; +} + +// +// K: Load compatability mode. +// +/* At a later date add a check to load e107 compat mode by $pref +PHP Compatabilty should *always* be on. */ +e107_require_once(e_HANDLER."php_compatibility_handler.php"); +e107_require_once(e_HANDLER."e107_Compat_handler.php"); +$aj = new textparse; // required for backwards compatibility with 0.6 plugins. + +// +// L: Extract core prefs from the database +// +$sql->db_Mark_Time('Start: Extract Core Prefs'); +e107_require_once(e_HANDLER."pref_class.php"); +$sysprefs = new prefs; + +e107_require_once(e_HANDLER.'cache_handler.php'); +e107_require_once(e_HANDLER.'arraystorage_class.php'); +$eArrayStorage = new ArrayData(); + +$PrefCache = ecache::retrieve('SitePrefs', 24 * 60, true); +if(!$PrefCache){ + // No cache of the prefs array, going for the db copy.. + $retrieve_prefs[] = 'SitePrefs'; + $sysprefs->ExtractPrefs($retrieve_prefs, TRUE); + $PrefData = $sysprefs->get('SitePrefs'); + $pref = $eArrayStorage->ReadArray($PrefData); + if(!$pref){ + $admin_log->log_event("CORE_LAN8", "CORE_LAN7", E_LOG_WARNING); // Core prefs error, core is attempting to + // Try for the automatic backup.. + $PrefData = $sysprefs->get('SitePrefs_Backup'); + $pref = $eArrayStorage->ReadArray($PrefData); + if(!$pref){ + // No auto backup, try for the 'old' prefs system. + $PrefData = $sysprefs->get('pref'); + $pref = unserialize($PrefData); + if(!is_array($pref)){ + message_handler("CRITICAL_ERROR", 3, __LINE__, __FILE__); + // No old system, so point in the direction of resetcore :( + message_handler("CRITICAL_ERROR", 4, __LINE__, __FILE__); + $admin_log->log_event("CORE_LAN8", "CORE_LAN9", E_LOG_FATAL); // Core could not restore from automatic backup. Execution halted. + exit; + } else { + // old prefs found, remove old system, and update core with new system + $PrefOutput = $eArrayStorage->WriteArray($pref); + if(!$sql->db_Update('core', "e107_value='{$PrefOutput}' WHERE e107_name='SitePrefs'")){ + $sql->db_Insert('core', "'SitePrefs', '{$PrefOutput}'"); + } + if(!$sql->db_Update('core', "e107_value='{$PrefOutput}' WHERE e107_name='SitePrefs_Backup'")){ + $sql->db_Insert('core', "'SitePrefs_Backup', '{$PrefOutput}'"); + } + $sql->db_Delete('core', "`e107_name` = 'pref'"); + } + } else { + message_handler("CRITICAL_ERROR", 3, __LINE__, __FILE__); + // auto backup found, use backup to restore the core + if(!$sql->db_Update('core', "`e107_value` = '".addslashes($PrefData)."' WHERE `e107_name` = 'SitePrefs'")){ + $sql->db_Insert('core', "'SitePrefs', '".addslashes($PrefData)."'"); + } + } + } + // write pref cache array + $PrefCache = $eArrayStorage->WriteArray($pref, false); + // store the prefs in cache if cache is enabled + ecache::set('SitePrefs', $PrefCache); +} else { + // cache of core prefs was found, so grab all the useful core rows we need + if(!isset($sysprefs->DefaultIgnoreRows)){ + $sysprefs->DefaultIgnoreRows = ""; + } + $sysprefs->DefaultIgnoreRows .= '|SitePrefs'; + $sysprefs->prefVals['core']['SitePrefs'] = $PrefCache; + if(isset($retrieve_prefs)) + { + $sysprefs->ExtractPrefs($retrieve_prefs, TRUE); + } + $pref = $eArrayStorage->ReadArray($PrefCache); +} + +$e107->set_base_path(); + +// extract menu prefs +$menu_pref = unserialize(stripslashes($sysprefs->get('menu_pref'))); + +$sql->db_Mark_Time('(Extracting Core Prefs Done)'); + + +// +// M: Subdomain and Language Selection +// +define("SITEURLBASE", ($pref['ssl_enabled'] == '1' ? "https://" : "http://").$_SERVER['HTTP_HOST']); +define("SITEURL", SITEURLBASE.e_HTTP); + +// let the subdomain determine the language (when enabled). +if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain'] && ($pref['user_tracking'] == "session")){ + e107_ini_set("session.cookie_domain",$pref['multilanguage_subdomain']); + require_once(e_HANDLER."language_class.php"); + $lng = new language; + if(e_SUBDOMAIN == "www"){ + $GLOBALS['elan'] = $pref['sitelanguage']; + } + elseif($eln = $lng->convert(e_SUBDOMAIN)) + { + $GLOBALS['elan'] = $eln; + } +} + + +// if a cookie name pref isn't set, make one :) +if (!$pref['cookie_name']) { + $pref['cookie_name'] = "e107cookie"; +} + +// start a session if session based login is enabled +if ($pref['user_tracking'] == "session") { + session_start(); +} + +define("e_SELF", ($pref['ssl_enabled'] == '1' ? "https://".$_SERVER['HTTP_HOST'] : "http://".$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME'])); + +// if the option to force users to use a particular url for the site is enabled, redirect users there as needed +// Now matches RFC 2616 (sec 3.2): case insensitive, https/:443 and http/:80 are equivalent. +// And, this is robust against hack attacks. Malignant users can put **anything** in HTTP_HOST! +if($pref['redirectsiteurl'] && $pref['siteurl']) { + // Find domain and port from user and from pref + list($urlbase,$urlport) = explode(':',$_SERVER['HTTP_HOST'].':'); + if (!$urlport) { $urlport = $_SERVER['SERVER_PORT']; } + if (!$urlport) { $urlport = 80; } + $aPrefURL = explode('/',$pref['siteurl'],4); + if (count($aPrefURL) > 2) { // we can do this -- there's at least http[s]://dom.ain/whatever + $PrefRoot = $aPrefURL[2]; + list($PrefSiteBase,$PrefSitePort) = explode(':',$PrefRoot.':'); + if (!$PrefSitePort) { + $PrefSitePort = ( $aPrefURL[0] == "https:" ) ? 443 : 80; // no port so set port based on 'scheme' + } + + // Redirect only if + // -- ports do not match (http <==> https) + // -- base domain does not match (case-insensitive) + // -- NOT admin area + if (($urlport != $PrefSitePort || stripos($PrefSiteBase, $urlbase) === FALSE) && strpos(e_SELF, ADMINDIR) === FALSE) { + $aeSELF = explode('/',e_SELF,4); + $aeSELF[0] = $aPrefURL[0]; // Swap in correct type of query (http, https) + $aeSELF[1] = ''; // Defensive code: ensure http:// not http:// + $aeSELF[2] = $aPrefURL[2]; // Swap in correct domain and possibly port + $location = implode('/',$aeSELF).(e_QUERY ? "?".e_QUERY : ""); + + header("Location: {$location}", true, 301); // send 301 header, not 302 + exit(); + } +} +} + +$page = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1); +define("e_PAGE", $page); + +// sort out the users language selection +if (isset($_POST['setlanguage']) || isset($_GET['elan']) || isset($GLOBALS['elan'])) { + if($_GET['elan']) // query support, for language selection splash pages. etc + { + $_POST['sitelanguage'] = $_GET['elan']; + } + if($GLOBALS['elan'] && !isset($_POST['sitelanguage'])) + { + $_POST['sitelanguage'] = $GLOBALS['elan']; + } + + $sql->mySQLlanguage = $_POST['sitelanguage']; + $sql2->mySQLlanguage = $_POST['sitelanguage']; + + if ($pref['user_tracking'] == "session") { + $_SESSION['e107language_'.$pref['cookie_name']] = $_POST['sitelanguage']; + } else { + setcookie('e107language_'.$pref['cookie_name'], $_POST['sitelanguage'], time() + 86400, "/"); + $_COOKIE['e107language_'.$pref['cookie_name']] = $_POST['sitelanguage']; + if (strpos(e_SELF, ADMINDIR) === FALSE) { + $locat = ((!$_GET['elan'] && e_QUERY) || (e_QUERY && e_LANCODE)) ? e_SELF."?".e_QUERY : e_SELF; + header("Location:".$locat); + } + } +} + +$user_language=''; +// Multi-language options. +if (isset($pref['multilanguage']) && $pref['multilanguage']) { + + if ($pref['user_tracking'] == "session") { + $user_language=(array_key_exists('e107language_'.$pref['cookie_name'], $_SESSION) ? $_SESSION['e107language_'.$pref['cookie_name']] : ""); + $sql->mySQLlanguage=($user_language) ? $user_language : ""; + $sql2->mySQLlanguage = $sql->mySQLlanguage; + } else { + $user_language= (isset($_COOKIE['e107language_'.$pref['cookie_name']])) ? $_COOKIE['e107language_'.$pref['cookie_name']] : ""; + $sql->mySQLlanguage=($user_language) ? $user_language : ""; + $sql2->mySQLlanguage = $sql->mySQLlanguage; + } + + +} + +// Get Language List for rights checking. +if(!$tmplan = getcachedvars("language-list")){ + $handle=opendir(e_LANGUAGEDIR); + while ($file = readdir($handle)) { + if (is_dir(e_LANGUAGEDIR.$file) && $file !="." && $file !=".." && $file !="CVS") { + $lanlist[] = $file; + } + } + closedir($handle); + $tmplan = implode(",",$lanlist); + cachevars("language-list", $tmplan); +} + +define("e_LANLIST",(isset($tmplan) ? $tmplan : "")); + +$language=(isset($_COOKIE['e107language_'.$pref['cookie_name']]) ? $_COOKIE['e107language_'.$pref['cookie_name']] : ($pref['sitelanguage'] ? $pref['sitelanguage'] : "English")); +$language = preg_replace("#\W#", "", $language); +define("USERLAN", ($user_language && (strpos(e_SELF, $PLUGINS_DIRECTORY) !== FALSE || (strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE && file_exists(e_LANGUAGEDIR.$user_language."/lan_".e_PAGE)) || (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE && file_exists(e_LANGUAGEDIR.$user_language."/admin/lan_".e_PAGE)) || file_exists(dirname($_SERVER['SCRIPT_FILENAME'])."/languages/".$user_language."/lan_".e_PAGE) || ( (strpos(e_SELF, $ADMIN_DIRECTORY) == FALSE) && (strpos(e_SELF, $PLUGINS_DIRECTORY) == FALSE) && file_exists(e_LANGUAGEDIR.$user_language."/".$user_language.".php") ) ) ? $user_language : FALSE)); +define("e_LANGUAGE", (!USERLAN || !defined("USERLAN") ? $language : USERLAN)); + +e107_include(e_LANGUAGEDIR.e_LANGUAGE."/".e_LANGUAGE.".php"); +e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/".e_LANGUAGE."_custom.php"); + +if($pref['sitelanguage'] != e_LANGUAGE && isset($pref['multilanguage']) && $pref['multilanguage'] && !$pref['multilanguage_subdomain']){ + list($clc) = explode("_",CORE_LC); + define("e_LAN", strtolower($clc)); + define("e_LANQRY", "[".e_LAN."]"); + unset($clc); +}else{ + define("e_LAN", FALSE); + define("e_LANQRY", FALSE); +} +$sql->db_Mark_Time('(Start: Pref/multilang done)'); + +// +// N: misc setups: online user tracking, cache +// +$sql -> db_Mark_Time('Start: Misc resources. Online user tracking, cache'); +$e_online = new e_online(); + +// cache class +$e107cache = new ecache; + + +if (isset($pref['del_unv']) && $pref['del_unv'] && $pref['user_reg_veri'] != 2) { + $threshold=(time() - ($pref['del_unv'] * 60)); + $sql->db_Delete("user", "user_ban = 2 AND user_join < '{$threshold}' "); +} + +e107_require_once(e_HANDLER."override_class.php"); +$override=new override; + +e107_require_once(e_HANDLER."event_class.php"); +$e_event=new e107_event; + +if (isset($pref['notify']) && $pref['notify'] == true) { + e107_require_once(e_HANDLER.'notify_class.php'); +} + +// +// O: Start user session +// +$sql -> db_Mark_Time('Start: Init session'); +init_session(); + +// for multi-language these definitions needs to come after the language loaded. +define("SITENAME", trim($tp->toHTML($pref['sitename'], "", "emotes_off defs no_make_clickable"))); +define("SITEBUTTON", $pref['sitebutton']); +define("SITETAG", $tp->toHTML($pref['sitetag'], FALSE, "emotes_off defs")); +define("SITEDESCRIPTION", $tp->toHTML($pref['sitedescription'], "", "emotes_off defs")); +define("SITEADMIN", $pref['siteadmin']); +define("SITEADMINEMAIL", $pref['siteadminemail']); +define("SITEDISCLAIMER", $tp->toHTML($pref['sitedisclaimer'], "", "emotes_off defs")); +define("SITECONTACTINFO", $tp->toHTML($pref['sitecontactinfo'], TRUE, "emotes_off defs")); + +// legacy module.php file loading. +if (isset($pref['modules']) && $pref['modules']) { + $mods=explode(",", $pref['modules']); + foreach ($mods as $mod) { + if (is_readable(e_PLUGIN."{$mod}/module.php")) { + require_once(e_PLUGIN."{$mod}/module.php"); + } + } +} + +// Load e_modules after all the constants, but before the themes, so they can be put to use. +if(isset($pref['e_module_list']) && $pref['e_module_list']){ + foreach ($pref['e_module_list'] as $mod){ + if (is_readable(e_PLUGIN."{$mod}/e_module.php")) { + require_once(e_PLUGIN."{$mod}/e_module.php"); + } + } +} + +// +// P: THEME LOADING +// + +$sql->db_Mark_Time('Start: Load Theme'); + +//########### Module redefinable functions ############### +if (!function_exists('checkvalidtheme')) { + function checkvalidtheme($theme_check) { + // arg1 = theme to check + global $ADMIN_DIRECTORY, $tp, $e107; + + if (strpos(e_QUERY, "themepreview") !== FALSE) { + list($action, $id) = explode('.', e_QUERY); + require_once(e_HANDLER."theme_handler.php"); + $themeArray = themeHandler :: getThemes("id"); + define("PREVIEWTHEME", e_THEME.$themeArray[$id]."/"); + define("PREVIEWTHEMENAME", $themeArray[$id]); + define("THEME", e_THEME.$themeArray[$id]."/"); + define("THEME_ABS", e_THEME_ABS.$themeArray[$id]."/"); + return; + } + if (@fopen(e_THEME.$theme_check."/theme.php", "r")) { + define("THEME", e_THEME.$theme_check."/"); + define("THEME_ABS", e_THEME_ABS.$theme_check."/"); + $e107->site_theme = $theme_check; + } else { + function search_validtheme() { + global $e107; + $th=substr(e_THEME, 0, -1); + $handle=opendir($th); + while ($file = readdir($handle)) { + if (is_dir(e_THEME.$file) && is_readable(e_THEME.$file.'/theme.php')) { + closedir($handle); + $e107->site_theme = $file; + return $file; + } + } + closedir($handle); + } + $e107tmp_theme = search_validtheme(); + define("THEME", e_THEME.$e107tmp_theme."/"); + define("THEME_ABS", e_THEME_ABS.$e107tmp_theme."/"); + if (ADMIN && strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) { + echo ''; + } + } + $themes_dir = $e107->e107_dirs["THEMES_DIRECTORY"]; + $e107->http_theme_dir = "{$e107->server_path}{$themes_dir}{$e107->site_theme}/"; + } +} + +// +// Q: ALL OTHER SETUP CODE +// +$sql->db_Mark_Time('Start: Misc Setup'); + +//------------------------------------------------------------------------------------------------------------------------------------// +if (!class_exists('e107_table')) { + class e107table { + function tablerender($caption, $text, $mode = "default", $return = false) { + /* + # Render style table + # - parameter #1: string $caption, caption text + # - parameter #2: string $text, body text + # - return null + # - scope public + */ + global $override; + + if ($override_tablerender = $override->override_check('tablerender')) { + $result=call_user_func($override_tablerender, $caption, $text, $mode, $return); + + if ($result == "return") { + return; + } + extract($result); + } + + if ($return) { + ob_start(); + tablestyle($caption, $text, $mode); + $ret=ob_get_contents(); + ob_end_clean(); + return $ret; + } else { + tablestyle($caption, $text, $mode); + } + } + } +} +//############################################################# + +$ns=new e107table; + +$e107->ban(); + +if($pref['force_userupdate'] && USER) { + if(force_userupdate()) { + header("Location: ".e_BASE."usersettings.php?update"); + } +} + +$sql->db_Mark_Time('Start: Signup/splash/admin'); + +define("e_SIGNUP", e_BASE.(file_exists(e_BASE."customsignup.php") ? "customsignup.php" : "signup.php")); +define("e_LOGIN", e_BASE.(file_exists(e_BASE."customlogin.php") ? "customlogin.php" : "login.php")); + +if ($pref['membersonly_enabled'] && !USER && e_PAGE != e_SIGNUP && e_PAGE != "index.php" && e_PAGE != "fpw.php" && e_PAGE != e_LOGIN && strpos(e_PAGE, "admin") === FALSE && e_PAGE != 'membersonly.php' && e_PAGE != 'sitedown.php') { + header("Location: ".e_HTTP."membersonly.php"); + exit; +} + +$sql->db_Delete("tmp", "tmp_time < '".(time() - 300)."' AND tmp_ip!='data' AND tmp_ip!='submitted_link'"); + + + +if ($pref['maintainance_flag'] && ADMIN == FALSE && strpos(e_SELF, "admin.php") === FALSE && strpos(e_SELF, "sitedown.php") === FALSE) { + header("Location: ".SITEURL."sitedown.php"); + exit; +} + +$sql->db_Mark_Time('(Start: Login/logout/ban/tz)'); + +if (isset($_POST['userlogin']) || isset($_POST['userlogin_x'])) { + e107_require_once(e_HANDLER."login.php"); + $usr = new userlogin($_POST['username'], $_POST['userpass'], $_POST['autologin']); +} + +if (e_QUERY == 'logout') { + $ip = $e107->getip(); + $udata=(USER === TRUE) ? USERID.".".USERNAME : "0"; + $sql->db_Update("online", "online_user_id = '0', online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}' LIMIT 1"); + + if ($pref['user_tracking'] == "session") { + session_destroy(); + $_SESSION[$pref['cookie_name']]=""; + } + + cookie($pref['cookie_name'], "", (time() - 2592000)); + $e_event->trigger("logout"); + echo "\n"; + exit; +} + + +/* +* Calculate time zone offset, based on session cookie set in e107.js. +* (Buyer beware: this may be wrong for the first pageview in a session, +* which is while the user is logged out, so not a problem...) +* +* Time offset is SECONDS. Seconds is much better than hours as a base, +* as some places have 30 and 45 minute time zones. +* It matches user clock time, instead of only time zones. +* Add the offset to MySQL/server time to get user time. +* Subtract the offset from user time to get server time. +* +*/ + +$e_deltaTime=0; + +if (isset($_COOKIE['e107_tdOffset'])) { + // Actual seconds of delay. See e107.js and footer_default.php + $e_deltaTime = $_COOKIE['e107_tdOffset']; +} + +if (isset($_COOKIE['e107_tzOffset'])) { + // Relative client-to-server time zone offset in seconds. + $e_deltaTime += (-($_COOKIE['e107_tzOffset'] * 60 + date("Z"))); +} + +define("TIMEOFFSET", $e_deltaTime); + +$sql->db_Mark_Time('Start: Get menus'); + +$menu_data = $e107cache->retrieve("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE)); +$menu_data = $eArrayStorage->ReadArray($menu_data); +if(!is_array($menu_data)) { + if ($sql->db_Select('menus', '*', "menu_location > 0 AND menu_class IN (".USERCLASS_LIST.") ORDER BY menu_order")) { + while ($row = $sql->db_Fetch()) { + $eMenuList[$row['menu_location']][]=$row; + $eMenuActive[]=$row['menu_name']; + } + } + $menu_data['menu_list'] = $eMenuList; + $menu_data['menu_active'] = $eMenuActive; + $menu_data = $eArrayStorage->WriteArray($menu_data, false); + $e107cache->set("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE), $menu_data); + unset($menu_data); +} else { + $eMenuList = $menu_data['menu_list']; + $eMenuActive = $menu_data['menu_active']; + unset($menu_data); +} + +$sql->db_Mark_Time('(Start: Find/Load Theme)'); + +if(!defined("THEME")){ + // any plugin file starting with 'admin_' is assumed to use admin theme + // any plugin file in a folder called admin/ is assumed to use admin theme. + // any file that specifies $eplug_admin = TRUE; + // this test: (strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE && strpos(e_PAGE,"admin_") === 0) + // alternate test: match ANY file starting with 'admin_'... + // strpos(e_PAGE, "admin_") === 0 + // + // here we TEST the theme (see below for deciding what theme to USE) + // + + if((strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || (strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE && (strpos(e_PAGE,"admin_") === 0 || strpos(str_replace($e107->base_path, "", e_SELF), "admin/") !== FALSE)) || (isset($eplug_admin) && $eplug_admin == TRUE)) && $pref['admintheme']) { + + if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') !== FALSE) { + checkvalidtheme($pref['sitetheme']); + } else if (strpos(e_SELF, "newspost.php") !== FALSE) { + define("MAINTHEME", e_THEME.$pref['sitetheme']."/"); + checkvalidtheme($pref['admintheme']); + } + else { + checkvalidtheme($pref['admintheme']); + } + } else { + if (USERTHEME !== FALSE && USERTHEME != "USERTHEME") { + checkvalidtheme(USERTHEME); + } else { + checkvalidtheme($pref['sitetheme']); + } + } +} + + + +// -------------------------------------------------------------- + + // here we USE the theme + if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || (strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE && strpos(e_PAGE,"admin_") === 0) || (isset($eplug_admin) && $eplug_admin == TRUE))) { + if (file_exists(THEME.'admin_theme.php')) { + require_once(THEME.'admin_theme.php'); + } else { + require_once(THEME."theme.php"); + } +} else { + require_once(THEME."theme.php"); +} + +$exclude_lan = array("lan_signup.php"); // required for multi-language. + +if (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || strpos(e_SELF, "admin.php") !== FALSE) { + e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".e_PAGE); + e107_include_once(e_LANGUAGEDIR."English/admin/lan_".e_PAGE); +} else if (!in_array("lan_".e_PAGE,$exclude_lan) && strpos(e_SELF, $PLUGINS_DIRECTORY) === FALSE) { + e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE); + e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE); +} + + + +if(!defined("IMODE")) define("IMODE", "lite"); + +if ($pref['anon_post'] ? define("ANON", TRUE) : define("ANON", FALSE)); + +if (Empty($pref['newsposts']) ? define("ITEMVIEW", 15) : define("ITEMVIEW", $pref['newsposts'])); + +if ($pref['antiflood1'] == 1) { + define('FLOODPROTECT', TRUE); + define('FLOODTIMEOUT', $pref['antiflood_timeout']); +}else{ + define('FLOODPROTECT', FALSE); +} + +$layout = isset($layout) ? $layout : '_default'; +define("HEADERF", e_THEME."templates/header{$layout}.php"); +define("FOOTERF", e_THEME."templates/footer{$layout}.php"); + +if (!file_exists(HEADERF)) { + message_handler("CRITICAL_ERROR", "Unable to find file: ".HEADERF, __LINE__ - 2, __FILE__); +} + +if (!file_exists(FOOTERF)) { + message_handler("CRITICAL_ERROR", "Unable to find file: ".FOOTERF, __LINE__ - 2, __FILE__); +} + +define("LOGINMESSAGE", ""); +define("OPEN_BASEDIR", (ini_get('open_basedir') ? TRUE : FALSE)); +define("SAFE_MODE", (ini_get('safe_mode') ? TRUE : FALSE)); +define("FILE_UPLOADS", (ini_get('file_uploads') ? TRUE : FALSE)); +define("INIT", TRUE); +if(isset($_SERVER['HTTP_REFERER'])) { + $tmp = explode("?", $_SERVER['HTTP_REFERER']); + define("e_REFERER_SELF",($tmp[0] == e_SELF)); +} else { + define('e_REFERER_SELF', FALSE); +} + +if (!class_exists('convert')) +{ + require_once(e_HANDLER."date_handler.php"); +} + + + + + +//@require_once(e_HANDLER."IPB_int.php"); +//@require_once(e_HANDLER."debug_handler.php"); +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +function js_location($qry){ + echo "\n"; exit; +} + +function check_email($email) { + return preg_match("/^([_a-zA-Z0-9-+]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,6})$/" , $email) ? $email : FALSE; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +function check_class($var, $userclass = USERCLASS, $peer = FALSE, $debug = FALSE) +{ + global $tp; + if($var == e_LANGUAGE){ + return TRUE; + } + + if (!$var || $var == "") + { + return TRUE; + } + + if(strpos($var, ",") !== FALSE) + { + $lans = explode(",",e_LANLIST); + $varList = explode(",", $var); + rsort($varList); // check the language first.(ie. numbers come last) + foreach($varList as $v) + { + if (in_array($v,$lans) && strpos($v, e_LANGUAGE) === FALSE) { + return FALSE; + } + + if(check_class($v, $userclass, $debug)) { + return TRUE; + } + } + return FALSE; + } + + if (preg_match("/^([0-9]+)$/", $var) && !$peer) + { + if ($var == e_UC_MAINADMIN && getperms('0')) + { + return TRUE; + } + + if ($var == e_UC_MEMBER && USER == TRUE) + { + return TRUE; + } + + if ($var == e_UC_GUEST && USER == FALSE) { + return TRUE; + } + + if ($var == e_UC_PUBLIC) { + return TRUE; + } + + if ($var == e_UC_NOBODY) { + return FALSE; + } + + if ($var == e_UC_ADMIN && ADMIN) { + return TRUE; + } + if ($var == e_UC_READONLY) { + return TRUE; + } + } + + if ($debug) { + echo "USERCLASS: ".$userclass.", \$var = $var : "; + } + + if (!defined("USERCLASS") || $userclass == "") { + if ($debug) { + echo "FALSE
"; + } + return FALSE; + } + + // user has classes set - continue + if (preg_match("/^([0-9]+)$/", $var)) { + $tmp=explode(',', $userclass); + if (is_numeric(array_search($var, $tmp))) { + if ($debug) { + echo "TRUE
"; + } + return TRUE; + } + } else { + // var is name of class ... + $sql=new db; + if ($sql->db_Select("userclass_classes", "*", "userclass_name='".$tp -> toDB($var)."' ")) { + $row=$sql->db_Fetch(); + $tmp=explode(',', $userclass); + if (is_numeric(array_search($row['userclass_id'], $tmp))) { + if ($debug) { + echo "TRUE
"; + } + return TRUE; + } + } + } + + if ($debug) { + echo "NOTNUM! FALSE
"; + } + + return FALSE; +} + +function getperms($arg, $ap = ADMINPERMS) { + global $PLUGINS_DIRECTORY; + if ($ap == "0") { + return TRUE; + } + if ($ap == "") { + return FALSE; + } + $ap='.'.$ap; + if ($arg == 'P' && preg_match("#(.*?)/".$PLUGINS_DIRECTORY."(.*?)/(.*?)#", e_SELF, $matches)) { + $psql=new db; + if ($psql->db_Select('plugin', 'plugin_id', "plugin_path = '".$matches[2]."' ")) { + $row=$psql->db_Fetch(); + $arg='P'.$row[0]; + } + } + if (strpos($ap, ".".$arg.".") !== FALSE) { + return TRUE; + } else { + return FALSE; + } +} + +/** + * Get the user data from user and user_extended tables + * + * @return array + */ +function get_user_data($uid, $extra = "") +{ + global $pref, $sql; + $uid = intval($uid); + $var = array(); + if($uid == 0) { return $var; } + if($ret = getcachedvars("userdata_{$uid}")) + { + return $ret; + } + + $qry = " + SELECT u.*, ue.* FROM #user AS u + LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id + WHERE u.user_id='{$uid}' {$extra} + "; + if (!$sql->db_Select_gen($qry)) + { + $qry = "SELECT * FROM #user AS u WHERE u.user_id='{$uid}' {$extra}"; + if(!$sql->db_Select_gen($qry)) + { + return FALSE; + } + } + + $var = $sql->db_Fetch(); + $extended_struct = getcachedvars("extended_struct"); + if(!$extended_struct) + { + unset($extended_struct); + $qry = "SHOW COLUMNS FROM #user_extended "; + if($sql->db_Select_gen($qry)) + { + while($row = $sql->db_Fetch()) + { + if($row['Default'] != "") + { + $extended_struct[] = $row; + } + } + if(isset($extended_struct)) + { + cachevars("extended_struct", $extended_struct); + } + } + } + + if(isset($extended_struct)) + { + foreach($extended_struct as $row) + { + if($row['Default'] != "" && ($var[$row['Field']] == NULL || $var[$row['Field']] == "" )) + { + $var[$row['Field']] = $row['Default']; + } + } + } + cachevars("userdata_{$uid}", $var); + return $var; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + +function save_prefs($table = 'core', $uid = USERID, $row_val = '') { + global $pref, $user_pref, $tp, $PrefCache, $sql, $eArrayStorage; + if ($table == 'core') { + if ($row_val == '') { + // Save old version as a backup + if(!$sql->db_Update('core', "e107_value='".addslashes($PrefCache)."' WHERE e107_name='SitePrefs_Backup'")){ + $sql->db_Insert('core', "'SitePrefs', '".addslashes($PrefCache)."'"); + } + + // traverse the pref array, with toDB on everything + $_pref = $tp -> toDB($pref, true, true); + // Create the data to be stored + $PrefCache1 = $eArrayStorage->WriteArray($_pref); + if(!$sql->db_Update('core', "e107_value='{$PrefCache1}' WHERE e107_name = 'SitePrefs'")){ + $sql->db_Insert('core', "'SitePrefs', '{$PrefCache1}'"); + } + ecache::clear('SitePrefs'); + } + } else { + + $_user_pref = $tp -> toDB($user_pref); + + $tmp=addslashes(serialize($_user_pref)); + $sql->db_Update("user", "user_prefs='$tmp' WHERE user_id=".intval($uid)); + return $tmp; + } +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + +class e_online { + function online($online_tracking = false, $flood_control = false) { + if($online_tracking == true || $flood_control == true) { + global $online_timeout, $online_warncount, $online_bancount; + if(!isset($online_timeout)) { + $online_timeout = 300; + } + if(!isset($online_warncount)) { + $online_warncount = 90; + } + if(!isset($online_bancount)) { + $online_bancount = 100; + } + global $sql, $pref, $e107, $listuserson, $e_event, $tp; + $page = (strpos(e_SELF, "forum_") !== FALSE) ? e_SELF.".".e_QUERY : e_SELF; + $page = (strpos(e_SELF, "comment") !== FALSE) ? e_SELF.".".e_QUERY : $page; + $page = (strpos(e_SELF, "content") !== FALSE) ? e_SELF.".".e_QUERY : $page; + $page = $tp -> toDB($page, true); + + $ip = $e107->getip(); + $udata = (USER === true ? USERID.".".USERNAME : "0"); + + if (USER) { + // Find record that matches IP or visitor, or matches user info + if ($sql->db_Select("online", "*", "(`online_ip` = '{$ip}' AND `online_user_id` = '0') OR `online_user_id` = '{$udata}'")) { + $row = $sql->db_Fetch(); + + if ($row['online_user_id'] == $udata) { + //Matching user record + if ($row['online_timestamp'] < (time() - $online_timeout)) { + //It has been at least 'timeout' seconds since this user has connected + //Update user record with timestamp, current IP, current page and set pagecount to 1 + $query = "online_timestamp='".time()."', online_ip='{$ip}', online_location='{$page}', online_pagecount=1 WHERE online_user_id='{$row['online_user_id']}' LIMIT 1"; + } else { + if (!ADMIN) { + $row['online_pagecount'] ++; + } + // Update user record with current IP, current page and increment pagecount + $query = "online_ip='{$ip}', `online_location` = '{$page}', `online_pagecount` = '".intval($row['online_pagecount'])."' WHERE `online_user_id` = '{$row['online_user_id']}' LIMIT 1"; + } + } else { + //Found matching visitor record (ip only) for this user + if ($row['online_timestamp'] < (time() - $online_timeout)) { + // It has been at least 'timeout' seconds since this user has connected + // Update record with timestamp, current IP, current page and set pagecount to 1 + $query = "`online_timestamp` = '".time()."', `online_user_id` = '{$udata}', `online_location` = '{$page}', `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + } else { + if (!ADMIN) { + $row['online_pagecount'] ++; + } + //Update record with current IP, current page and increment pagecount + $query = "`online_user_id` = '{$udata}', `online_location` = '{$page}', `online_pagecount` = ".intval($row['online_pagecount'])." WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + } + } + $sql->db_Update("online", $query); + } else { + $sql->db_Insert("online", " '".time()."', '0', '{$udata}', '{$ip}', '{$page}', 1, 0"); + } + } else { + //Current page request is from a visitor + if ($sql->db_Select("online", "*", "`online_ip` = '{$ip}' AND `online_user_id` = '0'")) { + $row = $sql->db_Fetch(); + + if ($row['online_timestamp'] < (time() - $online_timeout)) //It has been at least 'timeout' seconds since this ip has connected + { + //Update record with timestamp, current page, and set pagecount to 1 + $query = "`online_timestamp` = '".time()."', `online_location` = '{$page}', `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + } else { + //Update record with current page and increment pagecount + $row['online_pagecount'] ++; + // echo "here {$online_pagecount}"; + $query="`online_location` = '{$page}', `online_pagecount` = {$row['online_pagecount']} WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1"; + } + $sql->db_Update("online", $query); + } else { + $sql->db_Insert("online", " '".time()."', 'null', '0', '{$ip}', '{$page}', 1, 0"); + } + } + + if (ADMIN || $pref['autoban'] != 1) { + $row['online_pagecount'] = 1; + } + if ($row['online_pagecount'] > $online_bancount && $row['online_ip'] != "127.0.0.1") { + $sql->db_Insert("banlist", "'{$ip}', '0', 'Hit count exceeded ({$row['online_pagecount']} requests within allotted time)' "); + $e_event->trigger("flood", $ip); + exit; + } + if ($row['online_pagecount'] >= $online_warncount && $row['online_ip'] != "127.0.0.1") { + echo "
".LAN_WARNING."

".CORE_LAN6."
"; + exit; + } + + $sql->db_Delete("online", "`online_timestamp` < ".(time() - $online_timeout)); + + global $members_online, $total_online, $member_list, $listuserson; + $total_online = $sql->db_Count("online"); + if ($members_online = $sql->db_Select("online", "*", "online_user_id != '0' ")) { + $member_list = ''; + $listuserson = array(); + while ($row = $sql->db_Fetch()) { + $vals = explode(".", $row['online_user_id'], 2); + $member_list .= "{$vals[1]} "; + $listuserson[$row['online_user_id']] = $row['online_location']; + } + } + define("TOTAL_ONLINE", $total_online); + define("MEMBERS_ONLINE", $members_online); + define("GUESTS_ONLINE", $total_online - $members_online); + define("ON_PAGE", $sql->db_Count("online", "(*)", "WHERE `online_location` = '{$page}' ")); + define("MEMBER_LIST", $member_list); + } else { + define("e_TRACKING_DISABLED", true); + define("TOTAL_ONLINE", ""); + define("MEMBERS_ONLINE", ""); + define("GUESTS_ONLINE", ""); + define("ON_PAGE", ""); + define("MEMBER_LIST", ""); // + } + } +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +function cachevars($id, $var) { + global $cachevar; + $cachevar[$id]=$var; +} + +function getcachedvars($id) { + global $cachevar; + return (isset($cachevar[$id]) ? $cachevar[$id] : false); +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +class floodprotect { + function flood($table, $orderfield) { + /* + # Test for possible flood + # + # - parameter #1 string $table, table being affected + # - parameter #2 string $orderfield, date entry in respective table + # - return boolean + # - scope public + */ + $sql=new db; + + if (FLOODPROTECT == TRUE) { + $sql->db_Select($table, "*", "ORDER BY ".$orderfield." DESC LIMIT 1", "no_where"); + $row=$sql->db_Fetch(); + return ($row[$orderfield] > (time() - FLOODTIMEOUT) ? FALSE : TRUE); + } else { + return TRUE; + } + } +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +function init_session() { + /* + # Validate user + # + # - parameters none + # - return boolean + # - scope public + */ + global $sql, $pref, $user_pref, $tp, $currentUser, $e107; + + define('USERIP', $e107->getip()); + if (!isset($_COOKIE[$pref['cookie_name']]) && !isset($_SESSION[$pref['cookie_name']])) { + define("USER", FALSE); + define("USERTHEME", FALSE); + define("ADMIN", FALSE); + define("GUEST", TRUE); + define('USERCLASS', ''); + define('USEREMAIL', ''); + } else { + list($uid, $upw)=(isset($_COOKIE[$pref['cookie_name']]) && $_COOKIE[$pref['cookie_name']] ? explode(".", $_COOKIE[$pref['cookie_name']]) : explode(".", $_SESSION[$pref['cookie_name']])); + + if (empty($uid) || empty($upw)) { + cookie($pref['cookie_name'], "", (time() - 2592000)); + $_SESSION[$pref['cookie_name']] = ""; + session_destroy(); + define("ADMIN", FALSE); + define("USER", FALSE); + define("USERCLASS", ""); + define("LOGINMESSAGE",CORE_LAN10."

"); + return (FALSE); + } + + $result = get_user_data($uid); + if(is_array($result) && md5($result['user_password']) == $upw) + { + + define("USERID", $result['user_id']); + define("USERNAME", $result['user_name']); + define("USERURL", (isset($result['user_homepage']) ? $result['user_homepage'] : false)); + define("USEREMAIL", $result['user_email']); + define("USER", TRUE); + define("USERCLASS", $result['user_class']); + define("USERREALM", $result['user_realm']); + define("USERVIEWED", $result['user_viewed']); + define("USERIMAGE", $result['user_image']); + define("USERSESS", $result['user_sess']); + + $update_ip = ($result['user_ip'] != USERIP ? ", user_ip = '".USERIP."'" : ""); + + if($result['user_currentvisit'] + 3600 < time() || !$result['user_lastvisit']) + { + $result['user_lastvisit'] = $result['user_currentvisit']; + $result['user_currentvisit'] = time(); + $sql->db_Update("user", "user_visits = user_visits + 1, user_lastvisit = '{$result['user_lastvisit']}', user_currentvisit = '{$result['user_currentvisit']}', user_viewed = ''{$update_ip} WHERE user_id='".USERID."' "); + } + else + { + $result['user_currentvisit'] = time(); + $sql->db_Update("user", "user_currentvisit = '{$result['user_currentvisit']}'{$update_ip} WHERE user_id='".USERID."' "); + } + + $currentUser = $result; + $currentUser['user_realname'] = $result['user_login']; // Used by force_userupdate + define("USERLV", $result['user_lastvisit']); + + if ($result['user_ban'] == 1) { exit; } + + $user_pref = unserialize($result['user_prefs']); + + if (isset($_POST['settheme'])) { + $user_pref['sitetheme'] = ($pref['sitetheme'] == $_POST['sitetheme'] ? "" : $_POST['sitetheme']); + save_prefs("user"); + } + + define("USERTHEME", (isset($user_pref['sitetheme']) && file_exists(e_THEME.$user_pref['sitetheme']."/theme.php") ? $user_pref['sitetheme'] : FALSE)); + global $ADMIN_DIRECTORY, $PLUGINS_DIRECTORY; + if ($result['user_admin']) { + define("ADMIN", TRUE); + define("ADMINID", $result['user_id']); + define("ADMINNAME", $result['user_name']); + define("ADMINPERMS", $result['user_perms']); + define("ADMINEMAIL", $result['user_email']); + define("ADMINPWCHANGE", $result['user_pwchange']); + } else { + define("ADMIN", FALSE); + } + } else { + define("USER", FALSE); + define("USERTHEME", FALSE); + define("ADMIN", FALSE); + define("CORRUPT_COOKIE", TRUE); + define("USERCLASS", ""); + } + } + + define('USERCLASS_LIST', class_list()); + define('e_CLASS_REGEXP', "(^|,)(".str_replace(",", "|", USERCLASS_LIST).")(,|$)"); +} + +$sql->db_Mark_Time('Start: Go online'); +if(isset($pref['track_online']) && $pref['track_online']) { + $e_online->online($pref['track_online'], $pref['flood_protect']); +} + +function cookie($name, $value, $expire, $path = "/", $domain = "", $secure = 0) { + setcookie($name, $value, $expire, $path, $domain, $secure); +} + +// +// Use these to combine isset() and use of the set value. or defined and use of a constant +// i.e. to fix if($pref['foo']) ==> if ( varset($pref['foo']) ) will use the pref, or ''. +// Can set 2nd param to any other default value you like (e.g. false, 0, or whatever) +// $testvalue adds additional test of the value (not just isset()) +// Examples: +// $something = pref; // Bug if pref not set ==> $something = varset(pref); +// $something = isset(pref) ? pref : ""; ==> $something = varset(pref); +// $something = isset(pref) ? pref : default; ==> $something = varset(pref,default); +// $something = isset(pref) && pref ? pref : default; ==> $something = varset(pref,default, true); +// +function varset(&$val,$default='',$testvalue=false) { + if (isset($val)) { + return (!$testvalue || $val) ? $val : $default; + } + return $default; +} +function defset($str,$default='',$testvalue=false) { + if (defined($str)) { + return (!$testvalue || constant($str)) ? constant($str) : $default; + } + return $default; +} + +// +// These variants are like the above, but only return the value if both set AND 'true' +// +function varsettrue(&$val,$default='') { + if (isset($val) && $val) return $val; + return $default; +} +function defsettrue($str,$default='') { + if (defined($str) && constant($str)) return constant($str); + return $default; +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +function message_handler($mode, $message, $line = 0, $file = "") { + e107_require_once(e_HANDLER."message_handler.php"); + show_emessage($mode, $message, $line, $file); +} + +// ----------------------------------------------------------------------------- +function table_exists($check) { + if (!$GLOBALS['mySQLtablelist']) { + $tablist=mysql_list_tables($GLOBALS['mySQLdefaultdb']); + while (list($temp) = mysql_fetch_array($tablist)) { + $GLOBALS['mySQLtablelist'][] = $temp; + } + } + + $mltable=MPREFIX.strtolower($check); + + foreach ($GLOBALS['mySQLtablelist'] as $lang) { + if (strpos($lang, $mltable) !== FALSE) { + return TRUE; + } + } +} + +function class_list($uid = '') { + $clist=array(); + + if ($uid == '') + { + if (USER === TRUE) + { + if(USERCLASS) + { + $clist=explode(',', USERCLASS); + } + $clist[]=e_UC_MEMBER; + if (ADMIN === TRUE) { + $clist[] = e_UC_ADMIN; + } + } else { + $clist[] = e_UC_GUEST; + } + $clist[]=e_UC_READONLY; + $clist[]=e_UC_PUBLIC; + return implode(',', $clist); + } +} + +// --------------------------------------------------------------------------- +function e107_include($fname) { + global $e107_debug; + $ret = ($e107_debug ? include($fname) : @include($fname)); + return $ret; +} + +function e107_include_once($fname) { + global $e107_debug; + if(is_readable($fname)){ + $ret = (!$e107_debug)? @include_once($fname) : include_once($fname); + } + return (isset($ret)) ? $ret : ""; +} + +function e107_require_once($fname) { + global $e107_debug; + $ret = ($e107_debug ? require_once($fname) : @require_once($fname)); + return $ret; +} + +function e107_require($fname) { + global $e107_debug; + $ret = ($e107_debug ? require($fname) : @require($fname)); + return $ret; +} + +function include_lan($path, $force = false) { + if (!is_readable($path)) { + $path = str_replace(e_LANGUAGE, 'English', $path); + } + $ret = ($force) ? include($path) : include_once($path); + return (isset($ret)) ? $ret : ""; +} + +if(!function_exists("print_a")) { + function print_a($var, $return = false) { + if(!$return){ + echo '
'.print_r($var, true).'
'; + return true; + } else { + return '
'.print_r($var, true).'
'; + } + } +} + +function force_userupdate() { + + global $sql,$pref,$currentUser; + + if (e_PAGE == "usersettings.php" || strpos(e_SELF, ADMINDIR) == TRUE) + { + return FALSE; + } + + $signup_option_names = array("realname", "signature", "image", "timezone", "class"); + + foreach($signup_option_names as $key => $value) + { + if ($pref['signup_option_'.$value] == 2 && !$currentUser['user_'.$value]) + { + return TRUE; + } + } + + if($sql -> db_Select("user_extended_struct", "user_extended_struct_name", "user_extended_struct_required = '1'")) + { + while($row = $sql -> db_Fetch()) + { + $user_extended_struct_name = "user_{$row['user_extended_struct_name']}"; + + if(!$currentUser[$user_extended_struct_name]) + { + return TRUE; + } + } + } + + return FALSE; +} + +class error_handler { + + var $errors; + var $debug = false; + + function error_handler() { + if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== FALSE) || isset($_COOKIE['e107_debug_level'])) { + $this->debug = true; + error_reporting(E_ALL); + } else { + error_reporting(E_ERROR | E_PARSE); + } + } + + function handle_error($type, $message, $file, $line, $context) { + switch($type) { + case E_NOTICE: + if ($this->debug == true) { + $error['short'] = "Notice: {$message}, Line {$line} of {$file}
\n"; + $trace = debug_backtrace(); + $backtrace[0] = (isset($trace[1]) ? $trace[1] : ""); + $backtrace[1] = (isset($trace[2]) ? $trace[2] : ""); + $error['trace'] = $backtrace; + $this->errors[] = $error; + } + break; + case E_WARNING: + if ($this->debug == true) { + $error['short'] = "Warning: {$message}, Line {$line} of {$file}
\n"; + $trace = debug_backtrace(); + $backtrace[0] = (isset($trace[1]) ? $trace[1] : ""); + $backtrace[1] = (isset($trace[2]) ? $trace[2] : ""); + $error['trace'] = $backtrace; + $this->errors[] = $error; + } + break; + case E_USER_ERROR: + if ($this->debug == true) { + $error['short'] = "    Internal Error Message: {$message}, Line {$line} of {$file}
\n"; + $trace = debug_backtrace(); + $backtrace[0] = (isset($trace[1]) ? $trace[1] : ""); + $backtrace[1] = (isset($trace[2]) ? $trace[2] : ""); + $error['trace'] = $backtrace; + $this->errors[] = $error; + } + default: + return true; + break; + } + } + + function return_errors() { + $index = 0; $colours[0] = "#C1C1C1"; $colours[1] = "#B6B6B6"; + $ret = "\n"; + foreach ($this->errors as $key => $value) { + $ret .= "\t\n\t\t\n\t\n"; + $ret .= "\t\n\n"; + if($index == 0) { $index = 1; } else { $index = 0; } + } + $ret .= "
{$value['short']}
"; + return $ret; + } + + function trigger_error($information, $level) { + trigger_error($information); + } +} + +/** + * Strips slashes from a var if magic_quotes_gqc is enabled + * + * @param mixed $data + * @return mixed + */ +function strip_if_magic($data) { + if (MAGIC_QUOTES_GPC == true) { + return array_stripslashes($data); + } else { + return $data; + } +} + +/** + * Strips slashes from a string or an array + * + * @param mixed $value + * @return mixed + */ +function array_stripslashes($data) { + return is_array($data) ? array_map('array_stripslashes', $data) : stripslashes($data); +} + +$sql->db_Mark_Time('(After class2)'); + + +function e107_ini_set($var, $value){ + if (function_exists('ini_set')){ + ini_set($var, $value); + } +} + +?> diff --git a/comment.php b/comment.php new file mode 100644 index 000000000..052bd1cb7 --- /dev/null +++ b/comment.php @@ -0,0 +1,326 @@ +db_Select("polls", "poll_title", "`poll_id` = {$id} AND `poll_comment` = 1")) { + header("location: ".e_BASE."index.php"); + exit; + } + } else if($table == "news") { + if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = {$id} AND `news_allow_comments` = 0")) { + header("location: ".e_BASE."index.php"); + exit; + } + } + + $pid = (isset($_POST['pid']) ? $_POST['pid'] : 0); + $pid = intval($pid); + + $editpid = intval((isset($_POST['editpid']) ? $_POST['editpid'] : false)); + + $clean_authorname = $_POST['author_name']; + $clean_comment = $_POST['comment']; + $clean_subject = $_POST['subject']; + + $cobj->enter_comment($clean_authorname, $clean_comment, $table, $id, $pid, $clean_subject); + if ($table == "news") { + $e107cache->clear("news"); + } else { + $e107cache->clear("comment.php?{$table}.{$id}"); + } + + if($editpid) { + $redir = preg_replace("#\.edit.*#si", "", e_QUERY); + header("Location: ".e_SELF."?{$redir}"); + exit; + } +} + +if (isset($_POST['replysubmit'])) +{ + + if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' ")) { + header("location:".e_BASE."index.php"); + exit; + } else { + $row = $sql->db_Fetch(); + if (!$row['news_id']) { + $pid = (isset($_POST['pid']) ? $_POST['pid'] : 0); + $pid = intval($pid); + + $clean_authorname = $_POST['author_name']; + $clean_comment = $_POST['comment']; + $clean_subject = $_POST['subject']; + + $cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject); + $e107cache->clear("comment.php?{$table}.{$id}"); + } + //plugin e_comment.php files + $plugin_redir = false; + $e_comment = $cobj->get_e_comment(); + if ($table == $e_comment[$table]['eplug_comment_ids']){ + $plugin_redir = TRUE; + $reply_location = str_replace("{NID}", $nid, $e_comment[$table]['reply_location']); + } + + if ($plugin_redir) + { + echo "\n"; + exit; + } elseif ($table == "news" || $table == "poll") + { + echo "\n"; + exit; + } elseif($table == "bugtrack") + { + echo "\n"; + exit; + } elseif($table == "faq") + { + echo "\n"; + exit; + } elseif ($table == "content") + { + echo "\n"; + exit; + } elseif ($table == "download") + { + echo "\n"; + exit; + } elseif ($table == "page") + { + echo "\n"; + exit; + } + } +} + +if ($action == "reply") { + if (!$pref['nested_comments']) { + header("Location: ".e_BASE."comment.php?comment.{$table}.{$nid}"); + exit; + } + $query = "`comment_id` = '{$id}' LIMIT 0,1"; + if ($sql->db_Select("comments", "comment_subject", "`comment_id` = '{$id}'")) { + list($comments['comment_subject']) = $sql->db_Fetch(); + $not_parsed_subject = $comments['comment_subject']; + $subject = $tp->toHTML($comments['comment_subject']); + + } + if ($subject == "") { + if ($table == "news") { + if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) { + header("location: ".e_BASE."index.php"); + exit; + } else { + list($news['news_title']) = $sql->db_Fetch(); + $subject = $news['news_title']; + $title = COMLAN_100; + } + } elseif ($table == "poll") { + if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) { + header("location:".e_BASE."index.php"); + exit; + } else { + list($poll['poll_title']) = $sql->db_Fetch(); + $subject = $poll['poll_title']; + $title = COMLAN_101; + } + } elseif ($table == "content") { + $sql->db_Select("content", "content_heading", "content_id='{$nid}'"); + $subject = $content['content_heading']; + } elseif ($table == "bugtracker") { + $sql->db_Select("bugtrack", "bugtrack_summary", "bugtrack_id='{$nid}'"); + $subject = $content['content_heading']; + } + } + if ($table == "content") { + $sql->db_Select("content", "content_type", "content_id='{$nid}'"); + list($content['content_type']) = $sql->db_Fetch(); + if ($content['content_type'] == "0") { + $content_type = "article"; + $title = COMLAN_103; + } elseif ($content['content_type'] == "3") { + $content_type = "review"; + $title = COMLAN_104; + } elseif ($content['content_type'] == "1") { + $content_type = "content"; + $title = COMLAN_105; + } + } + + define('e_PAGETITLE', $title." / ".COMLAN_99." / ".COMLAN_102.$subject.""); + require_once(HEADERF); +} else { + + + if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}")) { + require_once(HEADERF); + echo $cache; + require_once(FOOTERF); + exit; + } else { + if ($table == "news") { + /* + changes by jalist 19/01/05: + updated db query removed one call + */ + + if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) { + $query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + LEFT JOIN #trackback AS tb ON tb.trackback_pid = n.news_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' + AND n.news_id={$id} + AND n.news_allow_comments=0 + GROUP by n.news_id"; + } else { + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' + AND n.news_id={$id} + AND n.news_allow_comments=0"; + } + + if (!$sql->db_Select_gen($query)) { + header("location:".e_BASE."index.php"); + exit; + } else { + $news = $sql->db_Fetch(); + $subject = $tp->toForm($news['news_title']); + define("e_PAGETITLE", COMLAN_100." / ".COMLAN_99." / {$subject}"); + require_once(HEADERF); + ob_start(); + $ix = new news; + $ix->render_newsitem($news, "extend"); // extend so that news-title-only news text is displayed in full when viewing comments. + $field = $news['news_id']; + $comtype = 0; + } + } + else if($table == "poll") { + if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) { + header("location:".e_BASE."index.php"); + exit; + } else { + $row = $sql->db_Fetch(); + $comments_poll = $row['poll_comment']; + $subject = $row['poll_title']; + define("e_PAGETITLE", COMLAN_101." / ".COMLAN_99." / ".$subject.""); + require_once(HEADERF); + require(e_PLUGIN."poll/poll_menu.php"); + $field = $row['poll_id']; + $comtype = 4; + + if(!$comments_poll) + { + require_once(FOOTERF); + exit; + } + } + } + require_once(HEADERF); + } +} + +if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){ + echo "".$pref['trackbackString']." ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}"; +} +$field = ($field ? $field : ($id ? $id : "")); +$width = (isset($width) && $width ? $width : ""); +$cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE); + +if (!strstr(e_QUERY, "poll")) { + $cache = ob_get_contents(); + $e107cache->set("comment.php?{$table}.{$field}", $cache); +} +ob_end_flush(); // dump the buffer we started + + +if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){ + if($sql->db_Select("trackback", "*", "trackback_pid={$id}")) + { + $tbArray = $sql -> db_getList(); + + if (file_exists(THEME."trackback_template.php")) { + require_once(THEME."trackback_template.php"); + } else { + require_once(e_THEME."templates/trackback_template.php"); + } + + $text = ""; + + foreach($tbArray as $trackback) + { + extract($trackback); + $TITLE = $trackback_title; + $EXCERPT = $trackback_excerpt; + $BLOGNAME = "{$trackback_blogname}"; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TRACKBACK); + } + + if($TRACKBACK_RENDER_METHOD) + { + $ns->tablerender("".COMLAN_315, $text); + } + else + { + echo "".$text; + } + } + else + { + echo "".COMLAN_316; + } + if (ADMIN && getperms("B")) { + echo "
".COMLAN_317."

"; + } +} + + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/contact.php b/contact.php new file mode 100644 index 000000000..a9e499723 --- /dev/null +++ b/contact.php @@ -0,0 +1,160 @@ +toEmail($_POST['author_name'],TRUE); + $sender = check_email($_POST['email_send']); + $subject = $tp->toEmail($_POST['subject'],TRUE); + $body = $tp->toEmail($_POST['body'],TRUE); + +// Check Image-Code + if (isset($_POST['rand_num']) && !$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) + { + $error .= LANCONTACT_15."\\n"; + } + +// Check message body. + if(strlen(trim($_POST['body'])) < 15) + { + $error .= LANCONTACT_12."\\n"; + } + +// Check subject line. + if(strlen(trim($_POST['subject'])) < 2) + { + $error .= LANCONTACT_13."\\n"; + } + + if(!strpos(trim($_POST['email_send']),"@")) + { + $error .= LANCONTACT_11."\\n"; + } + + +// Check email address on remote server (if enabled). + if ($pref['signup_remote_emailcheck'] && $error == "") + { + require_once(e_HANDLER."mail_validation_class.php"); + list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL); + $validator = new email_validation_class; + $validator->localuser= $adminuser; + $validator->localhost= $adminhost; + $validator->timeout=3; + // $validator->debug=1; + // $validator->html_debug=1; + if($validator->ValidateEmailBox($sender) != 1) + { + $error .= LANCONTACT_11."\\n"; + } + + } + +// No errors - so proceed to email the admin and the user (if selected). + if(!$error) + { + $body .= "\n\nIP:\t".USERIP."\n"; + $body .= "User:\t#".USERID." ".USERNAME."\n"; + + if(!$_POST['contact_person'] && isset($pref['sitecontacts'])) // only 1 person, so contact_person not posted. + { + if($pref['sitecontacts'] == e_UC_MAINADMIN) + { + $query = "user_perms = '0' OR user_perms = '0.' "; + } + elseif($pref['sitecontacts'] == e_UC_ADMIN) + { + $query = "user_admin = 1 "; + } + else + { + $query = $pref['sitecontacts'] . " IN (user_class) "; + } + } + else + { + $query = "user_id = ".$_POST['contact_person']; + } + + if($sql -> db_Select("user", "user_name,user_email",$query." LIMIT 1")) + { + $row = $sql -> db_Fetch(); + $send_to = $row['user_email']; + $send_to_name = $row['user_name']; + } + else + { + $send_to = SITEADMINEMAIL; + $send_to_name = ADMIN; + } + + require_once(e_HANDLER."mail.php"); + $message = (sendemail($send_to,"[".SITENAME."] ".$subject, $body,$send_to_name,$sender,$sender_name)) ? LANCONTACT_09 : LANCONTACT_10; + if(isset($pref['contact_emailcopy']) && $pref['contact_emailcopy'] && $_POST['email_copy'] == 1){ + sendemail($sender,"[".SITENAME."] ".$subject, $body,ADMIN,$sender,$sender_name); + } + $ns -> tablerender('', $message); + require_once(FOOTERF); + exit; + } + else + { + require_once(e_HANDLER."message_handler.php"); + message_handler("P_ALERT", $error); + } + +} + +if(SITECONTACTINFO && $CONTACT_INFO) +{ + $text = $tp->toHTML($CONTACT_INFO,"","parse_sc"); + $ns -> tablerender(LANCONTACT_01, $text,"contact"); +} + +if(isset($pref['sitecontacts']) && $pref['sitecontacts'] != 255) +{ + require_once(e_FILE."shortcode/batch/contact_shortcodes.php"); + $text = $tp->parseTemplate($CONTACT_FORM, TRUE, $contact_shortcodes); + + if(trim($text) != "") + { + $ns -> tablerender(LANCONTACT_02, $text, "contact"); + } +} +require_once(FOOTERF); +exit; +?> diff --git a/content.php b/content.php new file mode 100644 index 000000000..cd47082f4 --- /dev/null +++ b/content.php @@ -0,0 +1,73 @@ + db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){ + //require_once($plugindir."handlers/content_class.php"); + //$aa = new content; + + $tmp = explode(".", e_QUERY); + if($tmp[0]){ + //get type_id from the row with heading content, article or review + //this will only work if the three main parents are not renamed ! + if(!$sql -> db_Select("pcontent", "content_id", "content_heading='".$tp -> toDB($tmp[0])."'")){ + header("location:".e_PLUGIN."content/content.php"); + }else{ + $row = $sql -> db_Fetch(); + } + } + if ($tmp[0] == "content") { + if (is_numeric($tmp[1])) { //content view + + $tmp[1] = intval($tmp[1]); + header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]); + + }else{ //content recent page + header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']); + } + + }elseif ($tmp[0] == "article" || $tmp[0] == "review") { + + if (is_numeric($tmp[1])) { //item view + $tmp[1] = intval($tmp[1]); + header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]); + + }elseif($tmp[1] == "cat" ) { //category page + + if(!$tmp[2] || $tmp[2] == "0") { //all categories + //$mainparent = $aa -> getMainParent($tmp[2]); + //header("location:".e_PLUGIN."content/content.php?cat.list.".$mainparent.""); + header("location:".e_PLUGIN."content/content.php"); + + }else{ //view category + header("location:".e_PLUGIN."content/content.php?cat.".$tmp[2]); + } + + } else { //recent page + header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']); + } + }else{ //redirect to new content main page + header("location:".e_PLUGIN."content/content.php"); + } +} +//##### END REDIRECTION MANAGEMENT ------------------------------------------------------------------------- + +?> \ No newline at end of file diff --git a/download.php b/download.php new file mode 100644 index 000000000..42feb3eb7 --- /dev/null +++ b/download.php @@ -0,0 +1,739 @@ +toHTML($pref['agree_text'],TRUE,"parse_sc"); +$cobj = new comment; +global $tp; + +if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:100%"); } + +// To prevent display of sub-categories on the main display, un-comment the following line +//$pref['download_subsub'] = '0'; + + +/* define images */ +define("IMAGE_DOWNLOAD", (file_exists(THEME."images/download.png") ? THEME."images/download.png" : e_IMAGE."generic/".IMODE."/download.png")); +define("IMAGE_NEW", (file_exists(THEME."images/new.png") ? THEME."images/new.png" : e_IMAGE."generic/".IMODE."/new.png")); + +/* define image style */ + +if (!e_QUERY || $_GET['elan']) +{ + require_once(HEADERF); + // no qs - render categories ... + + if($cacheData = $e107cache->retrieve("download_cat",720)) // expires every 12 hours. + { + echo $cacheData; + require_once(FOOTERF); + exit; + } + + + if (!$DOWNLOAD_CAT_PARENT_TABLE) + { + if (is_readable(THEME."templates/download_template.php")) + { + require_once(THEME."templates/download_template.php"); + } + elseif (is_readable(THEME."download_template.php")) + { + require_once(THEME."download_template.php"); + } + else + { + require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php"); + } + } + if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");} + + $qry = " + SELECT dc.*, SUM(d.download_filesize) AS d_size, + COUNT(d.download_id) AS d_count, + MAX(d.download_datestamp) as d_last, + SUM(d.download_requested) as d_requests, + COUNT(d2.download_id) AS d_subcount, + SUM(d2.download_filesize) AS d_subsize, + SUM(d2.download_requested) as d_subrequests + FROM #download_category AS dc + LEFT JOIN #download AS d ON dc.download_category_id = d.download_category AND d.download_active > 0 AND d.download_visible IN (".USERCLASS_LIST.") + LEFT JOIN #download_category as dc2 ON dc2.download_category_parent=dc.download_category_id + LEFT JOIN #download AS d2 ON dc2.download_category_id = d2.download_category AND d2.download_active > 0 AND d2.download_visible IN (".USERCLASS_LIST.") + WHERE dc.download_category_class IN (".USERCLASS_LIST.") + GROUP by dc.download_category_id ORDER by dc.download_category_order + "; + if (!$sql->db_Select_gen($qry)) + { + $ns->tablerender(LAN_dl_18, "
".LAN_dl_2."
"); + require_once(FOOTERF); + exit; + } + else + { + while($row = $sql->db_Fetch()) + { + $catList[$row['download_category_parent']][] = $row; + } + foreach($catList[0] as $row) + { // Display main category headings, then sub-categories, optionally with sub-sub categories expanded + $download_cat_table_string .= parse_download_cat_parent_table($row); + foreach($catList[$row['download_category_id']] as $crow) + { + if (isset($pref['download_subsub']) && ($pref['download_subsub'] == '0')) + { // Don't display sub-sub categories here + $download_cat_table_string .= parse_download_cat_child_table($crow, FALSE); + } + else + { // Display sub-sub categories + $download_cat_table_string .= parse_download_cat_child_table($crow, $catList[$crow['download_category_id']]); + } + } + } + } + + $download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START); + + $DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = " ".LAN_dl_36; + $DOWNLOAD_CAT_SEARCH = " +
+

+ + + +

+
"; + + $download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END); + $text .= $download_cat_table_start.$download_cat_table_string.$download_cat_table_end; + + + ob_start(); + + if($DOWNLOAD_CAT_TABLE_RENDERPLAIN) { + echo $text; + } else { + $ns->tablerender(LAN_dl_18.$type, $text); + } + + $cache_data = ob_get_flush(); + $e107cache->set("download_cat", $cache_data); + + require_once(FOOTERF); + exit; +} + + +// Got a query string from now on +$tmp = explode(".", e_QUERY); +if (is_numeric($tmp[0])) +{ + $from = intval($tmp[0]); + $action = preg_replace("#\W#", "", $tp -> toDB($tmp[1])); + $id = intval($tmp[2]); + $view = intval($tmp[3]); + $order = preg_replace("#\W#", "", $tp -> toDB($tmp[4])); + $sort = preg_replace("#\W#", "", $tp -> toDB($tmp[5])); +} + else +{ + $action = preg_replace("#\W#", "", $tp -> toDB($tmp[0])); + $id = intval($tmp[1]); +} + +if (isset($_POST['commentsubmit'])) +{ + if (!$sql->db_Select("download", "download_comment", "download_id = '{$id}' ")) + { + header("location:".e_BASE."index.php"); + exit; + } + else + { + $row = $sql->db_Fetch(); + if ($row['download_comment'] && (ANON === TRUE || USER === TRUE)) + { + $clean_authorname = $_POST['author_name']; + $clean_comment = $_POST['comment']; + $clean_subject = $_POST['subject']; + + $cobj->enter_comment($clean_authorname, $clean_comment, "download", $id, $pid, $clean_subject); + $e107cache->clear("comment.download.{$sub_action}"); + } + } +} + +// ------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +if ($action == "list") { + + if (isset($_POST['view'])) { + extract($_POST); + } + + if (!$from) { + $from = 0; + } + if (!$order) { + $order = ($pref['download_order'] ? $pref['download_order'] : "download_datestamp"); + } + if (!$sort) { + $sort = ($pref['download_sort'] ? $pref['download_sort'] : "DESC"); + } + if (!$view) { + $view = ($pref['download_view'] ? $pref['download_view'] : "10"); + } + + $total_downloads = $sql->db_Count("download", "(*)", "WHERE download_category = '{$id}' AND download_active > 0 AND download_visible REGEXP '".e_CLASS_REGEXP."'"); + +// Next three lines extract page title + if ($sql->db_Select("download_category", "*", "(download_category_id='{$id}') AND (download_category_class IN (".USERCLASS_LIST."))") ) + { + $row = $sql->db_Fetch(); + extract($row); + + $type = $download_category_name; + + $type .= ($download_category_description) ? " [ ".$download_category_description." ]" : ""; + define("e_PAGETITLE", PAGE_NAME." / ".$download_category_name); + } + else + { // No access to this category + define("e_PAGETITLE", PAGE_NAME); + require_once(HEADERF); + $ns->tablerender(LAN_dl_18, "
".LAN_dl_3."
"); + require_once(FOOTERF); + exit; + } + + require_once(HEADERF); + + /* SHOW SUBCATS ... */ + + if($sql -> db_Select("download_category", "download_category_id", "download_category_parent='{$id}' ")) + { + /* there are subcats - display them ... */ + $qry = " + SELECT dc.*, dc2.download_category_name AS parent_name, dc2.download_category_icon as parent_icon, SUM(d.download_filesize) AS d_size, + COUNT(d.download_id) AS d_count, + MAX(d.download_datestamp) as d_last, + SUM(d.download_requested) as d_requests + FROM #download_category AS dc + LEFT JOIN #download AS d ON dc.download_category_id = d.download_category AND d.download_active > 0 AND d.download_visible IN (".USERCLASS_LIST.") + LEFT JOIN #download_category as dc2 ON dc2.download_category_id='{$id}' + WHERE dc.download_category_class IN (".USERCLASS_LIST.") AND dc.download_category_parent='{$id}' + GROUP by dc.download_category_id ORDER by dc.download_category_order + "; + $sql->db_Select_gen($qry); + $scArray = $sql -> db_getList(); + if (!$DOWNLOAD_CAT_PARENT_TABLE) + { + if (file_exists(THEME."download_template.php")) + { + require_once(THEME."download_template.php"); + } + else + { + require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php"); + } + } + if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");} + foreach($scArray as $row) + { + $download_cat_table_string .= parse_download_cat_child_table($row, FALSE); + } + if(strstr($row['parent_icon'], chr(1))) { + list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $row['parent_icon']); + } + $DOWNLOAD_CAT_MAIN_ICON = ($download_category_icon ? "" : " "); + $DOWNLOAD_CAT_MAIN_NAME = $tp->toHTML($row['parent_name']); + $download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START); + $DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = " ".LAN_dl_36; + $download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END); + $text = $download_cat_table_start.$download_cat_table_string.$download_cat_table_end; + if($DOWNLOAD_CAT_TABLE_RENDERPLAIN) + { + echo $text; + } + else + { + $ns->tablerender($type, $text); + } + $text = ""; // If other files, show in a separate block + $type = ""; // Cancel title once displayed + } // End of subcategory display + +// Now display individual downloads + $core_total = $sql->db_Count("download WHERE download_category='{$id}' AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.")"); + if (!check_class($download_category_class)) + { + + $ns->tablerender(LAN_dl_18, "
".LAN_dl_3."
"); + require_once(FOOTERF); + exit; + } + + if(strstr($download_category_icon, chr(1))) + { + list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon); + } + $DOWNLOAD_CATEGORY_ICON = ($download_category_icon ? "" : " "); + + $DOWNLOAD_CATEGORY = $tp->toHTML($download_category_name,FALSE,"emotes_off, no_make_clickable"); + $DOWNLOAD_CATEGORY_DESCRIPTION = $tp -> toHTML($download_category_description, TRUE); + + if (!$DOWNLOAD_LIST_TABLE) { + if (file_exists(THEME."download_template.php")) { + require_once(THEME."download_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php"); + } + } + if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");} + + $gen = new convert; + require_once(e_HANDLER."rate_class.php"); + $rater = new rater; + $sql = new db; + $sql2 = new db; + + $filetotal = $sql->db_Select("download", "*", "download_category='{$id}' AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.") ORDER BY {$order} {$sort} LIMIT {$from}, {$view}"); + $ft = ($filetotal < $view ? $filetotal : $view); + while ($row = $sql->db_Fetch()) { + extract($row); + $download_list_table_string .= parse_download_list_table($row); + $tdownloads += $download_requested; + } + + $DOWNLOAD_LIST_TOTAL_AMOUNT = $tdownloads." ".LAN_dl_16; + $DOWNLOAD_LIST_TOTAL_FILES = $ft." ".LAN_dl_17; + + $download_list_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_START); + $download_list_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_END); + $text .= $download_list_table_start.$download_list_table_string.$download_list_table_end; + + + if($DOWNLOAD_LIST_TABLE_RENDERPLAIN) { + echo $text; + } else { + $ns->tablerender($type, $text); + } + + + echo "
".LAN_dl_9."

"; + $parms = $total_downloads.",".$view.",".$from.",".e_SELF."?[FROM].list.{$id}.{$view}.{$order}.{$sort}."; + echo ($total_downloads > $view) ? "
 ".$tp->parseTemplate("{NEXTPREV={$parms}}")."
" : ""; + echo "
"; + + require_once(FOOTERF); + exit; +} // end of action=="list" + + +// ---------------- View Mode --------------------------------------------------------------------------------------------------------------------------------------------------- + +if ($action == "view") { + + $gen = new convert; + + $highlight_search = FALSE; + if (isset($_POST['highlight_search'])) { + $highlight_search = TRUE; + } + + $query = " + SELECT d.*, dc.* FROM #download AS d + LEFT JOIN #download_category AS dc ON d.download_category = dc.download_category_id + WHERE d.download_id = {$id} AND d.download_active > 0 + AND d.download_visible IN (".USERCLASS_LIST.") + AND dc.download_category_class IN (".USERCLASS_LIST.") + LIMIT 1"; + + if(!$sql -> db_Select_gen($query)){ + require_once(HEADERF); + $ns->tablerender(LAN_dl_18, "
".LAN_dl_3."
"); + require_once(FOOTERF); + exit; + } + + $dl = $sql -> db_Fetch(); + + if (!isset($DOWNLOAD_VIEW_TABLE) && is_readable(THEME."download_template.php")) + { + include_once(THEME."download_template.php"); + } + else + { + include_once(e_THEME."templates/download_template.php"); + } + + if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:0px");} + if(!isset($DL_VIEW_PAGETITLE)) + { + $DL_VIEW_PAGETITLE = PAGE_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}"; + } + + $DL_TITLE = $tp->parseTemplate($DL_VIEW_PAGETITLE, TRUE, $download_shortcodes); + + define("e_PAGETITLE", $DL_TITLE); + + require_once(HEADERF); + $DL_TEMPLATE = $DOWNLOAD_VIEW_TABLE_START.$DOWNLOAD_VIEW_TABLE.$DOWNLOAD_VIEW_TABLE_END; + $text = $tp->parseTemplate($DL_TEMPLATE, TRUE, $download_shortcodes); + + if(!isset($DL_VIEW_CAPTION)) + { + $DL_VIEW_CAPTION = "{DOWNLOAD_VIEW_CAPTION}"; + } + + if(!isset($DL_VIEW_NEXTPREV)) + { + $DL_VIEW_NEXTPREV = " +
+ + + + + + +
{DOWNLOAD_VIEW_PREV}{DOWNLOAD_BACK_TO_LIST}{DOWNLOAD_VIEW_NEXT}
+
+ "; + } + // ------- Next/Prev ----------- + $text .= $tp->parseTemplate($DL_VIEW_NEXTPREV,TRUE,$download_shortcodes); + $caption = $tp->parseTemplate($DL_VIEW_CAPTION,TRUE,$download_shortcodes); + + if($DOWNLOAD_VIEW_TABLE_RENDERPLAIN) { + echo $text; + } else { + + $ns->tablerender($caption, $text); + } + + unset($text); + + if ($dl['download_comment']) { + $cobj->compose_comment("download", "comment", $id, $width,$dl['download_name'], $showrate=FALSE); + } + + require_once(FOOTERF); + exit; + +} + +// ---------------- Report Broken Link Mode --------------------------------------------------------------------------------------------------------------------------------------------------- + +if ($action == "report" && check_class($pref['download_reportbroken'])) { + if (!$sql->db_Select("download", "*", "download_id = {$id} AND download_active > 0")) { + require_once(HEADERF); + require_once(FOOTERF); + exit; + } + + $row = $sql -> db_Fetch(); + extract($row); + + if (isset($_POST['report_download'])) { + $report_add = $tp -> toDB($_POST['report_add']); + $download_name = $tp -> toDB($download_name); + $user = USER ? USERNAME : LAN_dl_52; + + if ($pref['download_email']) { // this needs to be moved into the NOTIFY, with an event. + require_once(e_HANDLER."mail.php"); + $subject = LAN_dl_60." ".SITENAME; + $report = LAN_dl_58." ".SITENAME.":\n".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/")."download.php?view.".$download_id."\n + ".LAN_dl_59." ".$user."\n".$report_add; + sendemail(SITEADMINEMAIL, $subject, $report); + } + + $sql->db_Insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$id}, '{$report_add}'"); + + define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_47); + require_once(HEADERF); + + $text = LAN_dl_48."

".LAN_dl_49."tablerender(LAN_dl_50, $text); + + } else { + define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_51." ".$download_name); + require_once(HEADERF); + + $text = "
+ + + + + + + + + + + + +
+ ".LAN_dl_32.": ".$download_name."
+ + ".LAN_dl_53." + +
+
".LAN_dl_54."
".LAN_dl_55." +
+ +

+ +
"; + $ns->tablerender(LAN_dl_50, $text); + } + require_once(FOOTERF); + exit; +} + +// ---------------- Mirror Mode --------------------------------------------------------------------------------------------------------------------------------------------------- + + +if($action == "mirror") +{ + require_once(HEADERF); + + if (!$DOWNLOAD_MIRROR_START) { + if (file_exists(THEME."download_template.php")) { + require_once(THEME."download_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php"); + } + } + + $sql -> db_Select("download_mirror"); + $mirrorList = $sql -> db_getList("ALL", 0, 200, "mirror_id"); + + if($sql -> db_Select("download", "*", "download_id = {$id}")) + { + $row = $sql->db_Fetch(); + + extract($row); + $array = explode(chr(1), $download_mirror); + + $c = (count($array)-1); + for ($i=1; $i<$c; $i++) { + $d = mt_rand(0, $i); + $tmp = $array[$i]; + $array[$i] = $array[$d]; + $array[$d] = $tmp; + } + + $download_mirror = ""; + foreach($array as $mirrorstring) + { + if($mirrorstring) + { + $download_mirror .= parse_download_mirror_table($row, $mirrorstring, $mirrorList); + } + } + + $DOWNLOAD_MIRROR_HOST_LAN = LAN_dl_68; + $DOWNLOAD_MIRROR_GET_LAN = LAN_dl_32; + $DOWNLOAD_MIRROR_LOCATION_LAN = LAN_dl_70; + $DOWNLOAD_MIRROR_DESCRIPTION_LAN = LAN_dl_71; + $DOWNLOAD_MIRROR_REQUEST = LAN_dl_72."'".$download_name."'"; + + $download_mirror_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR_START); + $download_mirror_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR_END); + + $text = $download_mirror_start.$download_mirror.$download_mirror_end; + + if($DOWNLOAD_MIRROR_RENDERPLAIN) { + echo $text; + } else { + $ns->tablerender(LAN_dl_67, $text); + } + + require_once(FOOTERF); + } +} + +function parse_download_mirror_table($row, $mirrorstring, $mirrorList) +{ + + global $DOWNLOAD_MIRROR; + list($mirrorHost_id, $mirrorHost_url, $mirrorRequests) = explode(",", $mirrorstring); + + extract($mirrorList[$mirrorHost_id]); + + $DOWNLOAD_MIRROR_NAME = "
{$mirror_name}"; + $DOWNLOAD_MIRROR_IMAGE = ($mirror_image ? "" : ""); + $DOWNLOAD_MIRROR_LOCATION = ($mirror_location ? $mirror_location : ""); + $DOWNLOAD_MIRROR_DESCRIPTION = ($mirror_description ? $mirror_description : ""); + + $DOWNLOAD_MIRROR_FILESIZE = parsesize($row['download_filesize']); + $DOWNLOAD_MIRROR_LINK = ""; + + $DOWNLOAD_MIRROR_REQUESTS = (ADMIN ? LAN_dl_73.$mirrorRequests : ""); + $DOWNLOAD_TOTAL_MIRROR_REQUESTS = (ADMIN ? LAN_dl_74.$mirror_count : ""); + + return(preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR)); +} + +function parsesize($size) { + $kb = 1024; + $mb = 1024 * $kb; + $gb = 1024 * $mb; + $tb = 1024 * $gb; + if(!$size) + { + return '0'; + } + if ($size < $kb) { + return $size." b"; + } + else if($size < $mb) { + return round($size/$kb, 2)." kb"; + } + else if($size < $gb) { + return round($size/$mb, 2)." mb"; + } + else if($size < $tb) { + return round($size/$gb, 2)." gb"; + } else { + return round($size/$tb, 2)." tb"; + } +} + +function parse_download_cat_parent_table($row) { + global $tp,$current_row,$DOWNLOAD_CAT_PARENT_TABLE; + extract($row); + $current_row = ($current_row) ? 0 : 1; // Alternating CSS for each row.(backwards compatible) + + + $template = ($current_row == 1) ? $DOWNLOAD_CAT_PARENT_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_CAT_PARENT_TABLE); + + if (check_class($download_category_class)) { + $parent_status == "open"; + if(strstr($download_category_icon, chr(1))) + { + list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon); + } + $DOWNLOAD_CAT_MAIN_ICON .= ($download_category_icon ? "" : " "); + $DOWNLOAD_CAT_MAIN_NAME .= $tp->toHTML($download_category_name,FALSE,"emotes_off, no_make_clickable"); + } else { + $parent_status == "closed"; + } + return(preg_replace("/\{(.*?)\}/e", '$\1', $template)); +} + +function parse_download_cat_child_table($row, $subList) +{ + + global $tp,$current_row, $DOWNLOAD_CAT_CHILD_TABLE, $DOWNLOAD_CAT_SUBSUB_TABLE; + + $current_row = ($current_row) ? 0 : 1; // Alternating CSS for each row.(backwards compatible) + $template = ($current_row == 1) ? $DOWNLOAD_CAT_CHILD_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_CAT_CHILD_TABLE); + + + if(USER && $row['d_last'] > USERLV){ + $new = ""; + }else{ + $new = ""; + } + + list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $row['download_category_icon']); + if (!$download_category_icon_empty) + { + $download_category_icon_empty = $download_category_icon; + } + + if(!$row['d_count'] && !$row['d_subcount']) + { + $download_icon = ""; + } + else + { + $download_icon = ""; + } + + $DOWNLOAD_CAT_SUB_ICON = ($row['download_category_icon'] ? $download_icon : " "); + $DOWNLOAD_CAT_SUB_NEW_ICON = $new; + $dcatname=$tp->toHTML($row['download_category_name'],FALSE,"emotes_off, no_make_clickable"); + $DOWNLOAD_CAT_SUB_NAME = ($row['d_count'] ? "".$dcatname."" : $dcatname); + $DOWNLOAD_CAT_SUB_NAME_LINKED = "".$$dcatname.""; + $DOWNLOAD_CAT_SUB_DESCRIPTION = $tp->toHTML($row['download_category_description']); + $DOWNLOAD_CAT_SUB_COUNT = ($row['d_subcount'] ? $row['d_subcount'] : $row['d_count']); + $DOWNLOAD_CAT_SUB_SIZE = parsesize(($row['d_subsize'] ? $row['d_subsize'] : $row['d_size'])); + $DOWNLOAD_CAT_SUB_DOWNLOADED = intval(($row['d_subrequests'] ? $row['d_subrequests'] : $row['d_requests'])); + $DOWNLOAD_CAT_SUBSUB = ""; + // check for subsub cats ... + if($subList != FALSE) + { + foreach($subList as $subrow) + { + list($sub_download_category_icon, $sub_download_category_icon_empty) = explode(chr(1), $subrow['download_category_icon']); + if (!$sub_download_category_icon_empty) + { + $sub_download_category_icon_empty = $sub_download_category_icon; + } + + if(!$row['d_count'] && !$row['d_subcount']) + { + $sub_download_icon = ""; + } + else + { + $sub_download_icon = ""; + } + + $DOWNLOAD_CAT_SUBSUB_ICON = ($subrow['download_category_icon'] ? "$sub_download_icon" : " "); + $DOWNLOAD_CAT_SUBSUB_DESCRIPTION = $tp->toHTML($subrow['download_category_description']); + $DOWNLOAD_CAT_SUBSUB_COUNT = intval($subrow['d_count']); + $DOWNLOAD_CAT_SUBSUB_SIZE = parsesize($subrow['d_size']); + $DOWNLOAD_CAT_SUBSUB_DOWNLOADED = intval($subrow['d_requests']); + + if(USER && $subrow['d_last'] > USERLV) { + $subsub_new = ""; + }else { + $subsub_new = ""; + } + $DOWNLOAD_CAT_SUBSUB_NEW_ICON = $subsub_new; + $DOWNLOAD_CAT_SUBSUB_NAME = ($subrow['d_count'] ? "".$tp->toHTML($subrow['download_category_name'])."" : $tp->toHTML($subrow['download_category_name'],FALSE,"emotes_off, no_make_clickable")); + $DOWNLOAD_CAT_SUBSUB .= preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_SUBSUB_TABLE); + } + } + + return(preg_replace("/\{(.*?)\}/e", '$\1', $template)); +} + + +function parse_download_list_table($row) { + global $download_shortcodes,$tp,$current_row,$DOWNLOAD_LIST_TABLE, $rater, $pref, $gen, $agreetext; + + $current_row = ($current_row) ? 0 : 1; // Alternating CSS for each row.(backwards compatible) + $template = ($current_row == 1) ? $DOWNLOAD_LIST_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_LIST_TABLE); + + return $tp->parseTemplate($template,TRUE,$download_shortcodes); + +} + +?> diff --git a/e107.htaccess b/e107.htaccess new file mode 100644 index 000000000..a08f4d689 --- /dev/null +++ b/e107.htaccess @@ -0,0 +1,5 @@ +ErrorDocument 400 /error.php?400 +ErrorDocument 401 /error.php?401 +ErrorDocument 403 /error.php?403 +ErrorDocument 404 /error.php?404 +ErrorDocument 500 /error.php?500 \ No newline at end of file diff --git a/e107_admin/ad_links.php b/e107_admin/ad_links.php new file mode 100644 index 000000000..41abf641e --- /dev/null +++ b/e107_admin/ad_links.php @@ -0,0 +1,465 @@ +"); +} +if (!defined('E_32_CAT_USER')) { + define('E_32_CAT_USER', ""); +} +if (!defined('E_32_CAT_CONT')) { + define('E_32_CAT_CONT', ""); +} +if (!defined('E_32_CAT_FILE')) { + define('E_32_CAT_FILE', ""); +} +if (!defined('E_32_CAT_TOOL')) { + define('E_32_CAT_TOOL', ""); +} +if (!defined('E_32_CAT_PLUG')) { + define('E_32_CAT_PLUG', ""); +} + +// Small Nav Images +if (!defined('E_16_NAV_MAIN')) { + define('E_16_NAV_MAIN', e_IMAGE.'admin_images/main_16.png'); +} +if (!defined('E_16_NAV_DOCS')) { + define('E_16_NAV_DOCS', e_IMAGE.'admin_images/docs_16.png'); +} +if (!defined('E_16_NAV_LEAV')) { + define('E_16_NAV_LEAV', e_IMAGE.'admin_images/leave_16.png'); +} +if (!defined('E_16_NAV_LGOT')) { + define('E_16_NAV_LGOT', e_IMAGE.'admin_images/logout_16.png'); +} +if (!defined('E_16_NAV_ARROW')) { + define('E_16_NAV_ARROW', e_IMAGE.'admin_images/arrow_16.png'); +} +if (!defined('E_16_NAV_ARROW_OVER')) { + define('E_16_NAV_ARROW_OVER', e_IMAGE.'admin_images/arrow_over_16.png'); +} + +// Large Nav Images +if (!defined('E_32_NAV_MAIN')) { + define('E_32_NAV_MAIN', ""); +} +if (!defined('E_32_NAV_DOCS')) { + define('E_32_NAV_DOCS', ""); +} +if (!defined('E_32_NAV_LEAV')) { + define('E_32_NAV_LEAV', ""); +} +if (!defined('E_32_NAV_LGOT')) { + define('E_32_NAV_LGOT', ""); +} +if (!defined('E_32_NAV_ARROW')) { + define('E_32_NAV_ARROW', ""); +} +if (!defined('E_32_NAV_ARROW_OVER')) { + define('E_32_NAV_ARROW_OVER', ""); +} + +// Small Admin Main Link Images +if (!defined('E_16_ADMIN')) { + define('E_16_ADMIN', ""); +} +if (!defined('E_16_ADPASS')) { + define('E_16_ADPASS', ""); +} +if (!defined('E_16_BANLIST')) { + define('E_16_BANLIST', ""); +} +if (!defined('E_16_BANNER')) { + define('E_16_BANNER', ""); +} +if (!defined('E_16_CACHE')) { + define('E_16_CACHE', ""); +} +if (!defined('E_16_CREDITS')) { + define('E_16_CREDITS', ""); +} +if (!defined('E_16_CUST')) { + define('E_16_CUST', ""); +} +if (!defined('E_16_DATAB')) { + define('E_16_DATAB', ""); +} +if (!defined('E_16_DOWNL')) { + define('E_16_DOWNL', ""); +} +if (!defined('E_16_EMOTE')) { + define('E_16_EMOTE', ""); +} +if (!defined('E_16_FILE')) { + define('E_16_FILE', ""); +} +if (!defined('E_16_FORUM')) { + define('E_16_FORUM', ""); +} +if (!defined('E_16_FRONT')) { + define('E_16_FRONT', ""); +} +if (!defined('E_16_IMAGES')) { + define('E_16_IMAGES', ""); +} +if (!defined('E_16_INSPECT')) { + define('E_16_INSPECT', ""); +} +if (!defined('E_16_LINKS')) { + define('E_16_LINKS', ""); +} +if (!defined('E_16_WELCOME')) { + define('E_16_WELCOME', ""); +} +if (!defined('E_16_MAIL')) { + define('E_16_MAIL', ""); +} +if (!defined('E_16_MAINTAIN')) { + define('E_16_MAINTAIN', ""); +} +if (!defined('E_16_MENUS')) { + define('E_16_MENUS', ""); +} +if (!defined('E_16_META')) { + define('E_16_META', ""); +} +if (!defined('E_16_NEWS')) { + define('E_16_NEWS', ""); +} +if (!defined('E_16_NEWSFEED')) { + define('E_16_NEWSFEED', ""); +} +if (!defined('E_16_NOTIFY')) { + define('E_16_NOTIFY', ""); +} +if (!defined('E_16_PHP')) { + define('E_16_PHP', ""); +} +if (!defined('E_16_POLLS')) { + define('E_16_POLLS', ""); +} +if (!defined('E_16_PREFS')) { + define('E_16_PREFS', ""); +} +if (!defined('E_16_SEARCH')) { + define('E_16_SEARCH', ""); +} +if (!defined('E_16_UPLOADS')) { + define('E_16_UPLOADS', ""); +} +if (!defined('E_16_USER')) { + define('E_16_USER', ""); +} +if (!defined('E_16_USER_EXTENDED')) { + define('E_16_USER_EXTENDED', ""); +} +if (!defined('E_16_USERCLASS')) { + define('E_16_USERCLASS', ""); +} +if (!defined('E_16_LANGUAGE')) { + define('E_16_LANGUAGE', ""); +} + +// Small Admin Other Link Images +if (!defined('E_16_PLUGIN')) { + define('E_16_PLUGIN', ""); +} +if (!defined('E_16_PLUGMANAGER')) { + define('E_16_PLUGMANAGER', ""); +} +if (!defined('E_16_DOCS')) { + define('E_16_DOCS', ""); +} +if (!defined('E_16_THEMEMANAGER')) { + define('E_16_THEMEMANAGER', ""); +} + +// Small Admin Other Images +if (!defined('E_16_COMMENT')) { + define('E_16_COMMENT', ""); +} +if (!defined('E_16_ADMINLOG')) { + define('E_16_ADMINLOG', ""); +} + +// Large Admin Main Link Images +if (!defined('E_32_ADMIN')) { + define('E_32_ADMIN', ""); +} +if (!defined('E_32_ADPASS')) { + define('E_32_ADPASS', ""); +} +if (!defined('E_32_BANLIST')) { + define('E_32_BANLIST', ""); +} +if (!defined('E_32_BANNER')) { + define('E_32_BANNER', ""); +} +if (!defined('E_32_CACHE')) { + define('E_32_CACHE', ""); +} +if (!defined('E_32_CREDITS')) { + define('E_32_CREDITS', ""); +} +if (!defined('E_32_CUST')) { + define('E_32_CUST', ""); +} +if (!defined('E_32_DATAB')) { + define('E_32_DATAB', ""); +} +if (!defined('E_32_DOWNL')) { + define('E_32_DOWNL', ""); +} +if (!defined('E_32_EMOTE')) { + define('E_32_EMOTE', ""); +} +if (!defined('E_32_FILE')) { + define('E_32_FILE', ""); +} +if (!defined('E_32_FORUM')) { + define('E_32_FORUM', ""); +} +if (!defined('E_32_FRONT')) { + define('E_32_FRONT', ""); +} +if (!defined('E_32_IMAGES')) { + define('E_32_IMAGES', ""); +} +if (!defined('E_32_INSPECT')) { + define('E_32_INSPECT', ""); +} +if (!defined('E_32_LINKS')) { + define('E_32_LINKS', ""); +} +if (!defined('E_32_WELCOME')) { + define('E_32_WELCOME', ""); +} +if (!defined('E_32_MAIL')) { + define('E_32_MAIL', ""); +} +if (!defined('E_32_MAINTAIN')) { + define('E_32_MAINTAIN', ""); +} +if (!defined('E_32_MENUS')) { + define('E_32_MENUS', ""); +} +if (!defined('E_32_META')) { + define('E_32_META', ""); +} +if (!defined('E_32_NEWS')) { + define('E_32_NEWS', ""); +} +if (!defined('E_32_NEWSFEED')) { + define('E_32_NEWSFEED', ""); +} +if (!defined('E_32_NOTIFY')) { + define('E_32_NOTIFY', ""); +} +if (!defined('E_32_PHP')) { + define('E_32_PHP', ""); +} +if (!defined('E_32_POLLS')) { + define('E_32_POLLS', ""); +} +if (!defined('E_32_PREFS')) { + define('E_32_PREFS', ""); +} +if (!defined('E_32_SEARCH')) { + define('E_32_SEARCH', ""); +} +if (!defined('E_32_UPLOADS')) { + define('E_32_UPLOADS', ""); +} +if (!defined('E_32_USER')) { + define('E_32_USER', ""); +} +if (!defined('E_32_USER_EXTENDED')) { + define('E_32_USER_EXTENDED', ""); +} +if (!defined('E_32_USERCLASS')) { + define('E_32_USERCLASS', ""); +} +if (!defined('E_32_LANGUAGE')) { + define('E_32_LANGUAGE', ""); +} + +// Large Admin Other Link Images +if (!defined('E_32_PLUGIN')) { + define('E_32_PLUGIN', ""); +} +if (!defined('E_32_PLUGMANAGER')) { + define('E_32_PLUGMANAGER', ""); +} +if (!defined('E_32_DOCS')) { + define('E_32_DOCS', ""); +} +if (!defined('E_32_MAIN')) { + define('E_32_MAIN', ""); +} + +if (!defined('E_32_THEMEMANAGER')) { + define('E_32_THEMEMANAGER', ""); +} + +// Large Admin Other Images +if (!defined('E_32_COMMENT')) { + define('E_32_COMMENT', ""); +} +if (!defined('E_32_ADMINLOG')) { + define('E_32_ADMINLOG', ""); +} +if (!defined('E_32_LOGOUT')) { + define('E_32_LOGOUT', ""); +} + +$e_icon_array = array( + 'main' => E_32_MAIN, + 'admin' => E_32_ADMIN, + 'admin_pass' => E_32_ADPASS, + 'banlist' => E_32_BANLIST, + 'banner' => E_32_BANNER, + 'cache' => E_32_CACHE, + 'credits' => E_32_CREDITS, + 'custom' => E_32_CUST, + 'database' => E_32_DATAB, + 'docs' => E_32_DOCS, + 'download' => E_32_DOWNL, + 'emoticon' => E_32_EMOTE, + 'filemanage' => E_32_FILE, + 'fileinspector' => E_32_INSPECT, + 'frontpage' => E_32_FRONT, + 'image' => E_32_IMAGES, + 'language' => E_32_LANGUAGE, + 'links' => E_32_LINKS, + 'mail' => E_32_MAIL, + 'menus' => E_32_MENUS, + 'meta' => E_32_META, + 'newsfeed' => E_32_NEWSFEED, + 'news' => E_32_NEWS, + 'notify' => E_32_NOTIFY, + 'phpinfo' => E_32_PHP, + 'plug_manage' => E_32_PLUGMANAGER, + 'poll' => E_32_POLLS, + 'prefs' => E_32_PREFS, + 'search' => E_32_SEARCH, + 'theme_manage' => E_32_THEMEMANAGER, + 'maintain' => E_32_MAINTAIN, + 'upload' => E_32_UPLOADS, + 'userclass' => E_32_USERCLASS, + 'user_extended' => E_32_USER_EXTENDED, + 'users' => E_32_USER, + 'wmessage' => E_32_WELCOME ); + +$admin_cat['title'][1] = ADLAN_CL_1; +$admin_cat['id'][1] = 'setMenu'; +$admin_cat['img'][1] = E_16_CAT_SETT; +$admin_cat['lrg_img'][1] = E_32_CAT_SETT; + +$admin_cat['title'][2] = ADLAN_CL_2; +$admin_cat['id'][2] = 'userMenu'; +$admin_cat['img'][2] = E_16_CAT_USER; +$admin_cat['lrg_img'][2] = E_32_CAT_USER; + +$admin_cat['title'][3] = ADLAN_CL_3; +$admin_cat['id'][3] = 'contMenu'; +$admin_cat['img'][3] = E_16_CAT_CONT; +$admin_cat['lrg_img'][3] = E_32_CAT_CONT; + +$admin_cat['title'][4] = ADLAN_CL_6; +$admin_cat['id'][4] = 'toolMenu'; +$admin_cat['img'][4] = E_16_CAT_TOOL; +$admin_cat['lrg_img'][4] = E_32_CAT_TOOL; + +$admin_cat['title'][5] = ADLAN_CL_7; +$admin_cat['id'][5] = 'plugMenu'; +$admin_cat['img'][5] = E_16_CAT_PLUG; +$admin_cat['lrg_img'][5] = E_32_CAT_PLUG; + +// Info about attributes +/* +attribute 1 = link +attribute 2 = title +attribute 3 = description +attribute 4 = perms +attribute 5 = category +attribute 6 = 16 x 16 image +attribute 7 = 32 x 32 image +*/ + +$array_functions = array( + 0 => array(e_ADMIN."administrator.php", ADLAN_8, ADLAN_9, "3", 2, E_16_ADMIN, E_32_ADMIN), + 1 => array(e_ADMIN."updateadmin.php", ADLAN_10, ADLAN_11, "", 2, E_16_ADPASS, E_32_ADPASS), + 2 => array(e_ADMIN."banlist.php", ADLAN_34, ADLAN_35, "4", 2, E_16_BANLIST, E_32_BANLIST), + 3 => array(e_ADMIN."banner.php", ADLAN_54, ADLAN_55, "D", 3, E_16_BANNER, E_32_BANNER), + 4 => array(e_ADMIN."cache.php", ADLAN_74, ADLAN_75, "C", 1, E_16_CACHE, E_32_CACHE), + 5 => array(e_ADMIN."cpage.php", ADLAN_42, ADLAN_43, "5", 3, E_16_CUST, E_32_CUST), + 6 => array(e_ADMIN."db.php", ADLAN_44, ADLAN_45, "0", 4, E_16_DATAB, E_32_DATAB), + 7 => array(e_ADMIN."download.php", ADLAN_24, ADLAN_25, "R", 3, E_16_DOWNL, E_32_DOWNL), + 8 => array(e_ADMIN."emoticon.php", ADLAN_58, ADLAN_59, "F", 1, E_16_EMOTE, E_32_EMOTE), + 9 => array(e_ADMIN."filemanager.php", ADLAN_30, ADLAN_31, "6", 4, E_16_FILE, E_32_FILE), + 10 => array(e_ADMIN."frontpage.php", ADLAN_60, ADLAN_61, "G", 1, E_16_FRONT, E_32_FRONT), + 11 => array(e_ADMIN."image.php", ADLAN_105, ADLAN_106, "A", 1, E_16_IMAGES, E_32_IMAGES), + 12 => array(e_ADMIN."links.php", ADLAN_138, ADLAN_139, "I", 1, E_16_LINKS, E_32_LINKS), + 13 => array(e_ADMIN."wmessage.php", ADLAN_28, ADLAN_29, "M", 3, E_16_WELCOME, E_32_WELCOME), + 14 => array(e_ADMIN."ugflag.php", ADLAN_40, ADLAN_41, "9", 4, E_16_MAINTAIN, E_32_MAINTAIN), + 15 => array(e_ADMIN."menus.php", ADLAN_6, ADLAN_7, "2", 3, E_16_MENUS, E_32_MENUS), + 16 => array(e_ADMIN."meta.php", ADLAN_66, ADLAN_67, "T", 1, E_16_META, E_32_META), + 17 => array(e_ADMIN."newspost.php", ADLAN_0, ADLAN_1, "H", 3, E_16_NEWS, E_32_NEWS), + 18 => array(e_ADMIN."phpinfo.php", ADLAN_68, ADLAN_69, "0", 4, E_16_PHP, E_32_PHP), + 19 => array(e_ADMIN."prefs.php", ADLAN_4, ADLAN_5, "1", 1, E_16_PREFS, E_32_PREFS), + 20 => array(e_ADMIN."search.php", ADLAN_142, ADLAN_143, "X", 1, E_16_SEARCH, E_32_SEARCH), + 21 => array(e_ADMIN."theme.php", ADLAN_140, ADLAN_141, "1", 4, E_16_THEMEMANAGER, E_32_THEMEMANAGER), + 22 => array(e_ADMIN."upload.php", ADLAN_72, ADLAN_73, "V", 3, E_16_UPLOADS, E_32_UPLOADS), + 23 => array(e_ADMIN."users.php", ADLAN_36, ADLAN_37, "4", 2, E_16_USER, E_32_USER), + 24 => array(e_ADMIN."userclass2.php", ADLAN_38, ADLAN_39, "4", 2, E_16_USERCLASS, E_32_USERCLASS), + 25 => array(e_ADMIN."language.php", ADLAN_132, ADLAN_133, "0", 1, E_16_LANGUAGE, E_32_LANGUAGE), + 26 => array(e_ADMIN."mailout.php", ADLAN_136, ADLAN_137, "W", 2, E_16_MAIL, E_32_MAIL), + 27 => array(e_ADMIN."users_extended.php", ADLAN_78, ADLAN_79, "4", 2, E_16_USER_EXTENDED, E_32_USER_EXTENDED), + 28 => array(e_ADMIN."fileinspector.php", ADLAN_147, ADLAN_148, "Y", 4, E_16_INSPECT, E_32_INSPECT), + 29 => array(e_ADMIN."notify.php", ADLAN_149, ADLAN_150, "O", 4, E_16_NOTIFY, E_32_NOTIFY) + ); +?> diff --git a/e107_admin/admin.php b/e107_admin/admin.php new file mode 100644 index 000000000..eb443c266 --- /dev/null +++ b/e107_admin/admin.php @@ -0,0 +1,269 @@ +
+
".$HANDLERS_DIRECTORY."htmlarea/
".$ADMIN_DIRECTORY."htmlarea/
"; + $ns -> tablerender(ADLAN_ERR_1, $text); +} + +// check for old modules. +if(getperms('0') && isset($pref['modules']) && $pref['modules'] && $sql->db_Field("plugin",5) == "plugin_addons"){ + + $mods=explode(",", $pref['modules']); + $thef = "e_module.php"; + foreach ($mods as $mod) + { + if (is_readable(e_PLUGIN."{$mod}/module.php")) + { + $mod_found[] = e_PLUGIN."{$mod}/module.php"; + } + } + + if($mod_found) + { + $text = ADLAN_ERR_5." ".$thef.":

    "; + foreach($mod_found as $val){ + $text .= "
  • ".str_replace("../","",$val)."
  • \n"; + } + $text .="

+ + ".ADLAN_ERR_6." + +
"; + $ns -> tablerender(ADLAN_ERR_4,$text); + } +} + +// check for file-types; +if (is_readable(e_ADMIN.'filetypes.php')) { + $a_types = strtolower(trim(file_get_contents(e_ADMIN.'filetypes.php'))); +} else { + $a_types = 'zip, gz, jpg, png, gif'; +} + +$a_types = explode(',', $a_types); +foreach ($a_types as $f_type) { + $allowed_types[] = '.'.trim(str_replace('.', '', $f_type)); +} + +// avatar check. +$public = array(e_FILE.'public', e_FILE.'public/avatars'); +foreach ($public as $dir) { + if (is_dir($dir)) { + if ($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) { + if (is_dir($dir."/".$file) == FALSE && $file != '.' && $file != '..' && $file != '/' && $file != 'CVS' && $file != 'avatars' && $file != 'Thumbs.db' && $file !=".htaccess" && $file !="php.ini") { + $fext = substr(strrchr($file, "."), 0); + if (!in_array(strtolower($fext), $allowed_types) ) { + if ($file == 'index.html' || $file == "null.txt") { + if (filesize($dir.'/'.$file)) { + $potential[] = str_replace('../', '', $dir).'/'.$file; + } + } else { + $potential[] = str_replace('../', '', $dir).'/'.$file; + } + } + } + } + closedir($dh); + } + } +} + +if (isset($potential)) { + $text = ADLAN_ERR_3."

"; + + foreach ($potential as $p_file) { + $text .= $p_file.'
'; + } + + $ns -> tablerender(ADLAN_ERR_1, $text); +} + +// update users using old layout names to their new names +$update_prefs = FALSE; +if (!$pref['adminstyle'] || $pref['adminstyle'] == 'default') { + $pref['adminstyle'] = 'compact'; + $update_prefs = true; +} +if ($pref['adminstyle'] == 'adminb') { + $pref['adminstyle'] = 'cascade'; + $update_prefs = true; +} +if ($pref['adminstyle'] == 'admin_etalkers') { + $pref['adminstyle'] = 'categories'; + $update_prefs = true; +} +if ($pref['adminstyle'] == 'admin_combo') { + $pref['adminstyle'] = 'combo'; + $update_prefs = true; +} +if ($pref['adminstyle'] == 'admin_classis') { + $pref['adminstyle'] = 'classis'; + $update_prefs = true; +} + +// temporary code to switch users using admin_jayya to jayya + +if ($pref['admintheme'] == 'admin_jayya') { + $pref['admintheme'] = 'jayya'; + $update_prefs = true; +} + +if ($pref['sitetheme'] == 'admin_jayya') { + $pref['sitetheme'] = 'jayya'; + $update_prefs = true; +} + +// --------------------------------------------------------- + + +if ($update_prefs == true) { + save_prefs(); +} + +// auto db update +if ('0' == ADMINPERMS) { + require_once(e_ADMIN.'update_routines.php'); + update_check(); +} +// end auto db update + +if (e_QUERY == 'purge' && getperms('0')) { + $admin_log->purge_log_events(false); +} + +$td = 1; +if(!defined("ADLINK_COLS")){ + define("ADLINK_COLS",5); +} +function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE) { + global $td,$tp; + $text = ''; + if (getperms($perms)) { + if ($mode == 'adminb') { + $text = " +
+ ".$icon." ".$title." ".($description ? "[ ".$description." ]" : "")."
"; + } else { + if ($td == (ADLINK_COLS+1)) { + $text .= ''; + $td = 1; + } + if ($td == 1) { + $text .= ''; + } + if ($mode == 'default') { + $text .= "".$icon." ".$tp->toHTML($title,FALSE,"defs emotes_off").""; + } + else if ($mode == 'classis') { + $text .= "".$icon."
+ ".$tp->toHTML($title,FALSE,"defs emotes_off")."

"; + }elseif ($mode == 'beginner'){ + $text .= "".$icon." +
+ ".$tp->toHTML($title,FALSE,"defs emotes_off")."



"; + } + $td++; + } + } + return $text; +} + +function render_clean() { + global $td; + while ($td <= ADLINK_COLS) { + $text .= ""; + $td++; + } + $text .= ""; + $td = 1; + return $text; +} + +$newarray = asortbyindex($array_functions, 1); + +require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php'); + +function admin_info() { + global $tp; + + $width = (getperms('0')) ? "33%" : "50%"; + + $ADMIN_INFO_TEMPLATE = " +
+ + + + "; + + if(getperms('0')) + { + $ADMIN_INFO_TEMPLATE .= " + "; + } + + $ADMIN_INFO_TEMPLATE .= " +
+ {ADMIN_STATUS} + + {ADMIN_LATEST} + {ADMIN_LOG}
"; + + return $tp->parseTemplate($ADMIN_INFO_TEMPLATE); +} + +function status_request() { + global $pref; + if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') { + return TRUE; + } else { + return FALSE; + } +} + +function latest_request() { + global $pref; + if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') { + return TRUE; + } else { + return FALSE; + } +} + +function log_request() { + global $pref; + if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade'|| $pref['adminstyle'] == 'beginner') { + return TRUE; + } else { + return FALSE; + } +} + +require_once("footer.php"); + +?> diff --git a/e107_admin/admin_classis.php b/e107_admin/admin_classis.php new file mode 100644 index 000000000..88d452c31 --- /dev/null +++ b/e107_admin/admin_classis.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/admin_combo.php b/e107_admin/admin_combo.php new file mode 100644 index 000000000..8fc0da148 --- /dev/null +++ b/e107_admin/admin_combo.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/admin_etalkers.php b/e107_admin/admin_etalkers.php new file mode 100644 index 000000000..cebcc1886 --- /dev/null +++ b/e107_admin/admin_etalkers.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php new file mode 100644 index 000000000..9e827a2ea --- /dev/null +++ b/e107_admin/admin_log.php @@ -0,0 +1,114 @@ +db_Delete('dblog'); +} + +$total = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC", "no_where"); +$query = "SELECT l.*, u.user_name FROM #dblog AS l LEFT JOIN #user AS u ON l.dblog_user_id = u.user_id ORDER BY l.dblog_datestamp DESC LIMIT $from,$amount"; +$sql -> db_Select_gen($query); + +if(!is_object($gen)) { + $gen = new convert; +} + $parms = $total.",".$amount.",".$from.",".e_SELF.'?fm=[FROM]'; + $text .= "

".$tp->parseTemplate("{NEXTPREV={$parms}}")."

"; +$text .= "
\n"; + +$text .= " + + + + + + + + \n"; + +while ($row = $sql -> db_Fetch()) { + $datestamp = $gen->convert_date($row['dblog_datestamp'], 'short'); + $image = get_log_img($row['dblog_type']); + $text .= " \n"; + $text .= " \n"; + $text .= " \n"; + $text .= " \n"; + $text .= " \n"; + $text .= " \n"; + $text .= ($row['user_name']) ? " \n" : " \n"; + $text .= " \n"; +} + +$text .= "
 ".LAN_ADMINLOG_1."".LAN_ADMINLOG_2."".LAN_ADMINLOG_3."".LAN_ADMINLOG_4."".LAN_ADMINLOG_5."
{$image}{$datestamp}".$tp->toHtml($row['dblog_title'],FALSE,"defs")."".$tp->toHtml($row['dblog_remarks'],FALSE,"defs")."{$row['dblog_ip']}{$row['user_name']}{$row['dblog_user_id']}
\n"; + + $text .= "

".$tp->parseTemplate("{NEXTPREV={$parms}}")."
"; + +$ns->tablerender(LAN_ADMINLOG_0, $text); +require_once("footer.php"); + +function get_log_img($log_type) { + switch ($log_type) { + case E_LOG_INFORMATIVE: + return "".LAN_ADMINLOG_6.""; + break; + case E_LOG_NOTICE: + return "".LAN_ADMINLOG_8.""; + break; + case E_LOG_WARNING: + return "".LAN_ADMINLOG_10.""; + break; + case E_LOG_FATAL: + return "".LAN_ADMINLOG_12.""; + break; + case E_LOG_PLUGIN; + return "".LAN_ADMINLOG_6.""; + break; + } + return $log_type; +} + +function headerjs() { +?> + + diff --git a/e107_admin/adminb.php b/e107_admin/adminb.php new file mode 100644 index 000000000..df223b1ec --- /dev/null +++ b/e107_admin/adminb.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/administrator.php b/e107_admin/administrator.php new file mode 100644 index 000000000..9168d4e5f --- /dev/null +++ b/e107_admin/administrator.php @@ -0,0 +1,377 @@ +db_Select("user", "*", "user_id='".$_POST['a_id']."' "); + $row = $sql->db_Fetch(); + $a_name = $row['user_name']; + + $perm = ""; + + foreach($_POST['perms'] as $value) + { + if ($value == "0") + { + if (!getperms('0')) { $value = ""; break; } + + $perm = "0."; break; + } + + if ($value) + { + $perm .= $value."."; + } + } + + admin_update($sql -> db_Update("user", "user_perms='$perm' WHERE user_name='$a_name' "), 'update', ADMSLAN_56." ".$_POST['ad_name']." ".ADMSLAN_2."
"); + unset($ad_name, $a_perms); +} + +if ($_POST['edit_admin'] || $action == "edit") +{ + $edid = array_keys($_POST['edit_admin']); + $theid = ($edid[0]) ? $edid[0] : $sub_action; + $sql->db_Select("user", "*", "user_id=".$theid); + $row = $sql->db_Fetch(); + + if ($a_perms == "0") + { + $text = "
$ad_name ".ADMSLAN_3." +

+ ".ADMSLAN_4."
"; + $ns->tablerender(LAN_ERROR, $text); + require_once("footer.php"); + exit; + } +} + +if (isset($_POST['del_admin'])) +{ + $delid = array_keys($_POST['del_admin']); + $sql->db_Select("user", "*", "user_id= ".$delid[0]); + $row = $sql->db_Fetch(); + + if ($row['user_id'] == 1) + { + $text = "
".$row['user_name']." ".ADMSLAN_6." +

+ ".ADMSLAN_4.""; + $ns->tablerender(ADMSLAN_5, $text); + require_once("footer.php"); + exit; + } + + admin_update($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$delid[0]), 'update', ADMSLAN_61, LAN_DELETED_FAILED); +} + +if($_POST['edit_admin'] || $action == "edit"){ + edit_administrator($row); +}else{ + show_admins(); +} + +function show_admins(){ + global $sql,$tp,$ns,$pref; + + $sql->db_Select("user", "*", "user_admin='1'"); + + $text = "
+
+
+ + + + + + + + "; + + while ($row = $sql->db_Fetch()) + { + + $text .= " + + + + + + + "; + } + + $text .= "
ID".ADMSLAN_56."".ADMSLAN_18."".LAN_OPTIONS."
".$row['user_id']."".$row['user_name'].""; + + $permtxt = ""; + $text .= renderperms($row['user_perms'],$row['user_id'],"words"); + $text .= ""; + if($row['user_id'] != "1") + { + $text .= " + + toJS(ADMSLAN_59."? [".$row['user_name']."]")."') \" title='".ADMSLAN_59."' style='border:0px' />"; + } + $text .= " 
\n
\n
"; + + $ns->tablerender(ADMSLAN_13, $text); + +} + + + + +function edit_administrator($row){ + global $sql,$tp,$ns,$pref; + $lanlist = explode(",",e_LANLIST); + + $a_id = $row['user_id']; + $ad_name = $row['user_name']; + $a_perms = $row['user_perms']; + + $text = "
+
+ + + + + "; + + $text .=" + + + + "; + + $text .= " + + +
".ADMSLAN_16.": + "; + + $text .= $ad_name; + $text .= ""; + + $text .= " +
".ADMSLAN_18.":
"; + + $text .= checkb("1", $a_perms).ADMSLAN_19."
"; // Alter site preferences + $text .= checkb("2", $a_perms).ADMSLAN_20."
"; // Alter Menus + $text .= checkb("3", $a_perms).ADMSLAN_21."
"; // Modify administrator permissions + $text .= checkb("4", $a_perms).ADMSLAN_22."
"; // Moderate users/bans etc + $text .= checkb("5", $a_perms).ADMSLAN_23."
"; // create/edit custom pages/menus + $text .= checkb("Q", $a_perms).ADMSLAN_24."
"; // Manage download categories + $text .= checkb("6", $a_perms).ADMSLAN_25."
"; // Upload /manage files + $text .= checkb("Y", $a_perms).ADMSLAN_67."
"; // file inspector + $text .= checkb("O", $a_perms).ADMSLAN_68."
"; // notify + $text .= checkb("7", $a_perms).ADMSLAN_26."
"; // Oversee news categories + $text .= checkb("8", $a_perms).ADMSLAN_27."
"; // Oversee link categories + $text .= checkb("C", $a_perms).ADMSLAN_64."
"; // Clear Cache - Previously moderate chatbox + $text .= checkb("9", $a_perms).ADMSLAN_28."
"; // Take site down for maintenance + $text .= checkb("W", $a_perms).ADMSLAN_65."

"; // Configure mail settings and mailout + + $text .= checkb("D", $a_perms).ADMSLAN_29."
"; // Manage banners + $text .= checkb("E", $a_perms).ADMSLAN_30."
"; // Configure news feed headlines + $text .= checkb("F", $a_perms).ADMSLAN_31."
"; // Configure emoticons + $text .= checkb("G", $a_perms).ADMSLAN_32."
"; // Configure front page content + $text .= checkb("S", $a_perms).ADMSLAN_33."
"; // Configure log/stats + $text .= checkb("T", $a_perms).ADMSLAN_34."
"; // Configure meta tags + $text .= checkb("V", $a_perms).ADMSLAN_35."
"; // Configure public file uploads + $text .= checkb("X", $a_perms).ADMSLAN_66."
"; // Configure Search + $text .= checkb("A", $a_perms).ADMSLAN_36."
"; // Configure Image Settings (Previously Moderate forums - NOW PLUGIN) + $text .= checkb("B", $a_perms).ADMSLAN_37."
"; // Moderate comments + $text .= checkb("H", $a_perms).ADMSLAN_39."
"; // Post news + $text .= checkb("I", $a_perms).ADMSLAN_40."
"; // Post links +// $text .= checkb("J", $a_perms).ADMSLAN_41."
"; // Post articles - NOW PLUGIN +// $text .= checkb("K", $a_perms).ADMSLAN_42."
"; // Post reviews - NOW PLUGIN +// $text .= checkb("L", $a_perms).ADMSLAN_43."
"; // Post content pages - NOW PLUGIN + $text .= checkb("R", $a_perms).ADMSLAN_44."
"; // Post downloads + $text .= checkb("U", $a_perms).ADMSLAN_45."
"; // Post polls + $text .= checkb("M", $a_perms).ADMSLAN_46."
"; // Welcome message + $text .= checkb("N", $a_perms).ADMSLAN_47."

"; // Moderate submitted news + + $text .= "
".ADLAN_CL_7."

"; + $text .= checkb("Z", $a_perms).ADMSLAN_62."

"; // Plugin Manager + + $sql->db_Select("plugin", "*", "plugin_installflag='1'"); + while ($row = $sql->db_Fetch()) + { + $text .= checkb("P".$row['plugin_id'], $a_perms).LAN_PLUGIN." - ".$row['plugin_name']."
"; + } + +// Language Rights.. -------------- + if($pref['multilanguage']) + { + sort($lanlist); + $text .= "
".ADLAN_132."

\n"; + $text .= checkb($pref['sitelanguage'], $a_perms).$pref['sitelanguage']."
\n"; + foreach($lanlist as $langval) + { + $langname = $langval; + $langval = ($langval == $pref['sitelanguage']) ? "" : $langval; + if ($langval) + { + $text .= checkb($langval, $a_perms).$langval."
\n"; + } + } + } + // ------------------------- + + if (getperms('0')) + { + $text .= "

".ADMSLAN_58."

"; + $text .= checkb("0", $a_perms).ADMSLAN_58."
"; + } + + $text .= "

+ ".ADMSLAN_49." - + ".ADMSLAN_51."
+
+
"; + + $text .= " + "; + + $text .= "
+
+
"; + + $text .= "

".ADMSLAN_70."
"; + $ns->tablerender(ADMSLAN_52, $text); +} + + + +require_once("footer.php"); + + + + + + +function checkb($arg, $perms) +{ + if (getperms($arg, $perms)) + { + $par = "\n"; + } + else + { + $par = "\n"; + } + return $par; +} + + +function renderperms($perm,$id){ + global $pref,$sql,$pt; + if($perm == "0"){ + return ADMSLAN_58; + } + $sql2 = new db; + $lanlist = explode(",",e_LANLIST); + + + if(!$pt){ + $pt["1"] = ADMSLAN_19; + $pt["2"] = ADMSLAN_20; + $pt["3"] = ADMSLAN_21; + $pt["4"] = ADMSLAN_22; // Moderate users/bans etc + $pt["5"] = ADMSLAN_23; // create/edit custom pages/menus + $pt["Q"] = ADMSLAN_24; // Manage download categories + $pt["6"] = ADMSLAN_25; // Upload /manage files + $pt["Y"] = ADMSLAN_67; // file inspector + $pt["O"] = ADMSLAN_68; // notify + $pt["7"] = ADMSLAN_26; + $pt["8"] = ADMSLAN_27; + $pt["C"] = ADMSLAN_64; + $pt["9"] = ADMSLAN_28; + $pt["W"] = ADMSLAN_65; + $pt["D"] = ADMSLAN_29; + $pt["E"] = ADMSLAN_30; + $pt["F"] = ADMSLAN_31; + $pt["G"] = ADMSLAN_32; + $pt["S"] = ADMSLAN_33; + $pt["T"] = ADMSLAN_34; + $pt["V"] = ADMSLAN_35; + $pt["X"] = ADMSLAN_66; + $pt["A"] = ADMSLAN_36; // Configure Image Settings + $pt["B"] = ADMSLAN_37; + $pt["H"] = ADMSLAN_39; + $pt["I"] = ADMSLAN_40; + $pt["L"] = ADMSLAN_43; + $pt["R"] = ADMSLAN_44; + $pt["U"] = ADMSLAN_45; + $pt["M"] = ADMSLAN_46; + $pt["N"] = ADMSLAN_47; + $pt["Z"] = ADMSLAN_62; + + + // foreach($lanlist as $lan){ + // $pt[$lan] = $lan; + // } + + $sql2->db_Select("plugin", "*", "plugin_installflag='1'"); + while ($row2 = $sql2->db_Fetch()){ + $pt[("P".$row2['plugin_id'])] = LAN_PLUGIN." - ".$row2['plugin_name']; + } + } + + $tmp = explode(".", $perm); + $langperm = ""; + foreach($tmp as $pms){ + if(in_array($pms, $lanlist)){ + $langperm .= $pms." "; + }else{ + $permtxt[] = $pms; + if($pt[$pms]){ + $ptext[] = $pt[$pms]; + } + } + } + + $ret = implode(" ",$permtxt); + if($pref['multilanguage']){ + $ret .= ", ". $langperm; + } + + $text = "
$ret
+ "; + return $text; + + +} + +?> diff --git a/e107_admin/article.php b/e107_admin/article.php new file mode 100644 index 000000000..5dd55ed0e --- /dev/null +++ b/e107_admin/article.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/e107_admin/auth.php b/e107_admin/auth.php new file mode 100644 index 000000000..304a8eb42 --- /dev/null +++ b/e107_admin/auth.php @@ -0,0 +1,175 @@ +verify_code($_POST['rand_num'], $_POST['code_verify'])) + { + echo "\n"; + header("location: ../index.php"); + exit; + } + } + + $row = $authresult = $obj->authcheck($_POST['authname'], $_POST['authpass']); + if ($row[0] == "authfail") { + echo "\n"; + header("location: ../index.php"); + exit; + } else { + + $userpass = md5($_POST['authpass']); + $cookieval = $row['user_id'].".".md5($userpass); + + $sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['authname'])."'"); + list($user_id, $user_name, $userpass) = $sql->db_Fetch(); + if ($pref['user_tracking'] == "session") { + $_SESSION[$pref['cookie_name']] = $cookieval; + } else { + cookie($pref['cookie_name'], $cookieval, (time()+3600 * 24 * 30)); + } + echo "\n"; + } + } + + $e_sub_cat = 'logout'; + require_once(e_ADMIN."header.php"); + + if (ADMIN == FALSE) { + $obj = new auth; + $obj->authform(); + require_once(e_ADMIN."footer.php"); + exit; + } +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +class auth +{ + + function authform() + { + /* + # Admin auth login + # + # - parameters none + # - return null + # - scope public + */ + + global $use_imagecode, $sec_img; + + $text = "
+
\n + + + + + + + + + + "; + + if ($use_imagecode) { + $text .= " + + + + + "; + } + + $text .= " + + + +
".ADLAN_89."\n
".ADLAN_90."\n
".ADLAN_152." + ". + $sec_img->r_image(). + "
+ + +
+
+
"; + + $au = new e107table; + $au->tablerender(ADLAN_92, $text); + } + + function authcheck($authname, $authpass) + { + /* + # Admin auth check + # - parameter #1: string $authname, entered name + # - parameter #2: string $authpass, entered pass + # - return boolean if fail, else result array + # - scope public + */ + global $tp; + $sql_auth = new db; + $authname = $tp -> toDB(preg_replace("/\sOR\s|\=|\#/", "", $authname)); + if ($sql_auth->db_Select("user", "*", "user_loginname='$authname' AND user_admin='1' ")) + { + $row = $sql_auth->db_Fetch(); + } + else + { + if ($sql_auth->db_Select("user", "*", "user_name='$authname' AND user_admin='1' ")) + { + $row = $sql_auth->db_Fetch(); + } + } + if($row['user_id']) + { + if($row['user_password'] == md5($authpass)) + { + return $row; + } + } + return array("authfail"); + } +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// +?> diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php new file mode 100644 index 000000000..b807efaec --- /dev/null +++ b/e107_admin/banlist.php @@ -0,0 +1,131 @@ +toDB($_POST['ban_reason']); + admin_update($sql -> db_Insert("banlist", "'".$_POST['ban_ip']."', '".ADMINID."', '".$_POST['ban_reason']."'"), 'insert'); + unset($ban_ip); +} + +if (isset($_POST['update_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) { + $_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']); + admin_update($sql -> db_Update("banlist", "banlist_ip='".$_POST['ban_ip']."', banlist_admin=".ADMINID.", banlist_reason='".$_POST['ban_reason']."' WHERE banlist_ip='".$_POST['old_ip']."'")); + unset($ban_ip); +} + +if ($action == "remove" && isset($_POST['ban_secure'])) { + $sql -> db_Delete("generic", "gen_type='failed_login' AND gen_ip='$sub_action'"); + admin_update($sql -> db_Delete("banlist", "banlist_ip='$sub_action'"), 'delete'); +} + +if ($action == "edit") { + $sql->db_Select("banlist", "*", "banlist_ip='$sub_action'"); + $row = $sql->db_Fetch(); + extract($row); +} else { + unset($banlist_ip, $banlist_reason); + if (e_QUERY && strpos($_SERVER["HTTP_REFERER"], "userinfo")) { + $banlist_ip = $action; + } +} + +$text = ""; + + + +$text .= "
+
+ + + + + + + + + + + + + + + +
".BANLAN_5.": {$rdns_warn} + +
".BANLAN_7.": + +
". +($action == "edit" ? "" : "")." + +
+
+
"; + +if(!varsettrue($pref['enable_rdns'])) +{ + $text .= "

".BANLAN_12."
"; +} + +$ns->tablerender(BANLAN_9, $text); + +if ($action != "edit") { + $text = $rs->form_open("post", e_SELF, "ban_form")."
".$rs->form_hidden("ban_secure", "1"); + if (!$ban_total = $sql->db_Select("banlist","*","ORDER BY banlist_ip","nowhere")) { + $text .= "
".BANLAN_2."
"; + } else { + $text .= " + + + + "; + $count = 0; + while ($row = $sql->db_Fetch()) { + extract($row); + $banlist_reason = str_replace("LAN_LOGIN_18", BANLAN_11, $banlist_reason); + $text .= " + \n"; + $count++; + } + $text .= "
".BANLAN_10."".LAN_OPTIONS."
$banlist_ip
".BANLAN_7.": $banlist_reason
".$rs->form_button("submit", "main_edit_$count", LAN_EDIT, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs->form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."
\n"; + } + $text .= "
".$rs->form_close(); + $ns->tablerender(BANLAN_3, $text); +} + +require_once("footer.php"); +?> diff --git a/e107_admin/banner.php b/e107_admin/banner.php new file mode 100644 index 000000000..d0b23aadb --- /dev/null +++ b/e107_admin/banner.php @@ -0,0 +1,677 @@ +get_files(e_IMAGE."banners/","",$reject); + +if (isset($_POST['update_menu'])) { + + $menu_pref['banner_caption'] = $tp->toDB($_POST['banner_caption']); + $menu_pref['banner_amount'] = intval($_POST['banner_amount']); + $menu_pref['banner_rendertype'] = intval($_POST['banner_rendertype']); + + if (isset($_POST['catid'])) { + $array_cat = explode("-", $_POST['catid']); + $cat=''; + for($i = 0; $i < count($array_cat); $i++) { + $cat .= $tp->toDB($array_cat[$i])."|"; + } + $cat = substr($cat, 0, -1); + $menu_pref['banner_campaign'] = $cat; + } + + $sysprefs->setArray('menu_pref'); + $message = BANNER_MENU_L2; +} + + + +if ($_POST['createbanner'] || $_POST['updatebanner']) +{ + + $start_date = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear'])); + + $end_date = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear'])); + + $cli = ($_POST['client_name'] ? $_POST['client_name'] : $_POST['banner_client_sel']); + + if ($_POST['banner_pages']) { + $postcampaign = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']); + $pagelist = explode("\r\n", $_POST['banner_pages']); + for($i = 0 ; $i < count($pagelist) ; $i++) { + $pagelist[$i] = trim($pagelist[$i]); + } + $plist = implode("|", $pagelist); + $pageparms = $postcampaign."^".$_POST['banner_listtype']."-".$plist; + $pageparms = preg_replace("#\|$#", "", $pageparms); + $pageparms = (trim($_POST['banner_pages']) == '') ? '' : + $pageparms; + $cam = $pageparms; + } else { + $cam = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']); + } + + if ($_POST['createbanner']) { + admin_update($sql->db_Insert("banner", "0, '".$cli."', '".$_POST['client_login']."', '".$_POST['client_password']."', '".$_POST['banner_image']."', '".$_POST['click_url']."', '".intval($_POST['impressions_purchased'])."', '$start_date', '$end_date', '".$_POST['banner_class']."', 0, 0, '', '".$cam."'"), 'insert', BNRLAN_63); + } else { + admin_update($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$_POST['client_login']."', banner_clientpassword='".$_POST['client_password']."', banner_image='".$_POST['banner_image']."', banner_clickurl='".$_POST['click_url']."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='$start_date', banner_enddate='$end_date', banner_active='".$_POST['banner_class']."', banner_campaign='".$cam."' WHERE banner_id='".$_POST['eid']."'"), 'update', BNRLAN_64); + } + unset($_POST['client_name'], $_POST['client_login'], $_POST['client_password'], $_POST['banner_image'], $_POST['click_url'], $_POST['impressions_purchased'], $start_date, $end_date, $_POST['banner_enabled'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['banner_class'], $_POST['banner_pages'], $_POST['banner_listtype']); +} + +if (isset($_POST['confirm'])) { + admin_update($sql->db_Delete("banner", "banner_id='".$_POST['id']."' "), 'delete', BNRLAN_1); +} + +if ($action == "delete" && $sub_action) { + $text = "
+ ".BNRLAN_2." +

+
+ + + +
+
"; + $ns->tablerender(BNRLAN_5, $text); + + require_once("footer.php"); + exit; +} +if (isset($_POST['cancel'])) { + $message = BNRLAN_6; +} + +if (isset($message)) { + $ns->tablerender("", "
".$message."
"); +} + +if ($sql->db_Select("banner")) { + while ($row = $sql->db_Fetch()) { + extract($row); + + if (strpos($banner_campaign, "^") !== FALSE) { + $campaignsplit = explode("^", $banner_campaign); + $banner_campaign = $campaignsplit[0]; + } + + if ($banner_campaign) { + $campaigns[] = $banner_campaign; + } + if ($banner_clientname) { + $clients[] = $banner_clientname; + } + if ($banner_clientlogin) { + $logins[] = $banner_clientlogin; + } + if ($banner_clientpassword) { + $passwords[] = $banner_clientpassword; + } + } +} + + +if (!$action) { + $text = " + + + + + + + + + + + "; + + if (!$banner_total = $sql->db_Select("banner")) { + $text .= ""; + } else { + while ($row = $sql->db_Fetch()) { + extract($row); + + $clickpercentage = ($banner_clicks && $banner_impressions ? round(($banner_clicks / $banner_impressions) * 100)."%" : "-"); + $impressions_left = ($banner_impurchased ? $banner_impurchased - $banner_impressions : BNRLAN_16); + $impressions_purchased = ($banner_impurchased ? $banner_impurchased : BNRLAN_16); + + $start_date = ($banner_startdate ? strftime("%d %B %Y", $banner_startdate) : BNRLAN_17); + $end_date = ($banner_enddate ? strftime("%d %B %Y", $banner_enddate) : BNRLAN_17); + + if (strpos($banner_campaign, "^") !== FALSE) { + $campaignsplit = explode("^", $banner_campaign); + $banner_campaign = $campaignsplit[0]; + $textvisivilitychanged = "(*)"; + } else { + $textvisivilitychanged = ""; + } + + $text .= " + + + + + + + + + + + + + + + "; + } + } + $text .= "
".BNRLAN_7."
".BNRLAN_8."".BNRLAN_9."".BNRLAN_10."".BNRLAN_11."".BNRLAN_12."".BNRLAN_13."".LAN_OPTIONS."
".BNRLAN_15."
".$banner_id."".$banner_clientname."".$banner_clicks."".$clickpercentage."".$impressions_purchased."".$impressions_left."".ADMIN_EDIT_ICON." ".ADMIN_DELETE_ICON."
 ".$banner_campaign."".r_userclass_name($banner_active)." ".$textvisivilitychanged."".BNRLAN_45.": ".$start_date." <> ".BNRLAN_21.": ".$end_date."
 
"; + + $ns->tablerender(BNRLAN_42, $text); +} + +if ($action == "create") { + + if ($sub_action == "edit" && $id) { + if (!$sql->db_Select("banner", "*", "banner_id = '".$id."' " )) { + $text .= "
".BNRLAN_15."
"; + } else { + while ($row = $sql->db_Fetch()) { + extract($row); + + $_POST['client_name'] = $banner_clientname; + $_POST['client_login'] = $banner_clientlogin; + $_POST['client_password'] = $banner_clientpassword; + $_POST['banner_image'] = $banner_image; + $_POST['click_url'] = $banner_clickurl; + $_POST['impressions_purchased'] = $banner_impurchased; + $_POST['banner_campaign'] = $banner_campaign; + $_POST['banner_active'] = $banner_active; + + if ($banner_startdate) { + $tmp = getdate($banner_startdate); + $_POST['startmonth'] = $tmp['mon']; + $_POST['startday'] = $tmp['mday']; + $_POST['startyear'] = $tmp['year']; + } + if ($banner_enddate) { + $tmp = getdate($banner_enddate); + $_POST['endmonth'] = $tmp['mon']; + $_POST['endday'] = $tmp['mday']; + $_POST['endyear'] = $tmp['year']; + } + + if (strpos($_POST['banner_campaign'], "^") !== FALSE) { + $campaignsplit = explode("^", $_POST['banner_campaign']); + $listtypearray = explode("-", $campaignsplit[1]); + $listtype = $listtypearray[0]; + $campaign_pages = str_replace("|", "\n", $listtypearray[1]); + $_POST['banner_campaign'] = $campaignsplit[0]; + } else { + $_POST['banner_campaign'] = $banner_campaign; + } + + } + } + } + + $text = " +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
".($sub_action == "edit" ? BNRLAN_22 : BNRLAN_23)."
".BNRLAN_24.""; + if (count($campaigns)) { + $text .= " ".BNRLAN_25."  "; + } + $text .= " + ".BNRLAN_26." +
".BNRLAN_27.""; + + if (count($clients)) { + $text .= " ".BNRLAN_28."  "; + $text .= ""; + } + + $text .= " + ".BNRLAN_29." +
".BNRLAN_30." + +
".BNRLAN_31." + +
".BNRLAN_32." + +

"; + $c = 0; + while ($images[$c]) + { + + $image = $images[$c]['path'].$images[$c]['fname']; + + $fileext1 = substr(strrchr($image, "."), 1); + $fileext2 = substr(strrchr($image, "."), 0); + + $text .= " + + +
"; + } + else if($fileext1 == "php" || $fileext1 == "html" || $fileext1 == "js") { + $text .= " /> ".BNRLAN_46.": ".$images[$c]['fname']."
"; + } else { + $text .= " />
"; + } + $c++; + } + $text .= "
".BNRLAN_33." + +
".BNRLAN_34." + 0 = ".BNRLAN_35." +
".BNRLAN_36." ".BNRLAN_38." +
".BNRLAN_37." + ".BNRLAN_38." +
".BNRLAN_39." + ".MENLAN_4." + ".r_userclass("banner_class", $_POST['banner_active'], "off", "public,member,guest,admin,classes,nobody,classes")." +
"; + $text .= ($sub_action == "edit" && $id ? ""); + + $text .= "
+
"; + + $ns->tablerender(BNRLAN_42, $text); + +} + + + +if ($action == "menu") +{ + + $array_cat_in = explode("|", $menu_pref['banner_campaign']); + if (!$menu_pref['banner_caption']) + { + $menu_pref['banner_caption'] = BANNER_MENU_L1; + } + + $category_total = $sql -> db_Select("banner", "DISTINCT(banner_campaign) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where"); + while ($row = $sql -> db_Fetch()) + { + extract($row); + if (in_array($banner_campaign, $array_cat_in)) + { + $in_catname[] = $banner_campaign; + } else { + $out_catname[] = $banner_campaign; + } + } + + + $text = "
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
".BANNER_MENU_L3.": + +
".BANNER_MENU_L6." + + + + + + +
".BANNER_MENU_L7."
+ +
".BANNER_MENU_L8."
+

+ + +
+ +
".BANNER_MENU_L19." + +
".BANNER_MENU_L10." +
+
+
"; + + + + + + + + + + + + + + + + + + $ns->tablerender(BANNER_MENU_L5, $text); + echo "\n"; +} + + +function banner_adminmenu() { + + global $action, $sql, $sub_action, $id; + $act = $action; + if ($act == "") { + $act = "main"; + } + $var['main']['text'] = BNRLAN_58; + $var['main']['link'] = e_SELF; + + $var['create']['text'] = BNRLAN_59; + $var['create']['link'] = e_SELF."?create"; + + $var['menu']['text'] = BNRLAN_61; + $var['menu']['link'] = e_SELF."?menu"; + + show_admin_menu(BNRLAN_62, $act, $var); +} + +require_once("footer.php"); + +?> \ No newline at end of file diff --git a/e107_admin/cache.php b/e107_admin/cache.php new file mode 100644 index 000000000..0e6098fc5 --- /dev/null +++ b/e107_admin/cache.php @@ -0,0 +1,87 @@ +clear(); + $update = true; + } + admin_update($update, 'update', CACLAN_4); +} + +if (isset($_POST['empty_cache'])) { + $ec->clear(); + $ns->tablerender(LAN_UPDATE, "
".CACLAN_6."
"); +} + +$text = "
+
+ + + + + + + + + + + + + + + +
".CACLAN_1."
"; +$text .= (!$pref['cachestatus']) ? "" : + ""; +$text .= CACLAN_7." +
"; +if (is_writable(e_FILE."cache")) { + $text .= ('1' == $pref['cachestatus']) ? "" : + ""; + $text .= CACLAN_9; +} else { + $text .= CACLAN_9."

".CACLAN_10.""; +} +$text .= "
+ + + + +
+
+
"; + +$ns->tablerender(CACLAN_3, $text); + +require_once("footer.php"); +?> \ No newline at end of file diff --git a/e107_admin/cascade.php b/e107_admin/cascade.php new file mode 100644 index 000000000..39faaa92c --- /dev/null +++ b/e107_admin/cascade.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/categories.php b/e107_admin/categories.php new file mode 100644 index 000000000..6386c692c --- /dev/null +++ b/e107_admin/categories.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/classis.php b/e107_admin/classis.php new file mode 100644 index 000000000..3351beb8d --- /dev/null +++ b/e107_admin/classis.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/combo.php b/e107_admin/combo.php new file mode 100644 index 000000000..0b364a72f --- /dev/null +++ b/e107_admin/combo.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/comment.php b/e107_admin/comment.php new file mode 100644 index 000000000..2729a1a38 --- /dev/null +++ b/e107_admin/comment.php @@ -0,0 +1,47 @@ +db_Update("comments", "comment_blocked='1' WHERE comment_id='$id' "); + } + if ($action == "unblock") { + $sql->db_Update("comments", "comment_blocked='0' WHERE comment_id='$id' "); + } + if ($action == "delete") { + $sql->db_Delete("comments", "comment_id='$id' "); + } + if (!$e107cache->clear($item)) { + $tmp = explode("?", $item); + $item = $tmp[0]."?news.".$c_item; + $e107cache->clear($item); + } +} +echo "\n"; +?> \ No newline at end of file diff --git a/e107_admin/compact.php b/e107_admin/compact.php new file mode 100644 index 000000000..599fcb53c --- /dev/null +++ b/e107_admin/compact.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_admin/content.php b/e107_admin/content.php new file mode 100644 index 000000000..7fc8c7395 --- /dev/null +++ b/e107_admin/content.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/e107_admin/core_image.php b/e107_admin/core_image.php new file mode 100644 index 000000000..65a966add --- /dev/null +++ b/e107_admin/core_image.php @@ -0,0 +1,5711 @@ + + array ( + 'includes' => + array ( + 'beginner.php' => '399d299a1ad1dece1776fa3e477fdd31', + 'cascade.php' => 'f02f4e7c20f7590a19681f0324307800', + 'categories.php' => 'a99113a6cabb51bc0bcded28892a0957', + 'classis.php' => '5648c4272072a1f3bbf2665329d480bd', + 'combo.php' => '416828015462d3e305c002a3798ad76e', + 'compact.php' => '2c5c2b4d66971f1b0aaa0ac8e81097e7', + ), + 'sql' => + array ( + 'db_update' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'core_pg.php' => 'af38d186d0a03cde899b4e0939b6ee6c', + 'core_sql.php' => 'cc00538c4f8b87a107ac6d2dacbaf9b2', + 'extended_country.php' => '0ef441f85dc0628bbf00c91e1163f114', + ), + 'ad_links.php' => 'd4d181f5337ba8bc939828d9068c8d43', + 'admin.php' => '3300cf551a1fa5ecc473e2f355c97ea7', + 'admin_classis.php' => 'ed861d18477db9ce0bc3620a69443723', + 'admin_combo.php' => '8958300a2a42fd2aa68977d566c1edb9', + 'admin_etalkers.php' => '9d684ef56c54bbf919e3346927cf4509', + 'admin_log.php' => '38c702ad61600d3c48851ee1dc868dfd', + 'adminb.php' => '1e31b2ad3907c7cba29dca04342cee1d', + 'administrator.php' => 'bd8de4773ebe49ab0884ba3d1c19568c', + 'article.php' => '7b21dc8ef4bc68ceb9ecf4d1c519a645', + 'auth.php' => '6bdf6b7895598b70c76e219069b930c6', + 'banlist.php' => 'f858a52c69ad86e1ed66127434a12915', + 'banner.php' => '3913e712c16227a49c5333b7f0e64489', + 'cache.php' => '62fc17d1f4c6db977c66642c5a76127a', + 'cascade.php' => '3d70a650778f09e6c85efd91b6ab5e4a', + 'categories.php' => 'cbbed37d26ab602700d46a0cb1955205', + 'classis.php' => 'ae46c368d41390a44cd6005404d651d7', + 'combo.php' => '6b0f9e175585ef0b42585b444b003678', + 'comment.php' => '96f04e71003de6b6a6ea3a0f2ede285d', + 'compact.php' => '20bccea2ef81cc86a86782fa4841e45f', + 'content.php' => 'bf2239404990afed185913002429e682', + 'core_image.php' => 'e989fac71ee65a3db9047565d6f34b48', + 'cpage.php' => '57ab65c7fa55e1dcfc5f3a9a94bc2528', + 'credits.php' => '322fe1169cd992db88624e84d7f51288', + 'db.php' => 'a48795e26302b874c1fe397689f01d9f', + 'db_verify.php' => 'e14434e165ac07b4cb630809dd4b3150', + 'docs.php' => 'e5ebdd8fd30362636cfe1a3878b3fb18', + 'download.php' => '636316389ea0a9dd8d6dc7b9d2044c81', + 'e107_update.php' => 'c23624862e7dc50fab29aa1890c7872a', + 'emoticon.php' => '4139a4c00680ed7b94bb2848bb9c7cec', + 'fileinspector.php' => '7430c97538e5d63ced422b4d552344ae', + 'filemanager.php' => 'af7dfc6ef908953d0208cd18ba5d444d', + 'filetypes_.php' => 'f951037335e993337792606cc1475cec', + 'fla.php' => 'c44c289dcdbe2bcf53305103275ce899', + 'footer.php' => '0cc1b838f19770de51917dd614b7b246', + 'frontpage.php' => '78acc7a2d9f879636291a2b45d06c80a', + 'header.php' => 'a61922daac7e562e86251bd9a67877f3', + 'image.php' => 'fc510663610cbf4b53eec2f9948999b6', + 'index.php' => 'e4e143ee2d34d4ce1f17b3f043cc6cd6', + 'lancheck.php' => '8b8fea89e7d9a0dc3d1931971a9b4939', + 'language.php' => '67569d7ab4a4e25984c19353a143e31c', + 'links.php' => '39c7ab07f379c047fe20f0415735b474', + 'mailout.php' => '9779b609afed1f62c16bf7694f1a68e5', + 'menus.php' => '1abba8d34311ca3795d37d4526a41042', + 'message.php' => 'a598b5e493298500d81b815f1455280b', + 'meta.php' => '346305add7d4a15981103cd42ae02d15', + 'modcomment.php' => 'b8787d8ebce9cc813ccaa416ec3a923c', + 'newspost.php' => '6aba9db62369e328f78f623644ea04a8', + 'notify.php' => 'a988fd7416b4595e72975b22ccc6362b', + 'phpinfo.php' => '994ea857810fe5f47ac8612f570aadb1', + 'plugin.php' => '3714121cbb762b83f29f28a9fa1d094f', + 'prefs.php' => 'e9ac6b838ef5368d1861481e629c8c08', + 'review.php' => '1919d31943803a66cb2d12828bd92db2', + 'search.php' => 'b1239e5af6795205648d8965ec3a1ec9', + 'theme.php' => 'b05f7265501a3e1c5e7c47cb3f891831', + 'ugflag.php' => 'b3b47767137dd7ea5e3726150507e158', + 'update_routines.php' => '16e3369df255bb5d6f76e8288830e3e1', + 'updateadmin.php' => '770fff43134883ea4d502498b28d70d2', + 'upload.php' => '69b274043c816b5a8c7241c20de0b9fb', + 'userclass.php' => 'b7fd96c785b6f3eead88fd5acd5760ad', + 'userclass2.php' => 'f0a95f4feecabe0d801b4a7f64c89ec0', + 'userinfo.php' => 'fcbb4c620a0a9ed430588ee7539fb2d7', + 'users.php' => '97cf741f0e67b3be9a55232c4a189932', + 'users_extended.php' => 'c0cc2efb094dbb76b7e73fd31aedd06a', + 'users_extended_predefined.php' => 'a1bd4adc6a6c1996e304b467aed9d2c0', + 'ver.php' => '50bdc51a07a780bad3c7b109feeb22b1', + 'wmessage.php' => '17afb0f8ef07cfd675cd92e9f7e606a3', + ), + $coredir['docs'] => + array ( + 'help' => + array ( + 'English' => + array ( + 'Administrators' => '2d001305d3842ccda086c69d8480b7b5', + 'BBCode' => '5fa5841472b4f5ef147cdc3dfcf64583', + 'Banlist' => 'c26dea7d5c19e89270b6a4c66f7c5367', + 'Banners' => '07ec3ec7746666e5c8dc62d126e69cdf', + 'Cache' => 'd277d62ce899f0c85b5f9ab2721e2359', + 'Chatbox' => 'ee6779c1a022095e1384da1696a62a90', + 'Classes' => 'ee095eb315ad639cbda7e961f9ace940', + 'Downloads' => '8da67c083574a267ea6a82fe75f27329', + 'Emoticons' => '14a0d74aea591e0f8d82577aff8fe979', + 'Errors' => '46381d88a2326ff760562fea385b2fd0', + 'Forums' => '5976f081c2e1822a1261975cba4fcadf', + 'Front_Page' => 'f3f5ee030265c5892c022771b5f218e5', + 'Help!' => 'ad2abff800199fb22078a9d5b825b9d7', + 'Links' => '320eb08defa1360070a4f0c062e5fc84', + 'Maintainance' => 'f248eeafde7e99293b77d662304bfb52', + 'Menus' => '7344815f36b8aa616047ec8152ad54fa', + 'News' => '6eadf4f45748cad4f37e67fea04e05db', + 'Preferences' => '9b3d173843f5ac04b8cac472a8e213f2', + 'Uploads' => '1a979ee608d8dd812dd2752ba8d9f48a', + 'Users' => 'd62e15078e8d9d7ab8da7ec654cdef43', + 'Welcome_Message' => 'd3a3a4dfd02ec7258dd91364be7d6aa8', + ), + ), + 'README.html' => '0f900f790eb4081e213fef89b92a5125', + 'README_UPGRADE.html' => 'bd278a384e14d6306fc557a0560231fe', + 'gpl.txt' => 'e19d8295ecad01988af40b5a943bd55f', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'style.css' => '2e3b2c9e4bff6d8de091af58589faa1c', + ), + $coredir['files'] => + array ( + 'bbcode' => + array ( + 'b.bb' => '467bfb5e80f460fcebcdc2e6a3a8d38b', + 'blockquote.bb' => '2cfbbd3ab3fe2872d1a9873223d21522', + 'br.bb' => 'cb8d211703f0459735baa8dfbebb4bb4', + 'center.bb' => '5a1957946e3d8898a0b3d86650771809', + 'code.bb' => 'fbc07a20865e76438614cb49d4f50b4b', + 'color.bb' => '98b9d0ddcc76d2ee37af0f36eab8b1c3', + 'email.bb' => '123a8b604a28524320639ba1e09bef35', + 'file.bb' => '37ef44e5f420205d6c4f4519e69e7a32', + 'flash.bb' => 'd008adf0a77ce5b3398e908765247646', + 'hide.bb' => 'cf30f78c78855565b0bf868a01142fb8', + 'html.bb' => '9938499c3ef8c80a2598b9c3aed7e371', + 'i.bb' => 'ec842cfda8a6f33d53f8232763b56719', + 'img.bb' => '55dbceb76b1d0f3ac070c0122ed7ee10', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'justify.bb' => '016500f910beb0f820dd58c4915f2489', + 'left.bb' => '990ddba32b14bea648745cc373035bde', + 'link.bb' => '0682a13d56650ba5ca6859e9da761e6b', + 'list.bb' => 'a2b5f8075b9752bb5b60c3862c5d96ca', + 'php.bb' => '18bfe745513afb3bb7ec4d69f0683d95', + 'quote.bb' => '12bfbba32661e309a33972e388b0e912', + 'right.bb' => '9bd60ca738b30f35742a0049c5efc191', + 'size.bb' => 'bd62172ecb7083b85b534c2e45e79d48', + 'spoiler.bb' => '5929f20a04438093df87b7246e843bf0', + 'stream.bb' => '9661057e8db23c681e3ec2340ff3a4fa', + 'textarea.bb' => '51f2669f52dfec3ed57f38402fcc7652', + 'time.bb' => '3d83b0dfa9b139004bb19ee34b142b44', + 'u.bb' => '7f8703e65a5f24bd9d2edd5fc0dfef48', + 'url.bb' => 'ded6e905c2f5d9a12707d3bfa63d1d82', + ), + 'cache' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'user_extended.xml' => 'd0aebe83cdec17b0a33d8a3dca37bd14', + ), + 'downloadimages' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'downloads' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'downloadthumbs' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'images' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'import' => + array ( + 'import_mapper.php' => '78a98bfedbe66b043e8562bcd6449125', + 'import_readme.txt' => 'a76f8a52208d648e1c9e3afe71929755', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'mambo.php' => 'bbcff57b96ca83045d9f4afa982a6ff4', + 'phpbb2.php' => '80bdbe33731a881d122d68003096c4ad', + 'phpnuke.php' => '732653b3f39cf02364be2dcb0f065f3a', + ), + 'misc' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'public' => + array ( + 'avatars' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'resetcore' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'resetcore.php' => '8a69dad2ea719f5f8a85160b049d34eb', + 'style.css' => 'e294495db6f91c4514c4f40d7b09fcd5', + ), + 'shortcode' => + array ( + 'batch' => + array ( + 'bbcode_shortcodes.php' => 'ea6a74e0a309ad82b29f3fa467e77c39', + 'comment_shortcodes.php' => 'd443298b9ca99525f12817f6a3234706', + 'contact_shortcodes.php' => 'd593f9dadff312c61eb27e32457d7f95', + 'download_shortcodes.php' => '7ab132b79c308f5d010743e135dedce3', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'news_archives.php' => '1115fe90b0de9f170fce31c94680dabf', + 'news_shortcodes.php' => '6db3c049835db41b7fdace7e6c494d81', + 'signup_shortcodes.php' => '8726a38b93ea99fc74355f6188723c8f', + 'sitedown_shortcodes.php' => '3ae9199cbae645d23869d517a5f6cef4', + 'user_shortcodes.php' => '7f8fb9882adb3bcffdbd41435e62f154', + 'usersettings_shortcodes.php' => '0ba56f47a83cdbbdf3a5c72475ec100c', + ), + 'admin_alt_nav.sc' => '412e8fb7acac7746ea48b17854decfc4', + 'admin_credits.sc' => '0eb1784fcb76e13c8addd81d9a741074', + 'admin_docs.sc' => 'b010b7ac7618fa669c8777754a8337c6', + 'admin_help.sc' => '1ad9d6f1c5af06e7ce2d0e1744b02cd4', + 'admin_icon.sc' => 'e479849c3b09aae88aae3532b0550a92', + 'admin_lang.sc' => 'f5bf42455eb337119639528aa7fea705', + 'admin_latest.sc' => '96a92eb5000eb6e8f120b70734239968', + 'admin_log.sc' => 'ad42fe098b732d8985cd44b11a3402d5', + 'admin_logged.sc' => 'dec16fb0a9f5485db6ca1b4955753c2e', + 'admin_logo.sc' => 'ff7174ceae0a5e01bfd0bc7a343c16a4', + 'admin_menu.sc' => '33785fcda56c60c219a4cc30f6018f5b', + 'admin_msg.sc' => '1906530f20e337964878fd144b1047c5', + 'admin_nav.sc' => 'c22be64cb31ee333f0510f6dd8778363', + 'admin_plugins.sc' => 'cdf52aad6688cde7741d695a62be944d', + 'admin_preset.sc' => 'f27d1c59bb7459581fde09d29cfe6303', + 'admin_pword.sc' => 'abbe3f9d2709e86cfb37b378f2b3d13f', + 'admin_sel_lan.sc' => '6c2dbc4e17bdcc5f5260664ddb8c3280', + 'admin_siteinfo.sc' => '63bfd9a632b66f9368337983dd921537', + 'admin_status.sc' => 'ee77ec3ec0d56adfdc8681900a85bfc6', + 'admin_userlan.sc' => 'cbaf3dda959b6a36f6b3f4cf0a6f7536', + 'banner.sc' => '4a23a473eb15c7afbedbd4816f3922ea', + 'breadcrumb.sc' => '0591ee7dc26ded7ac9a359dea4b8fdf6', + 'custom.sc' => 'eae664abbaed381856936600574839a7', + 'e_image.sc' => '3819fdf5b9dfc7b189fb4073d33ae0d5', + 'email.sc' => 'a864fe0d78a0c9641b36d65688c63b10', + 'email_item.sc' => 'a23b3abbb722bbf5bc58be9d23906583', + 'emailto.sc' => '05843b1a7c7feb8f4985a55ac01ba9f3', + 'extended.sc' => '868d45e725d7565a1d9c5b743aba0967', + 'extended_icon.sc' => 'db16dbaa0dfa2f8fc944ba87c15a09d1', + 'extended_text.sc' => '5a1426815f88bb2239912638af30beb0', + 'extended_value.sc' => '1b720e5d3155c6d4a1464fc1e9cac5f1', + 'imageselector.sc' => '31d9db59fdc34235656d40a275e63c26', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'languagelinks.sc' => '46f5c006e1b1f5e5b941a6330711bf77', + 'linkstyle.sc' => '5ed64d972bc892a798f80179878f1266', + 'logo.sc' => '9fb4b737a74ac8d1168fa29fe88766ac', + 'menu.sc' => '44ea3e93ac49feeda0632a76773e2829', + 'news_alt.sc' => '25596ffed2cf4bed831b80397c77e295', + 'news_categories.sc' => 'c520fdee0b041b3622c93ca85f63f6fb', + 'news_category.sc' => '25596ffed2cf4bed831b80397c77e295', + 'newsfile.sc' => 'afe0363c51236eacdf1a5434d17533a3', + 'newsimage.sc' => '75738371cff6146174ea00971730a0da', + 'nextprev.sc' => 'c1c872831b48abb3c34d531e8ccdf2da', + 'picture.sc' => '0f4d00920f1ddbac7293549862b3c0da', + 'plugin.sc' => '3b827418651f2a8f070d1cf80fe2405f', + 'print_item.sc' => '8ca4f150e4758249c346dd0edd5623f3', + 'profile.sc' => 'ea7fc4eca12f39e19a735d2014fe341f', + 'search.sc' => '12a174161a186e9a936fc10c946f0517', + 'setstyle.sc' => '88ec920b668233bd21ba95e2cdd607e7', + 'sitecontactinfo.sc' => '5467f65cd62b910389014b5fb8b33fe5', + 'sitedescription.sc' => 'c617f50a35752e7cb8de2d15f7e6b614', + 'sitedisclaimer.sc' => 'cd111b6abc576ca1ab70c103f3f2a49b', + 'sitelinks.sc' => '754259e3bdab4efc147d92b50efdf262', + 'sitelinks_alt.sc' => '24ee01a0e4b5181620320b936a63245e', + 'sitename.sc' => 'a62bd1e1600931a2585f16b611fd0c6b', + 'sitetag.sc' => '338e16589e67c9fe45613e3c6dbb9b0d', + 'stylesheet.sc' => '40a390253676a08790cbadcd434619b3', + 'uploadfile.sc' => '85ea5b2a10cde7c2267a40c359694aed', + 'user_avatar.sc' => '1501550f2414900d47edee2621b2e624', + 'user_extended.sc' => '8fdffc090d07e85ceb203542ecbb0d32', + 'wmessage.sc' => 'b6bf7054c5f9ece93c13f2f1bfd13a31', + ), + 'def_e107_prefs.php' => '0886a4b7774f246f31aa027d4b8eb18b', + 'e107.css' => 'e5cfa4047831f19def7df032ef8bc830', + 'e107.js' => '2089336ebd5204061afce9be3094ad73', + 'e_ajax.js' => 'b583773e72852158e27af8a9bba7c97f', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'nav_menu.css' => '58ca165986f7428fb05e8b7b82c2ee13', + 'nav_menu.js' => 'f6345dfb29d05884a5017ff17ed36387', + 'nav_menu_alt.js' => 'cbfeb53bb0dfc7136f097c00265731ff', + 'popup.js' => 'a9d1e17d0a4c399736fc7bf16ac48fa8', + 'resetcore.php' => '8329fb938f7ae0058ab9582efc098c4c', + 'sleight_img.gif' => '7616b49c48ca0cd6cbd15e9f747c8886', + 'sleight_js.php' => '038fc3cccae701fab1c6aa35339a0853', + 'thumb.php' => '1506afd0bc12c8663688f7ca449aa853', + 'user.js' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + $coredir['handlers'] => + array ( + 'calendar' => + array ( + 'language' => + array ( + 'English.js' => '3eae52209f3587e2339a010280e22150', + ), + 'cal.gif' => 'c1e5255bd358fcd5a0779a0cc310a2fe', + 'calendar-setup.js' => 'bcdf616f6ebfe8fdb0235d389fb1d238', + 'calendar-setup_stripped.js' => '21fe92ab10616e9d40b066538b4d1fdb', + 'calendar.css' => '33ea70fdc6b81e988ffce30ad8f7c4f2', + 'calendar.js' => '0dca67d72cc4e8df1d64003ab4738d60', + 'calendar_class.php' => '79d604e52ab3b9fa60b9d0cd84e9bd6e', + 'calendar_stripped.js' => '3222e372b909b3eb246cdf3423493bda', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'menuarrow.gif' => 'b5a91d7a2755198b2eb729541ad3288c', + 'menuarrow2.gif' => '1f8c673c8f76832febaeeac88a5f4353', + 'sample.php' => '1d99312cd3ba1d6b9ef0484e6d138641', + ), + 'phpmailer' => + array ( + 'language' => + array ( + 'phpmailer.lang-en.php' => 'dca429b3dfc000a241f32ed11d3a6aca', + ), + 'class.phpmailer.php' => 'cf32be10ca659080ad4550acd26c102e', + 'class.pop3.php' => '5a96ba537abceb27300abeef11041302', + 'class.smtp.php' => 'dcae7f76c4549f804401195e06e2cb3a', + 'e107.htaccess' => '507de3fb6f951cafa6b1a346d232604f', + 'mailout_process.php' => '51fae3c946ebe47c33b298c36ef6f545', + ), + 'search' => + array ( + 'advanced_comment.php' => 'be2b0d04f5abfb8d659288a69cb73d49', + 'advanced_download.php' => 'fa435e7792317196d187e494212d0988', + 'advanced_news.php' => '4dd2b43f9acb91ea02b39fa44ccf4299', + 'advanced_pages.php' => '82c313fb52d708bd9aaad142a00dc2c4', + 'advanced_user.php' => '0f1f1668327d513090f6e13824d281ad', + 'comments_download.php' => '2cabddfffb2986e96bb7779da03d1f0a', + 'comments_news.php' => '771713752895af10bfa75c3c2bac4d1e', + 'comments_page.php' => '6e5a89313087d403e30cfeb8ddf4da78', + 'comments_user.php' => 'caa387a56d6f1b35610e80061e18cc1c', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'search_comment.php' => 'd6969967014e8c14e613bad64a091253', + 'search_download.php' => 'ba62e1be41cdd3457cfc2be8de146d01', + 'search_event.php' => '17c68ea4f5728e87e7009b96b978006c', + 'search_news.php' => 'bc0321e07ae69c925ac83a72ae67c136', + 'search_pages.php' => '57521d1569a214c3ccb99406561a229f', + 'search_user.php' => '90b545d731c887cef2715096d52cb968', + ), + 'tiny_mce' => + array ( + 'langs' => + array ( + 'en.js' => 'f304920296d23ba3ed1a8ec3a2a1844d', + ), + 'plugins' => + array ( + 'contextmenu' => + array ( + 'css' => + array ( + 'contextmenu.css' => 'f3cb9b44e37f0dc452bed97c02bec4c4', + ), + 'images' => + array ( + 'spacer.gif' => '12bf9e19374920de3146a64775f46a5e', + ), + 'contextmenu.css' => '93ad8b3e8a5e1a48bf6ed727ca0384e2', + 'editor_plugin.js' => 'f4df4d4889b61ecd067ea2d6977420ca', + 'editor_plugin_src.js' => '7772eef735b088e4a6fdfdf707e33e65', + ), + 'emoticons' => + array ( + 'images' => + array ( + 'emoticons.png' => '2867c94a2d99dedf5964a4a0de9e5839', + ), + 'langs' => + array ( + 'en.js' => '25334d4a3d329cc805a54c3f815ff26a', + ), + 'editor_plugin.js' => 'ede01e828a3698e2e00a9dbd503e7d95', + 'emoticons.php' => '31f361fda0b760ad25d72a9cf8bed070', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'ibrowser' => + array ( + 'images' => + array ( + 'constrain.gif' => '0ed8ffef1fb5cce76e51e2d720063ea9', + 'ibrowser.gif' => '3f92a28951b2d3048473262f5367d12d', + 'textflow.gif' => '2b34d07b43d1159590455146078cb4cc', + ), + 'langs' => + array ( + 'en.js' => '5bc48956a398ac86f36edb041a898a85', + ), + 'config.php' => '4e178e32efb96453c26523ded26f6ee7', + 'editor_plugin.js' => 'e16d63db65af69d1db26ff64b706a0d9', + 'ibrowser.php' => '1865b7afd71373cfff0cb986b632ee35', + ), + 'iespell' => + array ( + 'images' => + array ( + 'iespell.gif' => 'eb12c26b5768fcd344ea6205aa98e761', + ), + 'langs' => + array ( + 'en.js' => 'b262530d5b63841b50ab5b67f94883aa', + ), + 'editor_plugin.js' => 'fae3a5e1abb9e78c55eb4dab42d8dfd1', + 'editor_plugin_src.js' => '24caf83859f447628508cd99c907352c', + ), + 'media' => + array ( + 'css' => + array ( + 'content.css' => 'f665ed43e62a4ab7c0661d00fa4f0fdb', + 'media.css' => 'af181e09ae05dd73b0d32c0caa87d1a4', + ), + 'images' => + array ( + 'flash.gif' => '709d9df69d8c2030e56321046d76ab8b', + 'media.gif' => '0541d5bf542ee730346a5f4641416356', + 'quicktime.gif' => '4a4709a92bb1ef6bc1621019c92a83b8', + 'realmedia.gif' => '51de6342ba5327787eba762116d20130', + 'shockwave.gif' => 'acad15b370f34deb12355bea4b89c2e1', + 'windowsmedia.gif' => '825f4eca28a633397050f9a6cca9358f', + ), + 'jscripts' => + array ( + 'embed.js' => '2288f2d23b707283921aaeff2dfeb005', + 'media.js' => 'ff44b627774307f3ae807e6c27d66a06', + ), + 'langs' => + array ( + 'en.js' => 'de38190b0b16ff997c6f7a2e09818f3c', + ), + 'editor_plugin.js' => '6c1cbbc18a0f3a07757ee1a3969d55f8', + 'editor_plugin_src.js' => '9603968370efb4b25ae25d701db8ffd1', + 'media.htm' => 'd3fce5ed41db220e12ebfebd143e1f47', + ), + 'table' => + array ( + 'css' => + array ( + 'cell.css' => 'a51b50f9a8153e7f55fe06a03caca016', + 'row.css' => '6d95ac81b478e4e8a176e209c739c38d', + 'table.css' => '8357d1c13919a34806d23fa2160a8064', + ), + 'images' => + array ( + 'buttons.gif' => '7e50c576bb169b5dd93d9e28da67bb14', + 'table.gif' => '476b000e94b74dac818f1ce03681ace5', + 'table_cell_props.gif' => '6912d92a00e3e81a9baba3e251b7f0c0', + 'table_delete.gif' => '060899ca004398671369f92ef6a88a90', + 'table_delete_col.gif' => '333372a2469c8dfa12a002a2aad8de59', + 'table_delete_row.gif' => 'c58d9413b1d8150011db91818595871b', + 'table_insert_col_after.gif' => '5d19acf7a25262cf3ddc7a926a076218', + 'table_insert_col_before.gif' => 'd5910a210405a8cc7a24086104b06fa1', + 'table_insert_row_after.gif' => '6b3167fde6db6ac271488b9cef404792', + 'table_insert_row_before.gif' => '0e37e4c48dcddb1123bc6140ce323694', + 'table_merge_cells.gif' => 'd5552fd387ff429fbfe7b8aebc76b3c0', + 'table_row_props.gif' => '639bc7a8c034d99ab1cbef8f602f8aa8', + 'table_split_cells.gif' => 'aa2082cf1eb2e62eecda57fd2f986ab7', + ), + 'jscripts' => + array ( + 'cell.js' => 'df27f8a9de847dcc4b433960c72f99fa', + 'merge_cells.js' => 'f75d50d1dea59b83bd7f091fe53be6d3', + 'row.js' => '5564b689e370fc84c47b192de29e472b', + 'table.js' => '260a2bfaa8e3a3313fb14904f6daf7ea', + ), + 'langs' => + array ( + 'en.js' => 'efb577fa33557c4f819d45f8be16ff20', + ), + 'cell.htm' => '19a425a22f5dc25f42e755ad38d3ba98', + 'editor_plugin.js' => '21d04eeb64cf88af767f0641f1c360ee', + 'editor_plugin_src.js' => 'aeac85b281a5aff98f76157bbbbfb3f0', + 'merge_cells.htm' => '9470fcdf7575a48d499fdde3f20d8d5e', + 'row.htm' => '7c8c219909be04d09bad3bfeb048c560', + 'table.htm' => 'ec13d5c3ebb1e460e4a99de394664dc0', + ), + 'zoom' => + array ( + 'editor_plugin.js' => 'b4029d6df8bb33172ea5c44a9ba409ac', + 'editor_plugin_src.js' => '5a3aef8ef6b914daefb467674be73989', + ), + ), + 'themes' => + array ( + 'advanced' => + array ( + 'css' => + array ( + 'editor_content.css' => '4950d1774a92d46045b57911d41706ef', + 'editor_popup.css' => 'e2c24b08b5fdb21ca55da439aa30564a', + 'editor_ui.css' => '5d74992a65ac983a065f7c3d3012779e', + ), + 'images' => + array ( + 'xp' => + array ( + 'tab_bg.gif' => '3d53300281d4652d1fe2482f1bbec413', + 'tab_end.gif' => 'de9e554769bc24fc7f2acefddb04e895', + 'tab_sel_bg.gif' => 'f330e9c65e356cb6829596e421cf1116', + 'tab_sel_end.gif' => '6a4ffda436f2ffe5a56107d6c8c5a332', + 'tabs_bg.gif' => 'b3a2d232dd5bf5e8a829571bbec08522', + ), + 'anchor.gif' => '9997d8cbba012a0a8295ff92bced1207', + 'anchor_symbol.gif' => '5cb42865ce70a58d420786854fed4ae1', + 'backcolor.gif' => '9d4f0c287ef6a09ff25595c366920f61', + 'bold.gif' => 'd4eac7372d4d546db5110407596720dd', + 'bold_de_se.gif' => 'fa8d362da3c15cab263bc7eb2d192dd1', + 'bold_es.gif' => 'eedfd6c0dc13c5db5054bd893ac92ca0', + 'bold_fr.gif' => '8fbda35d5ebfc1474f93f808953b1386', + 'bold_ru.gif' => 'c227dfb4b70957d31c240fd0fd9f55b6', + 'browse.gif' => '2babc35c383abee1260e021dd87fd7a5', + 'bullist.gif' => 'f360470402affab13062de5ffbfb7f74', + 'button_menu.gif' => 'ed293e6a817f44328f74c0853c628e69', + 'buttons.gif' => '23c32309ebbca60a52fd064860788620', + 'cancel_button_bg.gif' => '57b808096854d5eeb5785effcd10c468', + 'center.gif' => '652af6256deb0eeb781b0793ee4142f2', + 'charmap.gif' => '3c3625a993caca8262dd93d61ff1a747', + 'cleanup.gif' => 'f082f5fdea8020fd9cdd714a30ca8e71', + 'close.gif' => '99fb1b6d91aca9519cfc18e182de8600', + 'code.gif' => '158e1ad2922f59a800e27e459c71d051', + 'color.gif' => 'c8e11c751b5575025fc50b7701719f0f', + 'copy.gif' => 'ef9a435cc72f9fe652ebc49498b89e86', + 'custom_1.gif' => 'bd1f96d299847c47fd535b1b54d3a2df', + 'cut.gif' => '4e3e44cccf150856322ba78ccf2533e7', + 'ecode.gif' => 'd78d5418d4c6883c837fdbeb7b824bb4', + 'forecolor.gif' => '160b10bd5949887d251eb5b96291b799', + 'full.gif' => '009750822e228e10f51e746ddf8d1fec', + 'help.gif' => 'e244d2c9d8f1d1910c7145699f767a9c', + 'hr.gif' => '8d92cb73437c32a0327323b538ad2214', + 'image.gif' => 'decae954176586ab7504c178b28b5041', + 'indent.gif' => '89c00ba134c89eb949411194060c135c', + 'insert_button_bg.gif' => '13a80583b2bf71103ea378514ac717e5', + 'italic.gif' => 'c8652735e55a968a2dd24d286c89642e', + 'italic_de_se.gif' => '2eafa516095a0d8b3cd03e7b8a4430f7', + 'italic_es.gif' => '61553fb992530dbbbad211eddcc66eb9', + 'italic_ru.gif' => 'bbc7be374d89a1ced0441287eeba297a', + 'justifycenter.gif' => '652af6256deb0eeb781b0793ee4142f2', + 'justifyfull.gif' => '009750822e228e10f51e746ddf8d1fec', + 'justifyleft.gif' => '7e1153a270935427f7b61c7b6c21ab8a', + 'justifyright.gif' => 'b91052a13211f6b1bc0a5ca596fe4a6b', + 'left.gif' => '7e1153a270935427f7b61c7b6c21ab8a', + 'link.gif' => '59cbc5812b993e7f6823937e89e85c18', + 'menu_check.gif' => '889563a22f10dd4535d0050b807e42ad', + 'newdocument.gif' => 'e6d9f7d0bdc4d21d9b9fd1ad6b888733', + 'numlist.gif' => 'd4c72d6e6d56fee2315ad59426a99a4e', + 'opacity.png' => 'bd2babb5fb15f4ad5352dd05be54e898', + 'outdent.gif' => 'b7249cc5a3bce3971f0b19fccac07f60', + 'paste.gif' => '14d2f6c0e090ce821ca302a6b5d7e7d9', + 'quote.gif' => '83277c79354c0cebed4b93b92ca96c56', + 'redo.gif' => '0fb531683cf59bb0e1c9911d475e640c', + 'removeformat.gif' => '2a5f195e9ec54e7e0e2fb40238678444', + 'right.gif' => 'b91052a13211f6b1bc0a5ca596fe4a6b', + 'separator.gif' => 'b0daa6a4ec9acc86c3b2b1bb71f5b6a5', + 'spacer.gif' => '12bf9e19374920de3146a64775f46a5e', + 'statusbar_resize.gif' => '4bece76f20ee7cd203d54c6ebd7a8153', + 'strikethrough.gif' => '0dcca301aa909817a82d705cc9a62952', + 'sub.gif' => 'dfbcf5f590c7a7d972f2750bf3e56a72', + 'sup.gif' => '15145f77c6f9629bfdb83669f14338a9', + 'table.gif' => '476b000e94b74dac818f1ce03681ace5', + 'table_delete_col.gif' => '333372a2469c8dfa12a002a2aad8de59', + 'table_delete_row.gif' => 'c58d9413b1d8150011db91818595871b', + 'table_insert_col_after.gif' => '5d19acf7a25262cf3ddc7a926a076218', + 'table_insert_col_before.gif' => 'd5910a210405a8cc7a24086104b06fa1', + 'table_insert_row_after.gif' => '6b3167fde6db6ac271488b9cef404792', + 'table_insert_row_before.gif' => '0e37e4c48dcddb1123bc6140ce323694', + 'underline.gif' => '203e5139ee72c00d597e4b00ed96d84b', + 'underline_es.gif' => '027608183023f80b0c9bf663c9e81301', + 'underline_fr.gif' => '027608183023f80b0c9bf663c9e81301', + 'underline_ru.gif' => '843cb1b52316024629bdc6adc665b918', + 'undo.gif' => '7883b9e1f9bf0b860e77b904e1941591', + 'unlink.gif' => 'dcd93dd109c065562fe9f5d6f978a028', + 'visualaid.gif' => '491fbaab8d180fdd051cece94f2b8845', + ), + 'jscripts' => + array ( + 'about.js' => '7168d330431da1d7c082c84df665a6f0', + 'anchor.js' => '5bffefe6a515c1b10fd636a4fbd45a34', + 'charmap.js' => '124138e299a3ef0c823010d2fbbdaf0f', + 'color_picker.js' => '9dcf13f6303af0db5d3fb280fa526f62', + 'image.js' => 'bf79747eacc011f3902a1804b49d6265', + 'link.js' => '3df42cdbae98782ae9a9bffaeba7ab53', + 'source_editor.js' => 'f2419d8fb2804a46ed626e6a8b953539', + ), + 'langs' => + array ( + 'en.js' => 'd954dbe69d706823e7ce2acc99ca16c6', + ), + 'about.htm' => 'fc2c574502ccf3e53fd00f52d9aa3869', + 'anchor.htm' => '15ace71eb4c333034944ef7cfb1646d2', + 'charmap.htm' => '9848d7254d4979ce94dfbdee055900ba', + 'color_picker.htm' => 'c00bae115f05a96d5a561dd46cfb9fa4', + 'editor_content.css' => '99f256c087e16872937f6cf9e4ea0c32', + 'editor_popup.css' => 'a2bbb5f95ba2d3422c1666222170d700', + 'editor_template.js' => '34f49851a46c0c3f5f90929fb5a1260e', + 'editor_template_src.js' => 'cd30e9a71b4422f62e370538a3b24dc4', + 'editor_ui.css' => '62632779c868eddf46f3a8e121083d31', + 'image.htm' => '4a2a0fe9cc33b4997f718b58af1be6ca', + 'link.htm' => '8f96d1fee5e848c10bd1c73faf0b38a6', + 'source_editor.htm' => '7b533802f9534af465bb276a2c318f35', + ), + ), + 'utils' => + array ( + 'editable_selects.js' => 'fafc283bd5b48b6cd188cf12856aac88', + 'form_utils.js' => '74cf73cde95e530009a570facd900874', + 'mclayer.js' => '1c7d5ff736bf571af7b1407758db937e', + 'mctabs.js' => '70249b9a54761a08db2006afb99079a1', + 'validate.js' => '50799f6a9ebc837f3d0345c4a42367bd', + ), + 'blank.htm' => '72406c871a9be7972922686221a885a2', + 'filelist.php' => '63d5fa62565bc100d3345de82ab36985', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'tiny_mce.js' => 'ae9f1a863b1d3686cf0c6ab0994acf2b', + 'tiny_mce_gzip.php' => '846511eed428312feca1f0e5fec6cd91', + 'tiny_mce_popup.js' => '0a5ce4187f9d2f58e36302d7d40bf3d2', + 'tiny_mce_src.js' => '1a99b9dcd773d76df1fee42e072cb1a4', + 'wysiwyg.php' => '3cc70beacb90d7c9ea9dcfea7288a8be', + ), + 'admin_handler.php' => '2d593943e40bf02d5d46cf6b6af6b7e7', + 'admin_log_class.php' => 'a19c073089c6149a755e253133594d65', + 'arraystorage_class.php' => '4862b38926c8f68029c95d31990435a4', + 'avatar_handler.php' => '54c9f790d9f17e30f52b8011633d486c', + 'bbcode_handler.php' => '4871033a545a98c465e3b0aa6e911374', + 'cache_handler.php' => 'e9b35486958d34ecf84afb69bed7fe16', + 'comment_class.php' => 'e525ee48e0f89300368bf201aed95783', + 'date_handler.php' => '900262e3d47034c444cf3da1abc9371d', + 'db_debug_class.php' => 'a1ac847f296f4701473806f80d5f7d23', + 'debug_handler.php' => 'fe93f06640b293a65a068d800c22daf6', + 'e107_Compat_handler.php' => 'e76211b3178e4a9724933ecfe85ba8ea', + 'e107_class.php' => '4ce6554308d42363e08c45c5b711df27', + 'e_parse_class.php' => '39060ea3a2092ca529710b0fc4d69037', + 'emailprint_class.php' => 'c7de0da4205693ddb952e9723a7fc226', + 'emote.php' => 'b5d34cd652e828769f49b855b090c96f', + 'emote_filter.php' => 'fedbb8c9daf1acd5f6dbbb9914b05dc4', + 'encrypt_handler.php' => '7a6f592c0900d68fcf5cbf7b0eb1e364', + 'equery_secure.php' => '00121b097ba978d5330349abbd350737', + 'event_class.php' => 'd14906b7576984e7d9467c097e285b65', + 'file_class.php' => 'f193a200c2717c932e3dd1ae7d378fcb', + 'form_handler.php' => '67deba10eb6acf65d941b760deec6134', + 'forum.php' => 'da5c0d4378b7288610945979d269a79c', + 'forum_include.php' => '8b562f8ba508cc3572c84b443c4e7a6c', + 'forum_mod.php' => 'fd1adbf1660996aeb4f51384506e0045', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'input_class.php' => 'f819fe76d1fa518f430410aa4e6c803e', + 'language_class.php' => '93fe59f6606cafbf4dddb8546fdd3a9b', + 'level_handler.php' => 'a231a4e63fcf4f498f9bfd7411250faf', + 'login.php' => 'cc67e51d6ea138cb66b9ada17adebaac', + 'magpie_rss.php' => '1297fc8132b5ec0a2c04436b38ec6aee', + 'mail.php' => '407db4ce0e57e22b7db8252af7f3085d', + 'mail_validation_class.php' => '75e722bf8c6975349ec402682323314e', + 'message_handler.php' => '176ebf4b88fb8267f143d28714bda42b', + 'mysql_class.php' => '4dc9c8b12ad9395b93c2452197c64259', + 'news_class.php' => 'c8c699da336670173562ede6f0f6a27c', + 'notify_class.php' => '2b2908df0eb85e94686bfed263389e77', + 'np_class.php' => '68a8edcf50703e47e19f165c1a108a45', + 'override_class.php' => 'a1f7451103a7fb47f3e541c31cf32343', + 'parser_functions.php' => '81daef0e484ee070d440e4ebc9bc8095', + 'parser_handler.php' => '650775595b663683a426c61dba6215cc', + 'pclerror.lib.php' => '7b1498a7efb4524dd899c954526c3ca2', + 'pcltar.lib.php' => 'b9313066aad3049bb0041099137a648e', + 'pcltrace.lib.php' => 'eb165fe908cc30c85975b7d35614990b', + 'pclzip.lib.php' => '1b0212a9a1e09b781172c8f6964296c2', + 'php_compatibility_handler.php' => 'f77929f2cd211a855516e3e72873ee99', + 'plugin_class.php' => 'd05c2666377d3c51de5c79119a56edc8', + 'pop3_class.php' => '3164abd686583e15f96901ab722cd272', + 'popup_handler.php' => '8915aa18adc4e69df003becaf508003d', + 'pref_class.php' => '4d2d63ee3f969ee742d6b989863b11e7', + 'preset_class.php' => '5a4df9b9b87aa3862dda2afd44165acd', + 'profanity_filter.php' => 'd41dc2dcd84a33f37f3ea1200fef3814', + 'rate_class.php' => '21ab83661e35eeb568386dc907a9726c', + 'ren_help.php' => '75ebce4f529d186cede57846d7f63693', + 'resize_handler.php' => '44e5777433fa18d97e80a4c16552f785', + 'search_class.php' => 'fe9c65c10349512b91164b8b67e724be', + 'secure_img_handler.php' => '18e7e3827ad38b79c3ff46b67e6627e1', + 'secure_img_render.php' => 'e772c2042868b1d9ecafbee3b4eab4ef', + 'session_handler.php' => '54f987aa4f0f2a31c646d9e0f81cd061', + 'shortcode_handler.php' => '845f8b0fdfe8b6d273d8e02f3cf8efd5', + 'sitelinks_class.php' => '64e7edf9541a0256066b9b636e550c18', + 'smtp.php' => '71008c80b0a5e12faef990c0560f8226', + 'theme_handler.php' => 'b38c4812a67c22705a15a263c66f3c92', + 'traffic_class.php' => 'd9939fec7c60e3c8b95111dca22ce918', + 'traffic_class_display.php' => '4583aae09eb49619d1b302160c27b721', + 'upload_handler.php' => '8720ea79c13c327e5c1c019daf077d4c', + 'user_extended_class.php' => '893014f71353a16c7eadaed563ac5dc7', + 'user_func.php' => 'bb871abafb6c91109c809afa9514afcc', + 'user_select_class.php' => '5f08187de31a562d5ea8ad88e1f6a3b2', + 'userclass_class.php' => '141c0e6732238a2c8d2dbfee515fb376', + 'usersession_class.php' => 'dcd6889bc9e8a11cba08fdd13f629615', + 'xml_class.php' => '2625ffa68fd7516ddf64eea40e47f218', + ), + $coredir['images'] => + array ( + 'admin_images' => + array ( + 'adminlogs_16.png' => 'fbfd5c6e0baadff05bda59e2f077a0d1', + 'adminlogs_32.png' => 'efd307a26601627eeebf563e22c8e5e7', + 'adminpass_16.png' => 'fbba9d9f7580b2f98337f8c0f18d5c53', + 'adminpass_32.png' => '57fa674965e09299b6cc340c7d406a36', + 'admins_16.png' => '64ad9ccbbcf1be92f0822150034b9c1a', + 'admins_32.png' => 'dc9cb0a7263efa4ea1dbb17ee1cdaa92', + 'arrow_16.png' => '38b69b179e7cdf232aa367a0dc3c4cbd', + 'arrow_32.png' => '95eb3ca28bf59f4cdbefec8fa86c3895', + 'arrow_over_16.png' => 'c37f8d92046ccd1ea70cc3cfc8f0fbdf', + 'arrow_over_32.png' => '93b788fd693c261aa8ea9ad788fce9b1', + 'articles_16.png' => '2d99036d870389c45c140370ec296050', + 'articles_32.png' => 'dbcdcd9f704906b9f3e1b48394abd545', + 'banlist_16.png' => 'e2f4be1afe16286a0a5363ba5a88ffe8', + 'banlist_32.png' => '5545b900ef6b8c90bce85143e5a985c9', + 'banners_16.png' => '052830d01fdf73ed2e1955ab76f3859e', + 'banners_32.png' => '3331be741e6c3f336034d6ddc5d223c3', + 'blocked.png' => 'd2b20874ccf7079dbb71b6c94e117d21', + 'cache_16.png' => 'f9aefee07fadf8f40e3883bac2973470', + 'cache_32.png' => '76ddb6584a9096bab54567a082357f8d', + 'cat_content_16.png' => 'af826022cad1ad5c5d2703d0a440aaf8', + 'cat_content_32.png' => '80f9caf4f37acd5bdcdd4afb7ceeb6e9', + 'cat_files_16.png' => '936037636275ca4c41a08fb962c79b86', + 'cat_files_32.png' => 'e6d063e74e730d05d688626c6d375b89', + 'cat_plugins_16.png' => 'a6bac798e6dad7b2e40487e3dedf51ad', + 'cat_plugins_32.png' => '74b17e491961633f65a2510e92ebde18', + 'cat_settings_16.png' => 'd981addefa729f697bf0b0dbf70293ea', + 'cat_settings_32.png' => '707034db3893c074c959a226ac6f6732', + 'cat_tools_16.png' => 'd1405a8ef3d0320c3ce7c8e870bd50b0', + 'cat_tools_32.png' => 'ffeca06ab80ddeb1453b397ac30816c1', + 'cat_users_16.png' => '32441383ed5d50d6fa9188b98d957dde', + 'cat_users_32.png' => 'a331baef28f6e923bad1a26ba5d17e4f', + 'chatbox_16.png' => '6524280b8f44bde11dd5ca5581432c14', + 'chatbox_32.png' => '2e6ae5a5be12ec8d09b5083e959347b9', + 'comments_16.png' => '721b2c81aa4fa1c43fe4211fb35c2ce0', + 'comments_32.png' => 'd5ba6ada9b084efe6209e1d9d603f749', + 'content_16.png' => '0205fc5130dc19a8b279244aeeeb4729', + 'content_32.png' => '2d2b276bf5f57a38575446262ac4fc75', + 'credits_16.png' => 'a24c7cbe05d44b7effcb6386f6a69455', + 'credits_32.png' => '6b96e92e85026907fcc4be6c45ae60df', + 'custom_16.png' => '3fdd7c500f2a5c8f9fe221d710958593', + 'custom_32.png' => 'a3813ae977ea3567b61d9bd3dfc398fb', + 'database_16.png' => '61541674f83748834b299d27d3aa5eb9', + 'database_32.png' => '83bb87a7cbaf1d57cdded1fc7078f2ec', + 'delete_16.png' => '3efc7450de9b20183c7196e3fd9a0b8b', + 'delete_32.png' => '5c479d67b5dc9f8fcc567d4201619b5a', + 'docs_16.png' => '70c3594a0a096d55e2af638a4bd7105e', + 'docs_32.png' => '2903138ad0be7ee641704dceca59089b', + 'down.png' => '434814c2c747f4062c6306fbfbec0622', + 'downloads_16.png' => '98cbf2ae49e39048e7ca60cc56898477', + 'downloads_32.png' => '1c745a271507abccff12574123b14f0d', + 'edit_16.png' => 'b6a25f62385219e73803e16c9682d438', + 'edit_32.png' => '17546bbd5fe9b8975fca44318f693932', + 'emoticons_16.png' => 'b92db0a7212cee1023293df03ae5bc90', + 'emoticons_32.png' => 'fa8974be1a06298f9819a1a203be02d8', + 'extended_16.png' => '4a6f3c5952ca3417e278c11d2551388e', + 'extended_32.png' => '72490efba6641db9a7521ff440cd9af9', + 'failedlogin_16.png' => '8888638ff60c8b47131f02a66c8df598', + 'fileinspector_16.png' => '7f7e61d6ed995277ce5fb60496d1a512', + 'fileinspector_32.png' => 'ca4961289d1d1a0aa22f561c6df68f3b', + 'filemanager_16.png' => '936037636275ca4c41a08fb962c79b86', + 'filemanager_32.png' => 'e6d063e74e730d05d688626c6d375b89', + 'forums_16.png' => '5773aa73ab08e4e575ceb2d60001f8f5', + 'forums_32.png' => '543708df3b2731ea4607ea5741a21f12', + 'frontpage_16.png' => 'e60c942e6e9a06ef05d167d7baceb2d5', + 'frontpage_32.png' => '2f385c03a9223119729ae2a08c28c1c9', + 'images_16.png' => 'baedd05460c41fd50c3eb4560cf1d574', + 'images_32.png' => '594f730d41b24b6c2da4b18e7173712b', + 'installed.png' => '31969aa03c0d7315e6b7d6b6b82e9e8c', + 'language_16.png' => '15f89da876e53572a12521378b92dc0f', + 'language_32.png' => '361c4a919639d165831e65a3a2c4fef1', + 'leave_16.png' => '536b996002b22632e757a82256e09417', + 'leave_32.png' => '171a1609e849b1836046e84cbd590bad', + 'links_16.png' => 'd3da622046d044d11ee0f4418eafc426', + 'links_32.png' => '41df266db1ae2cb292804acb1993e383', + 'logout_16.png' => '1344f00789bc5007f0219ee412bc59cc', + 'logout_32.png' => 'a97a480f681f58ef845d441fb3cb5eba', + 'mail_16.png' => '0ef7b53ee7a39baaba506f330f7ae161', + 'mail_32.png' => 'eb62361ca3d16865045a224fd8c74cf3', + 'main_16.png' => '7df71fa173411541ec291f858ac33c40', + 'main_32.png' => '1573eaa39de50801aa3e612ad99cd44c', + 'maintain_16.png' => '8914863c97d297e7952034ee35b9580d', + 'maintain_32.png' => '18c74535a7ecea3f53e05ff4ceb47c49', + 'menus_16.png' => '45889621dc7577c1b5ec6627d1260ecd', + 'menus_32.png' => '1df6ff20ba41d511667aeb95ec79b024', + 'meta_16.png' => 'd016ee58c8a4b3be2347e1e6a560f575', + 'meta_32.png' => 'cebc0933e6f32ebdcd174f1cd2c84175', + 'news_16.png' => 'bbc0eb1411a21d970b3f3c9855e516af', + 'news_32.png' => '5d7c3b72896f141b62dc256fa317db5d', + 'newsfeeds_16.png' => '861fa883c8f6068c7826805013d07373', + 'newsfeeds_32.png' => 'f0f57c5173167da962adb1517b2f98ff', + 'noinstall.png' => 'f89fe8f057694f93e4e163e4daf3de2e', + 'nopreview.png' => '49737d3c5a4ec9283374d6d0ad51d0f5', + 'notify_16.png' => '18ec179018401ce76acc5c1c06907844', + 'notify_32.png' => 'f766bf524380a6a38516cbd66ce9c5fb', + 'phpinfo_16.png' => '5948f2468a9c5103a70f0e6e1345335e', + 'phpinfo_32.png' => '2a7d8e07347e42d4e0b33e48bc7adffb', + 'plugins_16.png' => 'a6bac798e6dad7b2e40487e3dedf51ad', + 'plugins_32.png' => '74b17e491961633f65a2510e92ebde18', + 'plugmanager_16.png' => 'c9e73da3fd4c7599a95898def126e2da', + 'plugmanager_32.png' => '07f656ab0bae75a4dd83abdec439b4e5', + 'polls_16.png' => 'dfa11ad7ecf088f5bc50152e3c8318de', + 'polls_32.png' => '7c98815961fc0215e8bd38aef5e1c295', + 'prefs_16.png' => 'ee40f8fae0672844fe428863e7b9b28f', + 'prefs_32.png' => 'adcc28e37b40a339342bd1777c88efe3', + 'reviews_16.png' => '8d3eb23e13ea9c11108fe0e2959a0ced', + 'reviews_32.png' => '22750ab40ad6355053b9f6d88662f775', + 'search_16.png' => 'f1f617ae57346558eefce7d0b79b71c2', + 'search_32.png' => 'e0035406d30341e044c130ec0543a6c0', + 'stats_16.png' => 'f24d43706a08a9b56af5a32b63450ddb', + 'stats_32.png' => '403f0037feb233afd45899101b1a5630', + 'sub_forums_16.png' => '16a40908a7b37e8353c978ce3ecd1910', + 'sublink.png' => 'ccdbd8fa6d0d55ab04db69d55b4b85fc', + 'sublink_16.png' => '01e36bad2b292ae96fc802fc3a13d3b2', + 'themes_16.png' => 'dd5f28c2c4d15fae13310583371bde31', + 'themes_32.png' => '17c89daac72616669908555e43dfc127', + 'uninstalled.png' => '5b2f9aac0af8a3946a22e0ec066817eb', + 'up.png' => 'f023b6d5e7688dc3bdc0f42bbb8ba002', + 'upgrade.png' => 'd22e7b79c115c954255120aee1718277', + 'uploads_16.png' => '971a694016a861f18d746bbd2912be9d', + 'uploads_32.png' => '7a1d3f37f5f724f45fb2b9a8bace7582', + 'userclass_16.png' => '1ec9ff416999d28f737495e5de9a50a6', + 'userclass_32.png' => '7b017b1b700055243424f94aefeba3e4', + 'users_16.png' => '32441383ed5d50d6fa9188b98d957dde', + 'users_32.png' => 'a331baef28f6e923bad1a26ba5d17e4f', + 'welcome_16.png' => '997361b25db69ead1224a55f44ca7a41', + 'welcome_32.png' => '2bd4b95221a8d83bb03d9f488e9879b9', + ), + 'avatars' => + array ( + 'avatar_1.png' => 'afcfe041eed1d882cc4931d389a53f6b', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'banners' => + array ( + 'banner1.png' => '3d15e8b33ec2644f1c63e75b5878cd32', + 'banner2.png' => '1f7e31b2d7608c12d2f77612780846b7', + 'banner3.png' => 'e0d62559bab3b6634281900187fa548b', + ), + 'custom' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'emotes' => + array ( + 'default' => + array ( + 'alien.png' => '132447203b23b5ea2b27f163ae147375', + 'amazed.png' => '76ccc59194f25ef34164935d0ebdc81a', + 'angry.png' => '6339c6e824beaf63c72d01e7fc1c5039', + 'biglaugh.png' => 'd640e904627dec36da78083017e77e71', + 'cheesey.png' => 'c69f60044b7e243c1fefc24e2097c923', + 'confused.png' => '68af16e7f4d1031ea0976a73896d3dd2', + 'cry.png' => '75b3ff5af3f778c338a8e035005bfd96', + 'dead.png' => 'd1e3e9babb3aa762ec12444ab14b9029', + 'dodge.png' => '191aaaf658e90d1038fe56c3cf457f48', + 'frown.png' => '93e1b4df23ce2f4ea9f311c16b3feb78', + 'gah.png' => 'e86e47f9879750f6b65c4abf11c3b676', + 'grin.png' => 'a7ca30b7e3e2ff04324c5dc4b5a9f10b', + 'heart.png' => '6725f455e4bee2790a1e41409ea442fb', + 'idea.png' => 'bd3714d2834a24f37e44c75d8945aad6', + 'ill.png' => 'f19506e014a984c51d353e91ab407b63', + 'mad.png' => '728d6690e01f2e71609042976617ae31', + 'mistrust.png' => '3b6461df233511acb6b11cbcaf561675', + 'neutral.png' => 'cbedaeb373af5636babb772e867d53de', + 'question.png' => 'b90dd830b597832793e79b6cde609039', + 'rolleyes.png' => '79d5a5bb55e2bea788a1295ee8f3822a', + 'sad.png' => 'a9c921562b864bccc37d22661bed896a', + 'shades.png' => 'bc0d623f3569ab29cffcd59ceaf0c7ea', + 'shy.png' => 'f89a41079638cfbf785a59689b92b628', + 'smile.png' => '98412834fb8063733c819817150a6706', + 'special.png' => 'b54e4cddfb082fcf4104e44a71a9599f', + 'suprised.png' => 'c37ca48c0545b29439594f39e7a11964', + 'tongue.png' => '2ae4736fd035307f24332e603156e09a', + 'wink.png' => '5d4053942a4eb9fc6546b981b94fb9b6', + ), + ), + 'fileinspector' => + array ( + 'blank.png' => '36d4a4e95c2b83ac5aa338420d1c5bf9', + 'close.png' => '2955a752035c039435b4b0a8a37b3ee7', + 'contract.png' => '0fe7c9f9bcb9b3ab1b08d7e8e04c7a0e', + 'expand.png' => '265205998404f04e3e2341b5af839054', + 'file.png' => '853ef1ee108dbf52dc94a30b71e34e4e', + 'file_check.png' => '221397df4726589bb54824f6168d5484', + 'file_core.png' => '14659f2933ff4d012e0de7c1906a243a', + 'file_fail.png' => '354ee40218c997f8c91505b7f5921ff5', + 'file_missing.png' => '98ab830e6df162aef5bcc01f27d4703b', + 'file_old.png' => '594e132af5820c784354ea1f2266867f', + 'file_uncalc.png' => 'a64ad7faba8f6cc0cf223a5eb5edd52b', + 'file_unknown.png' => 'a8c3227bd1a34953f4cf399d8a3fca9d', + 'file_warning.png' => 'c89ce9c864175d152e68f52da184a50f', + 'fileinspector.png' => '7f7e61d6ed995277ce5fb60496d1a512', + 'folder.png' => 'ebc79586731bca95fc8325db909d3868', + 'folder_check.png' => 'eeb4f5128a415b4a967e419c88a31084', + 'folder_core.png' => '9b651167d978554d0e9fe8ac8d6014fd', + 'folder_fail.png' => '5c22933b877ca80494776f773122d179', + 'folder_missing.png' => '2795a36251fdb85980152557f235a44f', + 'folder_old.png' => '9a6a2a03b1bb4b93c0f24e3d9359e56c', + 'folder_old_dir.png' => '1bb0a25fa42a634a3d44c28e0af51723', + 'folder_root.png' => 'd6c388fcb5d70f133a1fe2275a40ea20', + 'folder_unknown.png' => '7332f53c115b6bc71972ae311cf030ef', + 'folder_up.png' => '7039e15ef64fd80a86a485a0ed59ee51', + 'folder_warning.png' => '06979aa4ae89a09acd2ef5c926566a97', + 'forward.png' => 'fdd333af9d6f6c75a15353d95b4870d2', + 'info.png' => '14a80e7098141b76d3a025a31cba972f', + 'integrity_fail.png' => '1b6843bcc78dd0f3919535f2c4f3131c', + 'integrity_pass.png' => '324a8f77bfbd3a84b1410cd35c9341ee', + 'warning.png' => 'df4fc8eca478c717b04b6414c94ae76e', + ), + 'filemanager' => + array ( + 'css.png' => '32ac2a0c288cf0aa36e38f4b5e6dc5b6', + 'def.png' => 'fb1d041d6a8676ca6b0e06774555fd01', + 'default.png' => '5930437a90ea872cf3bc52ddb8d960ef', + 'del.png' => '7ad01b059b7a69f526a0b382e5bf4387', + 'exe.png' => '5112337d61d7bda70bbecaa268ed1a73', + 'folder.png' => '106b81b7f1a2a088ac79ddd77fb2f151', + 'gif.png' => 'b863d1f9574232a6ea988fb7b8557854', + 'home.png' => 'cf548efa0e9e1ae3e22dd274a0d2d772', + 'htm.png' => 'de8b6e1e5f6730bb203d972b8ad85932', + 'jpg.png' => 'ca0dcf0c83d88c7c110070bf1019d1cf', + 'js.png' => 'd5ab294b6715368d746595b3f315819c', + 'link.png' => '23a41af7f24cca6ed09919efde7eb13e', + 'mp3.png' => 'f1686b1c368acb226332ed1f38feb256', + 'pdf.png' => '03d111bedff573dd436a0cb75de1e19f', + 'php.png' => 'f2d2759af9ddecc7b90ed8647db7a114', + 'png.png' => '2b8e0d0f947520dcb37568a3317a0d64', + 'txt.png' => '64e05312c122b017f6f2595e6df320c5', + 'updir.png' => '562f1cb1fe4038dc999db57786ad2f3c', + 'xml.png' => 'd8b2f286726d631b1a819cfd2c62e89e', + 'zip.png' => 'd4119fcc2b0b0080a1e98645c109e314', + ), + 'generic' => + array ( + 'bbcode' => + array ( + 'blockquote.png' => 'a06a9e6709453140681b7a97a7692870', + 'bold.png' => '3e23e2d8c5a4a2e7c1b750a5df9b03b8', + 'center.png' => '742d4eafd59c556ca747f6ae69aa04f8', + 'code.png' => '30583ffe0299705ee851a87dd7b8abe5', + 'emotes.png' => '64e692b505df9624ed2318c406eb5346', + 'flash.png' => '7a671f203fe9b582477ec0b1ebabdbc9', + 'fontcol.png' => 'd2175741c2e7e09aaaa134146636df67', + 'fontsize.png' => '89110496b363b669e3e8dffb630b9279', + 'image.png' => '1db77a12868512a36f836b986e6bb648', + 'italic.png' => 'a3e561a3c5d01819a3137562fd982958', + 'left.png' => 'bc27363615e096a000103c21984cd79f', + 'link.png' => '3adc8c31d1470a6cce76416fe0b6f3d7', + 'list.png' => '6bb4e650cad9857c47bb1433fd771052', + 'newpage.png' => 'ca132dbbb5c50e1486c02c3f0f9afe11', + 'prefile.png' => 'ab42c617455c9f05d5ea8534d607e4f9', + 'preimage.png' => '101b73c1584a2d14c4c313a15a66242e', + 'right.png' => '885e764546e87d2fd526b977aed84d1e', + 'shortcode.png' => '2c296e414c6e833bdcab2e3dda798061', + 'template.png' => '54281aba1f70c00dc1c947fd053fddfe', + 'underline.png' => '09d08b8f890c4ebba77ecb9f25f20705', + ), + 'dark' => + array ( + 'answer.png' => '211393b753f0c8aed1e9a24856195ce9', + 'arrow.png' => '998eb269289b90ad8d004bbcf39378c2', + 'download.png' => '7319b1158fefde24a4d87aab735e6333', + 'edit.png' => '418103beb48a1d430ef7e0804ba6607b', + 'email.png' => '7d37fab1f0904165a5f64408f7c455e9', + 'file.png' => '60fd70ce4acb78b454488c4ef9d99f4a', + 'image.png' => 'ed4e650087e42f815f5e086f021b9a9f', + 'new.png' => '96d33a15dfe1558805084225734cea60', + 'new_comments.png' => 'a4861dd50722e8d8b9b7f4cffa59ad3d', + 'newsedit.png' => 'fef524ec2422d5a35c422c57afda4f87', + 'nonew_comments.png' => '5e5332c02e5fd1863ea1e7b907124f89', + 'password.png' => '2703c1268bee5c1582919a6155ca634c', + 'printer.png' => '8c123d297261d687712d952ee30d6c4c', + 'question.png' => '790b246cd96a583ce2bb0b7e814172a6', + 'search_advanced.png' => '8cfb8fa25c792cbca4f4ff115f81ee08', + 'search_basic.png' => '9b3da3928a4e3ed317ad0dad431c93ad', + 'search_enhanced.png' => '6cff954f99c462eb9eb722554b7463d1', + 'sticky.png' => '25295751d78f9990a6635e6e2715fa43', + 'user_select.png' => '2431cdbcffa1b1d898b7e0ed8fd967e4', + ), + 'lite' => + array ( + 'answer.png' => 'eb63ab9d559dd785415ab5a783e93901', + 'arrow.png' => 'c56779c444bd61c1eeddb94fd8af3d61', + 'download.png' => 'f7cc87125001ff1ed99bf19887f7e6f3', + 'edit.png' => '726bada8e08555d38a6fa1a2b6655f8e', + 'email.png' => '14841d450ea66f22b82813f0468dae51', + 'file.png' => '734c8c413045129b92aac717daeab761', + 'image.png' => '10146c68a6f1acc36eae2cad602451d2', + 'new.png' => '28c7e4fb6b93a103c315c6930952cb13', + 'new_comments.png' => 'a4861dd50722e8d8b9b7f4cffa59ad3d', + 'newsedit.png' => '987e90984c9450e1dc1af89788d5ec0b', + 'nonew_comments.png' => '5e5332c02e5fd1863ea1e7b907124f89', + 'password.png' => '0c9ea13d60acd72b66ac44e2d12d432f', + 'printer.png' => '743fbcc77ab2017e6d02d6759585e0ca', + 'question.png' => 'c1ed6f4aa816112b7454eb6b2c2c15ba', + 'search_advanced.png' => '9d443b535924d4d840533f56def13e1b', + 'search_basic.png' => '4994d26dfb8a01d9dfdf0e594513db5f', + 'search_enhanced.png' => '9ad50bb193c4c53ceabfc74131901419', + 'sticky.png' => '23d10c4451b4f17d249f6eeb7b721cf6', + 'user_select.png' => '4ee12681a97e352b072dfa9d5dac808f', + ), + 'bar.png' => '278ca1b407bc68f138fa64f226700631', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'code_bg.gif' => '2b9dbcbb11a7b4fd46c3b4b25f419435', + 'code_bg.jpg' => 'd1693c7b554681efbd2e82ce04907eae', + 'code_bg.png' => '09bd8d9951b5d993bb4371836a9dae51', + 'cred.png' => '0e39907fdaf0dca630919b54ab01c9c1', + 'php-small-trans-light.gif' => 'f3cffe6d2a1a2fdd32c4d694e9cc989c', + 'poweredbymysql-88.png' => '850c2974bb9ff8fc41fb9cfdf244ce52', + 'valid-xhtml11.png' => '875ce84f7794284f50cafc7aab8b5a77', + 'valid-xhtml11_small.png' => '142b92a420fc7162912da3f96fdaa654', + 'vcss.png' => '780ad30f6a83c9dde3464ba9a4aeb664', + 'vcss_small.png' => 'ac93bad1a0a152c69bc0317b41b2ec63', + ), + 'icons' => + array ( + 'download_32.png' => '28d16188580b522e2e296ab985aa371d', + 'folder.png' => '20aa54f4fe9e4c3323d50089f0872a90', + 'folder_32.png' => '7d501e7392007bcf7458c8291eb0d4fe', + 'folderx.png' => 'e801994723571d22e198487431ec7573', + 'folderx_32.png' => '8ac80a5d0cd4a4a08bdabb7d050e272c', + 'html.png' => 'caa46c5b4aa1bf948a96dcb4c3c6611b', + 'icon1.png' => 'bdb55c0c08483b5a5f13bb602ffdfaf4', + 'icon10.png' => 'bef1f2d8866047851fd707f207c56908', + 'icon11.png' => '9dcfb98cf72b89dbbc7501d944ac1849', + 'icon12.png' => '1438dfa7e1f6082fe54f27969007b8cc', + 'icon13.png' => 'd5e20c025e0d4ac1a53adb995733fe9f', + 'icon14.png' => '8db20481620879f5ab538cca21323834', + 'icon15.png' => '63083b9dcc1cdeab206c36fa0f1982a1', + 'icon16.png' => '8195650382046743734b7fcfafcc27d5', + 'icon17.png' => '7256aa31268c39b5d47744199d7fb18b', + 'icon18.png' => 'e582b78688372dd7fff9851d1630b948', + 'icon19.png' => 'c9bc67c97ec8728f1b224599cb440c0b', + 'icon2.png' => '78fcc298d3b1153a29b95566d42a993f', + 'icon20.png' => 'f915bdcd951e94a263d4040fb760aed9', + 'icon21.png' => '0a26bcd73d38dc3acbf36399c66b3c94', + 'icon22.png' => '69b7fda0348fc416f98b8ef0c5eabe8c', + 'icon23.png' => 'f33c700ea73802ef02e6a4fc3262c074', + 'icon24.png' => '3c8bb8e3ed55fb42e81375d62ef4a88e', + 'icon25.png' => 'ffb34f77aa4a07a00618139204a860b7', + 'icon26.png' => 'bbc0eb1411a21d970b3f3c9855e516af', + 'icon3.png' => '8bd10c2043823acfc344a20ab3efee24', + 'icon4.png' => '66383ba925e4f488df0fe4704d362627', + 'icon5.png' => '83c34cfb4244dcca5fc42489aab98998', + 'icon6.png' => '03e04b50657db966ff6ae0fc8930d904', + 'icon7.png' => 'cdc8a8584b62f53498f4d90ecbffe7d1', + 'icon8.png' => '716b3b9833d4cb03a5594cd0111784f9', + 'icon9.png' => 'd0505cfb21a6d1c8cd6589c0a31e82cd', + ), + 'newspost_images' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'welcome.png' => 'dcd1a6d6463e28fc84994d56bb383060', + ), + 'rate' => + array ( + 'box' => + array ( + 'box1.png' => '89b6a1c3cf0178d55bb0c13a1f4bc70d', + 'box10.png' => 'eac820c7f66f66b1aad4bac8b0d42338', + 'box2.png' => '034686d522c6d907831f8272c9d2c35a', + 'box3.png' => '98481a017e09f720d6e725dd9a60f189', + 'box4.png' => 'f001913a928f9b5877e44b6d616d70a9', + 'box5.png' => '2a007464b58c49afd3f4b00aa9f6d6a0', + 'box6.png' => '7166324ef491fbc3ce7b20bc207c1699', + 'box7.png' => '35b7e46ffadd8e7b01beadba18fe1577', + 'box8.png' => '53be60725cc237466b537c9e47774473', + 'box9.png' => 'f9e1f9e5a88fec0569830d1bdbc1b5f3', + ), + 'dark' => + array ( + '1.png' => '069d68706d00652e2279a2370e1e1204', + '2.png' => '5d9e897ad6269159cae542557b1b088f', + '3.png' => 'b8225487772f15980bd8266a01c22cae', + '4.png' => '06197264693d06769207d56b83040cfd', + '5.png' => '9cb0b783db4ffccc38364a9aa6528381', + '6.png' => 'dc6b3fbb86581ca69175ba77cf1bd0a9', + '7.png' => 'ac5ea785f9d34fb2588cf24f5a3a3e60', + '8.png' => 'ed599a5204eaedc2c915f9bcdc609948', + '9.png' => '1035b9d5ff65916393620614057d1d79', + 'lev1.png' => '71860ab527620603bb1bd33083cd0c3f', + 'lev10.png' => '28fe7e15be0ad8e05cd4945e4c130967', + 'lev2.png' => '0c3cb7d2b6cd217d71a0bb2f5e255ed4', + 'lev3.png' => '5c1d9aba19a174ff40912534a52c6c8e', + 'lev4.png' => '7a7b0127d381e6128f1506c6d0ca7470', + 'lev5.png' => 'c52ea0fdaa597d4f5a2ab93981055b4d', + 'lev6.png' => '54fc1f5cdb88d2e6760cd44f58ae9a6f', + 'lev7.png' => '20e4472caa04d0db921de375c6a08b5c', + 'lev8.png' => '556266576a5d7bec39ccdc083e7b58ed', + 'lev9.png' => '99197d2afaa22ed2900cd9e231f7a37e', + 'star.png' => 'ca86f6b6a0dce04e3dbe14e2c9877e3b', + ), + 'lite' => + array ( + '1.png' => '6f7d1164a961cce68f45285a97e29a76', + '2.png' => '0bb0e1552ed71dacd2b824ebb195b8d6', + '3.png' => 'a39a7efccfef2e081383ce04cadb0b2a', + '4.png' => 'ec2547815e60e48d19fc278820155ffb', + '5.png' => 'c30ddc4ef328fc632e3a1d657e5383ac', + '6.png' => '1c33896015f47a12c8a64c29c133870b', + '7.png' => 'ab0d30021e8cc388eeac86356a92dece', + '8.png' => '882dabfb4a1accdb6a43f4f46762fee3', + '9.png' => '4e9592963cbcf80bd10cc980c99c71d4', + 'lev1.png' => '2b93a27bfa68a64c4f943fedc7a2db9b', + 'lev10.png' => '74736097ad258eda613888017ae1f886', + 'lev2.png' => '5289520ced54a12c5dde1919e9a5cd71', + 'lev3.png' => '71d9a412fac35ba7a396fb343d30c792', + 'lev4.png' => 'd7eef7456c608c89e65f2093e6fa4eae', + 'lev5.png' => '0ca73f9360c15138214d1660df733e0a', + 'lev6.png' => '3aec7910ecc2b6a518b67beada1e017c', + 'lev7.png' => '58c3f5c41b6214171b741bcb0fbf1823', + 'lev8.png' => 'e9b674e663de20e34520794598be3064', + 'lev9.png' => '4cb78772cfc2cbf653a3df8576552dec', + 'star.png' => 'b9f1804f1a08c3084ada5c034184a132', + ), + 'box.png' => '37e0a80e5782adee28a52e456d11ba07', + 'boxend.png' => 'e075b96122cb84dd7bb9d0ce8c789e84', + 'star.png' => '59876e874a49bec49ee4c867a5e52251', + ), + 'user_icons' => + array ( + 'realname_dark.png' => '495b61c3f719bc8bec44e1b25cc0b196', + 'realname_lite.png' => '9ca664d347f80793f016f61986ea3a38', + 'user_aim.png' => 'd54ddd04c02bcbb1dd6593ff5e8e2fa3', + 'user_birthday_dark.png' => '4acaaa85b357e0572759282ffe1922cf', + 'user_birthday_lite.png' => '14bbc908d5d6efefc6739d7806aa6bd4', + 'user_dark.png' => '85bc493bf67af508e5320a924b54cce2', + 'user_homepage.png' => 'bf0ee3d43c8ec5aa81d8425e51ef0f37', + 'user_icq.png' => 'eaa044e6d235a88c79ee2fd42d6e8a17', + 'user_lite.png' => '12b7c805c022708d57cf0d2ecd8b4a02', + 'user_location.png' => 'e2571843e8ce3df251f0a3fd5db53729', + 'user_msn.png' => '6aede4988c88b3e3829f1387cbf3914f', + 'user_realname_dark.png' => '495b61c3f719bc8bec44e1b25cc0b196', + 'user_realname_lite.png' => '9ca664d347f80793f016f61986ea3a38', + 'user_star_dark.png' => '899b215d9dccb0ff4ff38d7d1decf031', + 'user_star_lite.png' => '3c579e4f29bb42a413567f241cb3a2c2', + ), + 'adminlogo.png' => 'aac088a88a8c729f950c158fa875f1ce', + 'advanced.png' => '8e1db463c3cace7822b51ee311d208e4', + 'button.png' => '4388e88589f99a52a2cffe5f7e837548', + 'e107_icon_16.png' => 'd49ad6870dd304ce1b30b56be446ea07', + 'e107_icon_32.png' => '9fcedf8edb4728a97001fd5cc9616ef8', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'logo.png' => '22bd0af2fc2849c900ebec1ea80bc8e3', + 'logo_template.png' => '78e43c6f2492f1c5bcb5b4d223ebfc75', + 'logo_template_large.png' => 'cce83a8f84255d2bab00522b73a4e6d4', + 'pcmag.png' => 'abe521ccc3a89a43ff641ab3daf1f37d', + 'splash.jpg' => '7f749391cb6d31dcf9c9145f3d30df4d', + 'thumb.php' => 'd606e6c43e39f27bcf9f7622e32365eb', + ), + $coredir['languages'] => + array ( + 'English' => + array ( + 'admin' => + array ( + 'help' => + array ( + 'administrator.php' => 'bfc3305d4af30024ef36e2c3cac685d5', + 'article.php' => '3c7df3956134df9dfc86a4a67b73d78b', + 'banlist.php' => '589e0268a08606ff935ee928292602c7', + 'cache.php' => 'f889aa4a1889a3112699c899eb655744', + 'chatbox.php' => 'd5aede1254e7e48e3e8733f18f6ec0ce', + 'content.php' => 'dcf60ff22635488c42b4a99243bdf9f2', + 'cpage.php' => '66e658a3daca00f9fe6d9bb1e5016eef', + 'custommenu.php' => 'bc2d5fff1395d8495a45b80da77b7665', + 'db.php' => '56210313eb216b42cedde3f548461f70', + 'download.php' => 'dcfce12aec25465d48762456414ca9db', + 'emoticon.php' => '44293ed224e20f90dc81554c1064842a', + 'fileinspector.php' => 'b2ad72e245b79f582ee54c9ed1b7319b', + 'filemanager.php' => '62e147fa032aa065b11a139d3d53a241', + 'forum.php' => '161249fcb72351dee1b5b56fda1a15be', + 'frontpage.php' => '44e0a1156408e6ccffed96f35a516d04', + 'image.php' => '11a6e5190f22d4c3586b440a15203fdb', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'language.php' => '514346599719d0abc2f0a947945c77c8', + 'link_category.php' => '5352ce360022a7fc0882fb77603405cb', + 'links.php' => 'c9c06673b3d7089ac9a729e1601b82c4', + 'list_menu_conf.php' => '88bd581ba21987493206e430885cd3f0', + 'mailout.php' => '5050871042ba40b90e0dac92c29dab0b', + 'menus.php' => '9b2d9d2e0610b55965d9b49ecd7a91c1', + 'menus2.php' => '2249f7d8b325af8945ed1a5a3e9721e2', + 'meta.php' => '6c85ff99c2707a2d6e73ac990971ba83', + 'news_category.php' => '0c0bfcbb20aea2de7508c5cc3c4826f9', + 'newsfeed.php' => '93f7ef1481d3fc59ecde4d40ad6b6c84', + 'newspost.php' => '13fda1563ee88b65ebd855113ec7caef', + 'notify.php' => '96e76c0244bf06754516ced2bbb6a760', + 'phpinfo.php' => '201f61e8c6ba0619083a30143af56625', + 'poll.php' => '3adef894abf1c1920a311899071ff8ee', + 'prefs.php' => '4cc47a077677b93cdede1ca55e3b354f', + 'review.php' => '6997e7c8d919246f698837c0ba3693b3', + 'search.php' => 'e9b596e5e8855fe87e8905cf0dc9a6bd', + 'theme.php' => '7ac282adfbb1f04fc10a6aa07c11e7bf', + 'ugflag.php' => '3c686a412439317be96965a4f31bb720', + 'updateadmin.php' => '60b51ca80381001703f4af931236cbc2', + 'upload.php' => '38d7510182a2e393cd1a09b924c95df1', + 'userclass2.php' => 'b1e5e797e72b5015dd9a7b39ad7dff22', + 'users.php' => '135781d3419791aa07e7fb8988a733fb', + 'users_extended.php' => 'b73f20ff4c7d9f9b9eae883b300b2426', + 'wmessage.php' => '5aa5f420a6b29adad555ef7e55bd932f', + ), + 'lan_admin.php' => 'ae4bbdef3610765b59d67e2858707177', + 'lan_admin_log.php' => '0f9dacdf93cb2d6a4145487de304cb87', + 'lan_administrator.php' => '83b1eaead32e6c500d42a74c40b059a5', + 'lan_banlist.php' => '4b00aa5ed58a9f78ad1cbefb74dedb33', + 'lan_banner.php' => '11d2439138f74b116de4697e066f7ca5', + 'lan_cache.php' => '0926abdc99274d71157280c9d58749e0', + 'lan_cpage.php' => 'c95be0bafa672c32d75394f94bb3af02', + 'lan_credits.php' => 'aae0c491eb54b8c529013691755044a1', + 'lan_db.php' => 'c68b85a8b0c9817d3b996a5eac953b7f', + 'lan_db_verify.php' => '6c6067d3b23c7c0d9f36cb17867dc80a', + 'lan_docs.php' => '9df02b4a6fafef4e9be2962bfeaed509', + 'lan_download.php' => '5b3e7f94055a824fbdecd45bdd67afe6', + 'lan_e107_update.php' => '46f96e33e39b17c2ba54ef3011082041', + 'lan_emoticon.php' => '58e2c1f2752eff0f4ec7e1e0c126e3b8', + 'lan_fileinspector.php' => '70c6b39a6d29f3c77df604e2293d43b5', + 'lan_filemanager.php' => '8955a0b3b7730d3f008957108525ccb8', + 'lan_fla.php' => 'a987a7502238c9f1dae9555d944ebd38', + 'lan_footer.php' => '74880a9ba3fbe4524bc2f0987e936ab6', + 'lan_frontpage.php' => '37ec01b89e67032f33498cb43e44bdc9', + 'lan_header.php' => '2a339d027e92c0d53501986fcfd71a0f', + 'lan_image.php' => '573f928e8753db0df958df0cbdedc07c', + 'lan_lancheck.php' => '7615ba9c34ea6b3b5867d27e834acb54', + 'lan_language.php' => 'fdc99671777e203514aae7f52939d561', + 'lan_links.php' => '07972ca8826ee35f36ef825ff793a991', + 'lan_mailout.php' => 'bf59b50787dae47c9db0603ba86e169d', + 'lan_menus.php' => 'aff6368b11b30bea0515de7cbad89dde', + 'lan_message.php' => 'bcfd03068e0ee9d76eb1a3df969bb544', + 'lan_meta.php' => '31801b3e9c137a3b22d58e5d80d291c8', + 'lan_modcomment.php' => '7f8738c7c0b3ab882f4b9c330136b6b3', + 'lan_newspost.php' => '0868c7b3d37352144cf2d424d97e8670', + 'lan_notify.php' => '65a1a5a108c74ba8b2db5592c06a1ecd', + 'lan_plugin.php' => '29ced1cfb16745f64bbbce037b8d74ba', + 'lan_prefs.php' => '08bc01aee9d766842262e2a158c31010', + 'lan_search.php' => '039a04acb5ab8b3ef5b617e1c1fcf7bc', + 'lan_theme.php' => '20dab981133d2106e89afe3f14169166', + 'lan_ugflag.php' => '29f0ad8c752be1bf98cc067534994711', + 'lan_updateadmin.php' => 'ae3d2be7d92db3c4dd11f1e73fafeb7b', + 'lan_upload.php' => '5a01a0c1676c4b21551ce427866edfe7', + 'lan_userclass.php' => '3eedcbd961e57434d6c64f9321fddb59', + 'lan_userclass2.php' => 'e475c31e99b4867d9517705b584f5a44', + 'lan_userinfo.php' => '241d3c717696a30d97152aec8f5fcdf2', + 'lan_users.php' => 'cc6c5b0856d4fb77f6c9cd1f31005e8c', + 'lan_users_extended.php' => '9ae08fd0f346cf0319dc935c992f1036', + 'lan_wmessage.php' => '27b96105500cdfa56bc27e391a0c2f3b', + ), + 'English.php' => '92d7499a17a92e1c3259e5ed3dc61444', + 'lan_banner.php' => '92308af6029553992ebc4a46e97d4e1d', + 'lan_comment.php' => '19332dfe1a3261c78e7e67dfdf984017', + 'lan_contact.php' => 'f6ec02eb9a5effc567f8483071105e66', + 'lan_date.php' => 'af33dd14b696babe19fd09e386c200c5', + 'lan_download.php' => 'a66ac115b0016fda2c45091353e59890', + 'lan_email.php' => '797f6f5e516475e8202fc171997ebdf1', + 'lan_equery_secure.php' => '90ce9b58fa3ee0bc424dc9eab0a9b92e', + 'lan_error.php' => 'e63c154a52b72318443b0044d48ef9dd', + 'lan_fpw.php' => '85470fb3dad6d9f765fe366f49e045eb', + 'lan_installer.php' => '81560fd3264c885295b060968a6d0570', + 'lan_links.php' => 'c309a9bc93d06a914bdc735efc9190cb', + 'lan_login.php' => '3bf7ecb7c00be86b54c83370fab6f8c6', + 'lan_mail_handler.php' => '001b336311279c058df01c2ae04aa87d', + 'lan_membersonly.php' => '102bba47b482668bb433a5a607767bae', + 'lan_news.php' => 'c3d990cb42ba5d40c6eaf915f6122448', + 'lan_newspost.php' => '03cca3bd4c3553accde4fe1b2bb9856a', + 'lan_notify.php' => 'f930fc0c3afd1516e3b63f63f6f51e16', + 'lan_np.php' => '3d6c87e7ffeaa79de1ba06da0175f367', + 'lan_online.php' => 'cf15db263203fc5cca674ac1e03923bd', + 'lan_page.php' => '3c9c8e02259f7833670d198d02ab0a94', + 'lan_parser_functions.php' => '54fe2858faa02517a93c293ce176571e', + 'lan_prefs.php' => '0520bc45182553a3f44b88c51b5377f7', + 'lan_print.php' => '8a3e985622e8dfcc82487b0165c2bf3a', + 'lan_rate.php' => '02191b8a77011476d4e3e554387c01d5', + 'lan_ren_help.php' => '1ca40febf5f376f3dd7190f46cd26f02', + 'lan_search.php' => '01bed4f43957214885351de0d18e0e5c', + 'lan_signup.php' => 'bba7802c9f6fa2a5d6c3a179e7b88fec', + 'lan_sitedown.php' => '65c55fc812ceff72c4aba3f56dbaf4cc', + 'lan_sitelinks.php' => 'ca292ed1c514df28d693b3e8cdc6baec', + 'lan_submitnews.php' => 'ca6c4a8e2828f6317e56a8e4bff34d2a', + 'lan_top.php' => 'eaf2c17d7c6e40e4e660e9a6dea851a1', + 'lan_upload.php' => '52254da910f370cf89a14c080516e7fb', + 'lan_upload_handler.php' => 'f61e83d33b48733bbf58c4189103b0bc', + 'lan_user.php' => '992526de41f3848bcbcfb1134449522d', + 'lan_user_extended.php' => '890b9ce3e1cebdc59d098a3465f7d151', + 'lan_user_select.php' => '5632220cb249c60e812c3592f086039c', + 'lan_userclass.php' => 'be226be048b076da4873e6d23b9b6b77', + 'lan_userposts.php' => '976fa5108d96acf116bbd177d9b0f38a', + 'lan_usersettings.php' => '76e37338a24462d18e3d405d70351913', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + $coredir['plugins'] => + array ( + 'admin_menu' => + array ( + 'admin_menu.php' => '12f13f429b068399d2aad7270c07a5c9', + ), + 'alt_auth' => + array ( + 'images' => + array ( + 'icon_ldap.png' => 'a04116417bb033cbb747627677ba44e3', + ), + 'languages' => + array ( + 'English' => + array ( + 'lan_alt_auth_conf.php' => '012604e8400b5dfce4a4d95086152ac2', + 'lan_ldap_auth.php' => '1fec91ecfe7419204ef65af051a249bd', + 'lan_otherdb_auth.php' => '11309b4fe52763d7d28f94df64001016', + ), + ), + 'alt_auth_adminmenu.php' => '3dddfee80a662a804a06d833ad9d2670', + 'alt_auth_conf.php' => '1aedac47a6220c61425f89a96fc766b0', + 'alt_auth_login_class.php' => '0d10f8eab79b15e28effa341aa6b6cea', + 'alt_auth_readme.txt' => '75b056df0169fa9a03bb31633d7fcbdb', + 'alt_login_class.php' => '343de18d3ab651476e092c72d484ae41', + 'ldap_auth.php' => '4d740c0d4ba51a7a8437df5fd6de3b85', + 'ldap_conf.php' => '32f0718c8d2a6aa7f8d7b378ac0f371a', + 'otherdb_auth.php' => '868524702a10c3046d7822b463f82477', + 'otherdb_conf.php' => '7871556c81544d7373f2adb7e49414f5', + 'plugin.php' => '918fb0e07512efb82b6cecb01c566ba3', + ), + 'alt_news' => + array ( + 'alt_news.php' => '67c4b14229bbb94f1ded6214e89216f1', + ), + 'banner_menu' => + array ( + 'languages' => + array ( + 'English.php' => '34df03d8f502238bd6f3c8102f1fc399', + ), + 'banner_menu.php' => 'ba985aea9cf61edb441b9f2e73ad45cf', + 'config.php' => '91398fb8db5e565e0659790796de8860', + ), + 'blogcalendar_menu' => + array ( + 'languages' => + array ( + 'English.php' => 'bc4d844c9b0b8bb553913eb462542620', + ), + 'archive.php' => '8fbd24eafa2349e682fffcbcdfbddbc1', + 'blogcalendar_menu.php' => '512b4589bee3e51d54dffa57dd2347a0', + 'calendar.php' => '4c05e65f098d38d7ed84783a479d999e', + 'config.php' => '8bf4ecf1ebf7b0a2628081ebdee358bb', + 'functions.php' => 'f2cf77b89db87b5ac5d2a3935fd4ac59', + 'styles.php' => '44147a6b0a19c0228b6639ece5d79733', + ), + 'calendar_menu' => + array ( + 'images' => + array ( + 'b1.png' => 'de9174823c3ec762027752d1c8ca2787', + 'b10.png' => 'e92aab589b5a33207640e533b6e5a68c', + 'b11.png' => '45a15a73b00f46799b4a456ceb1d7cb7', + 'b12.png' => '16ceea91edba926971991f86ff99204d', + 'b13.png' => 'a737e352f69c566e88326015627f77f6', + 'b14.png' => '5c74299db8f6e92e004b4aacfac7b910', + 'b15.png' => '492bed712e09f7d95ea0d8593d4b373a', + 'b16.png' => '5010d685380c5ecaf6d2941ac66e3648', + 'b2.png' => '88d88374398613838909f9bea531c0d7', + 'b3.png' => '68c92cd6c067ad930a05ab0262ee4a89', + 'b4.png' => 'eabb1d49b67487e9b6502d3f22ee54eb', + 'b5.png' => 'e297c23ad9a7d7a3f3fe34b5f08d2eeb', + 'b6.png' => '894d38230672afa9765fff0afed8c2f9', + 'b7.png' => '6aaafba2e9218606e573766a1b79e065', + 'b8.png' => '2e7439fea8b0d6de515710fd0e894fb8', + 'b9.png' => '56b3452cfe1d6a898ff17bd446cce73e', + 'cal1.png' => 'c9a93d59ed67e69075f686563ddde806', + 'cal2.png' => '80178ae70f6089d2933cf2323f7fed2e', + 'cal3.png' => '3370f9cf32cc5683e07c2bc919d151e4', + 'calendar_16.png' => 'ace8396ac74a5909b38a62835e76d9f9', + 'calendar_32.png' => 'ee297b07e04c5d54afcfd124987c7d9f', + 'icon_ec.png' => 'de31be991ae1102420a3bc76e3317045', + 'star1.png' => '22cebabc9731207092fe2242c8922ef5', + 'star2.png' => 'b50d4638fe170e7766ad473aa4039701', + 'star3.png' => '8c04fb886a6d4f6d4ab505660186d160', + 'star4.png' => '3645c9f38bab928554feff707d6a130a', + 'star5.png' => 'c6289a1dd7d998ee799228b34af10e70', + 'star6.png' => 'a65f3fa346ad5888f15d2d2d5c5977d8', + 'star7.png' => 'be1cedf7be3f740c5a3cd92b3220badf', + 'star8.png' => '575da0a997de16c305cdfd9e0433b09e', + ), + 'languages' => + array ( + 'English.php' => '158355ab3a26f8c709126af50bbd4000', + 'English_search.php' => 'fc1f68851e4c41b94e1bf1fcf9c25e10', + ), + 'log' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'search' => + array ( + 'search_parser.php' => '05b18b0087a2816766543bce7da0b5b1', + ), + 'admin_config.php' => '1c338819605771130c4becf79f05cf06', + 'calendar.php' => 'cd96dede903591eb4e609ae9b1aea129', + 'calendar_menu.php' => '1cef409ba6b91f87b2c7361b9f3f5d7e', + 'calendar_shortcodes.php' => '902d42e033e1d4ea3d1424be96f249d7', + 'calendar_sql.php' => '39899457df794d8b56c58d3b1c8db88e', + 'calendar_template.php' => 'd852ceef7f6c8c10c5b10db571e16ccb', + 'e_list.php' => 'bc86836aabe7f01b4285d512a3079e9e', + 'e_notify.php' => '4c206cee17bed1c6b02f66fe202252f5', + 'e_rss.php' => '077b415bf70aaae7b8de3d55a5912632', + 'e_search.php' => 'a1681c6fed9972dd140b72b3ebfbd3c8', + 'ecal_class.php' => '8aca3973a9722d4e29aabcf54b488c99', + 'event.php' => '5edb018949600600fe3769e6507f4704', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'next_event_menu.php' => '6d1819f703dc045efa0fd1a4041e6545', + 'plugin.php' => '7e5ed3e5d637ff6239c0e7ed8ec84e35', + 'readme.pdf' => 'bde9420355a7306b71df8c5143575347', + 'subs_menu.php' => '816619639ab421ff3229f6536bb33416', + 'subscribe.php' => 'a7e9baffa5250f183edcc3449a0b0bfa', + ), + 'chatbox_menu' => + array ( + 'images' => + array ( + 'blocked.png' => 'd2b20874ccf7079dbb71b6c94e117d21', + 'chatbox_16.png' => '6524280b8f44bde11dd5ca5581432c14', + 'chatbox_32.png' => '2e6ae5a5be12ec8d09b5083e959347b9', + ), + 'languages' => + array ( + 'English' => + array ( + 'English.php' => 'f7161fde06c16b7a4c08311f6d6c1f98', + 'English_config.php' => '9adc5ef167b75da9ea343a3f0b1e07a7', + 'lan_chatbox_search.php' => 'cfe3e4e7191917199b79c85ae8b9f018', + ), + ), + 'search' => + array ( + 'search_advanced.php' => 'b7a8eab8e5969256ab578277c92d3c47', + 'search_parser.php' => 'c576ea7d07ce91c106c3bae38912237c', + ), + 'admin_chatbox.php' => '75780140254afd39349fe286a5c72669', + 'chat.php' => '860bf5dbfc5f861df1f74f0c944e6957', + 'chat_template.php' => 'cf97b7663cd4177f9c7ac299318ef8e5', + 'chatbox_menu.php' => '350f84c6d36f7ba4b8ac6e7edf3d3280', + 'chatbox_sql.php' => 'aeb0d501ff23212e304f7f9a83d6926d', + 'e_list.php' => '11fde3fe8b58bec52bc6220053498509', + 'e_notify.php' => '379fbef832829bc4e9188b9fed62f31f', + 'e_rss.php' => 'e48224955d484055c9c662f430d529ae', + 'e_search.php' => '172e48694433f84b0f8d43ffb880e881', + 'e_status.php' => 'd5fbab54f8fcb5ec5eaa42c1b328cf6a', + 'plugin.php' => 'e5cdb4f2a42dc00b08d06b33dea455ed', + ), + 'clock_menu' => + array ( + 'languages' => + array ( + 'admin' => + array ( + 'English.php' => 'bb111f81956918d1a7e7875a032e521f', + ), + 'English.php' => 'a6414a6871116b964cc12d77d72b2748', + ), + 'clock.js' => '576433d4e5242c567e6c6d0d97b7ca73', + 'clock_menu.php' => 'e0d33629ca46324479cf344eb2bdbdd8', + 'config.php' => 'b5c6e83c7f9141ade22165ed62ed1884', + ), + 'comment_menu' => + array ( + 'languages' => + array ( + 'English.php' => '10c5f9fd588de9eaa9bf96b42b11b535', + ), + 'comment_menu.php' => 'd3991926641aecf015f1acd6a3baeda6', + 'comment_menu_shortcodes.php' => '4c212b7efffa496ec8b5280528d46259', + 'comment_menu_template.php' => '17f0cb0b44f43d0cf62770f2b7cb4526', + 'config.php' => 'd8e5bd9258392c98d02009d552401aa4', + ), + 'compliance_menu' => + array ( + 'images' => + array ( + 'valid-xhtml11.png' => 'dc71b96214e7b1d1df0db38575f42313', + 'vcss.png' => 'adcc065d9d9ce649cba7c03f58f3eed8', + ), + 'languages' => + array ( + 'English.php' => 'fa122fc7d21d653f3bea9f1a790cb173', + ), + 'compliance_menu.php' => '4d0b73ff1df3ee7003286d61ad443478', + ), + 'content' => + array ( + 'handlers' => + array ( + 'content_class.php' => '596da39e8137e9a92c93425abc2623c4', + 'content_convert_class.php' => '2e05d94418f8960eaac431741ce402a1', + 'content_db_class.php' => '1029aa4c0652a3d846592b4494c8e7a4', + 'content_defines.php' => '784711a6c68dc17c7752fb084400229c', + 'content_form_class.php' => '64e3e202792d28b837e2a86fc953fde6', + 'content_preset.php' => 'd3bccd4ed8b20426222fadbeb6063cba', + ), + 'images' => + array ( + 'cat' => + array ( + 16 => + array ( + 'help.png' => '2e809fd98f717d0cf39cf1106783984f', + 'ledblue.png' => 'ef03ae552afbfb83a6fa7904e32858ec', + 'ledgreen.png' => '9fbd1469e20d4d18c42a67b8ba161b1f', + 'ledlightblue.png' => 'fb788d9f8fcf0db66b7af5d88d0e9dd1', + 'ledlightgreen.png' => '2469623cdc8957e372a3bcc0c495a438', + 'ledorange.png' => '35a155381c22a4b41deccab43d72e3e3', + 'ledpurple.png' => '870e78863fec7bcdf54f298df354708e', + 'ledred.png' => 'a78b6edef88f45df366721425604da25', + 'ledyellow.png' => '88b84ff109f92be3ab7771483902be26', + 'messagebox_info.png' => 'b2fe3cfcbe243aebcb7c933a6937596d', + ), + 48 => + array ( + 'help.png' => 'b5ca621ba2f7f8456b347bc52f42c37e', + 'ledblue.png' => 'fd023701c69e6d1eaa4ed552f213190c', + 'ledgreen.png' => 'ec1034e5bc3164b221346b3c74b0059e', + 'ledlightblue.png' => '4d1c8ed166533c3acbec721421be3400', + 'ledlightgreen.png' => 'b634d062505badfbef4c2975ca343461', + 'ledorange.png' => '6d8f2e413a621feca1f30ff286023b91', + 'ledpurple.png' => '411a1f3315c4875a391d2b405e7a987f', + 'ledred.png' => 'da8b898d4d4294b4a11a038aee027a7f', + 'ledyellow.png' => '6d0bfa866c30e0afaa599807cbd802a3', + 'messagebox_info.png' => '4b8fdb10f2fd9d65d7f09bfe16c432a8', + ), + ), + 'file' => + array ( + 'tmp' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'icon' => + array ( + 'tmp' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'blank.gif' => 'e3b9998dfa86c3849180ac8349da3f76', + ), + 'image' => + array ( + 'tmp' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'content_16.png' => '2d99036d870389c45c140370ec296050', + 'content_32.png' => 'dbcdcd9f704906b9f3e1b48394abd545', + 'error_16.png' => 'e7eff95804de0967e46c89361bd97604', + 'file_16.png' => '73d6e8b60327c61034be10adb2325771', + 'manager_16.png' => '358cedfcdc6ef1f44657050dd5892fac', + 'manager_48.png' => '3fd9a284f7d0d446ab430ccd4ef550dd', + 'ok_16.png' => '2a65610ea93831bfb0ad07e77fd2e488', + 'personal.png' => 'd1e39d963741e12edb0ed6261d72ace4', + 'score.png' => 'c368fe32f78a4ce09298b0c94f5fa89e', + 'score_empty.png' => '9cd759fdab39278d2fa4242c15d88871', + 'score_end.png' => 'e075b96122cb84dd7bb9d0ce8c789e84', + 'submit_16.png' => '90ec380e9ae114719e11f1332a89eefb', + 'submit_32.png' => 'df3dd61d416b00c26d3cbcdf02e862b4', + 'view_remove.png' => '084a9efcb11ca37426fbdae4fbeb0875', + 'warning_16.png' => '10b4bdba8f5f7d7598822219123e7792', + 'window_new.png' => '2bbce24fe15c0144cd225856ee0a990f', + ), + 'languages' => + array ( + 'English' => + array ( + 'lan_content.php' => '45d9ccc1d7a7d16b0332d5a0049bb836', + 'lan_content_admin.php' => '856dfef2e8887b83040ccbb5b33f088a', + 'lan_content_frontpage.php' => '1593838cd7ec925d50576a815bd3c9ee', + 'lan_content_help.php' => 'd7cea6d1b8db2650fce4962ddfcd295d', + 'lan_content_search.php' => '2b479bcefdb3b45f19c93ea5ae6bd221', + ), + ), + 'menus' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'search' => + array ( + 'search_advanced.php' => 'c6c6ae35cd1020d27a861ac693347560', + 'search_comments.php' => '34b14edbe1d2e8fbac541dc03262b21d', + 'search_parser.php' => '279e6a587720b6686f7f71d847f54f35', + ), + 'templates' => + array ( + 'default' => + array ( + 'content_archive_template.php' => '62bb9c57b8d97b412d589cac9bf201e1', + 'content_author_template.php' => '2f6f195b33d930334ae20cc60b8ebbcd', + 'content_cat_template.php' => '5470141c7a45562e154813450ce2c5c6', + 'content_content_template.php' => 'bc29f18104b597287e028b812651461c', + 'content_content_template_bigtext.php' => '66fa5e0429ce2b3c1e1a74a1a01fdc25', + 'content_content_template_blackonwhite.php' => 'd0d7f73a3c1e269f10980879156dcdd2', + 'content_content_template_whiteonblack.php' => '7200173ea254fde9a8e9dc33f030c791', + 'content_np_template.php' => '2ad6c3c80a4fd2e14de8d2c8ba75fb9f', + 'content_recent_template.php' => 'ed27692b0ab66df27fead9bc5015dde7', + 'content_score_template.php' => '4272ddd2bfeb3698a88876411eab716c', + 'content_search_template.php' => '30e7bf5ba4a25ab6f1eca9b522e75597', + 'content_searchresult_template.php' => 'ea466f98d73a18d1e727fb3b4708a678', + 'content_top_template.php' => '662e5228f88cb2486ca305da0828e617', + ), + 'content_manager_template.php' => '6ab7ef97e7f4312f64766097aa9f0fc1', + 'content_submit_type_template.php' => '7b02354f168c4584ddd25ae8cca95977', + 'content_type_template.php' => '09a3aaa479ecd0a50055998fc18b7110', + ), + 'admin_content_config.php' => 'eadd444a88a1942065596ec5d710abde', + 'content.js' => 'd41d8cd98f00b204e9800998ecf8427e', + 'content.php' => 'f714bcd07b21c334ecbc143c6361d17e', + 'content_manager.php' => '2ca76d9420ea8c40d91fa410f099e19b', + 'content_shortcodes.php' => '6eec7325d2ccaabafa89f0f76ac91a78', + 'content_sql.php' => '2632a603dd04ed62bbb3f011d3c5de41', + 'content_submit.php' => '00b3c60d1ef87219af86ab253dc732d4', + 'content_update.php' => '3820d50a8de13fe523bc58e949229e67', + 'content_update_check.php' => '83b6aa48eb79b70555f5d2d578baa07d', + 'e_comment.php' => 'e5a8abcc72deaf2fe9c0a8b5eb4887ea', + 'e_emailprint.php' => '48572a480656347a64798b024168a7f1', + 'e_frontpage.php' => '4fee2ac77b9c66c1d5b760b95e6ea255', + 'e_latest.php' => 'a2ddba2f8b0e67309960926086a0c985', + 'e_list.php' => '07f0e1369439b9927ac11d48b6deeb06', + 'e_meta.php' => 'cbb645eebdedb216511c413fe64991a8', + 'e_notify.php' => '71dceb8ed800b8aa97dbc7a79628a8a5', + 'e_rss.php' => '76954b881d598f26ecaebb4422f87696', + 'e_search.php' => 'd86c2f562c466bd7200974bd16f07c45', + 'e_status.php' => 'e327fef8f0ea1ad19fe9579b4f2ebe91', + 'help.php' => '950985bb6c445147d901bb4fb00b0f1d', + 'plugin.php' => 'cfb9004ff38e24cb87370ceb9017867f', + ), + 'counter_menu' => + array ( + 'languages' => + array ( + 'English.php' => '33ae994d0cd2b96deadf8d398d5d25d0', + ), + 'counter_menu.php' => '6d5e959504ca9a579f776610c8b258c5', + ), + 'featurebox' => + array ( + 'images' => + array ( + 'featurebox_16.png' => '74eae49d9d53afb825bc21ac95be07b3', + 'featurebox_32.png' => '9a498cd16e91c5cec29dfac61dc07199', + ), + 'languages' => + array ( + 'English.php' => '9fa4e9a659ccde7db2cc65e81ad6694d', + ), + 'templates' => + array ( + 'centered.php' => '39693534a9eb1b5e00d263fb22b4ded3', + 'default.php' => '4ae642d4bfc6b53350d75197182330f7', + ), + 'admin_config.php' => '61506bca5d21856190eb627f4b603975', + 'e_rss.php' => 'e3b277cca6f5262dcee948434aacfc5e', + 'featurebox.php' => '196e5d4286ac7b19cfa34e66ec382979', + 'plugin.php' => '39f2a1375fe640e6cda8347ff7ab8de3', + ), + 'forum' => + array ( + 'images' => + array ( + 'dark' => + array ( + 'English_admin.png' => '5fed0ae458f2100bfed0ffc655d1c1ce', + 'English_main_admin.png' => '1b3ec206bc4a6daabc970c231e148f16', + 'English_moderator.png' => '99b9bbef0e3440071ff394422819ea69', + 'English_newthread.png' => '64283f117398e1709a6aca23eba96c5c', + 'English_reply.png' => '6a07036cf75d4acf1e4126371998baf8', + 'admin.png' => '5fed0ae458f2100bfed0ffc655d1c1ce', + 'admin_block.png' => '53b924444c2bb9e082d47429244a375a', + 'admin_delete.png' => '21c3e43917c10a029527d768ba059951', + 'admin_edit.png' => 'ffe67f5626fbc4fe90d4d7e70e3df9ca', + 'admin_lock.png' => 'fe74ea0725e050cc1522f8c80d509dbd', + 'admin_move.png' => '7d3010809006f8bd0b52b89d507ee781', + 'admin_stick.png' => '7dea7baacf217c6f307a9a0a08fa27f4', + 'admin_unlock.png' => '535939916663b4d3e59fd744ded21481', + 'admin_unstick.png' => '87f050e6fe15dab0445cfefc47be2ddb', + 'aim.png' => 'ef7a16b7871c7b353a06186d3e0dce6b', + 'announce.png' => '86b85187f8e268e08f09b17ef17f1c8e', + 'announce_small.png' => '4306e6cbc173ecc3864b284e4731ca4f', + 'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc', + 'closed.png' => 'baeb3dcbb714f52d5f8007548ba487e9', + 'closed_small.png' => '6c541b1147791a28e78674a483f681d8', + 'delete.png' => '895db8d980f9378df51649443a5bdfc6', + 'e.png' => '5bb5064aaa81d5554ed6f653bf51cef7', + 'edit.png' => '0788c55ce19665d809c4a87a9d32d141', + 'email.png' => 'b17fa6548c6a8ef38ac9fc1691f73eff', + 'icq.png' => '6bc6f030b47ff1ee2de0913e71552681', + 'main_admin.png' => '1b3ec206bc4a6daabc970c231e148f16', + 'moderator.png' => '99b9bbef0e3440071ff394422819ea69', + 'msn.png' => 'cbf3f20c6baa59d7aae61bbc12bd9414', + 'new.png' => '14ec3ad326cf9efc5db59d08f6168ece', + 'new_popular.png' => 'e08fb87d0916010b1ea87e22193c26d8', + 'new_popular_small.png' => '0bb045dd66fa71755f87914d3daa3aa8', + 'new_small.png' => '893f53029a2c01d0ba9d5bad65c2c7dd', + 'newthread.png' => '64283f117398e1709a6aca23eba96c5c', + 'nonew.png' => '4e4745634cd57876764e3de04f2a6f98', + 'nonew_popular.png' => '4c14f635ff684394ba7f13a46ee2ed04', + 'nonew_popular_small.png' => 'b52411630e19de222230c516ec3b9ad6', + 'nonew_small.png' => '7d2084d22597ca40aa944367626eb0b0', + 'pm.png' => '11bcda04351efb950b1352b9a82a674d', + 'post.png' => '22de7b984a3044b53c19a4ccd3cb49db', + 'post2.png' => '0072597171f5e4380bc3715ddccb7e86', + 'profile.png' => 'f196e49eb8682872379a0ceea4b8ce24', + 'quote.png' => '44e56d509440c027fadff8fa3c71bb09', + 'reply.png' => '6a07036cf75d4acf1e4126371998baf8', + 'report.png' => 'e36a0b879ea8ac19169302705cd806b3', + 'sticky.png' => 'ba50de659d59a2997ee77ae177a605f9', + 'sticky_closed.png' => 'ea5b16c543e3056e866ca5579ecd163c', + 'sticky_closed_small.png' => '8413fe336a2ec79bdcb0b3bfbcd50896', + 'sticky_small.png' => 'ebf41f357e88f4e6f29e6d7d8b3464e8', + 'website.png' => 'ecd92710246e39b964a1857e8370db56', + ), + 'lite' => + array ( + 'English_admin.png' => '5fed0ae458f2100bfed0ffc655d1c1ce', + 'English_main_admin.png' => '1b3ec206bc4a6daabc970c231e148f16', + 'English_moderator.png' => '99b9bbef0e3440071ff394422819ea69', + 'English_newthread.png' => 'eb68d1b9677fca9c32c556e050e4f20c', + 'English_reply.png' => '58e4791eb2d8b5712b859639a0eb5320', + 'admin.png' => '5fed0ae458f2100bfed0ffc655d1c1ce', + 'admin_block.png' => 'e861b2014ffa66b391e3e4152278ec78', + 'admin_delete.png' => 'a8aca6d9512cdf1f18f98a324fc63fb1', + 'admin_edit.png' => 'c8d6b7bcc759884b6ed0a6bc4b53ad57', + 'admin_lock.png' => 'e709f1ded3bdea3174f30ef49f83aee3', + 'admin_move.png' => '704a6023c7f2900a6371a63f0dd56462', + 'admin_stick.png' => '7dea7baacf217c6f307a9a0a08fa27f4', + 'admin_unlock.png' => '19849fb8ace12d49b649724cdb1948de', + 'admin_unstick.png' => '4a6856f5ef4b32d56bd232c495baa817', + 'aim.png' => 'ef7a16b7871c7b353a06186d3e0dce6b', + 'announce.png' => '9874a0390f8b93d75af92a10a6311201', + 'announce_small.png' => '1b9b7a6b72ff112bc82b20537220e827', + 'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc', + 'closed.png' => 'baaf6f3e3dcca0f678f1a3c79a51a3b1', + 'closed_small.png' => '7207302f70051cff9c0167f20a89646d', + 'delete.png' => '895db8d980f9378df51649443a5bdfc6', + 'e.png' => 'b5e5c9ab677b46ae99ac512039d012d8', + 'edit.png' => 'dc9067455b48da0bbc50993a4217eedd', + 'email.png' => 'c51f9e3ef6f5b02087decb2ec7686278', + 'icq.png' => '6bc6f030b47ff1ee2de0913e71552681', + 'main_admin.png' => '1b3ec206bc4a6daabc970c231e148f16', + 'moderator.png' => '99b9bbef0e3440071ff394422819ea69', + 'msn.png' => 'cbf3f20c6baa59d7aae61bbc12bd9414', + 'new.png' => '8cf7c2a190bbbce7f18ce99818dbd481', + 'new_popular.png' => '37d60559b22ff18cbf7bdec33f4a72c1', + 'new_popular_small.png' => '7becbe1b6207fef993f1601463f57345', + 'new_small.png' => 'cff284b11533ac4bf740a146d019a942', + 'newthread.png' => 'eb68d1b9677fca9c32c556e050e4f20c', + 'nonew.png' => '2808e78e081d8c8d2d7802b9a290ce12', + 'nonew_popular.png' => '8df0ba08e69b552e7e24e9a2751e5d40', + 'nonew_popular_small.png' => '33355429da0af82e1f1c91bab2ba7f91', + 'nonew_small.png' => 'edc0414101f2e406d7c0a070f324220b', + 'pm.png' => '11bcda04351efb950b1352b9a82a674d', + 'post.png' => '22de7b984a3044b53c19a4ccd3cb49db', + 'post2.png' => '0f6cfe51518affb7a6baac798abd907b', + 'profile.png' => '32300a5d0546cf11e2cee898ec2e23c2', + 'quote.png' => '579d14bfb1faabf191272938fae3ab65', + 'reply.png' => '58e4791eb2d8b5712b859639a0eb5320', + 'report.png' => '3194bb43c91125fce2709500bbe33a9a', + 'sticky.png' => '45f3c7bfd16c3806a79c3a9540a9e847', + 'sticky_closed.png' => '9fa98262861f0a900236f795dc72096e', + 'sticky_closed_small.png' => '5c7f041ff02f267c87e4c46d608e7014', + 'sticky_small.png' => '4e820e6a2bba0f75e38c2d2bdcfe2111', + 'website.png' => '568b5e9dcc6fcc5067209e9390297162', + ), + 'fcap.png' => 'db19cb1423e2898da7b2d3802c89404f', + 'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'forums_16.png' => '5773aa73ab08e4e575ceb2d60001f8f5', + 'forums_32.png' => '543708df3b2731ea4607ea5741a21f12', + 'sub_forums_16.png' => '16a40908a7b37e8353c978ce3ecd1910', + ), + 'languages' => + array ( + 'English' => + array ( + 'lan_forum.php' => '8496b78042381e1eb0e55919386b1261', + 'lan_forum_admin.php' => '796328f81eb77d6c218ad978e83911b9', + 'lan_forum_conf.php' => '44f0d7ca6da7d71004e1acd9c1f04f70', + 'lan_forum_frontpage.php' => '5ac941c384cf10a76b6ab040f7ee7986', + 'lan_forum_post.php' => 'd92f497d14b273b09d3f6e1c3dffea21', + 'lan_forum_search.php' => 'dd1263ff01cf0b71991de16756677f68', + 'lan_forum_stats.php' => 'ecccb2b57c568336e5b1accfa29ad08b', + 'lan_forum_uploads.php' => '840b741edd3f2d8fcc340b29804689b5', + 'lan_forum_viewforum.php' => '7b44a441080e2b1a40b8c37944d9a719', + 'lan_forum_viewtopic.php' => '867fb663d2d3cff381f01f08db23de98', + 'lan_newforumposts_menu.php' => 'affcfab7c6a7dfa7ba9fd1c134075919', + ), + ), + 'search' => + array ( + 'search_advanced.php' => '32a26ccc8c2be60abca8ba2930ba329e', + 'search_parser.php' => '3419fe985c2b08959c127b6484a487fe', + ), + 'templates' => + array ( + 'forum_icons_template.php' => 'ac7e8c8f02f32719f64cd5bde7ec5f20', + 'forum_post_template.php' => 'f1017fb9b9ae6c73691d27b4da2d8cd3', + 'forum_posted_template.php' => 'eea66e0ed7f2d2a51c5e01a07cb871aa', + 'forum_preview_template.php' => '11b636f1bcccded162fcf42880df5b5d', + 'forum_template.php' => '725a50b55d6e76a9844821992601aa67', + 'forum_viewforum_template.php' => '004aacb79877ac05b538d320c8294b85', + 'forum_viewtopic_template.php' => '57b91f8b3ad09f48010d4d4958623f26', + ), + 'e_emailprint.php' => '8a41fe10faf7c2293a65bd66e598dd82', + 'e_frontpage.php' => 'c939394e051b055ccbc963d17b1a1d46', + 'e_latest.php' => 'ba485c38b9ab90c0f572a2397b49c9f5', + 'e_linkgen.php' => 'e0cdc0183ce0cf9adbbec54271c55766', + 'e_list.php' => '523f01012192923c6901b7c088101ec0', + 'e_rss.php' => '2d0f0839621d9d4539895e2047a76476', + 'e_search.php' => '663a93cb1f0d05351ecbb85a3bf721d4', + 'e_status.php' => 'e707e64a960612d443e16906faaf0e22', + 'forum.php' => '35a1744e058ca88ee47e966088ac1923', + 'forum_admin.php' => '741d27d12226bc98e4576697f4b97efc', + 'forum_class.php' => 'cec775f3d1561a4262c76c438c02de69', + 'forum_conf.php' => 'a4a4e140bda4b3d7cd73abd03170dc5b', + 'forum_mod.php' => 'bc6667cba8050bd3a2c015dea9bcd730', + 'forum_post.php' => 'd651a56661feb695867f8b914e2ed5d0', + 'forum_post_shortcodes.php' => '1b976852110cac3652082c43777e3dc3', + 'forum_shortcodes.php' => '06545816dec1484394144caeffb71a39', + 'forum_sql.php' => '3355b8219c200d8d669ce08e59053465', + 'forum_stats.php' => '9906e300c4764aa55e54d745ff3bc471', + 'forum_test.php' => 'ed668e3268952cb268b3f4aca0d2e37a', + 'forum_update.php' => '8e1fed1bae66e84eb3ad0235a60f0c69', + 'forum_update_check.php' => '95b6355554098357b5648807c4e95705', + 'forum_uploads.php' => '3ae344a843771d9ee6e578a1ddd84f8c', + 'forum_viewforum.php' => '53b717a8e1515fde643c25b89ae92e25', + 'forum_viewtopic.php' => 'ab460e959ba4523374375e92abebb874', + 'index.php' => '1d225ecdb6dfb425fcdd39501ed196c7', + 'newforumposts_menu.php' => '294da398e0ec6c0114c8d41e203cd411', + 'newforumposts_menu_config.php' => '8c7c855777e097fe6b8d92f9ef4e527b', + 'plugin.php' => '871a97116e50c74039db5f2e3c96d040', + ), + 'gsitemap' => + array ( + 'images' => + array ( + 'icon.png' => '29534d4c0ba369a5ad90e6150c86a5da', + 'icon_16.png' => '6d67b9c447227bd3432ad2cc2b197f79', + ), + 'languages' => + array ( + 'gsitemap_English.php' => '350d69eb976b596ee599530d5e6bff1c', + ), + 'admin_config.php' => '4a582593a83c6353f6b2c49371623301', + 'gsitemap_sql.php' => '81a34608c8cdd19c51fece5a25109159', + 'plugin.php' => 'c88f725348400384ef5721432e9ad169', + ), + 'integrity_check' => + array ( + 'images' => + array ( + 'integ.gif' => '80475f4211b9a876938a439470cde13a', + 'integrity_16.png' => 'e6ff53bf268d48088c085fb3d3e1f010', + 'integrity_32.png' => '82a32c32fad17965fcb6ab955b8f15b9', + ), + 'languages' => + array ( + 'English.php' => 'd78c5a1f0cd1dafde8fe3bf33083db1e', + ), + 'admin_integrity_check.php' => '0336e89bd0664a6e4ad9ff2c1ba9c236', + 'plugin.php' => 'b32f26e2fc819c93a60a0c53692888fa', + ), + 'lastseen' => + array ( + 'languages' => + array ( + 'English.php' => '847602620978795e90813a8ca2c2b2ec', + ), + 'lastseen_menu.php' => '2f1a208abccccfe316824d1defe2c857', + ), + 'links_page' => + array ( + 'cat_images' => + array ( + 'linkspage_16.png' => 'e0f7bd92f88b61dd38d82f952b3b1e98', + ), + 'images' => + array ( + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'generic.png' => 'bb86189cad80d49fbfe203dbac657a65', + 'linkspage_16.png' => 'e0f7bd92f88b61dd38d82f952b3b1e98', + 'linkspage_32.png' => '720b47a8d0dfb2e4cb2646c6be8e34e2', + ), + 'languages' => + array ( + 'English.php' => '2ccba0ca70987d6c5bfece279e25957f', + ), + 'link_images' => + array ( + 'button.png' => '11a491739c3c8dba29d7e25e0b2ef50c', + ), + 'search' => + array ( + 'search_advanced.php' => '985406e38223116b67ffe4afa714f176', + 'search_comments.php' => '6d3c5c4d9d15e0c0adf77b859a4c054b', + 'search_parser.php' => 'ff43c05ffddd9ce508c98e913f90e167', + ), + 'admin_linkspage_config.php' => '5576e1a0eee8984ad5909d901e481b30', + 'e_comment.php' => '13b0aa38e21d08a535276a7526cedde2', + 'e_frontpage.php' => '0a352c2a0b559b9d930943f1928f9d45', + 'e_latest.php' => '6ab452dd2d2d46749d5149c5fd1905fc', + 'e_list.php' => '9a49a4d6a015fb3fff2cda7a4ef788c1', + 'e_notify.php' => 'eab13b015f9b5fa679fef28f63d72dde', + 'e_rss.php' => 'd213cc9cc0d5eeed3442b861e565961e', + 'e_search.php' => '7a7416dde4bc42481cf92431f4832b65', + 'e_status.php' => 'e1b28e610e6f89277440430a2f8747d8', + 'help.php' => 'a8495b50a8243ebbb3e37c8bcb169184', + 'link_class.php' => '54cdcb1762817c504b6d81ed7924ad96', + 'link_defines.php' => '1c9c8a4d29cac5f35e2164805bb3eca6', + 'link_menu.php' => '20fd34d3e851223a174d56533dbb83a6', + 'link_shortcodes.php' => '614948aa511415a9d151b16a0518c4ba', + 'links.php' => '10d1f4b2e4ac07ad1a17c60ad5cee6a0', + 'links_page_sql.php' => 'ebe16a35037a69b93eaa929782ca66ba', + 'links_template.php' => 'b578512e4b94cd623ee3cfcf5d0be178', + 'plugin.php' => 'b05df4d36293f4c2e2b949b3006cc712', + ), + 'linkwords' => + array ( + 'images' => + array ( + 'linkwords_16.png' => '938cd3261a4a86543de6949f66d2d53b', + 'linkwords_32.png' => '83211d6305d2d1a4f0ae8ec7fc3e9ad5', + ), + 'languages' => + array ( + 'English.php' => 'ad0d4babe14fbc9317ba40e34833bd58', + ), + 'admin_config.php' => '84e9d47d8301b15c0ea3e88c2d7b68dd', + 'linkwords.php' => '6dbac4b16a1acaef98748f838f2fbf2e', + 'linkwords_sql.php' => '33f4d40e8da9aa758c512d4847f6d5d7', + 'plugin.php' => 'cda5616cc5cdb77a82392fe4d34d3ab4', + ), + 'list_new' => + array ( + 'icon' => + array ( + 'list_16.png' => 'a66abd8893e6183633d538bb7e77ee72', + 'list_32.png' => 'f20fb66244bea4fd4f094a5d79afbbc1', + ), + 'images' => + array ( + 'icon1.gif' => '647fbd5e1ef767240f657eb6c9bf7eb0', + 'icon10.gif' => 'f476f9f3348d5eaf6c8655d23107aec8', + 'icon11.gif' => 'acfb3909d01491bbb4e6e70a5d253db7', + 'icon2.gif' => '0f8cde50c8cf5dcf15ba92db83d823b2', + 'icon3.gif' => '5c93b3bd203880e147a9cf424dbdfc00', + 'icon4.gif' => 'd9322f3a64817417a3c31fd5127d0df7', + 'icon5.gif' => 'dbd33636a4598cb6ae3745c3c12bb036', + 'icon6.gif' => '7fa95c9ecb71ddd56d90d5a6c57c072a', + 'icon7.gif' => '0a77dbb9a9297684d76896932c28a7b1', + 'icon8.gif' => '6447987ad6456afdbb7058326c2b5278', + 'icon9.gif' => '6681ae39445665dcf8781333888923de', + ), + 'languages' => + array ( + 'English.php' => '3f559f59bef22144d80b09ea599732ba', + ), + 'section' => + array ( + 'list_comment.php' => '5efa984e2682a3fd37cffc87d8e8f94c', + 'list_download.php' => 'd0c7e07e3fe2372c7a8eda1562793b67', + 'list_members.php' => 'e49b1b7cfad6246287a43e59f803cef3', + 'list_news.php' => '7faa1d6728ff1e692aa834ac4027c4e0', + ), + 'admin_list_config.php' => '6a0ec89c7fc52da5ba7cfe7ba647d530', + 'list.php' => '40e2923674835fe1c404219d164e7a92', + 'list_class.php' => 'd114b0dc8172a77aea197a0d42084fa8', + 'list_new_menu.php' => 'b130b1aeb94b0c494dc77f6c58c7a19c', + 'list_recent_menu.php' => '83c2f61863857d3ce02539a668e98083', + 'list_shortcodes.php' => '1c4972d09e83f1945c6652126bba6248', + 'list_template.php' => 'ca73750411b19f1b8df71c5111fe1789', + 'plugin.php' => 'c39cfd9c145036b3cfbfca56aef150dc', + ), + 'log' => + array ( + 'images' => + array ( + 'abrowse.png' => 'da9925bf3cee78bb965c668857bb7225', + 'amaya.png' => '974a9fb5ae38e4d592aec302594ba58f', + 'ant.png' => 'f667945ec89b7883922828deec0e2fd2', + 'aol.png' => '5681ae48b5ab3fca312ade1b42658ee2', + 'aol2.png' => '5681ae48b5ab3fca312ade1b42658ee2', + 'avantbrowser.png' => '8dfcaaa62c0f5c07f4982f41bba18f50', + 'avantgo.png' => '006c1eeda85c0dd975ca56ed75a86d56', + 'aweb.png' => '1f4fd6be7682b4461b43768160f80746', + 'bar.png' => '5e921e04974e7fd41cfc34167d31edba', + 'beonex.png' => '2d5062958c73ad028233553d88c684b8', + 'beos.png' => 'e81a347cde7806d403369acf5125c4fe', + 'blazer.png' => '681d0c56db0d9eeec59e3b804dc809a8', + 'camino.png' => 'bcf331c02452984bada0f73534e15578', + 'chimera.png' => '6a6ad07a8495264fc00798ee298f3c04', + 'columbus.png' => 'd24df5eebe796dddf95eb6630f1ce1d3', + 'crazybrowser.png' => '96283b3c49fe550c35b96c595167670a', + 'curl.png' => 'c17099e14ae52777d46079cb126349ea', + 'deepnet.png' => 'a102b4c9f46ed88473190f8390d5ecde', + 'dillo.png' => 'a95459dde056b7de5965f5c1b984847b', + 'doris.png' => '0cde70660e8558aee3fd73ee9084f3cc', + 'epiphany.png' => 'edafb77862629ee99b06478d34689a61', + 'explorer.png' => '12663e51f35919fb31645ec6248230e4', + 'firebird.png' => 'e8481a441fb3bcd623b6ca7143443659', + 'firefox.png' => '7622da97e8ea3a9821a90e1f73aaf851', + 'freebsd.png' => '836fab28d495b801df8639da8cc13da7', + 'galeon.png' => '072543cf994aa44a868d24867df80de6', + 'html.png' => 'caa46c5b4aa1bf948a96dcb4c3c6611b', + 'ibrowse.png' => '8a94505f697ef87b353c5c6a56f54995', + 'icab.png' => 'd2d3147c69fca0071ff631900194d8e5', + 'ice.png' => 'c0a72eb1937576484240f94826a76e67', + 'isilox.png' => '677a40b0372f3a0b18f62a4793e8d820', + 'k-meleon.png' => '9ecbc0649045f8dc5115dfea2530adab', + 'konqueror.png' => '46b06a0ffb9ecbe6606bca51d98a9211', + 'links.png' => 'c47c6dd145554280f3e29323cbe34341', + 'linux.png' => '336a3e40452886a7bfac345e8a261138', + 'logo.png' => '8802e7deba7c6f03110b1541d775feeb', + 'lotus.png' => 'b9c3348d5ce4d2c4a6065a2229af74c8', + 'lunascape.png' => 'cecc58426c0c62aa6b7e09cde7c7bbe0', + 'lynx.png' => '00fcf432cff7e70cc8ef9fc32182fca6', + 'mac.png' => '3b5ceead951265dc1648d172fbdd6461', + 'maxthon.png' => '30ee9e712f34cc7cd6f092313ac37fc5', + 'mbrowser.png' => '491be57a6bcd67ee5a09f8b212fec39c', + 'mosaic.png' => 'c276bc202f408caaeef5e763e4e2cb18', + 'mozilla.png' => '0cb5578c00652e82053f81f94736ce58', + 'mozilla2.png' => '0cb5578c00652e82053f81f94736ce58', + 'multibrowser.png' => '3e41f9cabd8ca350a61e4adb6aeb52c4', + 'nautilus.png' => 'daa1ff10ec0a1d85b77db4a4a05a91c6', + 'netbsd.png' => '0cc1da48e638ee3549a53c459a0beaf1', + 'netcaptor.png' => '139a1211baca0b00447e64c657bb5161', + 'netfront.png' => '3ea80a15dabb2e26888d6fb66a16500f', + 'netpositive.png' => 'f3bf2146aa97c9821ce096f5d38d9ee5', + 'netscape.png' => '4dda4c2e4c32cc5f1e7cdb5b56156f5c', + 'netscape2.png' => '4dda4c2e4c32cc5f1e7cdb5b56156f5c', + 'omniweb.png' => '6b1d71fb7d85a3a5739bf33fa7646031', + 'openbsd.png' => '36a1043bb8aacd3ea0a85c5f4de3130a', + 'opera.png' => '8892071cd4ecb31298ec08373d1491dc', + 'oregano.png' => '50798ac094e34694cd75a1ebe7813689', + 'phaseout.png' => '5b6c84b85f576c2145dd4944f8b6188a', + 'phoenix.png' => 'a9544236943de787c6a7e03d47a23424', + 'proxomitron.png' => 'ad3be5d996043b5ebe5ab619dd2545d3', + 'remove.png' => '313b424965c1b13451212a2e2817b658', + 'robot.png' => '467598649618f8a635235011cee3650f', + 'safari.png' => 'ee7ab5a70f4d927a753756b1d3ec2863', + 'screen.png' => '64bb3f0780b2fd8ac7ed1ccc07329c38', + 'shiira.png' => '98568764150bfe30b8b14d9cfdca374f', + 'sleipnir.png' => '93aba37fc79e5f2459821b3fdffb2f8b', + 'slimbrowser.png' => 'dd18ad6de3ed12aaca4a495a8663343d', + 'spiders.png' => '40fe2edf5a3654abbaf364559ffaa62c', + 'staroffice.png' => '9df8b5abfefb57238799b1a15b6e32d9', + 'stats_16.png' => '4483cdd34566efe12872d9622f10499e', + 'stats_32.png' => 'feb2eeda7244d0d78bc635daa7ac4c4f', + 'sunos.png' => '5cce74b569193c10dfa03b2c8b292268', + 'sunrise.png' => 'e0ef33096f7b1bef35972c9da07124fe', + 'unix.png' => '3adfb8b111bb64bb8c01a1b8e7d1fee0', + 'unknown.png' => '731a1804b991a36c584521a4508e62cc', + 'unspecified.png' => '731a1804b991a36c584521a4508e62cc', + 'voyager.png' => '0f977fc50e485153fe5908635de33d0b', + 'w3m.png' => 'd1644f785735c7b82df2361ec9917eea', + 'web%20indexing%20robot.png' => '467598649618f8a635235011cee3650f', + 'webtv.png' => '37217cc2adf3e72c93fce1de22681c1d', + 'windows.png' => '28190c1e6828a3bb5892e14c5d324a66', + 'xiino.png' => '1067d1b475466744b562d1be8c7a462a', + ), + 'languages' => + array ( + 'admin' => + array ( + 'English.php' => 'a60ef592a7abd135da04b6cc482c992b', + ), + 'English.php' => '583eaac1a83c65da8e8d697ea4dd8058', + ), + 'logs' => + array ( + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'admin_config.php' => '67f5b9dd7f192b2dc8ca820a348f9ba7', + 'consolidate.php' => '1a17455630a62ef78d2c14778845df31', + 'e_meta.php' => '70eae996ff1b54a3ddc1cea0a737320b', + 'log.php' => '5ae5383b4abb6273e4d2b45850559d52', + 'log_sql.php' => '6593acd37950a8e486b0fc1490cf1750', + 'log_update.php' => '619bea78d9c76a1ec0cd4c44eeda36c5', + 'log_update_check.php' => 'f4e7f5fb3767e4c19adae8cb5e41e62c', + 'loginfo.php' => '68c8cc11daadec40bfbae1f4b9ece53a', + 'plugin.php' => 'b078f64e2aab381fb9f99a109dd96262', + 'stats.php' => 'd4d9200b6df966437eb88aefc8a8e3c3', + ), + 'login_menu' => + array ( + 'languages' => + array ( + 'English.php' => '3be9768e81217f108c055cff9f15c8d5', + ), + 'config.php' => '5f0c8229c96c4d4cf5a806bfc8d1a1c4', + 'login_menu.php' => '5617c07086b77c79d5c1e6548928536f', + 'login_menu_shortcodes.php' => '4232d61c5e9f401c023de6888cbe4d99', + 'login_menu_template.php' => '88e210369bd4f7ba640e0008b274d782', + ), + 'newforumposts_main' => + array ( + 'images' => + array ( + 'logo.png' => '06cb23ecc9cd39141194e1016a771f80', + 'new_forum_16.png' => '6f37a1029e4ffa1a22a65a07269c4a16', + 'new_forum_32.png' => '8e92602725475253ed57ea7625b19bf2', + ), + 'languages' => + array ( + 'English.php' => 'cbabc36202b6ab51003f0b859fb14598', + ), + 'admin_config.php' => '965609648b5052dad40742d8c76b8bf9', + 'newforumposts.sc' => '92de176e2d3503f91b9389d053d34348', + 'newforumposts_main.php' => '53e0ce09459853547bd35154e74f25e8', + 'plugin.php' => '81caf517e35d6fdb13bf56fb6ab5395e', + ), + 'newsfeed' => + array ( + 'images' => + array ( + 'newsfeed_16.png' => '854bc5f8ddf61c6dfbe6c32e7bb7c0d1', + 'newsfeed_32.png' => '6ff097b991a0c24947a29c16433abfdd', + ), + 'languages' => + array ( + 'English.php' => 'a166d6243430b0933b783255023239f8', + 'English_frontpage.php' => '6bdb1ac20906e1242f6aacc5981325ff', + ), + 'templates' => + array ( + 'newsfeed_menu_template.php' => 'a26b82efdcad76104273e02e268bcbe2', + 'newsfeed_template.php' => '5a1b8f38599596ff798b4df30873720f', + ), + 'admin_config.php' => '67d91a9c29acd1f52b4f12d36b3099e1', + 'e_frontpage.php' => '2a8967b05bef4a2eb6b771ca44e6bf01', + 'help.php' => '7942458e34eb69cdad92cc7d9454f626', + 'newsfeed.php' => 'b822c0fa9ace6409cef05d73eeae3ff5', + 'newsfeed_functions.php' => 'a06e7301f737550e69d18c85dc1a3153', + 'newsfeed_menu.php' => '4ab274b2b3dde37f3807457aaeead9d9', + 'plugin.php' => '9518316c3bbd37326a4c1383ae1d550d', + ), + 'newsletter' => + array ( + 'images' => + array ( + 'nl_16.png' => '59f315b213118bf6051dc29acea8bb8e', + 'nl_32.png' => 'f39c84dea17075e27e1c15411fc2b282', + ), + 'languages' => + array ( + 'English.php' => '5fe08735f2bf070770827d051fcd69cd', + ), + 'admin_config.php' => 'c6e4733cffed8bac3cbc27115476404e', + 'newsletter_menu.php' => 'f8b8ab30443dea6a8dbb2e27c17799d6', + 'plugin.php' => '5c491459a08ab61854fb5a8f56230f66', + ), + 'online_extended_menu' => + array ( + 'images' => + array ( + 'user.png' => 'ae648cc200000ccbb96c9e6c9049c5e2', + ), + 'languages' => + array ( + 'English.php' => '80ef79863e369f62df51b9659551a432', + ), + 'online_extended_menu.php' => '16d72e57d0cae0206e0a079638f23d83', + ), + 'online_menu' => + array ( + 'languages' => + array ( + 'English.php' => 'e7753b75880a1b606b6f525d736893cb', + ), + 'online_menu.php' => 'ba0b67252034c72c5a002aef708082bc', + ), + 'other_news_menu' => + array ( + 'languages' => + array ( + 'English.php' => 'b04593965071e6f5bd46286fadcec456', + ), + 'other_news2_menu.php' => '23ffe78f7e74092c6505bec603c04ec0', + 'other_news_menu.php' => '43943c839fbd809ae19b75ca7b296451', + ), + 'pdf' => + array ( + 'font' => + array ( + 'makefont' => + array ( + 'cp1250.map' => 'e100a417c3569cc2b7b8c1e976db4f14', + 'cp1251.map' => '03af6a71a67c0a5a99e16af4bdf0889f', + 'cp1252.map' => '2c892997d01d2138d800f5318bd76ad0', + 'cp1253.map' => '169376db7929541ef8950dd888f53c9f', + 'cp1254.map' => '6016c6d3a68c1d25696e64879b6527fc', + 'cp1255.map' => '0359cc7d06098a20400118788c7e1468', + 'cp1257.map' => '91b18d3c622bffa43003f38a60d15138', + 'cp1258.map' => '2d92adf84aed86b29765234a77b312bb', + 'cp874.map' => '3a3d272502dc21d4d12f3922633ca47f', + 'iso-8859-1.map' => 'a0f13acbaa06faf3fe240e1c49b7616a', + 'iso-8859-11.map' => '96aee891ad9f8c33f83b19c9b5fdadb2', + 'iso-8859-15.map' => '3bd2a4bd4eb8130add17624e128e190c', + 'iso-8859-16.map' => 'd1b40c31c1047d85881db30baee1f96b', + 'iso-8859-2.map' => '098cf77f5a3c281af86dba50f5389f58', + 'iso-8859-4.map' => '16c5ed9d616ffc407a560b3a92453f57', + 'iso-8859-5.map' => 'b9d6ad1f178c189aadf370ac9fe308af', + 'iso-8859-7.map' => 'bc6f9bdef50e1f802e5b17bd70b36d0d', + 'iso-8859-9.map' => '4d8ddb1b69f39e44b88addd04269e684', + 'koi8-r.map' => 'ed1be11b650e23bcf0804524d0299e73', + 'koi8-u.map' => 'd445ee6c5ec5f2edd31fdc48724dd168', + 'makefont.php' => '412c5335ef10e2fed8038a8ac5798971', + ), + 'courier.php' => '16234bee90ef280e42cb167d1ba2c60e', + 'helvetica.php' => '3dbdc93d4d688b45bfc6f4e49c45116e', + 'helveticab.php' => '0e327a1ae8e5aaec1b28c5c366e14237', + 'helveticabi.php' => 'f3d59db2e9426ac9e7f110705b07b7d7', + 'helveticai.php' => '29a074a2a45c43a87630f46e22436b2c', + 'symbol.php' => 'fd6c383c3cf14278d64b5cb1e8286890', + 'times.php' => '1f954b34c3d40187b7a67b8dc4535c38', + 'timesb.php' => 'd6197cb638addc463e2bc020fbf730a9', + 'timesbi.php' => '1e77620e40e3e4bba0d29da4b10f55a8', + 'timesi.php' => '9c92d3693094e7c46cfb6c6416369971', + 'zapfdingbats.php' => 'f4f9f7de4fc64851280d29dfafc868d1', + ), + 'images' => + array ( + 'pdf_16.png' => 'f79c40d961e1125010f572634fa61f8b', + 'pdf_32.png' => '7815b3da903470812856fe16cd53bc97', + ), + 'languages' => + array ( + 'English.php' => 'cdc4aab2e1c8caf5ddf209e32946c623', + ), + 'admin_pdf_config.php' => 'ab75370cbef1f9e7d32448717071eb82', + 'e107pdf.php' => '2911ada133d8c7b104f553e8232361e1', + 'fpdf.css' => '35c07d5049ac6e55b8ab473c6dc38bf0', + 'fpdf.php' => '47653b1a92f6a51cec644abc9b267bdc', + 'pdf.php' => '9c05a56fbb296b60cddcfc68ec1ae2c3', + 'pdf.sc' => 'cd179b47d126ac55eb48cdbdbd4c1a19', + 'plugin.php' => 'd5aba62f42496d21e3ec8d48ded5b3ba', + 'ufpdf.php' => 'fe9444d6d9c0553bd06fc1904b0df484', + ), + 'pm' => + array ( + 'attachments' => + array ( + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'images' => + array ( + 'attach.png' => '7b07df07c819ccf0c007e2753b026e6f', + 'mail_block.png' => '4c23d4b896e42753bfaeeb934e1a7e21', + 'mail_delete.png' => '6999f9a797e624857e12f875981fee8c', + 'mail_get.png' => 'f5405868a5064a382ebda5dde8eaa633', + 'mail_send.png' => 'ac54828ad23a1e10bc84330f0b754a12', + 'mail_unblock.png' => 'b949c53a1ce63cc57f47d3335ea0468f', + 'newpm.gif' => '4d16f5fbaa8e76067053c8c901972bc4', + 'pm.png' => '1adf028fe9c30aa21008b1c7dbc94243', + 'pvt_message_16.png' => 'd327402ad98c005569023d691458c83d', + 'pvt_message_32.png' => 'c466117afa172593078f2aae10394306', + 'read.png' => 'c7bacd62b460d2d05c210030c8733420', + 'unread.png' => 'ad2e1da81983bb1bf0c1aeb310cd9c17', + ), + 'languages' => + array ( + 'admin' => + array ( + 'English.php' => '8c6ed48f14ef1bf19bc22f97b48494db', + ), + 'English.php' => 'ac6ca2e308d6d15e11b4d322298bf3c9', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'plugin.php' => 'c89f4e634476ef16447a5375f39ce495', + 'pm.php' => 'a5aa043661c8230e93b8cb4effcc8007', + 'pm_class.php' => 'df040f82c02af492432c132c0887a9f5', + 'pm_conf.php' => '4219da868fbcd4ea43ecb050eec83fac', + 'pm_default.php' => '0213fb9bcfe60d37041f44136727649b', + 'pm_func.php' => '4b9c0a299c8995c1e6f6aab4071d2e17', + 'pm_notes.txt' => 'df26332907da1f35c4731d8893aea23e', + 'pm_shortcodes.php' => '944e2f2957ae880e49684f724cad8ab1', + 'pm_sql.php' => '4608486c1027c6485dc32674fd536dc5', + 'pm_template.php' => 'cc1bdd12537404e75f9bd6dca8022292', + 'pm_update.php' => 'e66fc6610e273471a212471e07598710', + 'pm_update_check.php' => 'a5b341b5373844cdfc1f961fb3d3151f', + 'private_msg_menu.php' => 'ae1b1a633de92742b1d8460a6fa5d9fb', + 'sendpm.sc' => '8e2ef687982946d62df06bf6e9bdbc24', + ), + 'poll' => + array ( + 'images' => + array ( + 'bar.png' => '37d6b48106f4cdde2f549720dfd0cf79', + 'barl.png' => '11f7a33d11a71e4dc52254ac6dd831ed', + 'barr.png' => '117b5de6bc7c859de48974d01887d738', + 'polls_16.png' => 'dfa11ad7ecf088f5bc50152e3c8318de', + 'polls_32.png' => '7c98815961fc0215e8bd38aef5e1c295', + ), + 'languages' => + array ( + 'English.php' => '36b348fdefe092023ee513a4b1e6aaae', + ), + 'search' => + array ( + 'search_comments.php' => 'cc9ad502cfe9c867ad4b3ff07e6cd019', + ), + 'templates' => + array ( + 'poll_template.php' => '0c83f7e4984e9a0b8bbc196262cc650f', + ), + 'admin_config.php' => 'ba8fbd550cb0e34cdf445d117f5c93cc', + 'oldpolls.php' => 'ae016f0aa026a6a9de8af8d24de53ff9', + 'plugin.php' => '6dff875dd04ce5d602f4b64b7732610e', + 'poll.php' => 'b51353ac9b1d4f9664b954d528644547', + 'poll_class.php' => 'd5e58aa6c9ab5b63d51ab7b36fdf52f0', + 'poll_menu.php' => 'b2e1d5b8d5e8cacf51e2724446b663c1', + 'poll_sql.php' => 'ffe53748dbd1504f7c4204027814064a', + ), + 'powered_by_menu' => + array ( + 'languages' => + array ( + 'English.php' => '4e4018bc11471818ca7256c722e28c13', + ), + 'powered_by_menu.php' => '030115b6ab06ef38b31510aec2b11ee3', + ), + 'rss_menu' => + array ( + 'images' => + array ( + 'rss1.png' => 'c25701747091968c0f31dfc76f2cefbd', + 'rss2.png' => '9382a50cb221e9e6b829df2a7f52d461', + 'rss3.png' => '0a9bb4cb46a75b34db034ce6f2b763e6', + 'rss4.png' => '9f9b20c3cdd5cee6072eda153278bef7', + 'rss_16.png' => '276d6e7671548aea71f2c64b026d731f', + 'rss_32.png' => '22602a166d61764a13184506dd75ea6c', + ), + 'languages' => + array ( + 'English.php' => '90ba4c3b30c128eac2a16d0007416c89', + ), + 'admin_prefs.php' => '511047205732e1f3a5098052e3a2eb4e', + 'e_meta.php' => 'cec75314cf27f19abc2ee1cbaa15c99a', + 'plugin.php' => '46b1e37c9d18e6872083425afb3115fa', + 'rss.php' => 'd2da7783fcbfe777929b54f93bf16a73', + 'rss_menu.php' => '1be0ce84109cbbbcdadf68cc93fb5c20', + 'rss_shortcodes.php' => '5f78ac16412442bb16f729c6e71c582a', + 'rss_sql.php' => 'efee18037cab9fbf35cdf81f97efc2a3', + 'rss_template.php' => '023614657d162b0f155fbe50e6e3dce2', + ), + 'search_menu' => + array ( + 'images' => + array ( + 'search.png' => 'f1f617ae57346558eefce7d0b79b71c2', + 'search_32.png' => 'e0035406d30341e044c130ec0543a6c0', + ), + 'languages' => + array ( + 'English.php' => '091e3795b604b11354ad70dfc36ada65', + ), + 'search_menu.php' => '7f656b728eb7b34a48043bda3b35d29f', + ), + 'sitebutton_menu' => + array ( + 'languages' => + array ( + 'English.php' => 'fdae05c8659df7d21edf91d0bd8aaa9d', + ), + 'sitebutton_menu.php' => 'a798130948fa4626a4a576f34c71ebf3', + ), + 'trackback' => + array ( + 'images' => + array ( + 'trackback_16.png' => '9092b95903c88570dab202d2a5892ca2', + 'trackback_32.png' => '323e78071fe7dc88aa05034102403456', + ), + 'languages' => + array ( + 'English.php' => 'e482c4c1b04b71a713e8aa21cb4b047c', + ), + 'admin_config.php' => 'd1222ea1494b8b8c06247e72fb5d2f9f', + 'e_meta.php' => 'dee500df70205a00f524a0b0720205c9', + 'modtrackback.php' => '97d65e889ac0682d106186d4c989e6ca', + 'plugin.php' => 'faaf0e70297414b7f61db1a8f030a02c', + 'trackback.php' => '68d35830a04bc5283cf0ab718b3ee2f2', + 'trackbackClass.php' => '40cf1ea472926781f7ce51d0a9653f6e', + ), + 'tree_menu' => + array ( + 'languages' => + array ( + 'English.php' => 'be4478e772ee1e1189a57284891582d8', + ), + 'config.php' => 'a78276d858ff5dcaf1980939ea0d9578', + 'tree_menu.php' => '81ddba9d61a54caa9c8b74d80ae1f439', + ), + 'userlanguage_menu' => + array ( + 'languages' => + array ( + 'English.php' => '11eb945ea792024fc2ecd881d77781d7', + ), + 'userlanguage_menu.php' => '86492340899ebf9da2fd44250544814a', + ), + 'usertheme_menu' => + array ( + 'languages' => + array ( + 'English.php' => 'a4163beed74433ec6657b9cbbba50846', + ), + 'usertheme_menu.php' => 'ee312586d8f026d46e72704b913ccf85', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + $coredir['themes'] => + array ( + 'crahan' => + array ( + 'images' => + array ( + 'bullet2.gif' => '0f846116f7143e8f997f9175ea93168f', + 'logo1.png' => 'c21ccdf73de64f318dbcb45ed048d585', + 'logo2.png' => '422b66f0e312417fc5a9647d18b5cd6a', + 'logo3.png' => '2e8eff0aa8a1c924bf0134e9ba6047ec', + 'logo4.png' => '8f189548b4f02543a138e9bf0314d9f1', + ), + 'languages' => + array ( + 'English.php' => '5634193f9c40908e7753db6c3b557c37', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'preview.jpg' => 'b841409838526ba769866861bf236100', + 'style.css' => 'ea3af6647ce3d7ed62c5a973b8a2a7bb', + 'theme.php' => '9f63c8aa0ff3f0e6ab07c89a8bb7bd08', + ), + 'e107v4a' => + array ( + 'images' => + array ( + 'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc', + 'bar.png' => 'e63a0d8adeca917fd487bee6634b0d54', + 'barl.png' => '4559714c78a2ea8591505123897d528c', + 'barr.png' => '283538272ee7de8888ddaccec7d0cf93', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bottom.png' => '6500994715b4d988e604fdb8cc592562', + 'bottomleft.png' => '40d167ca546bec754489f2ed4825fe2c', + 'bottomright.png' => '15c1d7e34d52549c285586ae5e03892c', + 'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1', + 'bullet3.png' => 'ffd6c250377d22660e9045d5d97705de', + 'button.png' => '69918234a9caea763d1c66781e50fe34', + 'button2.png' => 'a0aea9a2dd8889f65f48a0621eb91d2c', + 'button3.png' => 'd2fcad5cfabc21b2f204b1a5d7229e55', + 'cap1.png' => '01271e8d5f2f5770bccc7dca903339f1', + 'capdark.png' => '968732d5e5ddfa288f59af2c47f5d4d7', + 'capleft.png' => '3beb236cb19fce601ebb3ac45f9e389f', + 'caplight.png' => '8e6f1d6155da88c011f33ca4784b6989', + 'capright.png' => 'a83ca3941c8a447f19b51ad89ecfc72a', + 'captransition.png' => '27e1c09ff88834b2ea140fa4a3f974f2', + 'fcap.png' => 'fbb6a2f0fb0b7f474812f622dc5423cb', + 'fcap2.png' => 'df4f0cd94d3949340f9926da33a3b253', + 'header.png' => 'f486dfa869b0cdf39445ea02d120a68e', + 'left.png' => '38d094baede7ab50c1f6696a21f222ae', + 'logo.png' => '8dd271371d50ac36b2a501297e0e8c73', + 'nforumcaption.png' => '382fc538b165c4228dc1ac962bcccc1c', + 'nforumcaption2.png' => 'd5095a41f9669de31650e2b397119e29', + 'right.png' => '22025f8d78f4419f9ee92d9f88a34cef', + 'search.png' => '088a3d0166f6683ea9586cdce438f8ef', + 'temp.png' => '443805d6f488cd2669027b443f860483', + 'top.png' => 'cd6994bb0a6a40ab5bb19edc86668d6e', + 'topleft.png' => '37a08fb25f85cb85bbb9dca682fb9870', + 'topright.png' => 'be43c8d3237cc599524fd5100a719057', + ), + 'languages' => + array ( + 'English.php' => '267a4652945d08b0a14d421c47d7cdf8', + ), + 'forum_template.php' => '5236c9308b808d1c0c96aa4b8647ccec', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'newsfeed_template.php' => 'bf35ae0a44194fb397c9816bd81c7522', + 'preview.jpg' => '1f1e5815a674ceb1eaa562caa0e23607', + 'style.css' => '31dbd50ef3ff04150146f4b618c18385', + 'theme.php' => '533543688af3450cd14bdc170466c960', + ), + 'human_condition' => + array ( + 'images' => + array ( + 'bg.png' => 'e6015f86e49dee0db753301c1e7b3966', + 'bullet.png' => 'd96af312cdc074075a4e5fb559dac73b', + 'bullet2.gif' => '9d376a8d449bec3df0d1086127799a6f', + 'bullet2.png' => 'fad8045a7696954f7435c33bfd435811', + 'comment.png' => 'f227913f7b341d5a696606d5a5f7baf9', + 'footer.png' => '5fbba976e98c785c98b10aa2b2fe8e99', + 'header.png' => '3da9f377741904abbcd94ff63a011e78', + 'titlebar.png' => '9d7e299f83e2814fccd253d2f7b8ea04', + ), + 'languages' => + array ( + 'English.php' => 'e9de51bdb55910fdc36ebcf96dd86396', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'newforumpost.php' => '6a9cd60b76c00cd41384f21ce1265860', + 'preview.jpg' => '37766edab6519ba0d82d89d0fad9b9df', + 'style.css' => '98b43a380766349d489c4bdc3ea69eff', + 'theme.php' => 'e7f8584099975bafbd28c2f8683de37b', + ), + 'interfectus' => + array ( + 'images' => + array ( + 'background.jpg' => '9d2f41c5d82966332cb6438109160d2c', + 'bar.png' => 'b67fed22a0eb45e8f98f34513b5ccf46', + 'barl.png' => 'f89ad6313d8b53becafe22598ae74472', + 'barr.png' => '0a5849424599a8533be5089ef74d286f', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bottomcol.png' => '78c5741f54dfec40c82f641045a92ad9', + 'bottomleftcol.png' => '03a6d3ec5e14fdf7e478356ba92c955f', + 'bottomrightcol.png' => 'c2bd7c6b693370833043eef967647829', + 'bullet1.gif' => '029a9d7164bb4ed6a8be279af02bcb20', + 'bullet2.gif' => '23c11ebc20e7c45ef75920ae2cfea93e', + 'button.png' => 'e3f712ad4329ff235174499c2bb64a9d', + 'cap1.png' => 'ab7deb73123e7f49b1304b0a6b787a8e', + 'caption.png' => '16f3fb712fc7f9fd498233b6d1d2c56d', + 'fcap.png' => 'c4a6f800c5ad92d7690d6ef6d33257e9', + 'fcap2.png' => 'e6261197a46d0ba830b74bac1dbc14c6', + 'footer.png' => 'c652160dd5fdfc9f4d50508c2ca6ad82', + 'header.png' => '9bbef79c069270f41c14c7abaa300f68', + 'leftcol.png' => '028354997e0d91ec6b808f51b4e2d056', + 'link1.png' => '01c1e8458cd7bab11c832763fcbbbb23', + 'link2.png' => '73d622e9782c81667528e6244603f832', + 'menubottom.png' => '56cf53e0f327058a113e8e23610badee', + 'menubottom2.png' => '6d9773d2afe504030b13627d7fd4d7de', + 'menutop.png' => '6010f91e233a5898d758db3eafb23a68', + 'menutop2.png' => '86c8a40fe7738475c143da269138c22f', + 'pagefooter.png' => 'cef4949afdbdab08dbbdf5a7e6db0643', + 'pageheader.png' => '916bb72001e7de90e00fb7a812e9438a', + 'rightcol.png' => '6684d175a110688fca18a06d82c5bc25', + 'search.png' => '0f9fa3188d15796337583ee1e1119769', + 'topleftcol.png' => '8b11e9f5354e5d8c84e5aa70eed896b3', + 'toprightcol.png' => 'aa0e7a7ed969629447669c6fd7ca827a', + ), + 'languages' => + array ( + 'English.php' => 'bcd2c57395cc693ee791c8cdc5a7e420', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'preview.jpg' => 'a4b48f473468c22cb5f03054eda08794', + 'style.css' => 'bb2e6303ad7fed8a1119fd08b7bd11e8', + 'theme.php' => '1f15d7afdfee8ca33bd2667085cee2bc', + ), + 'jayya' => + array ( + 'forum' => + array ( + 'admin.png' => '64ebd91cca24b185ac81a05ddbd790eb', + 'admin_delete.png' => '68567d088171dc9800c75e3717d01551', + 'admin_edit.png' => 'a89466d56dbaae7d8bde1330e3714807', + 'admin_lock.png' => '228e1b606811f415c253e851f779fea1', + 'admin_move.png' => '7ec6991055150d10f3d61b0c4fc18527', + 'admin_stick.png' => 'c3e003b6f1873284eae24ac8e8997983', + 'admin_unlock.png' => '184c7a4c28517e01f3fda3c77f4c5d01', + 'admin_unstick.png' => '87309a3d62a49f3432888c79ece6fb5e', + 'announce.png' => 'eff175ae24b46fb0ee49a34cc6ca9e1e', + 'closed_small.png' => '228e1b606811f415c253e851f779fea1', + 'delete.png' => '7c20906029cbc1fc0c7c64d26d2868e2', + 'e.png' => '6c335c5d89cc241296a45eddb888ee95', + 'edit.png' => 'c762eaed37cf8d4a4ff68cdfcb5099a8', + 'email.png' => 'e6c3d37c6a4c39b9330ca3bd7e9bcffa', + 'fcap.png' => '20137d499eb7e57064231cc4bc910dd4', + 'fcap2.png' => '0a733fe6e51713f13276eec753da2d9c', + 'fcap2orig.png' => '5f6f45697bc185d51f2c06d904642aad', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'forum_icons_template.php' => '7b54f527b4da7200128d6e1e33918080', + 'main_admin.png' => '4033115a6d4c622f16e23c7d82bc1bd9', + 'moderator.png' => 'd3100a24d0bf141c8d3e5445d24b712a', + 'new.png' => 'f80e5840a07b08c9502af386b9c6c928', + 'new_popular.gif' => '9b92a52b897b1730793c4a975dd0edbf', + 'new_small.png' => '5197b92d879fd774e87cf9ee26694498', + 'newthread.png' => 'abfdbdcaa23bd33fdbd11f2f59c8e4c2', + 'nonew.png' => '4113a87c52860c4e131e919b0f8f0193', + 'nonew_popular.gif' => '9aa9a7418692e5cd1dd05026f577f984', + 'nonew_small.png' => '36e801e40256dae69c5f864a60555a22', + 'post.png' => 'c16dff0c96b789a40f1eb46c96291960', + 'profile.png' => 'df45fd4fc914d95c3e17b5929e4cd44d', + 'quote.png' => '33afa118321e687fb74b13c82d8ff04c', + 'reply.png' => '2b3fe53b428e0449dcf7ac886e309a62', + 'report.png' => '48eb0e1fd95db4c11441f058a9f45254', + 'sticky.png' => '4ddcd806ceeccb602772e668a42fc500', + 'stickyclosed.png' => '79cb1b7e7a1ae3f9d42cf3ec4bf57fc3', + 'website.png' => '7fba90ad852e9ddcf968eedc7f49a39f', + ), + 'images' => + array ( + 'arrow.png' => '38b69b179e7cdf232aa367a0dc3c4cbd', + 'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bullet2.gif' => 'f46acab251856c2c2e03dbba9ed2e469', + 'button.png' => '6ea310ffec2a7d4cdc2e76e0fcae2445', + 'buttonover.png' => 'c76d73539fef2b9d72506583908cfb36', + 'comments_16.png' => 'ada4e49b53f9732e0020f8f917125e16', + 'computer.jpg' => '424fa719231f821ffeb6b26f6d8553ff', + 'computer_pepper.jpg' => 'cdc1fe5c604b577faa4999a53a909f9d', + 'email_16.png' => '90866c1f54ed36c131038d2fc0851ac8', + 'on.png' => '34679051e7603ef4f91674e310fbd628', + 'polls.png' => '2b352ea3b2c392dcc1c6551d1c1b3920', + 'postedby_16.png' => 'bbc0eb1411a21d970b3f3c9855e516af', + 'print_16.png' => '574a45049daf40bb348ba6252a1e435c', + 's_body.png' => '7ba1f7cae60c29f12b290a1306df3281', + 's_body_.png' => '7ba1f7cae60c29f12b290a1306df3281', + 's_left_bevel.png' => '8568f929ef599f3116c49491f8893e90', + 's_left_bevel_.png' => '8d43f9f9c6b647e654e181ad510721f1', + 's_left_cap.png' => 'b6b3e6544925566237f0f357c7345bfb', + 's_left_cap_.png' => '1bc0b1738662ed120e97cf2afb0d3d8c', + 's_main_cap.png' => 'dfda87c00cfc0b6c3540c3666c8f4b51', + 's_main_cap_.png' => '4061f78621a6fe3b65aeb6fc64faf84a', + 's_nav.png' => '0ef5452590a980bb30cd463c0c6f4a8f', + 's_nav_.png' => '0ef5452590a980bb30cd463c0c6f4a8f', + 'screen.png' => 'd44a65d37f39fd788992214e3a4cbe84', + 'top_mid_back.jpg' => '1afb134a1f0da2309319bc6f662d155f', + 'top_mid_back_pepper.jpg' => 'cdc1fe5c604b577faa4999a53a909f9d', + 'top_right_back.jpg' => '44d2f4803a1d902a0cebf289c9598857', + 'top_right_back_pepper.png' => 'd44a65d37f39fd788992214e3a4cbe84', + ), + 'languages' => + array ( + 'English.php' => '6d5c404d3f5949d55660c3ba47ad338c', + ), + 'admin_template.php' => 'a894a1c9e20bb7b895e1151854a1083e', + 'canvas.css' => 'acdfee6441e3dc292657ca469b669df4', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'nav_menu.css' => 'ac9d2df99166eb5ce87c16bb146bc413', + 'pepper.css' => 'bcd1ac74e7cacb3ace1396355f238cc8', + 'preview.jpg' => '1d775846dbe1b7ea66065fc0eac72eaa', + 'style.css' => 'c406d47937f253e08d655b1d1008a6c2', + 'theme.php' => '82d43fe4ce914385611be80b3bc37bc9', + ), + 'khatru' => + array ( + 'images' => + array ( + 'background.png' => 'ce934d43f3fd71ee27d26b135457f6f6', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bottom.png' => '6b249ab3e679d5bd3dd39768683f9d60', + 'bottomleft.png' => 'e413385707e6a7d1e16229cfa49fe231', + 'bottomright.png' => '8bf0be6aaa09fce54811e2879e137873', + 'bullet.png' => '08eed4002e3d9fbf8f71d47c62a0fcfd', + 'bullet2.gif' => '1ec22e77515023bd344efeef8d827747', + 'button.png' => '62c64b41d5ad1a53fe6e23a2cf486b85', + 'icon.png' => '53e431306fb2e33a5ed3df6750933285', + 'left.png' => 'df5d30abe11aa5bf81d00fe5f16a9d31', + 'logo1.png' => '2d754a5f6ed77a9c5b58d5ca6d381fa4', + 'logo2.png' => 'de1b45f1e69c5d1874ee2fcde18e6073', + 'logo3.png' => '91c059d925a2825e0010a4cc2d5189bd', + 'menubg.png' => '1255daf004f8842b41e4f5e01e167c75', + 'menubg2.png' => '68f34e41e6334f70b6f14ed397c3df67', + 'nforumcaption.png' => '02cc27a5df2d68a063c5b2c8f4c42454', + 'nforumcaption2.png' => '1d62d20a5c0acbfd2211f2e8519c7fea', + 'right.png' => 'f29d08d4bf94b7e8946c09443004c77c', + 'top.png' => '5922796553902b607cca12e9a04b5f8b', + 'top2.png' => '9c11cc9f67cf21144e2c386fdc0b38d2', + 'topleft.png' => '4b41f3bed350f3b72de850a0c6f1d7ce', + 'topleft2.png' => '0dd4664012701da19679b020a916cf27', + 'topright.png' => 'f2b03fb32176cc7c067b411992d02d02', + 'topright2.png' => '7b6d4344421aad96d620a25a250d6f50', + ), + 'languages' => + array ( + 'English.php' => '66e19fa68eda6e34636ff907c328bb9e', + ), + 'download_template.php' => 'a9742a3e65ac83e279cabee1e1e50fb6', + 'forum_post_template.php' => 'fef4832dd26316448ef939cb2eb35931', + 'forum_posted_template.php' => '66bb8c27404c12d7e784745685f1f398', + 'forum_preview_template.php' => '4455c6b5e0991211db66dad466274bc0', + 'forum_template.php' => '93227cac477be310f0e5a1f6b4a310e5', + 'forum_viewforum_template.php' => '23b68de8f4d06ce6e22f281668d612d3', + 'forum_viewtopic_template.php' => 'e26e8e97cbe85e2b248a221af5148537', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'newforumpost.php' => 'bd44d5240db6fb7af02138dd2499a8ef', + 'news_template.php' => '0f5b689c4ad3d212934707f44b959b11', + 'poll_template.php' => 'c01388206c3cf373ff04e01c38485d99', + 'preview.png' => 'b164565b63d086a6a5a28fd76097487c', + 'style.css' => 'be699284eb74ccbd6543eac6f60754ea', + 'theme.php' => '91a9e9dd2439516210c1f0b29437a9ed', + ), + 'kubrick' => + array ( + 'images' => + array ( + '01_linkbg1.gif' => 'f63772c2cc656495a6d7f65d2a754f5f', + '01_linkbg2.gif' => '3bd01b3f95a387963bfb0b1ab01b8d91', + 'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc', + 'bullet2.gif' => 'd1b6cacb4849b507dad138766ed3057f', + 'kubrickbg.jpg' => 'ebc477e9f99d802b450616239317cfb9', + 'kubrickbgcolor.jpg' => 'a5fc1c9484453bdcc6a0c8eaa1d99ed3', + 'kubrickbgwide.jpg' => '1214890da2d47e7fcd149817021bdf04', + 'kubrickfooter.jpg' => '84b95d2c16d25dfef12d3c31ba33cbe4', + 'kubrickheader.jpg' => '29de9d7614370f301799cb340c1db703', + 'tileage.jpg' => '3435eafbab94790d5f74cb801b645c0a', + ), + 'languages' => + array ( + 'English.php' => '05890778f266bd0669aac13c92103ba8', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'preview.jpg' => 'cb94c52db72d1ba8bd4d1e08ee41cbfb', + 'style.css' => '0f93072e98199ac87d3d2957cda402b9', + 'theme.js' => '092a48b0a95fcb44c48236c40948eb13', + 'theme.php' => '449b35c64b081ab7061a97daec5ae1c0', + 'ul.sc' => '94dc33c24a82bbe2c357d4ac165d8c09', + ), + 'lamb' => + array ( + 'images' => + array ( + 'bar.jpg' => '48958de1c195f2b5694643a2fe1f2db2', + 'bg.png' => '6de8f72fdabaf5bf9fbd7cbed462ca68', + 'bluearrow.png' => 'a2df5d6a0f485040f843786e7c606e27', + 'bluearrow_greybg.png' => '0e9896ea0eb8c9eb4f01efdccd2f8a03', + 'boxbottom.png' => '01847b0507171e644013b4bab4febc78', + 'boxtop.png' => '607a50aed74c069befab870576de5868', + 'bullet2.gif' => '0f846116f7143e8f997f9175ea93168f', + 'button.png' => 'a8c0d55b31b31f36c1b1505651e0c5d0', + 'comment.png' => '4515b0331b8a6cb20f92efeacf214a59', + 'download.png' => '80f205604db6d451bf57a71166b6a804', + 'email.png' => '04c8a3218d13cb28be418ee835cac34f', + 'greyarrow.png' => 'dc96c19cd1ca4751040b1e88cae51c12', + 'lboxbottom.png' => '9144b3e9b6c290ef7c4348ace98128d8', + 'lboxtop.png' => '1676f64eaad673a63ae221d370bfcb1d', + 'left.png' => 'b7eb6f1082d63fa13db0da677ccbfad5', + 'link.png' => 'ddc7ad68de90d91f2d85d1c8bea8d358', + 'logo.png' => '5a5fcab0cdd03024f4163b385afa32cb', + 'logo_template.png' => '7cbeaf46b35c917ceaa378476a8938ed', + 'logobg.png' => '13be74d210b6e82c561fcf299087b5fa', + 'nforumcaption.png' => '02cc27a5df2d68a063c5b2c8f4c42454', + 'nforumcaption2.png' => '2b4a342e0fe48adfddb8e058d67cb8ca', + 'right.png' => '62054b67c23bbbd0f258fbe8ce23ab2d', + ), + 'languages' => + array ( + 'English.php' => '22dbd47c4a9f41af9d1bf3cbce5e19c9', + ), + 'alt_style.css' => 'e9ee5679b9218c1c7d89c98c2f95b701', + 'alt_theme.php' => '09fc4de57c31e85eac390e643d401ed7', + 'chat_template.php' => '8a57696d7ecb512823073c64768c8ed7', + 'download_template.php' => 'b6e968dc3f6d17d161b0105b67ae2903', + 'forum_post_template.php' => 'f1a897cbd307b7f0324a501f6664540d', + 'forum_posted_template.php' => '56a97c40620ae669bca178f30ffdd044', + 'forum_preview_template.php' => '2391640ab5380b18ac17e54a99feb29f', + 'forum_template.php' => '8c5f8a4dedc4829aca2c4f418ac49ceb', + 'forum_viewforum_template.php' => '4cdfeb489d50e1e90be0ac8a4af60cf0', + 'forum_viewtopic_template.php' => 'e0d6f0a2678206fa4542ee3ec6459333', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'newforumpost.php' => '7ec9f0bb87045e10862dc2b7dcc9757d', + 'news_template.php' => '0f5b689c4ad3d212934707f44b959b11', + 'preview.jpg' => '184658c1d2222cd0137cc445fcc785ea', + 'style.css' => '475d1badb0a770d6da07c350ffd6dcb7', + 'theme.php' => '6ca169bb182d7ef950c2b27ed88d28d2', + ), + 'leaf' => + array ( + 'fontstyles' => + array ( + 'large.css' => '6428f461d0af5de2a5af1547e98b4590', + 'medium.css' => '26ba7c74395c9c77f21a2345c2ed92b6', + ), + 'images' => + array ( + '01_bg.gif' => '50f03651c070e4138c97a4a7ee9e5339', + '01_bodybg.jpg' => 'ca5f9a092c397986fa10d5990023ab25', + '01_font1.gif' => 'df5d2f07cf7e70371169f54c085435fa', + '01_font2.gif' => 'e9b455dd3cb7ecde36b321aebe977c47', + '01_font3.gif' => '8e9bb2d8d0b48f1cc64e519bb090ef6d', + '01_footer.jpg' => 'cf2f00b3e5a2aff05e70e728eb225cb4', + '01_hdot.gif' => '945bc76d6f25d2a32fafb0abe1933e1d', + '01_header01.jpg' => 'd41622f4fd90237ed438026896dadbc7', + '01_header02.jpg' => '3b01a113505d77d9103b8ad7ae490b0a', + '01_header03.jpg' => '2c25376dbaa1e2a038f8d46fedd5881f', + '01_header04.jpg' => 'dcff85a614aa8fbc68452d2795f5a2f4', + '01_item1.gif' => 'fd6e6c5768ada8f441cd1e80d3e61b8a', + '01_item2.gif' => 'a46a4994806a4c181310caa3e92e80c1', + '01_item3.gif' => '8dce3a9b0c43a0f8b6c9fa4b7500ec19', + '01_linkbg1.gif' => 'f63772c2cc656495a6d7f65d2a754f5f', + '01_linkbg2.gif' => '3bd01b3f95a387963bfb0b1ab01b8d91', + '01_logo.gif' => '06df534ab4f86845ce92257b6737b57a', + '01_m_comment.gif' => '27ac7a5eba1cbc30e793a013ac7c0c5d', + '01_m_default.gif' => '43b70b8bb69fed0f1ec499eb415dc234', + '01_m_news.gif' => '4521605dfa4313520323c28ea26f466d', + '01_mountaintop2.gif' => '034d9e56c10dd3579a7e371735b3075b', + '01_quote.gif' => '93174f052a4a478a633d57dd5d45e32c', + '01_s_about.gif' => '8d0f8698265a152a788fffa7184e681a', + '01_s_categories.gif' => 'a5dedac27cf2c1403b60e52fe4897016', + '01_s_chatbox.gif' => '493f3eb5cd5cb6655997a7e511e350c5', + '01_s_default.gif' => '68c19e8bb6615de2836ec827ab5a6675', + '01_s_latestcomment.gif' => '0b310e282c178c70e190f930ce199117', + '01_s_links.gif' => 'dc4858a967f948815f08acc3dceb33f4', + '01_s_login.gif' => '7f4e38303d5c571bb34660ffb60513e7', + '01_s_online.gif' => '1dcaf5db2305af2c315777f91c6fc828', + '01_s_search.gif' => '1bc719781f1d326651ad4733906d67a9', + 'bullet2.gif' => '5d8d5d48a81b4a045de961a77413de18', + ), + 'languages' => + array ( + 'English.php' => 'b89b3b5688c29ffe9ad8ec70ce414db8', + ), + 'bluehigh.ttf' => 'd3003ad3a5de2a785fbb898c89cf40ff', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'links.sc' => 'a3f5d8fa1e9e14c1b6cc27b06c7754fc', + 'preview.png' => '804c22db1f71223d10e6f7b8b85f69a9', + 'style.css' => 'e7392ac143d7daa82882e906b5413c31', + 'theme.js' => '16285b5ba2631979457e5e2ec1cf10af', + 'theme.php' => '9c7ebc86ae47a457591fdd86337cb11e', + 'ul.sc' => '7614f31e4b096439bea1cd7c9f9ee0e9', + ), + 'newsroom' => + array ( + 'images' => + array ( + 'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9', + 'bullet2.gif' => '2ef6767f3a54a1e7c749421ef0ffad20', + 'logo_bg.png' => '2a38a1ac257ff1d975e15a5169221fd8', + 'logo_text.png' => 'a578be578c320aa365e9bf4ae07abe23', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'preview.jpg' => 'de22b398f66e271fdd908ac31f25e7e4', + 'style.css' => 'bd8715343b586a898a6e4e7875e2f6b6', + 'theme.php' => '5ee241f2ee0f5f852512101261bcad84', + ), + 'reline' => + array ( + 'images' => + array ( + 'arrow.png' => '38b69b179e7cdf232aa367a0dc3c4cbd', + 'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bullet2.gif' => 'b3baab02dac12534c559cb219422c2b3', + 'button.png' => '6ea310ffec2a7d4cdc2e76e0fcae2445', + 'buttonover.png' => 'c76d73539fef2b9d72506583908cfb36', + 'comments_16.png' => 'ada4e49b53f9732e0020f8f917125e16', + 'cube.png' => 'd3f6dd7ab8353b169403826534affb42', + 'e_adminlogo.png' => 'ea8741ecbb591306740e29f420e324b9', + 'e_logo.png' => 'c326c9fcad890ee3cf652b86b219d044', + 'email_16.png' => '90866c1f54ed36c131038d2fc0851ac8', + 'header.jpg' => '56fc3b2e5b74c3f3a111dbc462625c82', + 'header.png' => '094cd7068dc557ce83b5205499ace920', + 'loggedin.png' => '92edf005c8272484836b9f81e509b75a', + 'logo.png' => 'c326c9fcad890ee3cf652b86b219d044', + 'paperclip.png' => '7239a7df3faa4b0a77709b5f99dbbbf3', + 'polls.png' => '2b352ea3b2c392dcc1c6551d1c1b3920', + 'post_it_bottom.png' => '58bd6133cd5439ca03dabcf55a8d94f7', + 'post_it_middle.png' => '2fabff36c04748927032e2d28bc3ccae', + 'post_it_top.png' => 'c7caa215f5c456ab26cbf65d768d5568', + 'postedby_16.png' => 'bbc0eb1411a21d970b3f3c9855e516af', + 'print_16.png' => '574a45049daf40bb348ba6252a1e435c', + 's_nav.png' => '0ef5452590a980bb30cd463c0c6f4a8f', + 'search.png' => '5913e61a181f454a632998805524097d', + ), + 'languages' => + array ( + 'English.php' => '3288884b05004a91af4802cb7e2098a2', + ), + 'admin_style.css' => '7850d3c2db60fb1e649a6eb6201cfc11', + 'admin_template.php' => '92c8ff5fde3790dbcfc895c52c7dc3d0', + 'cube.sc' => 'f85e6d1f10ab3372ec7ebdb0548651ad', + 'full_width.css' => 'f806f549c1200131c4c043db72408da7', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'preview.jpg' => '30da9e1ef04e5f1fef38ae3d23e0f3c4', + 'style.css' => 'aa2df8aa8519c802f10e3eddfd95aed3', + 'theme.php' => '67949514e7139dcbf5dbb9b29d221940', + ), + 'sebes' => + array ( + 'images' => + array ( + 'arrow.png' => '26ea2f602e8ea98d2bedda29cb91c821', + 'button.png' => 'b2ad00a38be298ac4fde8652fb26c8a8', + 'fcaption.png' => '1cf687c703277456b26ea2aff99b3dce', + 'forumheader.png' => 'ad4c1d57c875addbcb9b91c249c1400d', + 'header.png' => '1dadfebcfa12467437c4fd9e02ccf34a', + 'logo1.png' => '36dd9e17390cdca7ec3e8211df5e744c', + 'logo1_template.png' => '5dc8493db503307b22ef2866b8bab58f', + 'logo2.png' => '6c393b306658173bf9f65954aa059260', + 'logo2_template.png' => '613631693ada2776add607af07ebb5d4', + 'marrow.png' => 'c5e56a7c552347ba6a4c5f965c013828', + 'oarrow.png' => '5e15f2f7b6a5e9ccea9583dc841dce8e', + 'search.png' => '5d1c0bcd24277a60b6e5f13059d3ec4f', + 'selarrow.png' => 'b8bd05491ab8b6796c01e9b8c54a7467', + ), + 'languages' => + array ( + 'English.php' => '886394355713facf26c16e029a2b9d7b', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'preview.jpg' => 'a9e7139c84a52e4b164c460a6428b317', + 'style.css' => '2520113be12170cc926299ac4ece598d', + 'theme.php' => '9e888e822f698fbb187bd602ec3ca7c4', + ), + 'templates' => + array ( + 'admin_template.php' => '57aec9f3ef5be669eb7fd47b3635a1b1', + 'banner_template.php' => '5c52f8c726bf4d8e2f843703c2bb24d4', + 'bbcode_template.php' => 'fe842867e0501311a9edd6363560fdaf', + 'comment_template.php' => 'be07b00f84a5fbbeeef3ad557294700d', + 'contact_template.php' => '7ac53206a020fa101c8ea0be32db6e75', + 'download_template.php' => 'da2e5aa05a326a17a976bf9d789dd509', + 'email_template.php' => '8fdbeb00322c889ebf52e43b5b58fb42', + 'footer_default.php' => '7178149c3035e2b16bb843eb0e9f529b', + 'fpw_template.php' => '8db941158070fc816be8111953b786fd', + 'header_default.php' => '958e7c6df8090617caa2d97277a4acff', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'login_template.php' => '8952e4916524b95a3b3f75979e85a58c', + 'membersonly_template.php' => '14635660ab8f2daed92f4260ed0f3fa1', + 'online_template.php' => '0b98cb57967fb6a4d0015a8feb2ecd1c', + 'search_template.php' => '100782de2e0ac37b7286bc2a1f65a2c2', + 'signup_template.php' => '2ba1f894bbba7b332cace51b8dc6e31a', + 'sitedown_template.php' => '85de9cb71af3df0f6e3ef44386d67d6e', + 'trackback_template.php' => 'fd54d8c26c75f9d380e8ec90860b0107', + 'user_template.php' => '40a17b45d7aad1c613fadec6453d75a4', + 'userposts_template.php' => '6f9724081a0be3c5f974d16c92860c9d', + 'usersettings_template.php' => '20d0f1ac95d0abe28ada5a98e987b70d', + ), + 'vekna_blue' => + array ( + 'images' => + array ( + 'bg.gif' => '00b62b8cd66526297fcb79d3229eaa8d', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bullet2.gif' => '206da1d113ffa22ef1cd732e43885a33', + 'button.png' => 'd7b133daf7c18942c478780df09d177e', + 'cap.gif' => 'c63589fcc69d3ad5b10e13e562ac8aa6', + 'capleft.gif' => 'd4ff03746b118ec243f533208949f7e0', + 'caption.png' => '2e9177b9f59bb6f6c6748475506d0689', + 'fcap.png' => '450b53805e3dfaf9d999c2858c40aa60', + 'line_bg.gif' => 'ab28e1dd152e681ff434f2f7cd9a1a5d', + 'logo4.jpg' => 'db6d375e1ab289c531b5046ec4a54e10', + 'menu.png' => '782886f2b16869bc4377c7d2ca745fe2', + 'menu1.gif' => '9eede26903c3fe185aab6a221bd90659', + 'menubottom.png' => '2f54898aac2a907a1a0c530ce1ae36aa', + ), + 'languages' => + array ( + 'English.php' => 'ec72bdf5070bdc80cc485e6e2b8ec3a3', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'nav_menu.css' => '74b91306b957f69bc390ed612df76ac9', + 'preview.jpg' => 'fbb8bde5f9eb4f8efc39f85234959823', + 'style.css' => 'b11955766d34da3f5ee12aa7ca734655', + 'theme.php' => '4e523e4af469271fbfbe5527b8ea859a', + ), + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'article.php' => 'ee3b7df97cb467d35263bedf589abf98', + 'backend.php' => '312552577f67c7965a76bda84b949a64', + 'banner.php' => '6328a170fd3ee6f75ebdd2472f3fb397', + 'class2.php' => '37696f5a30279e2ad8322862c788b067', + 'comment.php' => 'b75934b785dd22089fa9d0b2723916a9', + 'contact.php' => '77d372dad7c0a662b5dd837f8ce32228', + 'content.php' => '10e6c1a9e2180598f8edd8f49022f26b', + 'download.php' => '7be94c51d2d19953966d02c3f5e266de', + 'e107.htaccess' => 'c5e1ad68b41f947be285926c0f81d914', + 'e107_config.php' => 'd41d8cd98f00b204e9800998ecf8427e', + 'email.php' => 'c786469d105283c6735a62172bb63865', + 'error.php' => 'fe3ca6cc7b5947e43aead577a23128fe', + 'favicon.ico' => '5fceb78b9124ddae4027396d7cfcd328', + 'forum.php' => '3c10184d52685d7c9a6906a967b7e3d8', + 'forum_viewforum.php' => '4b9fcc3a820ed2f93b4dc707c3ebe3b4', + 'forum_viewtopic.php' => '5fea10d40850fd6f72cfbec7a328e120', + 'fpw.php' => 'd599b553d2bdd87520615addfb55b573', + 'gsitemap.php' => '4ebcfff3b23717454bb6b3538dd54565', + 'index.php' => '960de1b196ffa6e7887fe99ae65fa682', + 'links.php' => 'bed206fc2abe8f1307ef4db3b7fee63e', + 'login.php' => '6dbfe3d33ddd132cc85f5cb52b692f8c', + 'membersonly.php' => '0903a2ef48312a12ce81b2fa17fe0233', + 'news.php' => '39b13f3be2acd01f8f28fb1cbfcbfaf8', + 'online.php' => '947d1170bdc6cf524541d901f238f1a9', + 'page.php' => '75881aa5f0a3b478bd65feb353863af7', + 'print.php' => 'c115f1f57a0f6c691e5ce0e5b2d5b27a', + 'rate.php' => '19160ac5ab1600124219c2b61c9c4a12', + 'request.php' => '1cf6897842a4c804e33373e03c6b0ada', + 'robots.txt' => '118aadbc5395ee3d4c6fade187097e5a', + 'search.php' => '44bd9ed61fafe34b64a5d109ef2ec9d7', + 'signup.php' => '6cfcc3d5d9fd54add87a960cac1d2032', + 'sitedown.php' => '7a2d95fb0976ce5ab287a403b118acfa', + 'subcontent.php' => '468072ef82e179b6ed5ff20a4eb36225', + 'submitnews.php' => '090f7107c0f8c8636a84516a3cdfcfad', + 'top.php' => '26cae358e9c9a83bfa686832231a2718', + 'upload.php' => 'd7e5209dcd6f7964f0a6655e1f5ef8a5', + 'user.php' => 'bcbc7a76b14c83784949613b6bf61b3d', + 'userposts.php' => 'ffdb5e83f7f061ce19a376e5529c4a9d', + 'usersettings.php' => '44aea0d3fb8906c41c84a31ed5054c6d', +); + +$deprecated_image = array ( + $coredir['admin'] => + array ( + 'help' => + array ( + 'administrator.php' => '8d58e249f4c37c48ef3d0fb600db4c8f', + 'article.php' => '5eaec68b84cbbcbb34f2d970bea1c0b3', + 'banlist.php' => 'b841446435a2cb171968dafa9042444a', + 'cache.php' => '32619118102a53828749f6f5198377bb', + 'chatbox.php' => '64da6bf8536ba4a5f5fbdce91aef02ea', + 'content.php' => '9acd47fab88f17202b907dda61977762', + 'custommenu.php' => '23def1d72ae7dac360df9c3f710fdf55', + 'download.php' => 'd48ddda1acd7a6efe0de0787d6988a20', + 'downloads.php' => 'eb3a2a4d6c89ab2372d88c2999e8cd2a', + 'emoticon.php' => 'a1e9636fd7af1573aa4ba481b9c313b3', + 'filemanager.php' => '60c3a9f7c51c1c9d36c575508711f871', + 'forum.php' => 'bf299e990db850f86cdbcd42b9b3fd9c', + 'frontpage.php' => '3416ed1177991400b4aa82b10f91007d', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'link_category.php' => '4f3852c20f1ef019d22b5760b5e063ae', + 'links.php' => '566b6088a236cb2c093b425ec9309d66', + 'list_menu_conf.php' => '44e687a1ff5df331a63ad6a4892eeeab', + 'log.php' => 'bdb15ca1b175923e93785220f7e5821c', + 'menus.php' => 'e89bffe7bc21b21201a2d768561c473b', + 'menus2.php' => 'ef44b977037e87afeb228279c78e3bb3', + 'meta.php' => '29760d902f4aa3dfb3881842664940e7', + 'news_category.php' => 'fc0954aaa4fff8f878641c4ad707f08a', + 'newsfeed.php' => 'a13915c726c3b5dec2b8899c7422db81', + 'newspost.php' => 'bb22746bfbbdfdd8d7e780105ef9e854', + 'poll.php' => '041fc9b4489b9d467acbba15cbc5b2df', + 'review.php' => 'cf0bf878836e63bb7f12bbd978c4d7f9', + 'ugflag.php' => '309b077d78f56125ce2cbceb056e537f', + 'updateadmin.php' => '2a51d30073923c6ca0128d63f71dae5a', + 'userclass2.php' => 'a60b4f7f2c72660f46b34307bfdf39c2', + 'users.php' => 'df0e3b9a6b200f37225fae370b5c198d', + 'wmessage.php' => '6eb398815b8165d5ffef65fd42a7922a', + ), + 'htmlarea' => + array ( + 'images' => + array ( + 'ed_about.gif' => '8892c7e4a559a6bb1b50e9009ddb1665', + 'ed_align_center.gif' => 'f3c560b8cd085dd249e4632107ad5e02', + 'ed_align_justify.gif' => 'e4fd3728dc374e0cfc24b07ea6be90fc', + 'ed_align_left.gif' => '3301e69399d07346067114647bb3dc33', + 'ed_align_right.gif' => '00950f054f71e69d9c30378e76bc12a2', + 'ed_blank.gif' => 'ca710933239efd41bbf4d1a3231240f4', + 'ed_charmap.gif' => 'cbdbb8c0c3a4ec3d285d1b45eaafd08b', + 'ed_color_bg.gif' => 'cc74713d087b0d0a1200016a1e197100', + 'ed_color_fg.gif' => '3640d2e5ca79aeebd72414c0b85fa3df', + 'ed_copy.gif' => '684b277b164596eca2e53c750d8b5b04', + 'ed_custom.gif' => '1ccd6155d74e1b19b4651994219a6615', + 'ed_cut.gif' => '220ce8bbe529bf3a092a9643e936bdd7', + 'ed_delete.gif' => '573745a746bf300916c73a19d0819ab2', + 'ed_format_bold.gif' => '520b80446acc7ff6021574295e0b2a81', + 'ed_format_italic.gif' => '944c91acc59d24f9769eca617ff9239d', + 'ed_format_strike.gif' => '1ba752cc9729f54bd87efe636dca247b', + 'ed_format_sub.gif' => 'f63ce7a2b86ffcf07dcbddc0aac9b9d7', + 'ed_format_sup.gif' => '7d1ab42fd5003dc07c1a17d6eac514d5', + 'ed_format_underline.gif' => '468b978544e8811fa3b0deef30741efd', + 'ed_help.gif' => 'f652d29123b5a2f24d70d9da3c9dc653', + 'ed_hr.gif' => 'ae6fa428e1f6cda1008a7f608825f6da', + 'ed_html.gif' => '9b32f161406de6bae7884a3391798042', + 'ed_image.gif' => '9a1f8c6fbcfb03efe900b90f41851792', + 'ed_indent_less.gif' => '46c4a489b08646a7f110c360b61be3bc', + 'ed_indent_more.gif' => '77506085135c4008d62cca50ad3feb20', + 'ed_link.gif' => 'adfb4f124a9cfcbaf1d5f2dde6194641', + 'ed_list_bullet.gif' => '1a49be730188f40a7878ec8b9cd03b06', + 'ed_list_num.gif' => '282b0624844fe048e7f8d180c254c2df', + 'ed_redo.gif' => 'e8f409bcd2a561274505fa79902d175f', + 'ed_undo.gif' => '9c6818077df01f6aa3b0113b0c195a88', + 'fullscreen_maximize.gif' => '361a5915db890026ed4280bc518e502f', + 'fullscreen_minimize.gif' => '08a51cc59af4c9c1e1cc77290f5f26ad', + 'insert_table.gif' => 'cc65036d9589d6183342e2eed294ff57', + ), + 'popups' => + array ( + 'about.html' => 'd66d35b6344ded6911fed96b61bd2cb9', + 'blank.html' => 'c83301425b2ad1d496473a5ff3d9ecca', + 'custom2.html' => '2ccb932916cc2696d5d1952d4d36eb13', + 'editor_help.html' => '7ca29d18f18c0040db5c3af15254d0e8', + 'fullscreen.html' => 'ec725d362b4bb338111e43e064faef37', + 'insert_image.html' => '8a06b1d93a6115f1ecc12ec2caf5749f', + 'insert_table.html' => '1562c8c3b40afcef1800e6b753f6b895', + 'old-fullscreen.html' => '0daa59e83fdb6b487c6502c5e6a2d42d', + 'old_insert_image.html' => '9482a4fbbea5a45558f2faaf83291f09', + 'popup.js' => '1fbb9698cd184cd3b7f61aa9ca0a6d17', + 'select_color.html' => 'd76a6a92c9660aeeee17fc3fa25fa184', + ), + 'dialog.js' => '45236d35186f82dbc2fab623f0406f60', + 'htmlarea-lang-en.js' => 'c512cf5dbbf3f3194ea314bdf4710c55', + 'htmlarea.css' => '6113c65492628800a361ccef432b829b', + 'htmlarea.js' => 'e33f5031dffdd23c855a054bda135502', + 'index.php' => '0ec862dc66ce060cc098cfd977709c9e', + 'license.txt' => '0cb5443ecf825c27b9e488adae9ac8b2', + ), + 'includes' => + array ( + ), + 'sql' => + array ( + 'db_update' => + array ( + 'table_update_603_rev6.php' => '8d86e635ec98ef9b86f3ee8d442f7402', + 'table_update_603_to_604.php' => 'b2e91946ffe089e60f26857c2065f352', + 'table_update_611_to_612.php' => 'ebc6d228d4f32dc709337d173e8e3e92', + ), + ), + 'chatbox.php' => '7e75a4fc9d8a70280cf3ea38a6957039', + 'custommenu.php' => 'a1bcab76003c2d7a26075c6dde92a2ea', + 'downloadOLD.php' => 'da13cde41db327d1a251bd02b4f11974', + 'download_.php' => '17e197e6094df8c6f70c9d6ee5d99cb5', + 'download_category.php' => '6f81e7b0d0fd7b8e1278bab935bcb431', + 'filetypes.php' => 'f951037335e993337792606cc1475cec', + 'forum.php' => '8fcecb7939d0e2f3776602f12f256d41', + 'forum_conf.php' => '59104f7a4e953f4935c82eaedc060931', + 'header_links.php' => '89b428327e178a5ec1cd590a8a5a5eea', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'link_category.php' => 'a037103b28a327d7f68b179a6430e0cc', + 'linksOLD.php' => '97ea4f0610899f6f3892d4bf54f8fc57', + 'log.php' => '79f63402eb374a1756984f60511d13fd', + 'news_category.php' => 'f797eba058a27b2391eb25bd3cc185d9', + 'newsfeed.php' => '9b0566edc1f49895997f39a07b9037b1', + 'poll.php' => 'a2038a1b5a5f03b243ecd07ee5085181', + 'submenusgen.php' => 'cbb94c39c1a0640983700119686402ac', + 'submitnews.php' => '684139e60a097eb04be9767c49dd9985', + 'theme_prev.php' => '386420f2c1c731f23c7df91926443e72', + ), + $coredir['docs'] => + array ( + 'help' => + array ( + 'English' => + array ( + 'Articles' => '8bdb338ca53cd252f0d3f3a7ad511520', + 'Content' => '770d62fe3fa3c984956884553e85af2e', + ), + 'Administrators' => 'fde3f611512ac789609c80fc8a6f3609', + 'Articles' => 'b59d04443bec2260d4bed4ef013c94b4', + 'BBCode' => '33451916e62615ddeefb30103f570831', + 'Banlist' => '83a4c139037713c03d0999e28335c852', + 'Banners' => 'a1c096485e789b14c720b7c73b4ea7a2', + 'Cache' => '7fc85b1d45b8d7f3cf7b4866d3d37aa8', + 'Chatbox' => '5fa17c49db4bfef93729d2dac1fcc162', + 'Classes' => 'ea8b68f265aef007a9636443b7da3dc5', + 'Content' => '770d62fe3fa3c984956884553e85af2e', + 'Downloads' => '37399eb226ad7d1d729f68f65efc7b00', + 'Emoticons' => '14a0d74aea591e0f8d82577aff8fe979', + 'Errors' => '46381d88a2326ff760562fea385b2fd0', + 'Forums' => 'a2266bd5b818e1cf30168ac9053b7a59', + 'Front_Page' => '7df90a02713ecf9d6ff1c7f7f77cbcb0', + 'Help!' => 'cbbb887146e203d6e2cae27b17db7ff8', + 'Links' => '320eb08defa1360070a4f0c062e5fc84', + 'Maintainance' => 'cc818c06e047bba0e2c2349e954cfaf0', + 'Menus' => '44a53801c18ad52aa9e50c3b4fbfe241', + 'News' => 'e5ec6c8137c00916343f8f4f5084bfe7', + 'Preferences' => 'a089239dbffa47eba773c3c4f878d4b3', + 'Uploads' => '3db7011da6342cf030bb03f011706bb2', + 'Users' => 'd64be592aae221b66ca4d33b69056e7f', + 'Welcome_Message' => 'a3a7b26428d35d5ebb520e16ac6204da', + ), + 'ChangeLog_615.txt' => '0e4d3787cd2a3faf41c45d3b70311295', + ), + $coredir['files'] => + array ( + 'backend' => + array ( + 'news.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + 'news.xml' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'bbcode' => + array ( + ), + 'cache' => + array ( + ), + 'downloadimages' => + array ( + ), + 'downloads' => + array ( + ), + 'downloadthumbs' => + array ( + ), + 'images' => + array ( + ), + 'import' => + array ( + ), + 'misc' => + array ( + ), + 'public' => + array ( + 'avatars' => + array ( + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + ), + 'resetcore' => + array ( + ), + 'shortcode' => + array ( + 'batch' => + array ( + ), + ), + 'default.css' => '54d8e232fe73969b593f71df2afd6995', + 'style.css' => 'd62b27257e32cc08296930879a6df478', + ), + $coredir['handlers'] => + array ( + 'calendar' => + array ( + 'language' => + array ( + ), + ), + 'htmlarea' => + array ( + 'examples' => + array ( + '2-areas.cgi' => 'c26028a87777a45e8792cf9939cd5464', + '2-areas.html' => 'df7d45c30d0825f9c450f38c5af60508', + 'character_map.html' => 'b064eb5c9586d743ec86ac54370ac61f', + 'context-menu.html' => 'fc0226d993ec92c2a9c98fb06002bda1', + 'core.html' => 'c0349e4a3810a822cbb01ce26019afcc', + 'css.html' => '90120b460e62b056e46a443d869b104f', + 'custom.css' => 'd841b6b070f3ae8e67e196ff2ee6c5fe', + 'dynamic.css' => '402fa7e28e0b0c2035520676cc4ff581', + 'dynamic_css.html' => '3bcdb4239b896d49ba2d32c329b54e74', + 'empty.html' => '4404eb82dbf03fd2825e0fcce3413769', + 'full-page.html' => '588ce9c643c645eb2b6cbe1dbbfc09fe', + 'fully-loaded.html' => '5d7c6ca8fa4927dbbb40fc604d856922', + 'images.html' => '9553c5838b7c90a33a0401084a7a0c46', + 'index.html' => 'e8fdc4fc45c34917aff59da5c7ff001d', + 'list-type.html' => '25df168ea209a4be5ea42f559683b96e', + 'pieng.png' => 'f8915fe3b221dd044a93782fc0d2f5f0', + 'remove-font-tags.html' => 'a0caff2e51ec7a7aad6e4cf2f6d12dd4', + 'spell-checker.html' => 'e50a13ee08206801e968270c72adac0b', + 'table-operations.html' => '3e14d124b11047df9e7ad3ef92c932cc', + 'test.cgi' => 'b6b0615fc550bfec4c5e5adb1c69cc6a', + ), + 'images' => + array ( + 'ed_about.gif' => 'e0c3a2d4938e92642abe88319c37a019', + 'ed_align_center.gif' => '419a7cac054b4b2dff1b9eab7a45b747', + 'ed_align_justify.gif' => '9c31aa4411277ca29c3419f8df7b8b1d', + 'ed_align_left.gif' => '9c22c00f4c67931140be15e59db6d517', + 'ed_align_right.gif' => '93862fdc7d08142fa419cbd0f6c66213', + 'ed_blank.gif' => '020874e9edcbcd0b514d1b30f14b18bb', + 'ed_charmap.gif' => 'a897a03f66ec432ed8e7cd26c3b5f88e', + 'ed_color_bg.gif' => 'c6e286fdfa3ba31ebed7f18b0ecc75b4', + 'ed_color_fg.gif' => 'c72e9bc079196ed7b089afa9593cd8a9', + 'ed_copy.gif' => 'cf622962955f521c5ae576797d1032f7', + 'ed_custom.gif' => 'e7b27a6808e66a8a301cbaf64eb8825a', + 'ed_cut.gif' => 'f512b15c53dea427a6173023b8945a87', + 'ed_delete.gif' => '79ac46c129cf5dc8b21c5c0d42151831', + 'ed_format_bold.gif' => 'f4f614c2cb06763fc3063c93f07cf415', + 'ed_format_italic.gif' => 'a800ad94ba742d72099073f0faeb2004', + 'ed_format_strike.gif' => '9aa5a079df34a4eedcc5c716c9386a74', + 'ed_format_sub.gif' => 'b16263bc5ca08886c978db99f4feea40', + 'ed_format_sup.gif' => 'cad7d563b915d56d38cb0ee680191a59', + 'ed_format_underline.gif' => '505a23f166dcb38cea34af16ce4dbb5c', + 'ed_help.gif' => 'e7fce3f8566622f3add66b5255948397', + 'ed_hr.gif' => 'ff70dd8f9cefacf143e7396dcf4f58b6', + 'ed_html.gif' => 'fa6e7d1b61493b607b61bd71bf1f36d5', + 'ed_image.gif' => '4ab7d43a45532267df831d0a8fc34d8c', + 'ed_indent_less.gif' => '850310807053467daa42cc8bba2fcbac', + 'ed_indent_more.gif' => '3835d1bdd22a011a5b22e23fcce75e9e', + 'ed_left_to_right.gif' => 'a0f9ecd9a146094c0265df9ab57e1dce', + 'ed_link.gif' => 'f04cb59f80844ac38e9ce9f2698ce7f9', + 'ed_list_bullet.gif' => '236b4559afbfec1d238a939b65ea9d0b', + 'ed_list_num.gif' => '48d3e7c2c5826371be37b608d33af15a', + 'ed_paste.gif' => '81e1666c11b6def84943d3fab3aeedfa', + 'ed_print.gif' => '9bd797173a2fa37bedeeabd5d47e25cc', + 'ed_redo.gif' => 'e9e8c51b9f00093a3f303f0bf2ce7e05', + 'ed_right_to_left.gif' => 'c644f85dfa635e265e6a8da8c7c06227', + 'ed_rmformat.gif' => '287498e569fb9a902e7cfc8dd634e449', + 'ed_save.gif' => '07ad6426b48b0f86cf0985a599c7ee95', + 'ed_save.png' => '0a17a62b278ba3554338d254c4e9af60', + 'ed_show_border.gif' => 'ae228363e7079002dd18dffad8d66c62', + 'ed_splitcel.gif' => '2c04da7e1c53d5c63aff4f80e5023b22', + 'ed_undo.gif' => 'b9ba819ac9e7700ca0a876dba2b81c39', + 'fullscreen_maximize.gif' => '2118040d93941f64f7a2096b2370d7c2', + 'fullscreen_minimize.gif' => '816c96e44ded878836292b80da38ac1b', + 'insert_table.gif' => '3a985dd81474a602d4318b67dc5023e2', + ), + 'lang' => + array ( + 'b5.js' => '447acabed5a028ed6130315d9c943de9', + 'ch.js' => '9ad4148575e696b826345faf9c104ecb', + 'cz.js' => '7e0d467e3c3f95365f07fcd57e9e6036', + 'da.js' => '4450a6f37a4619e067466157477e227b', + 'de.js' => '24be5c7286b694ec285fdd3e39430eb5', + 'ee.js' => 'cef8b2148ce28b55eafdd41a9479d29e', + 'el.js' => '49f2dd6d814083e200450934175e54ce', + 'en.js' => '67a44be798d52f8434b1d5db9afc0344', + 'es.js' => '465284bdda072f89c1aa381bd129d4eb', + 'fi.js' => '1648e59b0fc3e98b673e260c4c4f2b54', + 'fr.js' => '9c8d847c3c1384e36d115c0437036961', + 'gb.js' => 'b6ff9b489e34676feeb33c94d67e3c40', + 'he.js' => '5973c58ae6d3cf1a7e13d53968e2f8b5', + 'hu.js' => 'e4058a7d72a280f4d007b0cba7dba299', + 'it.js' => '48f677e19fcbbf3eb3e2f32e808e6195', + 'ja-euc.js' => '1937933840fe8a3f6c27850f9d1a6b15', + 'ja-jis.js' => '58f5669e271d2a9399ed4319b6a27563', + 'ja-sjis.js' => '1ce17214bec7f48f7c7fbc0cb14ae591', + 'ja-utf8.js' => '08eec318143c80b3f9d77c16e302c327', + 'lt.js' => '8b5d346a3a49d276b0d613dbd05babc7', + 'lv.js' => '1821f4505b4824daab558b8ab8456589', + 'nb.js' => 'fe892254acff2640f3e52d26839b936b', + 'nl.js' => '31994cf5b276689e361684336577611c', + 'no.js' => 'ddb7044ad152be38f496969473a1175c', + 'pl.js' => '9ec4ec413e44d1f372db4dc5d3117153', + 'pt_br.js' => '79ffb2703fc0e55e71e54842a86598bd', + 'ro.js' => 'cdbeac570a639c27ebddde2825352787', + 'ru.js' => 'd980179d51e134536810d69fbd48568b', + 'se.js' => 'eb12fb43788fd80aa4a60b7826ec01cb', + 'si.js' => '886456af4fc31dbcd830e796ef7f3912', + 'vn.js' => '8c6666b64ed1206242f30b0b7c47dd56', + ), + 'plugins' => + array ( + 'CSS' => + array ( + 'lang' => + array ( + 'en.js' => '8e6555db8565a1d7f048b6a18dde3fda', + ), + 'css.js' => '090411fa76b76164871cf2344a83816b', + ), + 'CharacterMap' => + array ( + 'img' => + array ( + 'ed_charmap.gif' => 'cbdbb8c0c3a4ec3d285d1b45eaafd08b', + ), + 'lang' => + array ( + 'de.js' => '4ed8e64697d6e02747eecff014fb37f9', + 'en.js' => 'ead2887475037b02a936253d02b69f3d', + ), + 'popups' => + array ( + 'select_character.html' => 'a04ca5324301728db4e709e1ba6b042a', + ), + 'character-map.js' => '45ca956159d003a48cc3f986d9b9378e', + 'makefile.xml' => 'd931cda0bf52a8924c8f7ae33c7b2c1f', + ), + 'ContextMenu' => + array ( + 'lang' => + array ( + 'de.js' => '4b2fce5f5d94db5a1a9e8d49b14f251f', + 'el.js' => 'f66150fc20a7710a38f06ca26aba56c0', + 'en.js' => '3cd3c38364df0fc5bf545c040b575bb6', + 'he.js' => '42160bd5787ff8ebb2db2eba0b3765ed', + 'nl.js' => 'be00a4d988b49422748508b18aaca0b7', + ), + '1.pl' => 'b6bf5f353d0a8855a1fd306b66cbe9c5', + 'context-menu.js' => '5a7c67297506ef28729e14a3473862b3', + 'makefile.xml' => '014bbd44792974fd68bedd459ad86916', + 'menu.css' => 'e9a7d8e58b8467c4aa2c21d78a3d55f5', + ), + 'EnterParagraphs' => + array ( + 'enter-paragraphs.js' => 'e07557b92190a5afb75a1947b54183f6', + ), + 'FullPage' => + array ( + 'img' => + array ( + 'docprop.gif' => '7d7b378ee76a7261839f1761747c92ca', + ), + 'lang' => + array ( + 'de.js' => 'f2521a052eb077cc4ca8bdac46b52318', + 'en.js' => 'a32a89a7d529980c4578ce41d5060a83', + 'he.js' => '4d7d7ac12427b8e83409f5a722b24a3c', + 'ro.js' => '70c749f56e054ee375d3071835bff971', + ), + 'popups' => + array ( + 'docprop.html' => 'd70ad91008772d4cfddc481047450388', + ), + 'full-page.js' => '64e3137a2797388a5f9c8997bc95254a', + 'test.html' => 'bc2dbd5b474b8ee25201bdf9d6111f2d', + ), + 'HtmlTidy' => + array ( + 'img' => + array ( + 'html-tidy.gif' => 'df7a4baa0a571884619ae7eb0c200bb7', + 'makefile.xml' => '51b266fe6e1c56194e882daff3cced7c', + ), + 'lang' => + array ( + 'en.js' => 'db675a7d0202b2fb278038b16fbf9cd2', + 'makefile.xml' => '093576d9af435ec31fd92da9bce1744a', + ), + 'README' => 'e72c09ecd15ee4288dd403ef47bf0622', + 'html-tidy-config.cfg' => '09ee92887f93971b1858f289427d441c', + 'html-tidy-logic.php' => '8f7236a0097cc58f8f72dadb20ab3604', + 'html-tidy.js' => '7b9e2fcfb2a25fd01ec420a67e32a858', + 'makefile.xml' => '7dd3abc3e30aa07ac4b0d18810dea63e', + ), + 'ImageManager' => + array ( + 'Classes' => + array ( + 'Files.php' => '2692b44b256a5bd27b675abb64250682', + 'GD.php' => 'f0b6c4522817f07ca95bc64f9a162599', + 'IM.php' => 'cba66d49670c9e1e3e12281c1e456999', + 'ImageEditor.php' => 'e88d5eb443de0968694d7c84231a0a02', + 'ImageManager.php' => '0c3d9e63708ad26239a03ac4b1b4319f', + 'NetPBM.php' => 'd13aae16707bca40d61c9603cfb8bb59', + 'Thumbnail.php' => '57b96ef8a203a79eefbc53c7aa32f79b', + 'Transform.php' => '70627a5e07fd7bb51c35d5407333f64b', + ), + 'assets' => + array ( + 'EditorContent.js' => '56ca6920dc7b98dc4e975cebb8790712', + 'ImageEditor.css' => '923a26cbde11cd05a2fe714d75d61edd', + 'dialog.js' => 'e418b7c77ee9f8bf01d100b3de63757f', + 'editor.css' => '0523943b213ec2edfd9f3562397ee24d', + 'editor.js' => '97844fb6bc700e8c832a6bd95b6dd92c', + 'editorFrame.css' => 'd585831ec0b2a9088755c5748d80ffd3', + 'editorFrame.js' => '7da85c65207fcb1a66add2105d3d140c', + 'hover.htc' => 'b8e7a2a9b05a94f4789ec220f4c688ab', + 'imagelist.css' => '73a0b0581fb0020a3f734334dc60cdca', + 'images.js' => 'a46d80c6482269737ea52879f92ba643', + 'manager.css' => '8889b7af3a1d994e472fdd2ebe69500a', + 'manager.js' => '4b1887eb16e3794e47b707feae04b58e', + 'popup.js' => 'ce11aaa2796994d1a931e4376951fe8d', + 'slider.js' => 'd8bf45b210537f1f220d3f7123c51160', + 'wz_jsgraphics.js' => '034e994a173372f31661f66cd84cdb95', + ), + 'img' => + array ( + '2x2.gif' => '889a061243a8d254b8a051f4c2e5888e', + '2x2_w.gif' => 'e602cc47d26909903907a1141736bc4b', + 'btnFolderNew.gif' => 'd36d09544ef41db8a3230d25735960c8', + 'btnFolderUp.gif' => '6ee5eb9556897ac23a6762645b9c98fc', + 'btn_cancel.gif' => 'a4f53f6cfd7fe94f243762224f9f9c19', + 'btn_ok.gif' => '9c9ef0692dc686d2f80f387821364454', + 'crop.gif' => '9423eb4e1b1887ae43479f322bf624c3', + 'default.gif' => 'fd81a1c481584f1b1f1166f29b9ca60a', + 'div.gif' => 'cf5b3b40af68e894b7e8daf38dc590f0', + 'dots.gif' => '1f1d5ee955a043ef4e32a1fb6908a9d6', + 'edit_active.gif' => 'dd9aef4d47d74d2fd0468b306b93c7eb', + 'edit_pencil.gif' => '3c1632099bd6d9f628d75cc945d65472', + 'edit_trash.gif' => '544f51af0afd7c03f89aaed3bd236bce', + 'folder.gif' => '6d3fe7d47b4a1f5788b755b9f41962fe', + 'hand.gif' => '228dec68bb9d3e4db8f892da48b82077', + 'islocked2.gif' => '9d20ae36b2ba9ecbff770e4905779725', + 'locked.gif' => 'b1da4d2161b8a50077caff0affde606a', + 'measure.gif' => 'b965f9dec293df5ff007e57a20da5862', + 'noimages.gif' => '8f1b20dfcbb76ea7eccaaa7dce7bd2e6', + 'rotate.gif' => '2e9f127ae49427d98a389f97e88b8302', + 'save.gif' => '0ef008540649f73357ccb9e11fb0c143', + 'scale.gif' => '7681e29865fd4206871bbf9ff78a0d6e', + 'spacer.gif' => '221d8352905f2c38b3cb2bd191d630b0', + 't_black.gif' => '56953a9124d388a2c36e1f40cc539776', + 't_white.gif' => '9448cc76491fdc49524d19c21fd7c81c', + 'unlocked.gif' => '180782c948e3dcc25efac3fdb4bc1f25', + 'unlocked2.gif' => '717ef4a83a86cfc967c64110efdeadf7', + ), + 'lang' => + array ( + 'en.js' => '878cc575e93b0209fe9f16765c9834bc', + ), + 'README.txt' => '1c6d282806895395a23e514c4f1066b5', + 'config.inc.php' => '03269e9ae6a4b70e123e990a605031e6', + 'editor.php' => '170e45516bfc45c5a826e430827e1119', + 'editorFrame.php' => '802917ce477b1acd1e76d42be9aa5f6a', + 'image-manager.js' => 'dc30741f304b2950d50e7b96e0d47611', + 'images.php' => 'f218b51d5e9fcc072c5d66315423bab8', + 'manager.php' => '71baed2d33b08b013ec8b9aeeb4e6077', + 'newFolder.html' => '767491c7e3685a684e0061a7127b2ee4', + 'thumbs.php' => 'dac30ffea29e6ce86cd4d00ffc5008cb', + ), + 'ListType' => + array ( + 'lang' => + array ( + 'de.js' => '48151b4536ffef96e950b967a5ad27b3', + 'en.js' => '3e2424f60d678219d71dd3c5992520b4', + ), + 'list-type.js' => '9ae3d27711d44a896a4994ead5ce0e28', + ), + 'SpellChecker' => + array ( + 'img' => + array ( + 'he-spell-check.gif' => 'a9691fd828640716a4824fd3687095cc', + 'spell-check.gif' => '45f87ae3a236a82a00590675ab45300e', + ), + 'lang' => + array ( + 'cz.js' => '423ea6b03dd929379d8c3c0e2a1b03a6', + 'da.js' => '497d53b6de504e815f21e0b52c4429be', + 'de.js' => '8e1cf54a88bfa8f1f1bae8901ec724d3', + 'en.js' => '377855eaba880269a2a806e1f410dbd7', + 'he.js' => 'ee5604c67403b7344bd8aab484993b74', + 'hu.js' => '2f79d9530b544abcc01c980066319b5e', + 'it.js' => 'b731ddc9bccc8b8b45862bc8af1fc03c', + 'nl.js' => '347cc6ab35dc6e52f078173aca6038cb', + 'ro.js' => '1cb27ad27005caa43d26fe038aca361e', + ), + 'readme-tech.html' => 'dbeb0b3677a42ec8d6ba93c74d80777d', + 'spell-check-logic.cgi' => '8a73715a7dfca8571e40f2a0c0ce73ca', + 'spell-check-style.css' => '6953de17403da48de1a429187892200f', + 'spell-check-ui.html' => '3af087688cd52a07b4baedee45d4a36a', + 'spell-check-ui.js' => 'a1567a45c985106c96c18e999dc56ffa', + 'spell-checker.js' => 'd922b5b20388fb3d73ab470c79fb2f4e', + ), + 'TableOperations' => + array ( + 'img' => + array ( + 'cell-delete.gif' => '7bfbe4bb08412b6933b9e4cb67279a50', + 'cell-insert-after.gif' => '0cfcc1080fe87476e80ee62a5e7c228e', + 'cell-insert-before.gif' => '90729f21741e8d1e6de6bda134b8e28d', + 'cell-merge.gif' => '643f7ce0bd58e09e9d33afb7bafcfb41', + 'cell-prop.gif' => 'd499211088027cb901d0e2110608b6ec', + 'cell-split.gif' => '5f2d042f04107d2b74e205c4bcd75bed', + 'col-delete.gif' => 'b7e7a41e9176c07af5a10ca2035019e1', + 'col-insert-after.gif' => '999e3fec40db7cff90fafc0ef9b67c90', + 'col-insert-before.gif' => 'bcbdc75b946ef3c67523e26105046731', + 'col-split.gif' => 'c0c535be91376e5f5a763c3bee9bcaab', + 'row-delete.gif' => '550b14813b04e8a1a49f2799bbf2ecae', + 'row-insert-above.gif' => '121b8897f46625b42a0626e98b428ea3', + 'row-insert-under.gif' => 'dad2c7e0d7b38f9982382c2925ca18a2', + 'row-prop.gif' => 'e6df91ff1129ca622afb11dd1d9eb693', + 'row-split.gif' => '42fea49dff83dd1437defdc43795e300', + 'table-prop.gif' => 'a0c6945eba87e40f753952c16f1e788a', + ), + 'lang' => + array ( + 'cz.js' => '891f6cf5b22f7a1c8dcbf039a3bc29cd', + 'da.js' => '6253788b287cd7069c02bce1c25458ab', + 'de.js' => '48a37c922d8b8fc7d93cfb20a50357c4', + 'el.js' => '342afc0caefe7e53ac753d6b8f2ed041', + 'en.js' => '0d42d10515c8be7601482beffd37eff9', + 'fi.js' => '5b8ee761a423e09cc360294f87e85c08', + 'he.js' => 'a1645eb3b8b5306c7046791fd0b4b6a3', + 'hu.js' => '971f436dce04d926c0835e93816b2912', + 'it.js' => 'e9f2d5f3d7ff32468dd44077ea21937e', + 'nl.js' => '7d1ec5afd720877120bb81f73ba0cf70', + 'no.js' => '8613a29c3174424b0bf9abee60352434', + 'ro.js' => 'a01f89c091380da4a56acd9acf06516e', + ), + 'table-operations.js' => '1b988f2a82430274492780b22a2bb7ba', + ), + ), + 'popups' => + array ( + 'ImageEditor' => + array ( + 'jscripts' => + array ( + 'EditorContent.js' => 'a0d5619dd3570cd2ecc8711d23aa36d6', + 'slider.js' => '3d58fd930085aa61cd9fb0e7bc81f01d', + 'wz_jsgraphics.js' => '034e994a173372f31661f66cd84cdb95', + ), + '2x2.gif' => '889a061243a8d254b8a051f4c2e5888e', + '2x2_w.gif' => 'e602cc47d26909903907a1141736bc4b', + 'GD.php' => 'ad14fd96ebf77707b3f177536c0b20f2', + 'IM.php' => 'fcf6c91de9af23e2cb297412df1590e0', + 'ImageEditor.css' => '923a26cbde11cd05a2fe714d75d61edd', + 'ImageEditor.php' => '2f8f8c4fbfb1b0b3cd02efec79652c23', + 'NetPBM.php' => 'aa5eefb655d68a94702d41ccf6ff7d7c', + 'Transform.php' => 'e6448a8d758d5afb6ca1af5e6bfc7910', + 'btn_cancel.gif' => 'a4f53f6cfd7fe94f243762224f9f9c19', + 'btn_ok.gif' => '9c9ef0692dc686d2f80f387821364454', + 'crop.gif' => '1a76734219b53116f4e9905ea2af2e23', + 'div.gif' => 'cf5b3b40af68e894b7e8daf38dc590f0', + 'hand.gif' => '228dec68bb9d3e4db8f892da48b82077', + 'load_image.php' => 'f155a3b259125b861528d09768ed858d', + 'locked.gif' => '9d20ae36b2ba9ecbff770e4905779725', + 'man_image.html' => '8f012c3475587bc082fe6b20d942069a', + 'rotate.gif' => '2e9f127ae49427d98a389f97e88b8302', + 'ruler.gif' => '53000656f017f2c128e86dd9f314e95f', + 'save.gif' => '0ef008540649f73357ccb9e11fb0c143', + 'scale.gif' => '0ea1e46cc5de3f04a2e83f7daf690a95', + 'spacer.gif' => '221d8352905f2c38b3cb2bd191d630b0', + 't_black.gif' => '9897846e47b0b7dc9fcd2b89e918dacb', + 't_white.gif' => '9448cc76491fdc49524d19c21fd7c81c', + 'test.html' => '691e4bb7755b5ae86538a8852b9fe759', + ), + 'ImageManager' => + array ( + 'btnBack.gif' => '551c98aa577cd1fc06c6703ec167d6e8', + 'btnFolderNew.gif' => 'd36d09544ef41db8a3230d25735960c8', + 'btnFolderUp.gif' => '6ee5eb9556897ac23a6762645b9c98fc', + 'config.inc.php' => '31d8cebc72d510e35cc1c53f496d6367', + 'config.inc_orig.php' => '87b4ab3f0e7d8ae6a4562730cfe987c7', + 'dots.gif' => '1f1d5ee955a043ef4e32a1fb6908a9d6', + 'edit_active.gif' => 'dd9aef4d47d74d2fd0468b306b93c7eb', + 'edit_pencil.gif' => '3c1632099bd6d9f628d75cc945d65472', + 'edit_trash.gif' => '80269e15cbb7187371493dfa52b6a53d', + 'folder.gif' => '6d3fe7d47b4a1f5788b755b9f41962fe', + 'images.php' => 'aa1010985b23d278667e33c5d212c14f', + 'loading.gif' => '3e131b006c211839150e2336691918f4', + 'locked.gif' => 'b1da4d2161b8a50077caff0affde606a', + 'newFolder.html' => 'd7a282c567c2d84c6bbd312645538a29', + 'noimages.gif' => '8f1b20dfcbb76ea7eccaaa7dce7bd2e6', + 'thumbs.php' => '2f721186a74b6a0ece248b667bdf915e', + 'unlocked.gif' => '180782c948e3dcc25efac3fdb4bc1f25', + 'uploading.gif' => '62d8e984849c9747f9a05de393e055be', + ), + 'Copy of insert_image.html' => '8a06b1d93a6115f1ecc12ec2caf5749f', + 'about.html' => '9c6c02a3a05707cfeb768b428f60516e', + 'blank.html' => 'c83301425b2ad1d496473a5ff3d9ecca', + 'custom2.html' => '2ccb932916cc2696d5d1952d4d36eb13', + 'editor_help.html' => '7ca29d18f18c0040db5c3af15254d0e8', + 'fullscreen.html' => '4d9d7c276363f212428b2ed15cf9d8a6', + 'images.php' => '3755c66145eba21cc2199d455e855d73', + 'insert_image.html' => 'e9db88c76c75487cdd5415525ff94444', + 'insert_image.php' => 'b024826624d558a4600659d20189738b', + 'insert_image2.php' => '8a06b1d93a6115f1ecc12ec2caf5749f', + 'insert_table.html' => '47057008bd2f8af99f40b64d69fc7101', + 'link.html' => 'c692e60fd034d33bfe452e014d99fdaa', + 'old-fullscreen.html' => '0daa59e83fdb6b487c6502c5e6a2d42d', + 'old_insert_image.html' => '9482a4fbbea5a45558f2faaf83291f09', + 'popup.js' => '8efbf716ae23676c4cd3bec5a6b8df46', + 'select_color.html' => 'c047474ad06f18557cd711c78bf86c4e', + ), + 'ChangeLog' => 'c68e0a92145cad1afd0738dc0875f7a8', + 'dialog.js' => 'd84853c01220bee8568dc68701ff5253', + 'htmlarea.css' => '327b488d20dacdbf5466532bc2f6cd5a', + 'htmlarea.inc.php' => 'ba73019f5bb7502c17fadeb92975cd59', + 'htmlarea.js' => '13e42f7db453422762ce64cee52bb8f0', + 'index.html' => 'dda9c564dbf0a33feb4535edf11f9110', + 'index.php' => 'e515b64e6a348436045ef89d78776c1c', + 'license.txt' => '9153c7000079a9f2f6441e6211a20689', + 'popupdiv.js' => '3363d6531f00951387d0094217fcd3f9', + 'popupwin.js' => 'b24c467ee42722fc061e262fe11a5b4c', + 'reference.html' => '8b3cd84619e5476e118fb2d6285eceb7', + 'release-notes.html' => '64d8c1087c9ae11062682129e1547fca', + 'test.css' => '0edee201158cd4a1ffecd1334afe63dd', + ), + 'javascript' => + array ( + 'sitemap.php' => 'edd37423c3218ff1c3d242198ebfb60e', + ), + 'parse' => + array ( + 'parse_avatar.php' => 'bc7d58d3b0d15e23e030920b9051e16e', + 'parse_emailto.php' => 'df63e9219382e8ea652dfc97b4a30ca4', + 'parse_menu.php' => 'e3fa890a733e4262cfe0ae82910a338a', + 'parse_picture.php' => '6fee5312651fb1f3b525a02ad1a7ac6a', + 'parse_profile.php' => '64f116088d3e55f9a82e62c930828561', + 'parse_username.php' => '986ffd8dd73ebc6685fa5b82b8119307', + ), + 'phpmailer' => + array ( + 'language' => + array ( + ), + ), + 'search' => + array ( + 'search_article.php' => '9bec55cc19fbce64f7985ca93306a0fa', + 'search_chatbox.php' => '0de05ea2574562e19a0686a5bb803e43', + 'search_content.php' => '7bb898d8278a238bb71cb8169b9ed2bc', + 'search_forum.php' => 'dcfeb61a2f830291b4bb8b5e0617554f', + 'search_links.php' => '9667c1e5eca93a0cb1610616c8acc329', + 'search_review.php' => '323c3b48ecc585e6270ad7e35cc9f1e0', + ), + 'sitemap' => + array ( + 'sitemap_articles.php' => 'cadc92c5c59b98157358d7aaafe2750e', + 'sitemap_content.php' => '51139ad22af3be101821fb95d192fb03', + 'sitemap_custom.php' => 'fcb7a1472051f94d26428654f76971b6', + 'sitemap_downloads.php' => '797820b44a3d942e7d01b0671f018238', + 'sitemap_forums.php' => '0ee814778c6e0bfb2dfc887b55de9285', + 'sitemap_links.php' => 'bf0baa44ab7bffa9b6edfb9d5d5d4879', + 'sitemap_members.php' => '9b69a90d417413a0f71526d6e86d45f6', + 'sitemap_news.php' => 'edbaecb0c53a67c70f18115fdf016929', + 'sitemap_plugin.php' => '8efa15ed27447e28c5da1575e4585419', + 'sitemap_reviews.php' => '2ed15c10e8d7cd03e4514483fae57a99', + 'sitemap_stats.php' => 'b6c748044f12a7ecfd7c3d954368cbde', + ), + 'textparse' => + array ( + 'basic.php' => 'c90c4c7f52e629fdbab1485fe1f5b6b6', + ), + 'tiny_mce' => + array ( + 'langs' => + array ( + 'ar.js' => '169d300416af7cdce6b654bd06ac2a06', + 'ca.js' => 'e054365bf2a065901d056b32b0a59e70', + 'cs.js' => '1d3a1ae555dbba9bb95d9ce840baadf3', + 'cy.js' => '870de31fc18bab817e6d2d7b4aa872db', + 'da.js' => 'cc247f4d1e6091c73cc7ecf4b4cb7593', + 'de.js' => 'e537b2b171cd2f23576b629ab19ffa45', + 'el.js' => 'c096fbf3106ea60a2853ae7b20837083', + 'es.js' => '722eafb047cf340d2b4b3634c9e21b7e', + 'fa.js' => '765b91b313f4a0f26d42484c77467435', + 'fi.js' => 'ccc8cb4f10b06859601658a90bbe345e', + 'fr.js' => '830a88badcbf0fc6945629fce64170c2', + 'fr_ca.js' => '6bea7226495c8206f636fa254941f76c', + 'he.js' => '85bae4a55d6394528f8cad5ff5ea8f99', + 'hu.js' => 'aadba22877f75ffe0da5aae7411ee555', + 'is.js' => 'ff7131f18d060c1d1067c34dda46e07f', + 'it.js' => 'e7916809ed09cb8b08183a26631852b8', + 'ja.js' => '218c57cf1200749edef223732cac282c', + 'ko.js' => 'f6c50cb6f13426a16676bde0b40b020a', + 'nb.js' => '14256f6008d426eb669e371c9cf34060', + 'nl.js' => '82569f5c2204acb05bc092dda323305f', + 'nn.js' => '8c5856fcd3202541c30761a0bbe95abb', + 'no.js' => '4d36ba827e1f9abd6cb9feb15ff57b08', + 'pl.js' => '1684ef7d0c56a3a8cb05c4aefb819433', + 'pt.js' => 'bc6ae838e0606cf3fbade874358cfb30', + 'ru.js' => '56c1ff2e73723c6f8fae848272328d4f', + 'sk.js' => '9e0bb7f1f7e24a341032200403cbaa33', + 'sv.js' => '903a021d9a56c081bb7f3c472da74cea', + 'th.js' => '7f64804bf3630e8f5f15de051babad84', + 'zh_cn.js' => '20a2d07cc1c450f17bd32628f05d893e', + ), + 'plugins' => + array ( + 'contextmenu' => + array ( + 'css' => + array ( + ), + 'images' => + array ( + ), + ), + 'emoticons' => + array ( + 'images' => + array ( + ), + 'langs' => + array ( + 'da.js' => '814c678d68b7846bd3cc7185293f4a1c', + 'es.js' => '5c5e44038d0d5083510970ed518093b0', + ), + ), + 'flash' => + array ( + 'css' => + array ( + 'content.css' => '9ae9f08d9748dc78ed6e0b33cd11e458', + 'flash.css' => '5ad8611160baa5f2198abb88baae38c9', + ), + 'images' => + array ( + 'flash.gif' => '709d9df69d8c2030e56321046d76ab8b', + ), + 'jscripts' => + array ( + 'flash.js' => '6b51cb8bf256f6ebc86e3a325475209b', + ), + 'langs' => + array ( + 'cs.js' => '50b2809eb2cd7801895d1e6e98a9c91b', + 'cy.js' => '5dcfd2755cddfcbe6351d4dbe6c6ac85', + 'da.js' => 'f2b72ffa4f64243f1c1d8e531ccd74b1', + 'de.js' => '5d238f5f9a261564e09a002cb5c93ff1', + 'en.js' => '52de748671eb0182b112111dbaa35e88', + 'es.js' => 'ec24f744a0c500a651db47fe579994be', + 'fa.js' => '14a0820203eea7f22856a2c8174f9636', + 'fr.js' => 'e489db910121ca476419966302177706', + 'fr_ca.js' => 'b6768e9d9b8f57a5e19e0bb0e108f84a', + 'he.js' => '39b200474cb83b04a48c2f07319930ca', + 'hu.js' => '846d4333e20d69b57cbee77b243f51ae', + 'is.js' => 'cf9e78d16351bdfe2423a208a82f1ed3', + 'nb.js' => '2f5c5fe3b2de8c401b0a0649f40e9dd6', + 'nl.js' => '3d95f1fbb0c52ed3b6d54968de5f6e01', + 'nn.js' => '25fc03ee93c77b1e98a2294cf6c333b8', + 'pl.js' => '057d4c9a766965d068c47807ffc65332', + 'pt_br.js' => '1792b9f671c47547cfe2dbb4ee22bdd4', + 'ru.js' => '7f292bd82c13f543a2cc9d2ce57920ad', + 'sk.js' => 'f45dc9dd2d9351d9ad37ddf080b40959', + 'sv.js' => '0dd9da08e68b78ce0832b75ddf7b0d7f', + 'zh_cn.js' => 'c5e6a82179266880d79b4626f965b108', + ), + 'editor_plugin.js' => 'd9a86e84d6de9a92c07caa14c32fa436', + 'editor_plugin_src.js' => '9f6d08f5269ffb3d107bbb382d1080ae', + 'flash.css' => '439d26d52ddf50dd5ac7d5fcb29a6e7d', + 'flash.htm' => 'c67139b142800773e99457bd880978e9', + ), + 'ibrowser' => + array ( + 'images' => + array ( + ), + 'langs' => + array ( + 'da.js' => '3394bc3500d94fa47fd39c17f0bbfcf9', + 'es.js' => '7b1df3446f8ccb76e80cfd9a5b13ed17', + 'nl.js' => '7004a5cd5e9e09d193d6742849dfb4ee', + 'pl.js' => '5bc48956a398ac86f36edb041a898a85', + 'sv.js' => 'b95727449ec9e4bd7c3774ae8ceef0ab', + ), + ), + 'iespell' => + array ( + 'images' => + array ( + ), + 'langs' => + array ( + 'cs.js' => 'a0f2834cbbd44d40490c11fe370f7756', + 'cy.js' => '8f7626778be315a6918f66e19a5ff8c4', + 'da.js' => 'cfc6d891c08e588b1461202d2568d7d6', + 'de.js' => '91728a57ef0ba20f25e47ee03b4866da', + 'el.js' => '3d65d19ee490b26fa1787bd8fbd35855', + 'es.js' => 'dd6eac9bdd597674c08d5daa9991d0fe', + 'fr.js' => '724009d0efaff99b88271c7f34ef1dfa', + 'fr_ca.js' => '54bbb38074a99afe3837478c49c0afc2', + 'he.js' => '3609aafd758034d56598706932ca4662', + 'hu.js' => '8b95913effa4e9d396fa734cdc6fe186', + 'is.js' => '777e6acb33acea76fce8b1109d74c693', + 'it.js' => '0de3c5e3e36d73e9f3b6ef6ed03ce5c9', + 'ko.js' => 'a08675987efeac4b71e024e6766d40d9', + 'nb.js' => '5d570071a5be75f3545dfbdc330bad6d', + 'nl.js' => 'd868734d3267d4889352a8411a3eb43f', + 'nn.js' => '8484fc2cdf334f00d461b6c64ef91287', + 'pl.js' => 'be72eef12fd4177e9283cf6083267079', + 'pt_br.js' => 'f18184638fe63e45cce421a0caa70a42', + 'ru.js' => 'cc1b970dd624041f208852864544ce67', + 'sk.js' => '6b8f43fac2a387024e35f8526f407598', + 'sv.js' => '9df8dd73b0ab656e8296b8a60969a2bd', + 'zh_cn.js' => 'fcfa956bf3fa2efc6ce5cb980399f4f8', + ), + ), + 'media' => + array ( + 'css' => + array ( + ), + 'images' => + array ( + ), + 'jscripts' => + array ( + ), + 'langs' => + array ( + ), + ), + 'table' => + array ( + 'css' => + array ( + ), + 'images' => + array ( + ), + 'jscripts' => + array ( + ), + 'langs' => + array ( + 'ar.js' => 'ae43b3e7e800feda0f3b30047e791e36', + 'cs.js' => 'cd74781764e126601991f523238b2997', + 'cy.js' => 'cdab2180c5e65051912c96cc88c86354', + 'da.js' => '6149f162722148ecf3876fb10b3e737e', + 'de.js' => '8cb4b9f7f1c94b051d781acb3da4d0d5', + 'el.js' => 'dcd0296a2b66bea7eb4014c5e499ae53', + 'es.js' => '438ea428f82d61c1ed95eaed346f97dc', + 'fa.js' => 'e64696a278069b4ea22bd952aaadfcaf', + 'fi.js' => 'fcf27030ae50526ae018dcfafa692002', + 'fr.js' => '8454709e737811f71a61c8774017da1f', + 'fr_ca.js' => 'dd198d47e8338b4988847cf2f8f811c5', + 'he.js' => 'ced8892be5250b25aefd41de3a23916d', + 'hu.js' => '7efabf89b76f57212804fa31854fb6dc', + 'is.js' => '0da0419d1bb98cd59afd434715233b54', + 'it.js' => 'a28c251cfd0f5a8dbc65b8b84d1468cb', + 'ja.js' => '383db7d235a1afa20b3ca79802f23919', + 'ko.js' => '69d5c2869ae41c037aff46e60c02aec9', + 'nb.js' => '797eb5494ea48a5365b289c17069543a', + 'nl.js' => '2891eccd7b5c22123246970a022098c8', + 'nn.js' => 'a48ff66d7505c209fa8ee6a27caf20a1', + 'no.js' => '5752ac40187c94adec44113a9876ed9e', + 'pl.js' => '59353b4a299e3b5469ed727be36495bd', + 'pt.js' => '17255ea9f80c38ee898cd6d4b52adf04', + 'ru.js' => 'c314078b00ff63c22709ce42e3b5ad82', + 'sk.js' => 'b4bfbc71af3b861f0e9afbb459ebddca', + 'sv.js' => '3cb350e825625d35ee56a240968978d5', + 'tw.js' => '460af4c883d0599602a396ac6df2291f', + 'zh_cn.js' => '5e66efd3b2631d9d8a4b6d465df4444a', + ), + ), + 'zoom' => + array ( + ), + ), + 'themes' => + array ( + 'advanced' => + array ( + 'css' => + array ( + ), + 'images' => + array ( + 'xp' => + array ( + ), + ), + 'jscripts' => + array ( + ), + 'langs' => + array ( + 'ar.js' => '6602819f1c11e5dfa03aa9351b6c6ed4', + 'ca.js' => 'fc23aa867a542b271be04c0c507cbf7a', + 'cs.js' => 'fa05040a48ef15b534bcfd559fcc5e2a', + 'cy.js' => '41d7e18bf59ea3656971025ce7ee2360', + 'da.js' => '2df17219dbd20b478ddf818e782bf884', + 'de.js' => 'dacdff80bdd36137be8c01e49f321dc0', + 'el.js' => 'fd252d3ec3b889b64e49f156e1cce056', + 'es.js' => '38f3298054a3c0eccef751738c29357e', + 'fa.js' => '7cba6a1fe0a72e6d7fff260e5434d509', + 'fi.js' => '05e023a47b125ad62b7ca756f11fca15', + 'fr.js' => 'dbdb8ed00240c5365184125e39d1db0d', + 'fr_ca.js' => 'db301661bb2a7e36d5a0fb287e6e2ed0', + 'he.js' => 'b16b9eb1c62dc0bdefd65c274da9ec9e', + 'hu.js' => '07f5bcee49de2e283f5cbaee4eaa391a', + 'is.js' => '7ebb7ccf6298e6f223c39c75852b4a2f', + 'it.js' => '5e517d045390ec97bd987d1f7fa55541', + 'ja.js' => '6b3ad91960606adfb97828a7f79b5764', + 'ko.js' => 'c922cb3ae02c588a318f75c3855866c0', + 'nb.js' => 'd53cf8e45eb484f6ea1262d1b43ff98b', + 'nl.js' => '2a72f399dfff3279b8796f5af6a04939', + 'nn.js' => '0209d5f5c5f26acd1aaa495e61ac4a6a', + 'no.js' => 'f246a2593152ca90c0849918d12bd12c', + 'pl.js' => 'a56af438b6dd4609168f023894de62ca', + 'pt.js' => 'e760ace435516ee6093bf9b83c7288db', + 'pt_br.js' => '068b915ccea56b2fd1f5b6284457e5ce', + 'ru.js' => 'f5286bf3ab6e283e096defa8bca3b21a', + 'sk.js' => '8e9eef23292200746c3f231b4ac2c19f', + 'sv.js' => 'e0e158d02e077f0bf8102d7a1657b5b9', + 'tw.js' => '69e5f2fe9dae27269c4a31a8245bb2c7', + 'zh_cn.js' => 'e9a1c3aeb41c08b7ee4bed86c3cc193b', + ), + ), + ), + 'utils' => + array ( + ), + ), + 'errorhandler_class.php' => 'b169b03bc392d49864077e8010abd800', + 'poll_class.php' => '006ed3500ada715d561997ab4bd0eb5e', + 'security_handler.php' => '5e858bf7b977021b74bfcc55c0d8f9f4', + 'shortcuts.php' => '49ef7425046fce13b1fcef4fea3dcd63', + 'submenus_handler.php' => 'b866789e832461178d2ab169b5158b6a', + 'user_extended.php' => '45646ad4a16d5ceafadf6565130d226b', + 'users.php' => 'bffb0d325569bbf3f0d946e226d834fa', + ), + $coredir['images'] => + array ( + 'admin_images' => + array ( + ), + 'avatars' => + array ( + ), + 'banners' => + array ( + 'e107.jpg' => '01982e7527b5dfab3b8634a0ab0bd75c', + ), + 'custom' => + array ( + ), + 'download_icons' => + array ( + 'admin.png' => 'a7376ea540f3ca4f721909bd0e6ae71b', + 'icon1.png' => 'e931689a5df4fc129cb7edf515504411', + 'icon2.png' => '861ef3bb6203bb98533f5e4ad01ead5e', + 'icon3.png' => '7178378df49945353c4cf6cd5e0f8622', + 'icon4.png' => '3f56677de2890d6db093b0091f8e5e35', + 'icon5.png' => '62de66653d9f686f7087ee7807fdcfd8', + 'star2.gif' => '6cb9803a392f283aa7761169df820809', + 'star4.gif' => '20c59fcebfc2ad7f416afa46752ec89f', + ), + 'emotes' => + array ( + 'default' => + array ( + ), + ), + 'emoticons' => + array ( + 'alien.png' => '6974b00de984da10b297e7fa9e628afa', + 'amazed.png' => 'c283684df103a5e20700f96a5f41cb3f', + 'angry.png' => '5ee786d3503d667e3f31682f1d7b37fa', + 'biglaugh.png' => '113ab7a2958863073fd293f201b2b7ab', + 'cheesey.png' => 'ce2406a7c0f680fee7a4980f2f01759b', + 'confused.png' => 'ce8d57a08d36ae2651fe9a3c36e7ccae', + 'cry.png' => 'af9f652ec6b891840fa16419b487b590', + 'dead.png' => '769a5a9cf3fec9ba2025e68a0694ddbc', + 'dodge.png' => '263141e145f83250115d57a384df93de', + 'frown.png' => '36cbe1f5dd7d96e4555716391dc26ecd', + 'gah.png' => 'ed1291107ee075f2878e046116ec8b6b', + 'grin.png' => '2eaf0c22aab303d555b937331d54de3a', + 'heart.png' => 'f481cd586397523f5a049ab0e3bb8b6c', + 'idea.png' => 'efdc92d75376071b4f26bc4d9079504a', + 'ill.png' => 'f31128acc9a7fcee11364906a62f99a4', + 'mad.png' => 'cc8e3a28a0fb31ff8835976cadb56438', + 'mistrust.png' => 'b8d139dac005d271ed1b772293be3004', + 'neutral.png' => '387cd29b21d0eceab935d3fb161dc1f3', + 'question.png' => '21d92683bb918283efdc68636a5249b2', + 'rolleyes.png' => '9f7d79a73089c2080e2bf1023507ab72', + 'sad.png' => '0e66d4ab21cf0010c9a6e2ffc94795ef', + 'shades.png' => '2bc442022d4bb9b99850e4fb7c0919ec', + 'shy.png' => '7d1fa9f1ebacd3bea124648efbcac26c', + 'smile.png' => '98412834fb8063733c819817150a6706', + 'special.png' => 'e802a5e499d0794ffc2e93c4eedb5f4c', + 'suprised.png' => 'a3813e582897e99a5f5980bc6048567a', + 'template.png' => '190417a4630f9e46eaa58eb782607fc5', + 'template1.png' => '3b8aeab390660d69fce24f4628f0e0e7', + 'template2.png' => '42f0eac79e6fc87adf652da6e3c0bf3f', + 'tongue.png' => 'cd2b96e084ef3df7ab15a366e2bb728e', + 'wink.png' => '4b057effb0ec0a0c38cc9267adc8e535', + ), + 'fileinspector' => + array ( + ), + 'filemanager' => + array ( + ), + 'forum' => + array ( + 'admin.png' => 'cdd0a7cbc97c39ceba3bae3bdc01eda2', + 'admin_delete.png' => '707ddc11a86975090610a76e8ad01923', + 'admin_edit.png' => 'a383175b504d64e64a84a21dda5c1619', + 'admin_lock.png' => '744c74fecf65bd64d4ee22681cf6bd11', + 'admin_move.png' => 'c892805676f983c34dbf308eeb2627c7', + 'admin_stick.png' => 'ef0bc1380cdbd26118c6c53272e46af6', + 'admin_unlock.png' => '1818d0d48dfe5f76c8bf3cee9d9e949c', + 'admin_unstick.png' => '8b57798a150aff163c35a9e2a7c1ff62', + 'aim.png' => 'bfd4c59a6cc8e1bb380520147657e58a', + 'announce.png' => '51274830e593a079d57c3213da0b97ab', + 'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4', + 'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0', + 'e.png' => '797612f8767a25e9a934580f7d778ef5', + 'edit.png' => 'dc9067455b48da0bbc50993a4217eedd', + 'email.png' => 'd954a0e84dcb099a5ece71ff181650db', + 'fcap.png' => '3d1b365a597132548eb9635b6bca040d', + 'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'icq.png' => '3ab7fe8b2bfcd5d1bc376caaa7d01969', + 'lev1.png' => '6f459327ecc4db1418087664ec99cd0d', + 'lev10.png' => '00fb85385b347b832cce42195c203000', + 'lev2.png' => '9c348bddca193d020328b9910a5618ef', + 'lev3.png' => 'c5baa56ed9d682b28f1ca823f75b69e6', + 'lev4.png' => '29a7bbedc1bfd1d7a36ccb6b4e679baf', + 'lev5.png' => 'de0edacf89d8013ec4d63619b0363abb', + 'lev6.png' => 'c939b5600c78d4f679fa1892f9b57a63', + 'lev7.png' => '57442dff53452b993d10397a393415e4', + 'lev8.png' => '6ab02457fabe0c8951b51c80a47ebb5e', + 'lev9.png' => '5197a5949253e509e4994cb2cbc0dc0d', + 'main_admin.png' => 'cfdb4442feb26d0031828a0f7424f6fd', + 'moderator.png' => '5c1772259c00d8aca7eda2bac696a826', + 'msn.png' => 'd1613fee04df9ac3bca9d2d0cceb0c7f', + 'new.png' => '2bbd79241cf8036164e9965055b6f8b3', + 'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad', + 'new_small.png' => 'df5d599ecd2bdcc93d576d552b71a54c', + 'newthread.png' => '26fcf53b08097e354ef4d3516fb64c71', + 'newthread_alt.png' => '286f65b22c67f8edc8caabeb207acbd1', + 'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6', + 'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983', + 'nonew_small.png' => '2544ba225c65f82c7788b003edb2d1fe', + 'pm.png' => '75d5f1434923e1afa54f93dce494ba96', + 'post.png' => '5212304c8b38fb4033ddf691fd7b77ba', + 'post2.png' => '0f6cfe51518affb7a6baac798abd907b', + 'profile.png' => 'ed21e84603c3bcf82eb1820235c36075', + 'quote.png' => '579d14bfb1faabf191272938fae3ab65', + 'reply.png' => 'b260ec33dee1736c5a258567d117eb69', + 'reply_alt.png' => 'cfe83ef2927d9b7819a20fa62837a139', + 'report.png' => 'f5e4ecc39864c5a8a66cbc3cac33c3e9', + 'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20', + 'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8', + 'template1.png' => 'feeb5c3f76438732948137e771def211', + 'template2.png' => '56b7b1d54b872c29042e523c9c043c63', + 'template3.png' => '66096ef11a4734f52cf06a624786678f', + 'template4.png' => 'f81e1772495061820f50ed16e489d7b2', + 'template5.png' => 'f5213d718fe9ad02d6040111c827e8ee', + 'template6.png' => 'f8319c599737e975bd05ad1890f77725', + 'template7.png' => 'a1d4f847a68fb991a1126d5c31bda6e5', + 'website.png' => '568b5e9dcc6fcc5067209e9390297162', + ), + 'generic' => + array ( + 'English' => + array ( + 'but_create.png' => 'fdd815c97c1f2b7cb6fbd579abd72937', + 'but_delete.png' => '7d0a9a0845029855b1ee3a2df49150f2', + ), + 'bbcode' => + array ( + ), + 'dark' => + array ( + ), + 'lite' => + array ( + ), + 'access.png' => 'f32777222ff51a9d7717a5d66c10417d', + 'admin.gif' => 'de326ebb9129598abcd207aeacbca61c', + 'aim.png' => 'c4c641053830a0b470763991e7e1b343', + 'article.png' => '4c1af0ea92374fcd32eb086f1e63d51b', + 'attach1.png' => '3f24d017495d3e59a8a18de11a23f63c', + 'banned.gif' => 'e944e98fc61c72d541437d58309d22d6', + 'bday.png' => 'b91ccd6511a34855d3da5ec55178ef32', + 'blankbutton.png' => '32718a34c4e4c62290e5dea6399aaf0c', + 'blocked.png' => '1227a11750b236543697c6b1f493951c', + 'broken.png' => 'ded230fd8afbd01c8647e287b78232fe', + 'chatlink.png' => 'b9579a8c1af6be726547edfc5cfc6eaf', + 'delete.png' => 'bbffdfd37ba4270e862a73d93b81769b', + 'down.gif' => '841d5d013c86f7cd61e06b978c5c65a2', + 'down.png' => 'd94fedebe97edf504f4e3611a831d2c2', + 'download.png' => 'd121e11e2b01e117e12ca1d9d4bfc8da', + 'download2.png' => '3fb794a0407283c91fa0f138f26722cb', + 'e107.gif' => 'fc919304a3df80991ec801f39baf3ba5', + 'e107.png' => '16751559410e5d868409898522df2cb4', + 'edit.png' => 'f009b77ab253590ace79a70cfeff566c', + 'email.png' => '36e771c8c0f3c5508cfb06d09a73133d', + 'extand2_ico.png' => 'd6cab6c391859427df70a1cf73a3f8b3', + 'extand_ico.png' => 'ef0dad81c4551e1cf4e5b92cc2682a42', + 'friend.gif' => 'b86a05be607fc371d4af747e6fed3991', + 'hme.png' => '18b3c9241db5836b5d5071ba45cb57a6', + 'hme2.png' => 'e7b5ced50260f1ae8d2fc27d11305fa0', + 'icq.png' => 'baba3fba52f76960e0917996509849ad', + 'installed.png' => '13e75fe21dbe487dfe4a70fd8b6a4b8e', + 'left.gif' => 'a33e2c78aec1bb670527e699bf09142d', + 'link.png' => '9e921ccc10fdb20e1272441a14bec6cb', + 'location.png' => 'b47fcee2cfd5e9d8428dbf0bd2279f43', + 'mainadmin.gif' => 'e2ea0c3a07ad3360b6dc3565fadb92c9', + 'move.png' => 'c38620b0e49020a0e509bb396629d98b', + 'msn.png' => 'cb6f3038694b1050815a3c0faea7105c', + 'new.png' => '19c5797308bdc437a7e612e0e0c36afe', + 'new_comments.png' => '02c972790cfb529b39567fb2d813fbe4', + 'newsdelete.png' => 'b108358657ce78bcd8a32bea790c5cef', + 'newsedit.png' => '7905b143e1a8614f58deba888cfa1831', + 'noaccess.png' => '1747d86cee75b592d74aa7657f37785e', + 'noinstall.png' => 'f89fe8f057694f93e4e163e4daf3de2e', + 'nonew_comments.png' => '7611b72fa10b37d8b25b42b82b7014d5', + 'not_verified.gif' => '157e88132e5f7e6df5c56857177b5938', + 'off.gif' => 'b7939422edcdf36818e632fba7fa4c42', + 'off.png' => '211ebf7f9f317c20c24f34267f4ffe2d', + 'placeholder.png' => 'b1b16f1feb58cc1c262f4728e710bce4', + 'plugin.png' => '918cf0e41e6c810a36ddfd88b1571e96', + 'printer.gif' => '8ac26fe4699decd7a018fcb9887ae04a', + 'right.gif' => '59521255e9b42ecddf5b5c196db3acd5', + 'rname.png' => 'd9602be8c82e8b9a439224b659ebbe40', + 'star1.gif' => 'c92689cfe71f7e6dafccb9f54664ab45', + 'star2.gif' => '6cb9803a392f283aa7761169df820809', + 'star3.gif' => 'fde817afe8d962061bfe6e7c1d36d784', + 'star4.gif' => '20c59fcebfc2ad7f416afa46752ec89f', + 'uninstalled.png' => '67b9d067ee7eccc0f6732d0e709413c9', + 'up.gif' => '733fe173358fbd482b5745a3e6b2bf3c', + 'up.png' => '2bfaa32e6b6c45767ff67961d7f6a758', + 'upgrade.png' => '8a2a682aa0a1713cb627275c1e371714', + 'user.png' => '2a791be6fdba60bd8ef16d04faf4e789', + ), + 'icons' => + array ( + ), + 'install' => + array ( + 'install1.png' => 'c5cdc95dcb566d3a06dd9491773cb915', + 'install2.png' => '3a4afe78d9167935869fd62c3e32e5c7', + ), + 'link_icons' => + array ( + 'admin.png' => 'a7376ea540f3ca4f721909bd0e6ae71b', + 'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1', + 'icon1.png' => 'e931689a5df4fc129cb7edf515504411', + 'icon2.png' => '861ef3bb6203bb98533f5e4ad01ead5e', + 'icon3.png' => '7178378df49945353c4cf6cd5e0f8622', + 'icon4.png' => '3f56677de2890d6db093b0091f8e5e35', + 'icon5.png' => '62de66653d9f686f7087ee7807fdcfd8', + 'star2.gif' => '6cb9803a392f283aa7761169df820809', + 'star4.gif' => '20c59fcebfc2ad7f416afa46752ec89f', + ), + 'log' => + array ( + 'beos.png' => 'e81a347cde7806d403369acf5125c4fe', + 'explorer.png' => 'ad4b2066d1a13c4c3f01771684de08bc', + 'firebird.png' => 'aa7ab3a68f2321baccdda8c13d2ba051', + 'firefox.png' => '2b1b1ceb660b824b9dbffd7eeacf79bb', + 'freebsd.png' => '0cc1da48e638ee3549a53c459a0beaf1', + 'konqueror.png' => '086c6a2215282b93a0d827b9208709d8', + 'linux.png' => '336a3e40452886a7bfac345e8a261138', + 'lynx.png' => 'bf674cc89d48c3edca70148befacfc0c', + 'mac.png' => '3b5ceead951265dc1648d172fbdd6461', + 'mozilla.png' => '3bac9ec175a9a1210fe69133658e7a79', + 'netbsd.png' => '0cc1da48e638ee3549a53c459a0beaf1', + 'netcaptor.png' => '2e4d9005519f6ce2b393dfd5957b16f8', + 'netscape.png' => 'ef183a5383deb9cf83d90cde42efb24d', + 'openbsd.png' => '36a1043bb8aacd3ea0a85c5f4de3130a', + 'opera.png' => '8892071cd4ecb31298ec08373d1491dc', + 'robot.png' => '4af563ba21dd39f7d875f4e4af4f3d60', + 'spiders.png' => 'd74d7cf44e339255fbf66d5414f14db1', + 'sunos.png' => '455c936a67729dd85ebec12b9c6139eb', + 'unix.png' => 'eeddedaa7da41673f0ef6d3e60876dc0', + 'unknown.png' => 'ff386748bec43130392f50ddf6743d57', + 'unspecified.png' => 'ff386748bec43130392f50ddf6743d57', + 'web%20indexing%20robot.png' => '4af563ba21dd39f7d875f4e4af4f3d60', + 'windows.png' => '693b0f409fb73b8c688582cbf231de41', + ), + 'newsicons' => + array ( + 'admin.png' => 'a7376ea540f3ca4f721909bd0e6ae71b', + 'icon1.png' => 'e931689a5df4fc129cb7edf515504411', + 'icon2.png' => '861ef3bb6203bb98533f5e4ad01ead5e', + 'icon3.png' => '7178378df49945353c4cf6cd5e0f8622', + 'icon4.png' => '3f56677de2890d6db093b0091f8e5e35', + 'icon5.png' => '62de66653d9f686f7087ee7807fdcfd8', + 'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e', + ), + 'newspost_images' => + array ( + ), + 'rate' => + array ( + 'box' => + array ( + ), + 'dark' => + array ( + ), + 'lite' => + array ( + ), + '1.png' => '4b0844d8edcb6f21a30ccd614ce1f681', + '2.png' => '78f9dddde6747afdfe4d2ae74809c48b', + '3.png' => '0d94d295b5f76d02a3667f314f2e2e16', + '4.png' => '6bec72f755855b0f4bcad657627f2c8b', + '5.png' => 'f5fcf4a03e0e8a873421453fe9c8faa6', + '6.png' => '5f5e7867a7ab294c254490a97dbdb5e0', + '7.png' => '2c7386cf7b32d110795ede44b0649db1', + '8.png' => 'd831f36e9da9569a3ee9fc76ca744ab8', + '9.png' => '06a1a321bc60f7964ff49201187b6d6e', + 'empty.png' => 'fba656dd42a4642df933475f41555579', + ), + 'user_icons' => + array ( + ), + 'logo3.png' => 'd4969f3e493bbf085b7b04db22fb66c3', + ), + 'e107_install' => + array ( + 'images' => + array ( + '01_bg.gif' => '50f03651c070e4138c97a4a7ee9e5339', + '01_bodybg.jpg' => 'ca5f9a092c397986fa10d5990023ab25', + '01_footer.jpg' => 'cf2f00b3e5a2aff05e70e728eb225cb4', + '01_hdot.gif' => '945bc76d6f25d2a32fafb0abe1933e1d', + '01_header01.jpg' => 'cb8f84e1d43a127604ea9b244ecab97e', + 'bar.jpg' => 'deb2fd16258227f5e99fee0074b764af', + 'bar2.gif' => 'eb85624e746f91fd33511783cccc92a6', + 'bar2edge.gif' => '6d273a53798e532091bd6354f1e39c60', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bottom.png' => '46e798abeb638c4f9540973d239b10e7', + 'bottomleft.png' => '3db4e800cc8add7f4f360c5f055aba49', + 'bottomright.png' => '28a54110d855fd47380cf094d6b7b169', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1', + 'button.png' => '69918234a9caea763d1c66781e50fe34', + 'cap1.png' => 'c58d5a7a23bb01572a51ca806cf244e0', + 'capdark.png' => '968732d5e5ddfa288f59af2c47f5d4d7', + 'capleft.png' => 'a1af1a726e1aee5e6e9822b9ccba1a48', + 'caplight.png' => '159e80e78ab67ceb935eb084d8dc51ff', + 'capright.png' => '57e7b70a495978f5de9575e826cd7878', + 'captransition.png' => 'f762ef589c33ff9695bf4731eaf23738', + 'fcap.png' => 'fabf58910351f1f742dee108b60517b8', + 'fcap2.png' => '777e56bcaf32e29ad505df49f3cb6019', + 'left.png' => 'a7755093080be75e9430072bd3bb32b3', + 'pspbrwse.jbf' => 'e84c6e90a5babd91ff1705cdd904a60c', + 'right.png' => '1dc657e1d9065920653132f3a85d77ed', + 'temp.png' => '35e34c98922cf2df737eef3cec806af2', + 'top.png' => '75b4e22fcbe8059bf217690e08c265ac', + 'topleft.png' => '8b45a5185fa619c3d336e1ceb618bc81', + 'topright.png' => '1c6d6e49a6d9d173ec12f2baed2f45a8', + ), + 'defaults.php' => 'd74f7f56a35eaba3a446d0d7b9ece61e', + 'forms_class.php' => 'cab82e1076617e73b142f89e589e6302', + 'index.html' => 'd41d8cd98f00b204e9800998ecf8427e', + 'install_template_class.php' => '85720230062e45ca3e6c190a865db9a1', + 'installer_handling_class.php' => '43abe84e4f29d084e5aeb58f048585b3', + 'installer_template.html' => '7c5c280e54ef3ffb337143513dbefdcf', + 'style.css' => '78939dd07a01f44a78bb95f58e7999e5', + 'writable_file_list.txt' => '65391cea1b3218eee4fc5e3535c4b6eb', + ), + $coredir['languages'] => + array ( + 'Danish' => + array ( + 'lan_install.php' => '7106553eaeb91ce1f59d0108dac9d579', + ), + 'Dutch' => + array ( + 'lan_install.php' => '1670683dbb0fb0d17f932ae81940a416', + ), + 'English' => + array ( + 'admin' => + array ( + 'help' => + array ( + 'log.php' => '553fd4414b98f4aa5f0f6e1f8f7b0ad6', + ), + 'lan_admin.php.bak' => 'c8bd5eb16d7834de1975b2ac3cd301e3', + 'lan_article.php' => '78d8dba28058eb99e32fc670fed68f34', + 'lan_chatbox.php' => 'dc7462a5fb63958528d842662b0c0d4c', + 'lan_content.php' => '4b4dd166785d89b717ca41602e4908de', + 'lan_custommenu.php' => 'fca295a0aaca7e6dc6ea2b07d3ab8474', + 'lan_download_category.php' => '868e2a17778c821e21579b28c8e8db85', + 'lan_forum.php' => '3ab28d049e7ef2900dd601deb02ab693', + 'lan_forum_conf.php' => '208dd010683d2894d17ab734d712a270', + 'lan_link_category.php' => '4dff35a95718cc5cffee64fc635dc19e', + 'lan_log.php' => '6bf26c44f7553beeb8ce574de27dc29e', + 'lan_news_category.php' => '5337d8c36701776b22c27182a258e690', + 'lan_newsfeed.php' => 'bba9d1991b304ee031ac8f4339aa6a61', + 'lan_poll.php' => '9bedcde5926715eede2f03afcff20a67', + 'lan_review.php' => '36820722f27e35f1fe10edf238a13d93', + 'lan_submenusgen.php' => '40af0cbb4906703d1fc5d29d7f2790e4', + 'lan_submitnews.php' => '595ca7b58df223022b3f7bd44e8238f4', + 'lan_theme_prev.php' => '003c8edea2f4b757347a231cd61868ba', + 'lan_theme_prev.phpOLD' => 'af65c38f8c4bc38654b6fcddc83b2a29', + ), + 'lan_article.php' => '7cb2200110e779d2be72b32b5adae9e4', + 'lan_chat.php' => '1216025ec3eb4295cb7b7920d9c6d5f4', + 'lan_content.php' => '175020e7d6e637c7c560c7b710e7da67', + 'lan_forum.php' => 'ca5e1c87b06b0b4c76aa17222a2049b9', + 'lan_forum_post.php' => 'e354153441043fabd0cdd6ed99be37a7', + 'lan_forum_viewforum.php' => 'ae655efbf1d88f64a6f9436894767a64', + 'lan_forum_viewtopic.php' => 'dc93aa81babfe0ee610d559d70f8681a', + 'lan_install.php' => '6182909e4053d2da395298e4ca73323a', + 'lan_oldpolls.php' => '64379ca9ff42aaf1873b93bc41627fa7', + 'lan_request.php' => '023a40948ec32b3359e9a5bae2b04f71', + 'lan_sitemap.php' => '7d926f3eb3c81ed747a6682d4a9048a5', + 'lan_stats.php' => 'f9058e0cd84a315f694618e2edf94d94', + 'lan_subcontent.php' => '8307d6e57a66ad7df8a57777c1fdcb36', + ), + 'Finnish' => + array ( + 'lan_install.php' => '0f5a7f1603a519ee4456ec9fa1e7f8f9', + ), + 'French' => + array ( + 'lan_install.php' => '74ad3fd72cca13f1968785a89b6a09ad', + ), + 'German' => + array ( + 'lan_install.php' => 'c0e03443e52be1a6492e5b65776df1aa', + ), + 'Hebrew' => + array ( + 'lan_install.php' => '6f5fe3b0b3ba23463026f873453c98ab', + ), + 'Portugese' => + array ( + 'lan_install.php' => 'bfd10a1c0d92d1d5094a63d64aa9a809', + ), + 'Portugese - Brazilian' => + array ( + 'lan_install.php' => '4dcb400544c4cf60bf640d2418e15908', + ), + 'Russian' => + array ( + 'lan_install.php' => 'a99ce749efb53953f0121c71a88c9ae4', + ), + ), + $coredir['plugins'] => + array ( + 'admin_menu' => + array ( + 'languages' => + array ( + 'English.php' => '9cc7dc759d47e98f86d2223097fb6dd8', + ), + '.#admin_menu.php.1.1' => '996aec68e661d293d168721272bdeb79', + ), + 'alt_auth' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + 'English' => + array ( + ), + 'ldap_auth_English.php' => '8553f2510a8f44e048e75b0caad969f6', + ), + ), + 'alt_news' => + array ( + ), + 'articles_menu' => + array ( + 'languages' => + array ( + 'English.php' => '559ed80821be94dbbae47b244dbd837d', + ), + 'articles_menu.php' => 'fd15a3ca2e31528a95fc99184e440f63', + 'articles_menu.phpOLD' => '879325102370b1fe12e4d7ccdfbb02a2', + 'config.php' => '00b67a915d74fc094e077ea4466f7c2f', + 'config.phpMAIN' => 'e72301f4e60ede3df654b0a32ffd07c1', + ), + 'backend_menu' => + array ( + 'languages' => + array ( + 'English.php' => '2ceeff0b4fd187b6bc41f2c4112bec77', + ), + 'backend_menu.php' => '3518985b836c9d8a0ba41966452d704d', + ), + 'banner_menu' => + array ( + 'languages' => + array ( + ), + ), + 'blogcalendar_menu' => + array ( + 'languages' => + array ( + 'Dutch.php' => 'a5a25231f132dfe4b7f691e4ffeb684f', + ), + ), + 'calendar_menu' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'log' => + array ( + ), + 'search' => + array ( + ), + 'calendar_menu.crc.gz' => '90580c372c43234e82c73fe1687611d4', + 'config.php' => '401d559f53265f4b1778701b8e9dd512', + 'readme.rtf' => '47f6de1137030fe2efde782133ab725f', + ), + 'chatbox_menu' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + 'English' => + array ( + ), + 'English.php' => '89c8271c28118aae2dbbe8f35adc9f9f', + ), + 'search' => + array ( + ), + ), + 'clock_menu' => + array ( + 'languages' => + array ( + 'admin' => + array ( + ), + ), + ), + 'comment_menu' => + array ( + 'languages' => + array ( + ), + ), + 'compliance_menu' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'content' => + array ( + 'handlers' => + array ( + ), + 'images' => + array ( + 'cat' => + array ( + 16 => + array ( + ), + 48 => + array ( + ), + ), + 'file' => + array ( + 'tmp' => + array ( + ), + ), + 'icon' => + array ( + 'tmp' => + array ( + ), + ), + 'image' => + array ( + 'tmp' => + array ( + ), + ), + 'redo.png' => 'df3dd61d416b00c26d3cbcdf02e862b4', + ), + 'languages' => + array ( + 'English' => + array ( + ), + ), + 'menus' => + array ( + ), + 'search' => + array ( + ), + 'templates' => + array ( + 'default' => + array ( + ), + ), + ), + 'counter_menu' => + array ( + 'languages' => + array ( + ), + ), + 'custom' => + array ( + 'Readme.txt' => '2a5a677029c6a1ff8f31f3cd24452386', + ), + 'custompages' => + array ( + 'Readme.txt' => 'fe1235ad725e996d9f123fdb4e4c13e8', + ), + 'fader_menu' => + array ( + 'images' => + array ( + 'logo.png' => 'bcaf473988c4b267a7dcf56949a452eb', + ), + 'languages' => + array ( + 'English.php' => '33f3cf5b3c8706af602ed4cb3c81db9c', + ), + 'config.php' => '0aabe62b3e1611c441e9a2c2114cd5cf', + 'fader_menu.php' => '66caa671ec5bafd3fe27b4d2b5e4f6d9', + 'plugin.php' => '242e63190113a2aa45358d7cb3b7535c', + ), + 'featurebox' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'templates' => + array ( + ), + ), + 'forum' => + array ( + 'images' => + array ( + 'dark' => + array ( + ), + 'lite' => + array ( + ), + ), + 'languages' => + array ( + 'English' => + array ( + ), + ), + 'search' => + array ( + ), + 'templates' => + array ( + ), + ), + 'gsitemap' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'headlines_menu' => + array ( + 'languages' => + array ( + 'English.php' => '2829e43dff89716317f5e07b2c9be60b', + ), + 'headlines_menu.php' => 'ab3e7718b4bdc0692766939d1cce00bc', + ), + 'integrity_check' => + array ( + 'crc' => + array ( + 'core_v0.603brevision #6.crc.gz' => '951d6ff1eb9b511e9de413fda1025fd0', + 'core_v0.604b0.crc.gz' => '1b1d32dcd6b5748f5f61c1ae3ed75f60', + 'core_v0.605b0.crc.gz' => 'cfcbd7b968e01b4d7085b993c2edc2fd', + 'core_v0.606b0.crc.gz' => 'a507b39e47b6bd4da410800674f18b0e', + 'core_v0.607b0.crc.gz' => 'd462a23b24951c04630d98fbdaaa303e', + 'core_v0.608b0.crc.gz' => '8d28c1a7ed767f3b1f37fc2e5d42a7c4', + 'core_v0.609b0.crc.gz' => '619d9fb859dcebee7335b107df732989', + 'core_v0.610b0.crc.gz' => '40b629b94d1942330c3d6a00d9eb3928', + 'core_v0.611b0.crc.gz' => 'd2fa16d9224fe1582e926dab65fd7974', + 'core_v0.612b0.crc.gz' => '417f80d506105f093852f6ac444401d8', + 'core_v0.613b0.crc.gz' => '10ee72857c69cee04b32c9713d0854ee', + 'core_v0.614b0.crc.gz' => '8dc89467864a96ba78930ed1a8be086f', + 'core_v0.616b0.crc.gz' => 'ff549280c337968ac0ba94797a8713c6', + 'core_v0.617b20040917.crc.gz' => '772181b8a467cb436be8e70b5d792e36', + ), + 'images' => + array ( + ), + 'languages' => + array ( + 'German.php' => 'e89edc419022cf2407fb101d3eab899f', + ), + 'do_core_file.php' => 'fac13bd2f065a031c59841ab4cb7074e', + 'integrity_check.crc.gz' => 'd5cec3024c3e3a0be2cca541bd60d179', + 'integrity_check.php' => '49d5a8fa37a78f8716cb5e86d77337c0', + ), + 'lastseen' => + array ( + 'languages' => + array ( + ), + ), + 'links_page' => + array ( + 'cat_images' => + array ( + ), + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'link_images' => + array ( + ), + 'search' => + array ( + ), + ), + 'linkwords' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'list_new' => + array ( + 'icon' => + array ( + ), + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'section' => + array ( + ), + 'new.php' => '8c374be27e41a4318f68e707021ff984', + ), + 'log' => + array ( + 'images' => + array ( + 'trans.gif' => '39bc952559e5a8f4e84ba035fb2f7390', + ), + 'languages' => + array ( + 'admin' => + array ( + ), + ), + 'logs' => + array ( + ), + ), + 'login_menu' => + array ( + 'languages' => + array ( + ), + ), + 'newforumposts_main' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'config.php' => '276457a4bf2fa83ea6562797782310a6', + ), + 'newforumposts_menu' => + array ( + 'languages' => + array ( + 'English.php' => '693095a9bd834689047de027f5e0cbbd', + ), + 'config.php' => 'f01b9da7574412da71f6182494f33e1a', + 'newforumposts_menu.php' => '2cccc461e0dcea560a8d60cbf6923cb8', + ), + 'newsfeed' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'templates' => + array ( + ), + ), + 'newsletter' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'online_extended_menu' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'online_menu' => + array ( + 'languages' => + array ( + ), + ), + 'other_news_menu' => + array ( + 'languages' => + array ( + ), + ), + 'pdf' => + array ( + 'font' => + array ( + 'makefont' => + array ( + ), + ), + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'pm' => + array ( + 'attachments' => + array ( + ), + 'images' => + array ( + ), + 'languages' => + array ( + 'admin' => + array ( + ), + ), + ), + 'pm_menu' => + array ( + 'images' => + array ( + 'icon_pm.png' => '2912f05d43fd9f1aa7e5561f01f03d49', + 'new.png' => '2bbd79241cf8036164e9965055b6f8b3', + 'newpm.gif' => '4d16f5fbaa8e76067053c8c901972bc4', + 'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6', + ), + 'languages' => + array ( + 'admin' => + array ( + 'Dutch.php' => 'deaec186998741c967926a2b4a2c8883', + 'English.php' => '48e55f333c6cce298d8d42d23ac1ea86', + 'French.php' => 'afada3c05cd276a42b3ea2c0143cc4eb', + 'Hebrew.php' => '99a11d649976ca09269ba710331692a1', + 'Hungarian.php' => '24c9bee3429ab4cb0310dbf53bdf46a7', + 'Lithuanian.php' => '46ff3c0d24248c463bc1d4565ed8ae60', + 'Swedish.php' => '36db180754f4fc798d801b809afb30c6', + ), + 'Danish.php' => '0fd270f1290f030df0923b51c8e758d5', + 'Dutch.php' => '70c30863dc1e573e57b29e7ea833fe86', + 'English.php' => '3a1f134f8dfab0d6e9bd01affac61360', + 'French.php' => '95edb5e8ee1adbef13968f678013a1c7', + 'German.php' => '9777ec58ad0ba9749bf67a6fc90aad92', + 'Hebrew.php' => 'f924ee08fd163ca1b5d8a0971c37350a', + 'Hungarian.php' => '0bc057bb44fe3472db8782edbba65152', + 'Icelandic.php' => 'fd660d11befa4952c4389e119311552c', + 'Italian.php' => '5b1d9585320a00d8dc302c6b1d152dd2', + 'Lithuanian.php' => '6de02c868fcf76f6eafa4d286139f51e', + 'Swedish.php' => '89c03081c1f1bd395d8ef118034205f3', + 'Turkish.php' => '8c3f69574f0a1b7967942bcccd81ce63', + ), + 'parse' => + array ( + 'parse_sendpm.php' => '684f65074a3c163bff33ceee2f60d77f', + ), + 'help.php' => '05353ac9d91d7a289b949cd221209391', + 'parser.php' => 'a3b9072ded8b976ec8e6a39fb1ec62a1', + 'plugin.php' => 'e00be629dba8699c216a32717499e4c6', + 'pm.php' => '854e2027e899d6fe2f61c34b4ec7c231', + 'pm_class.php' => 'ceb78bfec4fa5d4858f3c6bdd96518f6', + 'pm_conf.php' => '6356e8c2401e0f56bf3c2d765fc22c7e', + 'pm_finduser.php' => 'f0f76ad2058a553e71565a514d5e5792', + 'pm_inc.php' => '884be6eeb255e9896af2df673ed11838', + 'pm_menu.php' => 'c0cb0fdf9a22d73ec4c296181a63bb9b', + 'pm_readme.txt' => 'f8a601545af5083601733d9b2f317185', + 'pm_sql.php' => '3bf115628a81235de959588024d9b06d', + ), + 'poll' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'search' => + array ( + ), + 'templates' => + array ( + ), + ), + 'poll_menu' => + array ( + 'languages' => + array ( + 'English.php' => '75af431da617ae283526e043ba4f3c02', + ), + 'poll_menu.php' => 'c2da89e8e0917e9fdc6d472c8427eade', + ), + 'powered_by_menu' => + array ( + 'languages' => + array ( + ), + ), + 'review_menu' => + array ( + 'languages' => + array ( + 'English.php' => '7593a048368d0addb3e47bddc9026067', + ), + 'config.php' => '3775094f836031f6027990847d9ebef2', + 'review_menu.php' => '70f03130e54f35d210a4eb1c8419ce51', + ), + 'rss_menu' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'rss_meta.php' => '7205d95791b223ce785e95b0fda76c5a', + ), + 'search_menu' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'sitebutton_menu' => + array ( + 'languages' => + array ( + ), + ), + 'theme_layout' => + array ( + 'images' => + array ( + 'icon.png' => 'ff19586caf182a0c7cf7cfbc1a074de4', + ), + 'layouts' => + array ( + 'layout1_chatbox.php' => 'b1db2075c5c7ea9f9b2c4f1597d08435', + 'layout1_comment.php' => 'ff0e3640109d2a025e1faf2e5581ec01', + 'layout1_forum.php' => '74047e347e584a4533319d7d0593bdb5', + 'layout1_main.php' => 'a65dc381f0e34fa3285f09720db06442', + 'layout1_news.php' => '6a36222bfc1e5df83753406ad14f0272', + 'layout1_poll.php' => '7298986d8189dcb866253b8526fed945', + ), + 'chatbox_layout.php' => '6e16ab5944c40af2d49a1e97bf00b0f8', + 'comment_layout.php' => '94eae619f29d869141caad9bd75cac24', + 'forum_layout.php' => '9e701c700316d8f2136f7343b2aa1566', + 'help.php' => 'a9dd8718eb1cff858c8a8ea9cd430fb5', + 'main_layout.php' => 'd348abf32cdf27bb2eb744771eea5ff7', + 'news_layout.php' => '6d609361cfedd501e23cdd4a90cc1e27', + 'poll_layout.php' => '327e6500d7df79f36e06c700aa413c1f', + 'theme.php' => 'd028142e833595ed508966fc37593659', + 'theme_layout.php' => '1ef564f5bfa15e9974c3018da2560688', + ), + 'trackback' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'tree_menu' => + array ( + 'languages' => + array ( + ), + ), + 'userlanguage_menu' => + array ( + 'languages' => + array ( + ), + ), + 'usertheme_menu' => + array ( + 'languages' => + array ( + 'French.php' => 'd21ea52501b9efc12e86d3577cb7186f', + 'usertheme_English.php' => '675a4f2690d5771613818338502eb4c5', + 'usertheme_French.php' => 'd21ea52501b9efc12e86d3577cb7186f', + ), + ), + ), + $coredir['themes'] => + array ( + 'blue_patriot' => + array ( + 'images' => + array ( + 'balloon.jpg' => '64dc97bcb2ba327399ae75905800f4e6', + 'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199', + 'blue_patriot_01.jpg' => '7831ce0cb8eb13b4ea1a92adbdab9d62', + 'blue_patriot_02.jpg' => 'ac12826a6e0a05b9c070c5521161f120', + 'blue_patriot_03.jpg' => 'c3411aaea64f1ccbd45dd412b7a2467c', + 'blue_patriot_04.jpg' => 'ac3b851650183ac0d47b41472afcdecf', + 'blue_patriot_05.jpg' => '0dfcd5f3553aa7e5d3df05dd13629e61', + 'blue_patriot_06.jpg' => '15b839a9fd716900dd4cf603bff890e8', + 'blue_patriot_07.jpg' => 'f71799048ccf41e6fc6689f3f609e2db', + 'blue_patriot_08.jpg' => '5619bba0856394e207e8e39a6670dc50', + 'blue_patriot_09.jpg' => 'ffec8e1466bbdc30c3c7a15e4cb7727b', + 'blue_patriot_10.jpg' => '9f486fba3969a36958bbfc1ecb4f9851', + 'blue_patriot_11.jpg' => '6c2c5e0ad28eb6f70775f9ee64d5b8d7', + 'blue_patriot_12.jpg' => '5b5775e1043b999729199c4c27f43974', + 'blue_patriot_13.jpg' => '557e9b1c1cf68dfb1b51969f6ada6fd4', + 'blue_patriot_14.jpg' => 'bca587141e6745d02447526574e1b9c2', + 'blue_patriot_15.jpg' => '99a9e333f4cccf0fcd79679864de9346', + 'blue_patriot_16.jpg' => '71f45abb20a470dbb7b1f05571b9d165', + 'blue_patriot_17.jpg' => '2955f18ffa7e16c441b17feaa3b6bcca', + 'blue_patriot_18.jpg' => 'd7c7faf35abfd47fcd387a1745d4e5b3', + 'blue_patriot_19.jpg' => '16f1986bb5658c5ef33916092760702c', + 'blue_patriot_20.jpg' => '775a338453d65e0f8e6982b541ccbb95', + 'blue_patriot_21.jpg' => 'afffe79cf460ce63991c5e85dbf116ba', + 'blue_patriot_22.jpg' => 'd07ee234e9a0f53999ef60105591da82', + 'blue_patriot_23.jpg' => 'd33fd108f4828402b9dbb710f29ac2b2', + 'blue_patriot_24.jpg' => '430faa6d08785afe5254974c08407461', + 'blue_patriot_25.jpg' => 'd005d6c8d1df0ef80cd308cecf6f8cff', + 'blue_patriot_26.jpg' => '7f704f010bfb3fd6291a3b6a9ee465ba', + 'blue_patriot_27.jpg' => '6852500646a0a40f845d29a9998e965d', + 'blue_patriot_28.jpg' => '1fc8fe28545213a22cce040331db573b', + 'blue_patriot_29.jpg' => '698df200ff09414407fcc0c84ee74926', + 'blue_patriot_30.jpg' => 'fdd019a93a7d605d47dfa51ab6e965cc', + 'blue_patriot_31.jpg' => '27d3aab176590dab3458102d865aed21', + 'blue_patriot_32.jpg' => '1cee9c979aee7d52bcdf47f0fd1a1756', + 'blue_patriot_33.jpg' => '802673dea5d6b3318392267cfbe798b4', + 'blue_patriot_34.jpg' => '4a26464b5b3b2c4fd3621be82506bca9', + 'blue_patriot_35.jpg' => '48f2693b73a17381db62d36836958406', + 'blue_patriot_36.jpg' => 'abf7188d7973f01a9f255174ddfddf20', + 'blue_patriot_37.jpg' => 'dbf963f8163715e98d74c0beb3af2d8a', + 'blue_patriot_38.jpg' => 'a69c3868b52ceabecde8e10eed6ca0e6', + 'blue_patriot_39.jpg' => 'd4409c49b7b9fe7ff945a25df0c90395', + 'blue_patriot_40.jpg' => '623d4acd8692a8d5d91ced7108ec84e7', + 'bodybg.jpg' => 'cf7b94186d42ddb69a007fe7d6a5a2bd', + 'bullet2.gif' => 'de856ab1707989549981594c40ac0b0d', + 'captionbg.jpg' => '3cfcfda4fa37a1dd9800bd2f8ff37b11', + 'sm_folder.jpg' => 'f8de850ff6da330959af2431eb2b83fa', + ), + 'style.css' => '4eeeebf4cc2410e55cc6d0015a7b2dcb', + 'theme.php' => '522ceddf68bff62ff177e83d291b7b65', + ), + 'clan' => + array ( + 'forum' => + array ( + 'admin_delete.png' => '707ddc11a86975090610a76e8ad01923', + 'admin_edit.png' => 'a383175b504d64e64a84a21dda5c1619', + 'admin_lock.png' => '744c74fecf65bd64d4ee22681cf6bd11', + 'admin_move.png' => 'c892805676f983c34dbf308eeb2627c7', + 'admin_stick.png' => 'ef0bc1380cdbd26118c6c53272e46af6', + 'admin_unlock.png' => '1818d0d48dfe5f76c8bf3cee9d9e949c', + 'admin_unstick.png' => '8b57798a150aff163c35a9e2a7c1ff62', + 'announce.png' => '51274830e593a079d57c3213da0b97ab', + 'closed.png' => '661d62b0359cece8ea019268aea90b72', + 'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4', + 'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0', + 'e.png' => '5c4648034ca4494db00270b4f73cb4e9', + 'edit.png' => '1dfc36a823e1752f2aef6fce3d4ab4d8', + 'email.png' => 'f76baf56d637b8918f686345cd3ca7d2', + 'fcap.png' => '35e09d61f248d03d9ae67ff46f6e5a91', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8', + 'new.png' => '63c68b98a1ebf395a58c194688665404', + 'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad', + 'new_small.png' => 'df5d599ecd2bdcc93d576d552b71a54c', + 'newthread.png' => '0b580ca6d9cd6fd514c7ac3bb3b1c171', + 'nonew.png' => '7833bd100df8495e076dfaf400d1afb3', + 'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983', + 'nonew_small.png' => '2544ba225c65f82c7788b003edb2d1fe', + 'post.png' => '4abd6992f5bcb6c624ce670468ff538a', + 'profile.png' => 'd533f49ea50c756a6f61db3ae87ae8b1', + 'quote.png' => 'fd587e1696430999022aa2e6dd765904', + 'reply.png' => 'f7004bc6a716839bb4e803a4f08470ce', + 'sticky.png' => '31f95734f8ddea70f1532658cc123e24', + 'stickyclosed.png' => '0d8232ce1f8854a81a8832560fe47d4a', + 'website.png' => '882b8448acefe7857e31639a78acb47e', + ), + 'images' => + array ( + 'bar.jpg' => '699a527e29ee1fee2932255d76c095fa', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4', + 'bullet1.gif' => '097e3c018ae655310889fa98f85be57b', + 'bullet2.gif' => '026bd38853b2fc24353da648893737e5', + 'cap.png' => '32a40d90d55b3fc92350e3437ec79d7e', + 'cap2.png' => 'f56be37f5bb99b498a354762e1fac575', + 'header.png' => '200d62810e3f06bf792e920bcdce1d30', + 'logo.png' => 'bc9ceb041746cc1a021af2ed19002663', + 'menubg.png' => 'c23f21ecfb2ea65d9870e155058fb5b0', + 'topbar.png' => 'cf65e56f37871f04f3ce83337ae123e7', + ), + 'style.css' => 'b9acced713fc611ec3c94abdbf5a6bcd', + 'theme.php' => '88af12095e58d509e387eea822d36c0a', + ), + 'comfort' => + array ( + 'forum' => + array ( + 'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7', + 'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e', + 'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d', + 'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2', + 'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5', + 'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f', + 'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5', + 'announce.png' => '51274830e593a079d57c3213da0b97ab', + 'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4', + 'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0', + 'e.png' => '797612f8767a25e9a934580f7d778ef5', + 'edit.png' => 'dc9067455b48da0bbc50993a4217eedd', + 'email.png' => 'bd759f54b3496efb62529a08c2b15116', + 'fcap.png' => 'fa0919ce75dbdcb15cf7e651d5842415', + 'fcap2.png' => '2c1e274a0b58e66d9cc36a08df4d20c9', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8', + 'new.png' => '2bbd79241cf8036164e9965055b6f8b3', + 'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad', + 'new_popular.png' => '610f65b2547cdd8fd22fdf6903f90f61', + 'new_small.png' => '7ccbd065e0bb7baff3bca315f2e7989e', + 'newthread.png' => '2d08a2071204a9a9b4766969704b8fee', + 'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6', + 'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983', + 'nonew_small.png' => '948a5a7b2bcb069fd17dcd0c467ce2b5', + 'post.png' => '5212304c8b38fb4033ddf691fd7b77ba', + 'profile.png' => 'ed21e84603c3bcf82eb1820235c36075', + 'quote.png' => '579d14bfb1faabf191272938fae3ab65', + 'reply.png' => 'ba0faaf5b9a0c9e4edafc921a049739f', + 'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20', + 'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8', + 'website.png' => '568b5e9dcc6fcc5067209e9390297162', + ), + 'images' => + array ( + 'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195', + 'bg.gif' => '058052ed6c5234762c53f70b0001fb92', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7', + ), + 'style.css' => '6bbba211070fa8517ee4b8a6d3c26e7e', + 'theme.php' => 'edba9bf51ddd484b9d77ffdb0c9c3a1c', + ), + 'comfortless' => + array ( + 'forum' => + array ( + 'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7', + 'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e', + 'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d', + 'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2', + 'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5', + 'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f', + 'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5', + 'announce.png' => '51274830e593a079d57c3213da0b97ab', + 'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4', + 'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0', + 'e.png' => '22d175dba98b439b73d17da6cd142adf', + 'edit.png' => 'dc9067455b48da0bbc50993a4217eedd', + 'email.png' => 'bd759f54b3496efb62529a08c2b15116', + 'fcap.png' => 'fa0919ce75dbdcb15cf7e651d5842415', + 'fcap2.png' => '2c1e274a0b58e66d9cc36a08df4d20c9', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8', + 'new.png' => '2bbd79241cf8036164e9965055b6f8b3', + 'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad', + 'new_small.png' => 'efb0e1cd78edb0a66d8e83c245e0f0d5', + 'newthread.png' => '3b51e035b6cb3579d955372de1b36934', + 'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6', + 'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983', + 'nonew_small.png' => '887892198ae123a03df21132e08c6964', + 'post.png' => '5212304c8b38fb4033ddf691fd7b77ba', + 'profile.png' => 'ed21e84603c3bcf82eb1820235c36075', + 'quote.png' => '579d14bfb1faabf191272938fae3ab65', + 'reply.png' => '26ff2128f3e5b5c985c688118015b69f', + 'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20', + 'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8', + 'website.png' => '568b5e9dcc6fcc5067209e9390297162', + ), + 'images' => + array ( + 'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195', + 'bg.gif' => '058052ed6c5234762c53f70b0001fb92', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7', + ), + 'style.css' => '92e3bf1e539749704b1fcb013d9df71a', + 'theme.php' => '58fecc858bb054ae7a71bc79ea12c5b7', + ), + 'crahan' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'e107' => + array ( + 'images' => + array ( + 'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4', + 'bullet1.gif' => '097e3c018ae655310889fa98f85be57b', + 'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d', + 'button.png' => '5a1a29b5670e03697659581da597b5fc', + 'cap.png' => 'b439047ea62b69e3569cc70999ff6e5f', + 'header.png' => '200d62810e3f06bf792e920bcdce1d30', + 'installlogo.png' => '3cd312e939be5dbb073ce76a3116231d', + 'logo.png' => '346418f2f391f029e9b83c854b74b1d7', + ), + 'style.css' => 'e92d7179f04ee8849024a9af22877d0b', + 'theme.php' => '39270d4c1c77ac7f34373d7fdb452984', + ), + 'e107v4a' => + array ( + 'images' => + array ( + 'bar2.gif' => 'eb85624e746f91fd33511783cccc92a6', + 'bar2edge.gif' => '6d273a53798e532091bd6354f1e39c60', + ), + 'languages' => + array ( + ), + 'forum_design.php' => '6afe8b9762a01cad599d77c37d54bf80', + ), + 'example' => + array ( + 'images' => + array ( + 'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => 'd3ef60cb45ff91968ce65db5b49b985b', + 'bullet1.gif' => '097e3c018ae655310889fa98f85be57b', + 'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d', + 'cap.png' => '736f4166b8ecd0c1a8f031e336657c5e', + 'header.png' => '200d62810e3f06bf792e920bcdce1d30', + 'logo.png' => '346418f2f391f029e9b83c854b74b1d7', + ), + 'style.css' => '64dfcfe7f8a5dd55d755d00f751fa97c', + 'theme.php' => '6b0cdd3e6833728e44772a8c8722724f', + ), + 'fiblack3d' => + array ( + 'images' => + array ( + 'bar.jpg' => 'a87f6df0dc62f6059164a784e48605f3', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bottomleft.png' => '258e3e69e770bbeacde6264051d8ac5c', + 'bottommiddle.png' => '356edf3b2e72b9991576d8cdc1269a1f', + 'bottomright.png' => 'd9b376c57987219f22b86737e6068080', + 'bullet1.gif' => '097e3c018ae655310889fa98f85be57b', + 'bullet2.gif' => 'f7a33fe24f02eb54392eb094b6ded7de', + 'bullet3.gif' => 'b2cc886c34040cd25e787819e20433f2', + 'button.png' => '5a1a29b5670e03697659581da597b5fc', + 'cap.png' => 'b439047ea62b69e3569cc70999ff6e5f', + 'cap1.gif' => '9ad552a50c8425d6c1d8d766216c1093', + 'fcap.png' => 'c398adcd3acaa56b3b0168fe63140363', + 'fcap2.png' => '484bca31074eacfc1b1689437780d987', + 'g_head.gif' => 'e5b7c8416887f1c7d8d9427763072117', + 'header.png' => '200d62810e3f06bf792e920bcdce1d30', + 'left.png' => '96c753c33cf6d69d093120448681a510', + 'logo.jpg' => 'a2a402adf9ec65f2abe9c5a141791d1e', + 'logo2.png' => '867f8d31edb08e05bf3540cc03eedd2f', + 'nforumcaption.png' => '18a5f435d48bdeb8e036af0020f8ed26', + 'nforumcaption2.png' => '9864c81acddb5f2d2e792738e1468f4e', + 'right.png' => 'fe20a5ed232fdb263b20b12e74ea34e2', + 'sb_template.png' => '05d718c4d7ffff4cb4a39e1fe3098a13', + 'tbbg.png' => '418dea906f043bd84f108e701921d53f', + 'topleft.png' => '1d78bbdc0e9802cf3067eeb3efcf1a5a', + 'topmiddle.png' => '875f5c3a51b520a8684a36e55bc412da', + 'topright.png' => '5be0284fbb41ff6987b64cfb783e7c7d', + 'y_head.gif' => '052f449cda374ade80ee10df09ecd227', + ), + 'style.css' => 'd398533bd3d96e28ee03af6430dacbce', + 'theme.php' => 'fdd24c507722ddbb56cd10d77c0c7c7a', + ), + 'human_condition' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'interfectus' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'jayya' => + array ( + 'forum' => + array ( + ), + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'khatru' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'nexter.css' => '9290a07f99bb3d5068a3e6a3a580d325', + ), + 'kubrick' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + 'nicetitle.js' => '81658d0b559af2fb4c0ad27b8ffb9a0d', + ), + 'lamb' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'leaf' => + array ( + 'fontstyles' => + array ( + ), + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'leap of faith' => + array ( + 'images' => + array ( + 'bar.jpg' => 'deb2fd16258227f5e99fee0074b764af', + 'bar2.gif' => 'eb85624e746f91fd33511783cccc92a6', + 'bar2edge.gif' => '6d273a53798e532091bd6354f1e39c60', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bottom.png' => '46e798abeb638c4f9540973d239b10e7', + 'bottomleft.png' => '3db4e800cc8add7f4f360c5f055aba49', + 'bottomright.png' => '28a54110d855fd47380cf094d6b7b169', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1', + 'button.png' => '69918234a9caea763d1c66781e50fe34', + 'cap1.png' => 'd014368f2839e01b455ef1d63175188d', + 'capdark.png' => 'f8ec8fc5f9ccb1e72f0543e9405c0649', + 'capleft.png' => 'b57f36c4daf41cee56d31cbd47f9b1f1', + 'caplight.png' => 'ca308b892123bdb7e9e0f7cf1f729c59', + 'capright.png' => '36e3ec810d778dc3664b456c714e62f3', + 'captransition.png' => '7e9583f5c1c96b4191fa309a058aa314', + 'fcap.png' => 'fabf58910351f1f742dee108b60517b8', + 'fcap2.png' => '777e56bcaf32e29ad505df49f3cb6019', + 'left.png' => 'a7755093080be75e9430072bd3bb32b3', + 'right.png' => '1dc657e1d9065920653132f3a85d77ed', + 'temp.png' => '35e34c98922cf2df737eef3cec806af2', + 'top.png' => '75b4e22fcbe8059bf217690e08c265ac', + 'topleft.png' => '8b45a5185fa619c3d336e1ceb618bc81', + 'topright.png' => '1c6d6e49a6d9d173ec12f2baed2f45a8', + ), + 'style.css' => '1b8a431a51e1e374e4eadcd8d7ed3ca6', + 'theme.php' => 'ecde1a337a506f397465704e887a9865', + ), + 'nagrunium' => + array ( + 'images' => + array ( + 'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195', + 'bg.gif' => '058052ed6c5234762c53f70b0001fb92', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7', + ), + 'style.css' => '289d72f0f610c28fa47e856ef1d16113', + 'theme.php' => '9417c6b28e9c4f9b2754c26cdb200abb', + ), + 'newsroom' => + array ( + 'images' => + array ( + ), + ), + 'nordranious' => + array ( + 'forum' => + array ( + 'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7', + 'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e', + 'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d', + 'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2', + 'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5', + 'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f', + 'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5', + 'announce.png' => '51274830e593a079d57c3213da0b97ab', + 'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4', + 'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0', + 'e.png' => '797612f8767a25e9a934580f7d778ef5', + 'edit.png' => 'dc9067455b48da0bbc50993a4217eedd', + 'email.png' => 'bd759f54b3496efb62529a08c2b15116', + 'fcap.png' => 'b660b71d0208edb76a1b16930f2b81ac', + 'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8', + 'new.png' => '2bbd79241cf8036164e9965055b6f8b3', + 'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad', + 'new_small.png' => 'c593a4a99887c7eaeb1cd8dd000ebfcd', + 'newthread.png' => '94fdbfd082142c1443af2cf82914a833', + 'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6', + 'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983', + 'nonew_small.png' => '1e88b9f0b2e714475d4243509336b5c4', + 'post.png' => '5212304c8b38fb4033ddf691fd7b77ba', + 'profile.png' => 'ed21e84603c3bcf82eb1820235c36075', + 'quote.png' => '579d14bfb1faabf191272938fae3ab65', + 'reply.png' => '556906857646412a52b35814b4f707ba', + 'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20', + 'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8', + 'website.png' => '568b5e9dcc6fcc5067209e9390297162', + ), + 'images' => + array ( + 'bar.jpg' => '683a63e29f5c473fe677836187953c1a', + 'bar.png' => '9791d8cbd8e00c4b4538696990977d2b', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => 'd3ef60cb45ff91968ce65db5b49b985b', + 'blank.gif' => '7de900b8e3dd46a432e384eb231f079d', + 'bullet1.gif' => '09331909ba55a4f54c08018cede1ec85', + 'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d', + 'bullet3.gif' => '54e9d1f816051d002420875fb3499fd8', + 'button.png' => '5a1a29b5670e03697659581da597b5fc', + 'cap.png' => '81e98497b6b21b117be42ab30e6b8551', + 'corner.png' => '55d255b0484a611b1e94e0c9f89fce34', + 'left.png' => 'ddc536f7ec329942af71a88a8c8edaad', + 'side.png' => '18dd6404dc3020641158c286b25b0ea9', + 'top.png' => 'ca8d4b489c4c86f2cc8e1e0d48ef5eaf', + ), + 'style.css' => '60e1cb2188f3fb4e88e21e138ff5aa07', + 'theme.php' => 'f04beabe808e9269589d0a30889d8d6d', + ), + 'phpbb' => + array ( + 'forum' => + array ( + 'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7', + 'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e', + 'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d', + 'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2', + 'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5', + 'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f', + 'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5', + 'announce.png' => '51274830e593a079d57c3213da0b97ab', + 'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4', + 'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0', + 'e.png' => '797612f8767a25e9a934580f7d778ef5', + 'edit.png' => 'dc9067455b48da0bbc50993a4217eedd', + 'email.png' => 'bd759f54b3496efb62529a08c2b15116', + 'fcap.png' => '3d1b365a597132548eb9635b6bca040d', + 'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad', + 'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9', + 'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8', + 'new.png' => '2bbd79241cf8036164e9965055b6f8b3', + 'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad', + 'new_small.png' => 'c593a4a99887c7eaeb1cd8dd000ebfcd', + 'newthread.png' => '94fdbfd082142c1443af2cf82914a833', + 'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6', + 'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983', + 'nonew_small.png' => '1e88b9f0b2e714475d4243509336b5c4', + 'post.png' => '5212304c8b38fb4033ddf691fd7b77ba', + 'profile.png' => 'ed21e84603c3bcf82eb1820235c36075', + 'quote.png' => '579d14bfb1faabf191272938fae3ab65', + 'reply.png' => '556906857646412a52b35814b4f707ba', + 'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20', + 'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8', + 'website.png' => '568b5e9dcc6fcc5067209e9390297162', + ), + 'images' => + array ( + 'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4', + 'bullet1.gif' => '097e3c018ae655310889fa98f85be57b', + 'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d', + 'bullet3.gif' => 'e1bfc882a4a4a1f3b245585e17181da6', + 'button.png' => '5a1a29b5670e03697659581da597b5fc', + 'cap.png' => 'b439047ea62b69e3569cc70999ff6e5f', + 'cap1.gif' => '9ad552a50c8425d6c1d8d766216c1093', + 'header.png' => '200d62810e3f06bf792e920bcdce1d30', + 'sb_template.png' => '05d718c4d7ffff4cb4a39e1fe3098a13', + ), + 'style.css' => '5eaeee033e7af67e3642494321211461', + 'theme.php' => '3bebdfb44352857292267e9e40baa744', + ), + 'ranyart' => + array ( + 'images' => + array ( + 'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => 'd3ef60cb45ff91968ce65db5b49b985b', + 'bullet1.gif' => '097e3c018ae655310889fa98f85be57b', + 'bullet2.gif' => 'ffa05a27f0da01830e12d15095b5473b', + 'button.png' => '15462dc5844b42f6891e3a05dbfc0b3b', + 'cap.png' => '736f4166b8ecd0c1a8f031e336657c5e', + 'clock.png' => 'b8a6c6b2c3e1b66f3ae03b217665a1a2', + 'header.png' => '200d62810e3f06bf792e920bcdce1d30', + 'logo.png' => '830db48cdb37387b806423ed0ca9960d', + 'monitor.png' => 'fe57c7050bc8c7903806149e7f4e25b4', + ), + 'style.css' => '62365fd9c2b8b1b18485f69f1503818d', + 'theme.php' => '0c1cdae9b4143f3ea1a0855231fe4b84', + ), + 'reline' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'sebes' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'smacks' => + array ( + 'images' => + array ( + 'bg.gif' => '890e67e4d2d362079e3a794ff0c3950b', + 'bg.png' => 'e70a48befe520f37d50872c6d7816ab6', + 'body.png' => '555772b48dc8bebc0be424d4ef837e51', + 'bottom.png' => 'f12ecaa6b26786524f6e9b0c1d0baa91', + 'bottomleft.png' => '0df01a95deaeecdcfbd378500fb016d1', + 'bottomright.png' => 'faf4235009b7bceda62f5e6e98f71a92', + 'bullet1.gif' => '992bd9b4f72c80b5e74168af0adb225b', + 'bullet2.gif' => 'ee9887f23030161576dc7267a163c59b', + 'caption.png' => '98afcbf04a2dc04ecd6491c9a4beb3b9', + 'left.png' => '3eef5624d4a069d3e31fb8576e785419', + 'logo.png' => 'bb8d5e083cf27c045313e6e5bcd97e52', + 'right.png' => 'd47a3a781045dc015f9cca05eb1b5ab8', + 'tablebg.png' => 'c5c91fb04407c388ef0be982bb8809ae', + 'top.png' => 'a48a0e033119a0289852812325b594ef', + 'topbar.png' => '0dd080dfcd0a2df285fa26f5a3740147', + 'topleft.png' => 'c872a73060a134dbdc57727348a6d907', + 'topright.png' => '23ffd97e5448427efd333179d094387a', + ), + 'style.css' => '44eb298d24e6eff161e327c06289e801', + 'theme.php' => '8e83b87b38504a2d08292c0bbf7301c5', + ), + 'soar' => + array ( + 'images' => + array ( + 'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195', + 'bg.gif' => '058052ed6c5234762c53f70b0001fb92', + 'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7', + 'cap1.png' => '98be8e32cc8651622d43a466f63b169c', + 'caption.png' => '3d84f35bff62f78624822c7eae1bc5d2', + 'caption2.png' => '2eac2c5145782f11f605842c3f5f6911', + 'caption3.png' => '9804cedbccc111a22dc0b56c4aa5f1ae', + 'fcap.png' => '808ecd89f8890df55e0f2a76555ef4d2', + 'fcap2.png' => '90c520d65d4dd19217739cfcc6e3979a', + 'hr.png' => 'e41d8ce6c3381c08bc20fad9ebf26aee', + 'logo.jpg' => 'c79b084a3bb2e76ab49f9ddce0319ac1', + 'nforumcaption.png' => '18a5f435d48bdeb8e036af0020f8ed26', + 'nforumcaption2.png' => '9864c81acddb5f2d2e792738e1468f4e', + 'shadow_left.png' => 'f47a342e00d6f4248b552fa5e39294d1', + 'shadow_middle.png' => '946975a66e4db58fbe6442899afbeb13', + 'shadow_right.png' => '00a7c72cc479dd89a50ccddeec650758', + ), + 'forum_design.php' => '45e828a47cedaaa44e312470846d4930', + 'style.css' => '62cb98d0e63beb9ca74cdfcd7c599785', + 'theme.js' => 'bd6ab25405b19545bbdcad691da94fe8', + 'theme.php' => '92fa9c0015733df0c6b935d0c2ce082c', + ), + 'templates' => + array ( + 'content_template.php' => '4234fe2ce5e65e85d0597efc6ee68d5d', + 'forum_template.php' => '7c4aa61097a7cf0ea4a5f3d2089a5b9d', + 'forum_viewforum_template.php' => '7a2c7fc3c28a3df76661ec297119daab', + 'forum_viewtopic_template.php' => 'fb3516a937155a9e86eaa9a080905646', + 'links_template.php' => '21d8747bb5c1d6d590a9ad0b0d26e576', + ), + 'vekna_blue' => + array ( + 'images' => + array ( + ), + 'languages' => + array ( + ), + ), + 'wan' => + array ( + 'forum' => + array ( + 'fcap.png' => '5c3f4de6a594f0cfc26ba5f262cff6a3', + 'fcap2.png' => '5faf526e1c2b8b8473d73b5f1a034baa', + ), + 'images' => + array ( + 'bar.jpg' => '36494528dd74cb5869a176be426f48fd', + 'bar2.gif' => '340f87a5da4dfff37fd833a7a9834a92', + 'bar2edge.gif' => '3a224f579f9c6fa28687b44c61a03581', + 'bullet1.gif' => 'c80146f4417e32ea9f21f9a1bd71dd19', + 'bullet2.gif' => '62dfcf66db90d4a8d16093604582630d', + 'cap.png' => 'e4767da365351414865449a5b59450a2', + 'desktop.gif' => '24bdbaec3683f038c4c1e77983357aea', + 'header.png' => '9123aa2265308104754a534b8540c8ba', + 'iconmail.png' => 'e4ba543e3f4e02185e7df1ea5b689800', + 'iconprint.png' => '933d2be01f102e99f7ed03bea96bfbe1', + ), + 'style.css' => '1e999f8f80ebc89a4bde3c803f934bd3', + 'theme.php' => 'bbe4d283f553c324863c4451e3212ea4', + ), + 'xog' => + array ( + 'images' => + array ( + 'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9', + 'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba', + 'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195', + 'bg.gif' => '058052ed6c5234762c53f70b0001fb92', + 'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739', + 'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7', + 'hr.png' => 'e41d8ce6c3381c08bc20fad9ebf26aee', + 'logo.png' => '973175159c8710e70cbb136a9db781a6', + ), + 'style.css' => '0de81736ec6019f246ee3df97133ba2b', + 'theme.php' => 'f61421dacc4fb1456f289569b9a22b9c', + ), + ), + 'CHANGES.txt' => '20499ea696da01da57ff542cb8cc90ce', + 'Copy of class2.php' => '4bc75d69d5486bb439f681467ccb9256', + 'Copy of forum_post.php' => '0063a6cdd546d5f90374bbb3ae342a2a', + 'README.txt' => 'f4ae5aa39099819a240951d0694fe105', + 'ReadMe_English_iso-8859-1.txt' => 'a15c32416143ecdebb10fab747a9065a', + 'chat.php' => 'f99ca9a68e350852ff12b6f201ff46e4', + 'e107_6171_readme.txt' => '7f411eaafccc974f91447c8efd9992d4', + 'forum_post.php' => 'b4537a7296252a0d8c010824b698259b', + 'install.php' => 'f6c6c7a5151ead93de10528d3a38092d', + 'oldpolls.php' => '2758e56550195c508819c6062b950bc3', + 'readme.txt' => 'ff257006036939e779d287cdfee3b4b3', + 'sitemap.php' => 'd72fdc265a68f5a3b8a5d4b51d776f84', + 'stats.php' => '70a4419f7b5ce5ad398a2f2d38ab55eb', + 'upgrade.php' => '5e74e594b56732d62183c0300e222f2a', +); + diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php new file mode 100644 index 000000000..46d21c214 --- /dev/null +++ b/e107_admin/cpage.php @@ -0,0 +1,453 @@ +mySQLlanguage) ? $sql->mySQLlanguage : $pref['sitelanguage']; + +if (e_QUERY) +{ + $tmp = explode(".", e_QUERY); + $action = $tmp[0]; + $sub_action = $tmp[1]; + $id = $tmp[2]; + $from = ($tmp[3] ? $tmp[3] : 0); +} + +if(isset($_POST['submitPage'])) +{ + $page -> submitPage(); +} + +if(isset($_POST['uploadfiles'])) +{ + + $page -> uploadPage(); + $id = $_POST['pe_id']; + $sub_action = ($_POST['pe_id']) ? "edit" : ""; + $page -> createPage($_POST['mode']); +} + +if(isset($_POST['submitMenu'])) +{ + $page -> submitPage("", TRUE); +} + +if(isset($_POST['updateMenu'])) +{ + $page -> submitPage($_POST['pe_id'], TRUE); +} + +if(isset($_POST['updatePage'])) +{ + $page -> submitPage($_POST['pe_id']); +} + +if(isset($_POST['delete'])) +{ + foreach(array_keys($_POST['delete']) as $pid) + { + $page -> delete_page($pid); + } +} + +if (isset($_POST['saveOptions'])) { + $page -> saveSettings(); +} + +if($page->message) +{ + $ns->tablerender("", "
".$page->message."
"); +} + +if(!e_QUERY) +{ + $page -> showExistingPages(); +} +else +{ + $function = $action."Page"; + $page -> $function(); +} + +require_once(e_ADMIN."footer.php"); + +class page +{ + var $message; + + function showExistingPages() + { + global $sql, $tp, $ns; + + $text = "
"; + + if(!$sql -> db_Select("page", "*", "ORDER BY page_datestamp DESC", "nowhere")) + { + $text .= CUSLAN_42; + } + else + { + $pages = $sql -> db_getList('ALL', FALSE, FALSE); + $text .= "
+ + + + + + + "; + + foreach($pages as $pge) + { + $text .= " + + + + + + "; + } + + $text .= " +
ID".CUSLAN_1."".CUSLAN_2."".CUSLAN_3."
$pge[page_id]$pge[page_title]".($pge[page_theme] ? "menu" : "page")." + ".ADMIN_EDIT_ICON." + +
+
"; + } + + $text .= " +
"; + + $ns -> tablerender(CUSLAN_5, $text); + } + + function createmPage() + { + $this -> createPage(TRUE); + } + + function uploadPage() + { + global $pref; + $pref['upload_storagetype'] = "1"; + require_once(e_HANDLER."upload_handler.php"); + $uploaded = file_upload(e_IMAGE."custom/"); + } + + function createPage($mode=FALSE) + { + /* mode: FALSE == page, mode: TRUE == menu */ + + global $sql, $tp, $ns, $pref, $sub_action, $id; + + if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit']) + { + if ($sql->db_Select("page", "*", "page_id='$id' ")) + { + $row = $sql->db_Fetch(); + $page_class = $row['page_class']; + $page_password = $row['page_password']; + $page_title = $tp -> toFORM($row['page_title']); + $page_rating_flag = $row['page_rating_flag']; + $page_comment_flag = $row['page_comment_flag']; + $page_display_authordate_flag = $row['page_author']; + $data = $tp -> toFORM($row['page_text']); + $edit = TRUE; + } + + if ($sql -> db_Select("links", "*", "link_url='page.php?".$id."'")) + { + $row = $sql -> db_Fetch(); + $page_link = $row['link_name']; + } + } + + $text = "
+
+ "; + + if($mode) + { + $text .= " + + + "; + } + + $text .= " + + + + + + + + + + + + + "; + + if(!$mode) + { + $text .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + } + + $text .= " + + + +
".CUSLAN_7.""; + + if($edit) + { + $text .= $page_theme; + } + else + { + $text .= ""; + } + + $text .= "
".CUSLAN_8."
".CUSLAN_9.""; + + require_once(e_HANDLER."ren_help.php"); + $insertjs = (!e_WYSIWYG)?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);' style='width:95%'": "rows='25' style='width:100%' "; + $data = $tp->toForm($data); + $text .= ""; + + $text .= "
".display_help('',"cpage")."
".LAN_UPLOAD_IMAGES."".$tp->parseTemplate("{UPLOADFILE=".e_IMAGE."custom/}")."
".CUSLAN_10." + ".CUSLAN_38."   + ".CUSLAN_39." +
".CUSLAN_13." + ".CUSLAN_38."   + ".CUSLAN_39." +
".CUSLAN_41." + ".CUSLAN_38."   + ".CUSLAN_39." +
".CUSLAN_14."
".CUSLAN_15."
".CUSLAN_16."
".CUSLAN_17."
".CUSLAN_18."".r_userclass("page_class", $page_class)."
". + + (!$mode ? + ($edit ? "" : "") : + ($edit ? "" : "")) + + ." +
+
+
"; + + $caption =(!$mode ? ($edit ? CUSLAN_23 : CUSLAN_24) : ($edit ? CUSLAN_25 : CUSLAN_26)); + $ns -> tablerender($caption, $text); + } + + + function submitPage($mode = FALSE, $type=FALSE) + { + global $sql, $tp, $e107cache; + + $page_title = $tp -> toDB($_POST['page_title']); + $page_text = $tp -> toDB($_POST['data']); + $pauthor = ($_POST['page_display_authordate_flag'] ? USERID : 0); + + if($mode) + { + $update = $sql -> db_Update("page", "page_title='$page_title', page_text='$page_text', page_author='$pauthor', page_rating_flag='".intval($_POST['page_rating_flag'])."', page_comment_flag='".intval($_POST['page_comment_flag'])."', page_password='".$_POST['page_password']."', page_class='".$_POST['page_class']."', page_ip_restrict='".$_POST['page_ip_restrict']."' WHERE page_id='$mode'"); + $e107cache->clear("page_{$mode}"); + $e107cache->clear("page-t_{$mode}"); + + if ($_POST['page_link']) + { + if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."' && link_name!='".$tp -> toDB($_POST['page_link'])."'")) + { + $sql -> db_Update("links", "link_name='".$tp -> toDB($_POST['page_link'])."' WHERE link_url='page.php?".$mode."'"); + $update++; + $e107cache->clear("sitelinks"); + } + else if (!$sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."'")) + { + $sql -> db_Insert("links", "0, '".$tp -> toDB($_POST['page_link'])."', 'page.php?".$mode."', '', '', 1, 0, 0, 0, ".$_POST['page_class']); + $update++; + $e107cache->clear("sitelinks"); + } + } else { + if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."'")) + { + $sql -> db_Delete("links", "link_url='page.php?".$mode."'"); + $update++; + $e107cache->clear("sitelinks"); + } + } + admin_update($update, 'update', "Page updated in database."); + } + else + { + + $menuname = ($type ? $tp -> toDB($_POST['menu_name']) : ""); + + admin_update($sql -> db_Insert("page", "0, '$page_title', '$page_text', '$pauthor', '".time()."', '".intval($_POST['page_rating_flag'])."', '".intval($_POST['page_comment_flag'])."', '".$_POST['page_password']."', '".$_POST['page_class']."', '', '".$menuname."'"), 'insert', CUSLAN_27); + + if($type) + { + $sql -> db_Insert("menus", "0, '$menuname', '0', '0', '0', '', '".mysql_insert_id()."' "); + } + + if($_POST['page_link']) + { + $link = "page.php?".mysql_insert_id(); + if (!$sql->db_Select("links", "link_id", "link_name='".$tp -> toDB($_POST['page_link'])."'")) + { + $linkname = $tp -> toDB($_POST['page_link']); + $sql->db_Insert("links", "0, '$linkname', '$link', '', '', 1, 0, 0, 0, ".$_POST['page_class']); + $e107cache->clear("sitelinks"); + } + } + } + } + + function delete_page($del_id) + { + global $sql, $e107cache; + admin_update($sql -> db_Delete("page", "page_id='$del_id' "), 'delete', CUSLAN_28); + $sql -> db_Delete("menus", "menu_path='$del_id' "); + if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$del_id."'")) + { + $sql -> db_Delete("links", "link_url='page.php?".$del_id."'"); + $e107cache->clear("sitelinks"); + } + } + + function optionsPage() + { + global $ns, $pref; + + if(!isset($pref['pageCookieExpire'])) $pref['pageCookieExpire'] = 84600; + + $text = "
+
+ + + + + + + + + + + + + + + +
".CUSLAN_29." + ".CUSLAN_38."   + ".CUSLAN_39." +
".CUSLAN_30." + +
+ +
+
+
"; + + $ns->tablerender("Options", $text); + } + + + function saveSettings() + { + global $pref; + $pref['listPages'] = $_POST['listPages']; + $pref['pageCookieExpire'] = $_POST['pageCookieExpire']; + save_prefs(); + $this -> message = "Settings saved."; + } + + function show_options($action) + { + if ($action == "") + { + $action = "main"; + } + $var['main']['text'] = CUSLAN_11; + $var['main']['link'] = e_SELF; + + $var['create']['text'] = CUSLAN_12; + $var['create']['link'] = e_SELF."?create"; + + $var['createm']['text'] = CUSLAN_31; + $var['createm']['link'] = e_SELF."?createm"; + + $var['options']['text'] = LAN_OPTIONS; + $var['options']['link'] = e_SELF."?options"; + + + show_admin_menu(CUSLAN_33, $action, $var); + } +} + +function cpage_adminmenu() { + global $page; + global $action; + $page -> show_options($action); +} + +?> diff --git a/e107_admin/credits.php b/e107_admin/credits.php new file mode 100644 index 000000000..f4a086ea6 --- /dev/null +++ b/e107_admin/credits.php @@ -0,0 +1,257 @@ + "MagpieRSS", + "url" => "http://magpierss.sourceforge.net/", + "description" => CRELAN_10, + "version" => "0.71.1", + "licence" => "GPL, ".CRELAN_8 + ), + array( "name" => "PCLZip", + "url" => "http://www.phpconcept.net/pclzip/", + "description" => CRELAN_11, + "version" => "2.3", + "licence" => "GPL" + ), + array( "name" => "PCLTar", + "url" => "http://www.phpconcept.net/pcltar/", + "description" => CRELAN_12, + "version" => "1.3", + "licence" => "GPL" + ), + array( "name" => "TinyMCE", + "url" => "http://tinymce.moxiecode.com/", + "description" => CRELAN_13, + "version" => "2.08", + "licence" => "GPL" + ), + array( "name" => "Nuvolo Icons", + "url" => "http://www.icon-king.com", + "description" => CRELAN_14, + "version" => "1.0", + "licence" => "GPL" + ), + array( "name" => "PHPMailer", + "url" => "http://phpmailer.sourceforge.net/", + "description" => CRELAN_15, + "version" => "1.72", + "licence" => "GPL" + ), + array( "name" => "Brainjar DHTML Menu", + "url" => "http://www.brainjar.com/dhtml/menubar/", + "description" => CRELAN_16, + "version" => "0.1", + "licence" => "GPL, ".CRELAN_8 + ), + array( "name" => "DHTML / JavaScript Calendar", + "url" => "http://www.dynarch.com/projects/", + "description" => CRELAN_17, + "version" => "1.0", + "licence" => "GPL" + ), + array( "name" => "FPDF", + "url" => "http://www.fpdf.org/", + "description" => CRELAN_18, + "version" => "1.53", + "licence" => "Freeware" + ), + array( "name" => "UFPDF", + "url" => "http://www.acko.net/node/56", + "description" => CRELAN_19, + "version" => "0.1", + "licence" => "GPL" + ), + ); + +$contentA = array( + "

".CRELAN_6."<\/h3>", + "

Carl Cedergren<\/h1>[ asperon ]


".CRELAN_20, + "

Cameron Hanly<\/h1>[ CaMer0n ]


".CRELAN_21, + "

Steve Dunstan<\/h1>[ jalist ]


".CRELAN_22, + "

Eric Vanderfeesten<\/h1> [ lisa ]


".CRELAN_23, + "

Thom Michelbrink<\/h1>[ McFly ]


".CRELAN_24, + "

William Moffett<\/h1>[ que ]


".CRELAN_25, + "

Martin Nicholls<\/h1>[ streaky ]


".CRELAN_26, + "

James Currie<\/h1>[ SweetAs ]


".CRELAN_27, + "

Pete Holzmann<\/h1>[ MrPete ]


".CRELAN_28 +); + +echo " + + +".PAGE_NAME." + + + + + + +
+
".CRELAN_7." ".$e107info['e107_version'].", build ".($e107info['e107_build'] ? $e107info['e107_build'] : "zero")."
© 2002-2006, ".CRELAN_3."
+ +"; + + +$fadejs = " + + +TEXT; + +echo $fadejs; + +echo " +
+
". +(e_QUERY && e_QUERY == "stps" ? "" : "")."
+
+
+ +
+ + +"; + +?> diff --git a/e107_admin/db.php b/e107_admin/db.php new file mode 100644 index 000000000..c8e7bf869 --- /dev/null +++ b/e107_admin/db.php @@ -0,0 +1,281 @@ + +
\n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
".DBLAN_15."
".DBLAN_4."
".DBLAN_6."
".DBLAN_28."
".DBLAN_19."
".DBLAN_8." + +
+
+

"; + +$ns->tablerender(DBLAN_10, $text); + +function backup_core() { + global $pref, $sql; + $tmp = base64_encode((serialize($pref))); + if (!$sql->db_Insert("core", "'pref_backup', '{$tmp}' ")) { + $sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='pref_backup'"); + } +} + +function optimizesql($mySQLdefaultdb) { + + $result = mysql_list_tables($mySQLdefaultdb); + while ($row = mysql_fetch_row($result)) { + mysql_query("OPTIMIZE TABLE ".$row[0]); + } + + $str = " +
+ ".DBLAN_11." $mySQLdefaultdb ".DBLAN_12.". + +

+ +
+ +
+
+
"; + $ns = new e107table; + $ns->tablerender(DBLAN_14, $str); + +} + +function plugin_viewscan() +{ + global $sql, $pref, $ns, $tp; + require_once(e_HANDLER."plugin_class.php"); + $ep = new e107plugin; + $ep->update_plugins_table(); // scan for e_xxx changes and save to plugin table. + $ep->save_addon_prefs(); // generate global e_xxx_list prefs from plugin table. + + $ns -> tablerender(DBLAN_22, "
".DBLAN_23."

".DBLAN_13."
"); + + $text = "
+
+ + + + "; + + $sql -> db_Select("plugin", "*", "plugin_id !='' order by plugin_path ASC"); // Must order by path to pick up duplicates. (plugin names may change). + while($row = $sql-> db_Fetch()){ + $text .= " + + + + + "; + $previous = $row['plugin_path']; + } + $text .= "
".DBLAN_24."".DBLAN_25."".DBLAN_26."".DBLAN_27."
".$tp->toHtml($row['plugin_name'],FALSE,"defs")."".$row['plugin_path']."".str_replace(",","
",$row['plugin_addons'])."
"; + if($previous == $row['plugin_path']) + { + $delid = $row['plugin_id']; + $delname = $row['plugin_name']; + $text .= "\n"; + } + else + { + $text .= ($row['plugin_installflag'] == 1) ? DBLAN_27 : " "; // "Installed and not installed"; + } + $text .= "
"; + $ns -> tablerender(ADLAN_CL_7, $text); + +} + + +function pref_editor() +{ + global $pref,$ns,$tp; + ksort($pref); + + $text = "
+
+ + + + + + + "; + + foreach($pref as $key=>$val) + { + $ptext = (is_array($val)) ? "
".print_r($val,TRUE)."
" : htmlspecialchars($val); + $ptext = $tp -> textclean($ptext, 80); + + $text .= " + + + + + + "; + } + $text .= " +
".LAN_DELETE."".DBLAN_17."".DBLAN_18."".LAN_OPTIONS."
".$key."".$ptext." + +
+ +
"; + $text .= "

".DBLAN_13."
\n"; + $ns -> tablerender(DBLAN_20, $text); + + return $text; + +} + + + +function del_pref_val(){ + global $pref,$ns,$e107cache; + $del = array_keys($_POST['delpref']); + $delpref = $del[0]; + + if($delpref) + { + unset($pref[$delpref]); + $deleted_list .= "
  • ".$delpref."
  • "; + } + if($_POST['delpref2']){ + + foreach($_POST['delpref2'] as $k=>$v) + { + $deleted_list .= "
  • ".$k."
  • "; + unset($pref[$k]); + } + } + + $message = "

      ".$deleted_list."
    +

    ".DBLAN_13."
    "; + save_prefs(); + $e107cache->clear(); + $ns -> tablerender(LAN_DELETED,$message); + +} + +function delete_plugin_entry() +{ + global $sql,$ns; + $del = array_keys($_POST['delplug']); + $message = ($sql -> db_Delete("plugin", "plugin_id='".intval($del[0])."' LIMIT 1")) ? LAN_DELETED : LAN_DELETED_FAILED; + $caption = ($message == LAN_DELETED) ? LAN_DELETED : LAN_ERROR; + $ns -> tablerender($caption,$message); +} + +require_once("footer.php"); + +?> diff --git a/e107_admin/db_verify.php b/e107_admin/db_verify.php new file mode 100644 index 000000000..a5f916376 --- /dev/null +++ b/e107_admin/db_verify.php @@ -0,0 +1,402 @@ +
    "; + exit; +} + + $tables["core"] = $sql_data; + +if (!getperms("0")) { + header("location:".e_BASE."index.php"); + exit; +} + +//Get any plugin _sql.php files + + foreach($pref['e_sql_list'] as $path => $file) + { + $filename = e_PLUGIN.$path."/".$file.".php"; + if(is_readable($filename)){ + $fd = fopen($filename, "r"); + $sql_data = fread($fd, filesize($filename)); + fclose ($fd); + $id = str_replace("_sql","",$file); + $tables[$id] = $sql_data; + }else{ + echo $filename." is not readable
    "; + } + } + + + +function read_tables($tab) { + global $tablines; + global $table_list; + global $tables,$sql,$pref; + + $file = split("\n", $tables[$tab]); + foreach($file as $line) { + $line = ltrim(stripslashes($line)); + if (preg_match("/CREATE TABLE (.*) /", $line, $match)) { + if($match[1] != "user_extended"){ + $table_list[$match[1]] = 1; + $current_table = $match[1]; + $x = 0; + $cnt = 0; + } + } + + if (strpos($line, "TYPE=") !== FALSE) { + $current_table = ""; + } + + if ($current_table && $x) { + $tablines[$current_table][$cnt++] = $line; + + } + + $x = 1; + } + +// Get multi-language tables as well + if($pref['multilanguage']){ + $langs = table_list(); + foreach($table_list as $name=>$stuff){ + if($langs[$name]){ + $ltab = $langs[$name]; + $table_list[$ltab] = 1; + $tablines[$ltab] = $tablines[$name]; + } + } + } + +} + +function get_current($tab, $prefix = "") { + if (!$prefix) { + $prefix = MPREFIX; + } + $result = mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1'); + $qry = 'SHOW CREATE TABLE `'.$prefix.$tab."`"; + $z = mysql_query($qry); + if ($z) { + $row = mysql_fetch_row($z); + return str_replace("`", "", stripslashes($row[1])); + } else { + + return FALSE; + } +} + +function check_tables($what) { + global $tablines; + global $table_list; + global $ns; + $cur=0; + $table_list = ""; + read_tables($what); + + $text = "
    +
    + + + + + + + "; + foreach(array_keys($table_list) as $k) { + + $prefix = MPREFIX; + $current_tab = get_current($k, $prefix); + unset($fields); + unset($xfields); + if ($current_tab) { + $lines = split("\n", $current_tab); + $fieldnum = 0; + foreach($tablines[$k] as $x) { + $fieldnum++; + $ffound = 0; + list($fname, $fparams) = split(" ", $x, 2); + if ($fname == "KEY") { + list($key, $keyname, $keyparms) = split(" ", $x, 3); + $fname = $key." ".$keyname; + $fparams = $keyparms; + } + $fields[$fname] = 1; + $fparams = ltrim(rtrim($fparams)); + $fparams = preg_replace("/\r?\n$|\r[^\n]$|,$/", "", $fparams); + + if(stristr($k, "lan_") !== FALSE && $cur != 1){ + $text .= ""; + $cur = 1; + }; + + + + $text .= ""; + $s = 0; + $xfieldnum = -1; + foreach($lines as $l) { + $xfieldnum++; + list($xl, $tmp) = split("\n", $l, 2); + $xl = ltrim(rtrim(stripslashes($xl))); + $xl = preg_replace("/\r?\n$|\r[^\n]$/", "", $xl); + list($xfname, $xfparams) = split(" ", $xl, 2); + + if ($xfname == "KEY") { + list($key, $keyname, $keyparms) = split(" ", $xl, 3); + $xfname = $key." ".$keyname; + $xfparams = $keyparms; + } + + if ($xfname != "CREATE" && $xfname != ")") { + $xfields[$xfname] = 1; + } + $xfparams = preg_replace("/,$/", "", $xfparams); + $fparams = preg_replace("/,$/", "", $fparams); + if ($xfname == $fname) { + $ffound = 1; + if (strcasecmp($fparams, $xfparams) != 0) { + $text .= ""; + $text .= ""; + $fix_active = TRUE; + } elseif($fieldnum != $xfieldnum) { + $text .= " + "; + } else { + $text .= " + "; + } + } + } + + if ($ffound == 0) { + $text .= " + "; + $fix_active = TRUE; + } + $prev_fname = $fname; + $text .= "\n"; + } + foreach(array_keys($xfields) as $tf) { + if (!$fields[$tf] && $k != "user_extended") { + $fix_active = TRUE; + $text .= ""; + } + } + } else { // Table Missing. + $text .= ""; + $fix_active = TRUE; + } + } + $text .= "
    ".DBLAN_4."".DBLAN_5."".DBLAN_6."".DBLAN_7."
    ".ADLAN_132."
    $k$fname"; + if (strpos($fparams, "KEY") !== FALSE) { + $text .= " $fparams"; + } + $text .= "".DBLAN_8."".DBLAN_9."
    ".$xfparams."
    ".DBLAN_10."
    ".$fparams."
    ".fix_form($k,$fname,$fparams,"alter")."
    ".DBLAN_5." ".DBLAN_8."".DBLAN_9." #{$xfieldnum}
    ".DBLAN_10." #{$fieldnum}
    OK ".DBLAN_11."".DBLAN_10." [$fparams]
    ".fix_form($k,$fname,$fparams,"insert",$prev_fname)."
    $k$tf".DBLAN_12." ".fix_form($k,$tf,$fparams,"drop")."
    $k ".DBLAN_13."
     ".fix_form($k,$tf,$tablines[$k],"create")."
    "; + + if($fix_active){ + $text .= "
    +
    \n"; + } + + foreach(array_keys($_POST) as $j) { + if (preg_match("/table_(.*)/", $j, $mitch)) { + $lx = $mitch[1]; + $text .= "\n"; + } + } + $text .= "
    "; + + return $text; +} + +global $table_list; + +// -------------------- Table Fixing ------------------------------ + +if(isset($_POST['do_fix'])){ + $text = "
    "; + foreach( $_POST['fix_active'] as $key=>$val){ + + if (MAGIC_QUOTES_GPC == TRUE) { + $table = stripslashes($_POST['fix_table'][$key][0]); + $newval = stripslashes($_POST['fix_newval'][$key][0]); + $mode = stripslashes($_POST['fix_mode'][$key][0]); + $after = stripslashes($_POST['fix_after'][$key][0]); + } else { + $table = $_POST['fix_table'][$key][0]; + $newval = $_POST['fix_newval'][$key][0]; + $mode = $_POST['fix_mode'][$key][0]; + $after = $_POST['fix_after'][$key][0]; + } + + + $field= $key; + + if($mode == "alter"){ + $query = "ALTER TABLE `".MPREFIX.$table."` CHANGE `$field` `$field` $newval"; + } + + if($mode == "insert"){ + $query = "ALTER TABLE `".MPREFIX.$table."` ADD `$field` $newval AFTER $after"; + } + + if($mode == "drop"){ + $query = "ALTER TABLE `".MPREFIX.$table."` DROP `$field` "; + } + + if($mode == "index"){ + $query = "ALTER TABLE `".MPREFIX.$table."` ADD INDEX `$field` (`$newval`)"; + } + + if($mode == "indexdrop"){ + $query = "ALTER TABLE `".MPREFIX.$table."` DROP INDEX `$field`"; + } + + if($mode == "create"){ + $query = "CREATE TABLE ".MPREFIX.$table." ($newval) TYPE=MyISAM;"; + } + + + $text .= ""; + + + } + $text .= "
    ".$query.""; + $text .= (mysql_query($query)) ? " - ".LAN_UPDATED."" : " - ".LAN_UPDATED_FAILED.""; + $text .= "
    "; + $text .="

    +
    + +
    +
    "; + + $ns -> tablerender(DBLAN_20, $text); +} + + + +// ---------------------- Main Form and Submit. ------------------------ +if (!$_POST['db_verify'] && !$_POST['do_fix']) { + $text = " +
    + +
    ".DBLAN_14."

    "; + foreach(array_keys($tables) as $x) { + $text .= "".$x."
    "; + } + $text .= " +
    +
    "; + $ns->tablerender(DBLAN_16, $text); +} else { + foreach(array_keys($_POST) as $k) { + if (preg_match("/table_(.*)/", $k, $match)) { + $xx = $match[1]; + $str = "
    +
    +
    + +
    +
    "; + $ns->tablerender(DBLAN_16." - $xx ".DBLAN_18, check_tables($xx).$str); + } + } +} + + + +// -------------------------------------------------------------- +function fix_form($table,$field, $newvalue,$mode,$after =''){ + + if(stristr($field, "KEY ") !== FALSE){ + $field = chop(str_replace("KEY ","",$field)); + $mode = ($mode == "drop") ? "indexdrop" : "index"; + $search = array("(",")"); + $newvalue = str_replace($search,"",$newvalue); + } + + if($mode == "create"){ + $newvalue = implode("\n",$newvalue); + } + + $text .= " ".DBLAN_19."\n"; // 'attempt to fix' + $text .= "\n"; + $text .= "\n"; + $text .= "\n"; + $text .= ($after) ? "\n" : ""; + + return $text; +} + +function table_list() { + // grab default language lists. + global $mySQLdefaultdb; + + $exclude[] = "banlist"; $exclude[] = "banner"; + $exclude[] = "cache"; $exclude[] = "core"; + $exclude[] = "online"; $exclude[] = "parser"; + $exclude[] = "plugin"; $exclude[] = "user"; + $exclude[] = "upload"; $exclude[] = "userclass_classes"; + $exclude[] = "rbinary"; $exclude[] = "session"; + $exclude[] = "tmp"; $exclude[] = "flood"; + $exclude[] = "stat_info"; $exclude[] = "stat_last"; + $exclude[] = "submit_news"; $exclude[] = "rate"; + $exclude[] = "stat_counter";$exclude[] = "user_extended"; + $exclude[] = "user_extended_struc"; + $exclude[] = "pm_messages"; + $exclude[] = "pm_blocks"; + + // print_r($search); + + $tables = mysql_list_tables($mySQLdefaultdb); + while (list($temp) = mysql_fetch_array($tables)){ + $prefix = MPREFIX."lan_"; + + if(preg_match("/^".$prefix."(.*)/", $temp, $match)){ + $e107tab = str_replace(MPREFIX, "", $temp); + $pos = strrpos($match[1],"_")+1; + $core = substr(str_replace("lan_","",$e107tab),$pos); + if (str_replace($exclude, "", $e107tab)){ + $tabs[$core] = $e107tab; + } + } + } + + return $tabs; +} + + + + +require_once(e_ADMIN."footer.php"); +?> diff --git a/e107_admin/docs.php b/e107_admin/docs.php new file mode 100644 index 000000000..1d5361765 --- /dev/null +++ b/e107_admin/docs.php @@ -0,0 +1,58 @@ +toHTML($text, TRUE); + $text = preg_replace("/Q\>(.*?)A>/si", "\\1A>", $text); + $text = str_replace("A>", "", $text); + + $ns->tablerender(str_replace("_", " ", $helplist[e_QUERY]), $text."
    "); + unset($text); +} + +require_once("footer.php"); +?> \ No newline at end of file diff --git a/e107_admin/download.php b/e107_admin/download.php new file mode 100644 index 000000000..8cd1440e8 --- /dev/null +++ b/e107_admin/download.php @@ -0,0 +1,1646 @@ +load_files(); +} + +$e_sub_cat = 'download'; + +require_once(e_HANDLER."form_handler.php"); +require_once(e_HANDLER."userclass_class.php"); +require_once(e_HANDLER."file_class.php"); + +$fl = new e_file; + +// -------- Presets. ------------ +require_once(e_HANDLER."preset_class.php"); +$pst = new e_preset; +$pst->form = array("myform","dlform"); // form id of the form that will have it's values saved. +$pst->page = array("download.php?create","download.php?cat"); // display preset options on which page(s). +$pst->id = array("admin_downloads","admin_dl_cat"); +// ------------------------------- + +$download = new download; +require_once("auth.php"); +$pst->save_preset(); // unique name(s) for the presets - comma separated. + + /* +One form example (no arrays needed) +$pst->form = "myform"; // form id of the form that will have it's values saved. +$pst->page = "download.php?create"; // display preset options on which page. +$pst->save_preset("admin_downloads"); // unique name for the preset +*/ + +$rs = new form; +if (e_QUERY) { + $tmp = explode(".", e_QUERY); + $action = $tmp[0]; + $sub_action = $tmp[1]; + $id = $tmp[2]; + $from = ($tmp[3] ? $tmp[3] : 0); + unset($tmp); +} + +if(isset($_POST['delete'])) +{ + $tmp = array_keys($_POST['delete']); + list($delete, $del_id) = explode("_", $tmp[0]); + unset($_POST['searchquery']); +} + +$from = ($from ? $from : 0); +$amount = 50; + + +if($file_array = $fl->get_files(e_DOWNLOAD, "","standard",2)){ + sort($file_array); +} + +if($public_array = $fl->get_files(e_FILE."public/")){ + foreach($public_array as $key=>$val){ + $file_array[] = str_replace(e_FILE."public/","",$val); + } +} + + + +if ($sql->db_Select("rbinary")){ + while ($row = $sql->db_Fetch()) { + extract($row); + $file_array[] = "Binary ".$binary_id."/".$binary_name; + } +} + + + +if($image_array = $fl->get_files(e_FILE."downloadimages/", ".gif|.jpg|.png|.GIF|.JPG|.PNG","standard",2)){ + sort($image_array); +} + +if($thumb_array = $fl->get_files(e_FILE."downloadthumbs/", ".gif|.jpg|.png|.GIF|.JPG|.PNG","standard",2)){ + sort($thumb_array); +} + +if(isset($_POST)){ + $e107cache->clear("download_cat"); +} + +if (isset($_POST['add_category'])) { + $download->create_category($sub_action, $id); +} + +if (isset($_POST['submit_download'])) { + $download->submit_download($sub_action, $id); + $action = "main"; + unset($sub_action, $id); +} + + +if(isset($_POST['update_catorder'])){ + foreach($_POST['catorder'] as $key=>$order){ + if($_POST['catorder'][$key]){ + $sql -> db_Update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'"); + } + } + $ns->tablerender("", "
    ".LAN_UPDATED."
    "); +} + +if (isset($_POST['updateoptions'])) +{ + $pref['download_php'] = $_POST['download_php']; + $pref['download_view'] = $_POST['download_view']; + $pref['download_sort'] = $_POST['download_sort']; + $pref['download_order'] = $_POST['download_order']; + $pref['agree_flag'] = $_POST['agree_flag']; + $pref['download_email'] = $_POST['download_email']; + $pref['agree_text'] = $tp->toDB($_POST['agree_text']); + $pref['download_denied'] = $tp->toDB($_POST['download_denied']); + $pref['download_reportbroken'] = $_POST['download_reportbroken']; + save_prefs(); + $message = DOWLAN_65; +} + +if(isset($_POST['addlimit'])) +{ + if($sql->db_Select('generic','gen_id',"gen_type = 'download_limit' AND gen_datestamp = {$_POST['newlimit_class']}")) + { + $message = DOWLAN_116; + } + else + { + if($sql->db_Insert('generic',"0, 'download_limit', '".intval($_POST['newlimit_class'])."', '".intval($_POST['new_bw_num'])."', '".intval($_POST['new_bw_days'])."', '".intval($_POST['new_count_num'])."', '".intval($_POST['new_count_days'])."'")) + { + $message = DOWLAN_117; + } + else + { + $message = DOWLAN_118; + } + } +} + +if(isset($_POST['updatelimits'])) +{ + + if($pref['download_limits'] != $_POST['download_limits']) + { + $pref['download_limits'] = ($_POST['download_limits'] == 'on') ? 1 : 0; + save_prefs(); + $message .= DOWLAN_126."
    "; + } + foreach(array_keys($_POST['count_num']) as $id) + { + if(!$_POST['count_num'][$id] && !$_POST['count_days'][$id] && !$_POST['bw_num'][$id] && !$_POST['bw_days'][$id]) + { + //All entries empty - Remove record + if($sql->db_Delete('generic',"gen_id = {$id}")) + { + $message .= $id." - ".DOWLAN_119."
    "; + } + else + { + $message .= $id." - ".DOWLAN_120."
    "; + } + } + else + { + $sql->db_Update('generic',"gen_user_id = '".intval($_POST['bw_num'][$id])."', gen_ip = '".intval($_POST['bw_days'][$id])."', gen_intdata = '".intval($_POST['count_num'][$id])."', gen_chardata = '".intval($_POST['count_days'][$id])."' WHERE gen_id = {$id}"); + $message .= $id." - ".DOWLAN_121."
    "; + } + } +} + +if(isset($_POST['submit_mirror'])) +{ + $download->submit_mirror($sub_action, $id); +} + +if($action == "mirror") +{ + $download -> show_existing_mirrors(); +} + + +if ($action == "dlm") +{ + $action = "create"; + $id = $sub_action; + $sub_action = "dlm"; +} + +if ($action == "create") { + $download->create_download($sub_action, $id); +} + +if ($delete == 'category') { + if (admin_update($sql->db_Delete("download_category", "download_category_id='$del_id' "), 'delete', DOWLAN_49." #".$del_id." ".DOWLAN_36)) { + $sql->db_Delete("download_category", "download_category_parent='{$del_id}' "); + } +} + +if ($action == "cat") { + $download->show_categories($sub_action, $id); +} + +if ($delete == 'main') { + + $result = admin_update($sql->db_Delete("download", "download_id='$del_id' "), 'delete', DOWLAN_27." #".$del_id." ".DOWLAN_36); + if($result) + { + admin_purge_related("download", $del_id); + $e_event->trigger("dldelete", $del_id); + } + unset($sub_action, $id); +} + + +if (isset($message)) { + $ns->tablerender("", "
    ".$message."
    "); +} + +if (!e_QUERY || $action == "main") { + $download->show_existing_items($action, $sub_action, $id, $from, $amount); +} + + +if ($action == "opt") { + global $pref, $ns; + $agree_flag = $pref['agree_flag']; + $agree_text = $pref['agree_text']; + $text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".DOWLAN_69.""; + $c = $pref['download_php'] ? " checked = 'checked' " : ""; + $text .= " ".DOWLAN_70."
    + ".DOWLAN_55." + + +
    + ".DOWLAN_56." + + + +
    + ".LAN_ORDER." + + +
    ".DOWLAN_151."". r_userclass("download_reportbroken", $_POST['download_reportbroken'])."
    ".DOWLAN_150."". ($pref['download_email'] ? "" : "")."
    ".DOWLAN_100."". ($agree_flag ? "" : "")."
    + ".DOWLAN_101." + + +
    + ".DOWLAN_146." + + +
    + +
    +
    +
    "; + $ns->tablerender(DOWLAN_54, $text); +} + +if($action == 'limits') +{ + if($sql->db_Select('userclass_classes','userclass_id, userclass_name')) + { + $classList = $sql->db_getList(); + } + if($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as limit_bw_num, gen_ip as limit_bw_days, gen_intdata as limit_count_num, gen_chardata as limit_count_days", "gen_type = 'download_limit'")) + { + while($row = $sql->db_Fetch()) + { + $limitList[$row['limit_classnum']] = $row; + } + } + $txt = " +
    + + + + + + + + + + + "; + + foreach($limitList as $row) + { + $txt .= " + + + + + + + "; + } + + $txt .= " + + + + + + + + + + + + + + + "; + + $txt .= "
    + "; + if($pref['download_limits'] == 1) + { + $chk = "checked = 'checked'"; + } + else + { + $chk = ""; + } + + $txt .= " + ".DOWLAN_125." +
    ".DOWLAN_67."".DOWLAN_113."".DOWLAN_107."".DOWLAN_108."
    ".$row['limit_id']."".r_userclass_name($row['limit_classnum'])." + ".DOWLAN_109." + ".DOWLAN_110." + + ".DOWLAN_111." ".DOWLAN_109." + ".DOWLAN_110." +
    + +


    ".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")." + ".DOWLAN_109." + ".DOWLAN_110." + + ".DOWLAN_111." ".DOWLAN_109." + ".DOWLAN_110." +
    + +
    "; + + $ns->tablerender(DOWLAN_112, $txt); + require_once(e_ADMIN.'footer.php'); + exit; +} + +//$download->show_options($action); + +require_once("footer.php"); +exit; + +class download { + + function show_existing_items($action, $sub_action, $id, $from, $amount) { + global $sql, $rs, $ns, $tp, $mySQLdefaultdb,$pref; + $text = "
    "; + $sortorder = ($pref['download_order']) ? $pref['download_order'] : "download_datestamp"; + if(isset($_POST['searchdisp'])){ + $pref['admin_download_disp'] = implode("|",$_POST['searchdisp']); + save_prefs(); + } + + if(!$pref['admin_download_disp']){ + $search_display = array("download_name","download_class"); + }else{ + $search_display = explode("|",$pref['admin_download_disp']); + } + + $query = "SELECT d.*, dc.* FROM #download AS d LEFT JOIN #download_category AS dc ON dc. download_category_id = d.download_category"; + + if (isset($_POST['searchquery']) && $_POST['searchquery'] != "") { + $query .= " WHERE download_url REGEXP('".$_POST['searchquery']."') OR download_author REGEXP('".$_POST['searchquery']."') OR download_description REGEXP('".$_POST['searchquery']."') "; + foreach($search_display as $disp){ + $query .= " OR $disp REGEXP('".$_POST['searchquery']."') "; + } + $query .= " ORDER BY ".$sortorder." DESC"; + } else { + $query .= " ORDER BY ".($sub_action ? $sub_action : $sortorder)." ".($id ? $id : "DESC")." LIMIT $from, $amount"; + } + + if ($sql->db_Select_gen($query)) { + $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform")." + + + + "; + +// Search Display Column header.---------- + foreach($search_display as $disp){ + if($disp == "download_name"){ + $text .= ""; + }else{ + $repl = array("download_","_"); + $text .= ""; + } + } + +// ------------------------------ + $text .=" + + "; + while ($row = $sql->db_Fetch()) { + extract($row); + $text .= " + "; + +// Display Chosen options ------------------------------------- + $bolean_list = array("download_active","download_comment"); + + foreach($search_display as $disp){ + $text .= ""; + } +// ------------------------------------------------------------- + + $text .= " + + "; + } + $text .= "
    ID".DOWLAN_27."".ucwords(str_replace($repl," ",$disp))."".LAN_OPTIONS."
    $download_id"; + + if($disp == "download_name"){ + $text .= "$download_name"; + }elseif($disp == "download_category"){ + $text .= $row['download_category_name']." "; + }elseif($disp == "download_datestamp"){ + $text .= ($row[$disp]) ? strftime($pref['shortdate'],$row[$disp])." " : " "; + }elseif($disp == "download_class" || $disp == "download_visible"){ + $text .= r_userclass_name($row[$disp])." "; + }elseif($disp == "download_filesize"){ + $text .= ($row[$disp]) ? round(($row[$disp] / 1000))." Kb " : " "; + }elseif($disp == "download_thumb"){ + $text .= ($row[$disp]) ? "" : ""; + }elseif($disp == "download_image"){ + $text .= "".$row[$disp]." "; + }elseif($disp == "download_description"){ + $text .= $tp->toHTML($row[$disp],TRUE)." "; + }elseif($disp == "download_active"){ + if($row[$disp]== 1){ $text .= "\n"; } + elseif($row[$disp]== 2){ $text .= "\n"; } + else{ $text .= "\n"; } + }elseif($disp == "download_comment"){ + $text .= ($row[$disp]) ? ADMIN_TRUE_ICON : " "; + }else{ + $text .= $row[$disp]." "; + } + + $text .= " + ".ADMIN_EDIT_ICON." + toJS(DOWLAN_33." [ID: $download_id ]")."') \" /> +
    "; + } else { + $text .= "
    ".DOWLAN_6."
    "; + } + $text .= "
    "; + +// Next-Previous. ========================== + + $downloads = $sql->db_Count("download"); + if ($downloads > $amount && !$_POST['searchquery']) { + $parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.download_id.desc.")."[FROM]"; + $text .= "
    ".$tp->parseTemplate("{NEXTPREV={$parms}}"); + } + + +// Search & display options etc. =========================. + + $text .= "
    \n

    \n\n\n

    "; + + $text .= "
    ".LAN_DISPLAYOPT."
    "; + $text .= " +
    \n +
    "; +// ====================== + + $ns->tablerender(DOWLAN_7, $text); + } + + function show_options($action) { + + if ($action == "") { + $action = "main"; + } + $var['main']['text'] = DOWLAN_29; + $var['main']['link'] = e_SELF; + + $var['create']['text'] = DOWLAN_30; + $var['create']['link'] = e_SELF."?create"; + + $var['cat']['text'] = DOWLAN_31; + $var['cat']['link'] = e_SELF."?cat"; + $var['cat']['perm'] = "Q"; + + $var['opt']['text'] = LAN_OPTIONS; + $var['opt']['link'] = e_SELF."?opt"; + + $var['limits']['text'] = DOWLAN_112; + $var['limits']['link'] = e_SELF."?limits"; + + $var['mirror']['text'] = DOWLAN_128; + $var['mirror']['link'] = e_SELF."?mirror"; + + show_admin_menu(DOWLAN_32, $action, $var); + + } + + +// --------------------------------------------------------------------------- + + + function create_download($sub_action, $id) { + + + global $cal,$tp, $sql, $fl, $rs, $ns, $file_array, $image_array, $thumb_array,$pst; + require_once(e_FILE."shortcode/batch/download_shortcodes.php"); + + $download_status[0] = DOWLAN_122; + $download_status[1] = DOWLAN_123; + $download_status[2] = DOWLAN_124; + $preset = $pst->read_preset("admin_downloads"); // read preset values into array + extract($preset); + + if (!$sql->db_Select("download_category")) { + $ns->tablerender(ADLAN_24, "
    ".DOWLAN_5."
    "); + return; + } + $download_active = 1; + if ($sub_action == "edit" && !$_POST['submit']) { + if ($sql->db_Select("download", "*", "download_id='$id' ")) { + $row = $sql->db_Fetch(); + extract($row); + + if($download_mirror) + { + + $mirrorTArray = explode(chr(1), $download_mirror); + $mirrorArray = array(); + + $count=0; + foreach($mirrorTArray as $mirror) + { + if($mirror) + { + list($mid, $murl) = explode(",", $mirror); + $mirrorArray[$count]['id'] = $mid; + $mirrorArray[$count]['url'] = $murl; + $count++; + } + } + } + } + } + + if ($sub_action == "dlm" && !$_POST['submit']) { + if ($sql->db_Select("upload", "*", "upload_id='$id' ")) { + $row = $sql->db_Fetch(); + + $download_category = $row['upload_category']; + $download_name = $row['upload_name'].($row['upload_version'] ? " v" . $row['upload_version'] : ""); + $download_url = $row['upload_file']; + $download_author_email = $row['upload_email']; + $download_author_website = $row['upload_website']; + $download_description = $row['upload_description']; + $download_image = $row['upload_ss']; + $download_filesize = $row['upload_filesize']; + $image_array[] = array("path" => "", "fname" => $row['upload_ss']); + $download_author = substr($row['upload_poster'], (strpos($row['upload_poster'], ".")+1)); + } + } + + + $text = " +
    +
    + + + + + + + + + + + + + + + + + + + "; + } + else + { + + $text .= DOWLAN_132."
    +
    "; + + $mirrorList = $sql -> db_getList(); + + $m_count = (count($mirrorArray) ? count($mirrorArray) : 1); + + for($count = 1; $count <= $m_count; $count++){ + + $opt = ($count==1) ? "id='mirror'" : ""; + $text .=" + + "; + $text .= "
    "; + } + + $text .="

    + + + + + + + + "; + } + + $text .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + + + $text .= " + + + + + + + + + + + "; + + if ($sub_action == "dlm") { + $text .= " + + + + + + + + + + + + "; + } + + $text .= " + + + +
    ".DOWLAN_11.""; + + $text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$download_category}}",true,$download_shortcodes); + + $text .= "
    ".DOWLAN_12.": + toForm($download_name)."\" maxlength='200' /> +
    ".DOWLAN_13.":
    ".DOWLAN_131."   + +
    + ".DOWLAN_149." + + +
    ".DOWLAN_128.":"; + + if(!$sql -> db_Select("download_mirror")) + { + $text .= DOWLAN_144."
    ".DOWLAN_155." + + ".DOWLAN_156."
    + ".DOWLAN_157." +
    ".DOWLAN_15.": + +
    ".DOWLAN_16.": + +
    ".DOWLAN_17.": + +
    ".DOWLAN_18.": + +
    ".DOWLAN_19.": + "; + + if($sub_action == "dlm" && $download_image) + { + $text .= " + \n"; + } + + $text .= " +
    ".DOWLAN_20.": + +
    ".LAN_DATESTAMP.": + "; + if(!$download_datestamp){ + $download_datestamp = time(); + } + $cal_options['firstDay'] = 0; + $cal_options['showsTime'] = false; + $cal_options['showOthers'] = false; + $cal_options['weekNumbers'] = false; + $cal_options['ifFormat'] = "%d/%m/%Y %H:%M:%S"; + $cal_options['timeFormat'] = "24"; + $cal_attrib['class'] = "tbox"; + $cal_attrib['size'] = "12"; + $cal_attrib['name'] = "download_datestamp"; + $cal_attrib['value'] = date("d/m/Y H:i:s", $download_datestamp); + $text .= $cal->make_input_field($cal_options, $cal_attrib); + + $update_checked = ($_POST['update_datestamp']) ? "checked='checked'" : ""; + $text .= "  ".DOWLAN_148." + +
    ".DOWLAN_21.": + "; + + $text .= "
    ".DOWLAN_102.":"; + + + if ($download_comment == "0") { + $text .= LAN_YES.": + ".LAN_NO.": "; + } else { + $text .= LAN_YES.": + ".LAN_NO.": "; + } + + $text .= "
    ".DOWLAN_145.":".r_userclass('download_visible', $download_visible, 'off', 'public, nobody, member, admin, classes, language')."
    ".DOWLAN_106.":".r_userclass('download_class', $download_class, 'off', 'public, nobody, member, admin, classes, language')."
    ".DOWLAN_153.":
    + +
    ".DOWLAN_103.":
    + + +
    "; + + + if ($id && $sub_action == "edit") { + $text .= " "; + } else { + $text .= ""; + } + + $text .= "
    +
    +
    "; + $ns->tablerender(ADLAN_24, $text); + } + + +// ----------------------------------------------------------------------------- + + + function show_message($message) { + global $ns; + $ns->tablerender("", "
    ".$message."
    "); + } + + +// ----------------------------------------------------------------------------- + + + + function submit_download($sub_action, $id) { + global $tp, $sql, $DOWNLOADS_DIRECTORY, $e_event; + + if($sub_action == 'edit') + { + if($_POST['download_url_external'] == '') + { + $_POST['download_filesize_external'] = FALSE; + } + } + + if ($_POST['download_url_external'] && $_POST['download_url'] == '') + { + $durl = $_POST['download_url_external']; + $filesize = $_POST['download_filesize_external']; + } + else + { + $durl = $_POST['download_url']; + if($_POST['download_filesize_external']) + { + $filesize = $_POST['download_filesize_external']; + } + else + { + if (strpos($DOWNLOADS_DIRECTORY, "/") === 0 || strpos($DOWNLOADS_DIRECTORY, ":") >= 1) + { + $filesize = filesize($DOWNLOADS_DIRECTORY.$durl); + } + else + { + $filesize = filesize(e_BASE.$DOWNLOADS_DIRECTORY.$durl); + } + } + } + + if (!$filesize) + { + if($sql->db_Select("upload", "upload_filesize", "upload_file='$durl'")) + { + $row = $sql->db_Fetch(); + $filesize = $row['upload_filesize']; + } + } + + // ---- Move Images and Files ------------ + + if($_POST['move_image']) + { + if($_POST['download_thumb']) + { + $oldname = e_FILE."public/".$_POST['download_thumb']; + $newname = e_FILE."downloadthumbs/".$_POST['download_thumb']; + if(!$this -> move_file($oldname,$newname)) + { + return; + } + } + if($_POST['download_image']) + { + $oldname = e_FILE."public/".$_POST['download_image']; + $newname = e_FILE."downloadimages/".$_POST['download_image']; + if(!$this -> move_file($oldname,$newname)) + { + return; + } + } + } + + if($_POST['move_file'] && $_POST['download_url']) + { + $oldname = e_FILE."public/".$_POST['download_url']; + $newname = $_POST['move_file'].$_POST['download_url']; + if(!$this -> move_file($oldname,$newname)) + { + return; + } + $durl = str_replace(e_DOWNLOAD,"",$newname); + } + + + // ------------------------------------------ + + + $_POST['download_description'] = $tp->toDB($_POST['download_description']); + $_POST['download_name'] = $tp->toDB($_POST['download_name']); + $_POST['download_author'] = $tp->toDB($_POST['download_author']); + + if (preg_match("#(.*?)/(.*?)/(.*?) (.*?):(.*?):(.*?)$#", $_POST['download_datestamp'], $matches)){ + $_POST['download_datestamp'] = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); + }else{ + $_POST['download_datestamp'] = time(); + } + + if($_POST['update_datestamp']){ $_POST['download_datestamp'] = time(); } + + $mirrorStr = ""; + $mirrorReq = ""; + + if($_POST['download_mirror_name'][0]) + { + $mirrors = count($_POST['download_mirror_name']); + for($a=0; $a<$mirrors; $a++) + { + $mirror_id = $_POST['download_mirror_name'][$a]; + $mirror_url = $_POST['download_mirror'][$a]; + $mirrorStr .= $mirror_id.",".$mirror_url.",0".chr(1); + } + } + + if ($id) + { + admin_update($sql->db_Update("download", "download_name='".$_POST['download_name']."', download_url='".$durl."', download_author='".$_POST['download_author']."', download_author_email='".$_POST['download_author_email']."', download_author_website='".$_POST['download_author_website']."', download_description='".$_POST['download_description']."', download_filesize='".$filesize."', download_category='".intval($_POST['download_category'])."', download_active='".intval($_POST['download_active'])."', download_datestamp='".intval($_POST['download_datestamp'])."', download_thumb='".$_POST['download_thumb']."', download_image='".$_POST['download_image']."', download_comment='".intval($_POST['download_comment'])."', download_class = '{$_POST['download_class']}', download_mirror='$mirrorStr', download_mirror_type='".intval($_POST['download_mirror_type'])."' , download_visible='".$_POST['download_visible']."' WHERE download_id=".intval($id)), 'update', DOWLAN_2." (".$_POST['download_name'].")"); + $dlinfo = array("download_id" => $download_id, "download_name" => $_POST['download_name'], "download_url" => $durl, "download_author" => $_POST['download_author'], "download_author_email" => $_POST['download_author_email'], "download_author_website" => $_POST['download_author_website'], "download_description" => $_POST['download_description'], "download_filesize" => $filesize, "download_category" => $_POST['download_category'], "download_active" => $_POST['download_active'], "download_datestamp" => $time, "download_thumb" => $_POST['download_thumb'], "download_image" => $_POST['download_image'], "download_comment" => $_POST['download_comment'] ); + $e_event->trigger("dlupdate", $dlinfo); + } else { + if (admin_update($download_id = $sql->db_Insert("download", "0, '".$_POST['download_name']."', '".$durl."', '".$_POST['download_author']."', '".$_POST['download_author_email']."', '".$_POST['download_author_website']."', '".$_POST['download_description']."', '".$filesize."', '0', '".intval($_POST['download_category'])."', '".intval($_POST['download_active'])."', '".intval($_POST['download_datestamp'])."', '".$_POST['download_thumb']."', '".$_POST['download_image']."', '".intval($_POST['download_comment'])."', '{$_POST['download_class']}', '$mirrorStr', '".intval($_POST['download_mirror_type'])."', '".$_POST['download_visible']."' "), 'insert', DOWLAN_1." (".$_POST['download_name'].")")) { + $dlinfo = array("download_id" => $download_id, "download_name" => $_POST['download_name'], "download_url" => $durl, "download_author" => $_POST['download_author'], "download_author_email" => $_POST['download_author_email'], "download_author_website" => $_POST['download_author_website'], "download_description" => $_POST['download_description'], "download_filesize" => $filesize, "download_category" => $_POST['download_category'], "download_active" => $_POST['download_active'], "download_datestamp" => $time, "download_thumb" => $_POST['download_thumb'], "download_image" => $_POST['download_image'], "download_comment" => $_POST['download_comment'] ); + $e_event->trigger("dlpost", $dlinfo); + + if ($_POST['remove_upload']) { + $sql->db_Update("upload", "upload_active='1' WHERE upload_id='".$_POST['remove_id']."'"); + $mes = "
    ".$_POST['download_name']." ".DOWLAN_104; + $mes .= "

    ".DOWLAN_105.""; + $this->show_message($mes); + } + } + } + } + + +// ----------------------------------------------------------------------------- + + function show_categories($sub_action, $id) + { + global $sql, $rs, $ns, $tp, $pst; + + if (!is_object($sql2)) { + $sql2 = new db; + } + $text = $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); + $text .= "
    "; + + $qry = " + SELECT dc.*, COUNT(d.download_id) AS filecount FROM #download_category AS dc + LEFT JOIN #download AS d ON d.download_category = dc.download_category_id + GROUP BY dc.download_category_id + ORDER BY dc.download_category_order + "; + if($sql->db_Select_gen($qry)) + { + $categories = $sql->db_getList(); + foreach($categories as $cat) + { + $cat_array[$cat['download_category_parent']][] = $cat; + } + + $text .= " + + + + + + + + "; + + + //Start displaying parent categories + foreach($cat_array[0] as $parent) + { + if(strstr($parent['download_category_icon'], chr(1))) + { + list($parent['download_category_icon'], $parent['download_category_icon_empty']) = explode(chr(1), $parent['download_category_icon']); + } + + $text .= " + + + + + + "; + + //Show main categories + + if(is_array($cat_array[$parent['download_category_id']])) + { + foreach($cat_array[$parent['download_category_id']] as $main) + { + + if(strstr($main['download_category_icon'], chr(1))) + { + list($main['download_category_icon'], $main['download_category_icon_empty']) = explode(chr(1), $main['download_category_icon']); + } + $text .= " + + + + + + "; + + //Show sub categories + if(is_array($cat_array[$main['download_category_id']])) + { + foreach($cat_array[$main['download_category_id']] as $sub) + { + + if(strstr($sub['download_category_icon'], chr(1))) + { + list($sub['download_category_icon'], $sub['download_category_icon_empty']) = explode(chr(1), $sub['download_category_icon']); + } + $text .= " + + + + + + "; + } + } + } + } + + } + + $text .= "
     ".DOWLAN_11."".DOWLAN_52."".LAN_ORDER."".LAN_OPTIONS."
    ".($parent['download_category_icon'] ? "" : " ")."{$parent['download_category_name']} + + + ".ADMIN_EDIT_ICON." + "; + if(!is_array($cat_array[$parent['download_category_id']])) + { + $text .= "toJS(DOWLAN_34." [ID: {$parent['download_category_id']} ]")."') \"/>"; + } + $text .= " +
    ".($main['download_category_icon'] ? "" : " ")."{$main['download_category_name']}
    {$main['download_category_description']}
    {$main['filecount']} + + + ".ADMIN_EDIT_ICON.""; + if(!is_array($cat_array[$main['download_category_id']]) && !$main['filecount']) + { + $text .= "toJS(DOWLAN_34." [ID: {$main['download_category_id']} ]")."') \"/>"; + } + $text .= " +
    ".($sub['download_category_icon'] ? "" : " ")."    ".DOWLAN_53.": {$sub['download_category_name']}
        {$sub['download_category_description']}
    {$sub['filecount']} + + + ".ADMIN_EDIT_ICON." + "; + if(!$sub['filecount']) + { + $text .= "toJS(DOWLAN_34." [ID: {$sub['download_category_id']} ]")."') \"/>"; + } + $text .= " +
    "; + $text .= "
    + +
    "; + } + else + { + $text .= "
    ".DOWLAN_38."
    "; + } + $text .= ""; + $ns->tablerender(DOWLAN_37, $text); + + unset($download_category_id, $download_category_name, $download_category_description, $download_category_parent, $download_category_icon, $download_category_class); + + $handle = opendir(e_IMAGE."icons"); + while ($file = readdir($handle)) { + if ($file != "." && $file != ".." && $file != "/" && $file != "CVS") { + $iconlist[] = $file; + } + } + closedir($handle); + + if ($sub_action == "edit" && !$_POST['add_category']) { + if ($sql->db_Select("download_category", "*", "download_category_id=$id")) { + $row = $sql->db_Fetch(); + extract($row); + $main_category_parent = $download_category_parent; + if(strstr($download_category_icon, chr(1))) + { + list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon); + } + else + { + $download_category_icon_empty = ""; + } + } + } + + $preset = $pst->read_preset("admin_dl_cat"); // read preset values into array + extract($preset); + + $frm_action = (isset($_POST['add_category'])) ? e_SELF."?cat" : e_SELF."?".e_QUERY; + $text = "
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + + + $text .= " + + + +
    ".DOWLAN_37.": "; + + if (!$download_cats = $sql->db_Select("download_category")) { + $text .= " + \n"; + } else { + $text .= " + "; + } + $text .= "
    ".DOWLAN_12.": + +
    ".DOWLAN_18.": + +
    ".DOWLAN_41.": + + +
    + +
    ".DOWLAN_147.": + + +
    + +
    ".DOWLAN_43.":
    (".DOWLAN_44.")
    ".r_userclass("download_category_class", $download_category_class, 'off', 'public, nobody, member, admin, classes, language')." + +
    "; + if ($id && $sub_action == "edit" && !isset($_POST['add_category'])) { + $text .= " "; + } else { + $text .= ""; + } + $text .= "
    +
    +
    "; + $ns->tablerender(DOWLAN_39, $text); + } + + function create_category($sub_action, $id) { + global $sql, $tp; + $download_category_name = $tp->toDB($_POST['download_category_name']); + $download_category_description = $tp->toDB($_POST['download_category_description']); + $download_category_icon = $tp->toDB($_POST['download_category_icon']); + + if(isset($_POST['download_category_icon_empty']) && $_POST['download_category_icon_empty'] != ""){ + $download_category_icon .= trim(chr(1).$tp->toDB($_POST['download_category_icon_empty'])); + } + + if ($id) { + admin_update($sql->db_Update("download_category", "download_category_name='$download_category_name', download_category_description='$download_category_description', download_category_icon ='$download_category_icon', download_category_parent= '".intval($_POST['download_category_parent'])."', download_category_class='".$_POST['download_category_class']."' WHERE download_category_id='$id'"), 'update', DOWLAN_48); + } else { + admin_update($sql->db_Insert("download_category", "0, '$download_category_name', '$download_category_description', '$download_category_icon', '".intval($_POST['download_category_parent'])."', '".$_POST['download_category_class']."', 0 "), 'insert', DOWLAN_47); + } + if ($sub_action == "sn") { + $sql->db_Delete("tmp", "tmp_time='$id' "); + } + } + + + + function show_existing_mirrors() + { + + global $sql, $ns, $tp, $sub_action, $id, $delete, $del_id; + + if($delete == "mirror") + { + admin_update($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135); + } + + + if(!$sql -> db_Select("download_mirror")) + { + $text = "
    ".DOWLAN_144."
    "; // No mirrors defined yet + } + else + { + + $text = "
    +
    + + + + + + + + "; + + $mirrorList = $sql -> db_getList(); + + foreach($mirrorList as $mirror) + { + extract($mirror); + $text .= " + + + + + + + + "; + } + $text .= "
    ID".DOWLAN_12."".DOWLAN_136."".LAN_OPTIONS."
    $mirror_id".$tp -> toHTML($mirror_name)."".($mirror_image ? "" : "None")." + ".ADMIN_EDIT_ICON." + +
    "; + + } + + $ns -> tablerender(DOWLAN_138, $text); + + require_once(e_HANDLER."file_class.php"); + $fl = new e_file; + $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', 'null*'); + $imagelist = $fl->get_files(e_FILE."downloadimages/","",$rejecthumb); + + if($sub_action == "edit" && !defined("SUBMITTED")) + { + $sql -> db_Select("download_mirror", "*", "mirror_id='".intval($id)."' "); + $mirror = $sql -> db_Fetch(); + extract($mirror); + $edit = TRUE; + } + else + { + unset($mirror_name, $mirror_url, $mirror_image, $mirror_location, $mirror_description); + $edit = FALSE; + } + + $text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".DOWLAN_12." + +
    ".DOWLAN_139." + +
    ".DOWLAN_136." + + + +
    + +
    ".DOWLAN_141." + +
    ".DOWLAN_18." + +
    + ".($edit ? "" : "")." +
    +
    +
    "; + + $caption = ($edit ? DOWLAN_142 : DOWLAN_143); + + $ns -> tablerender($caption, $text); + } + + function submit_mirror() + { + global $tp, $sql; + define("SUBMITTED", TRUE); + if(isset($_POST['mirror_name']) && isset($_POST['mirror_url'])) + { + $name = $tp -> toDB($_POST['mirror_name']); + $url = $tp -> toDB($_POST['mirror_url']); + $location = $tp -> toDB($_POST['mirror_location']); + + $description = $tp -> toDB($_POST['mirror_description']); + + if (isset($_POST['id'])){ + admin_update($sql -> db_Update("download_mirror", "mirror_name='$name', mirror_url='$url', mirror_image='".$_POST['mirror_image']."', mirror_location='$location', mirror_description='$description' WHERE mirror_id=".$_POST['id']), 'update', DOWLAN_133); + } else { + admin_update($sql -> db_Insert("download_mirror", "0, '$name', '$url', '".$_POST['mirror_image']."', '$location', '$description', 0"), 'insert', DOWLAN_134); + } + } + } + + // --------------------------------------------------------------------------- + + function move_file($oldname,$newname) + { + global $ns; + if(file_exists($newname)) + { + return TRUE; + } + + if(!file_exists($oldname) || is_dir($oldname)) + { + $ns -> tablerender(LAN_ERROR,DOWLAN_68 . " : ".$oldname); + return FALSE; + } + + $directory = dirname($newname); + if(is_writable($directory)) + { + if(!rename($oldname,$newname)) + { + $ns -> tablerender(LAN_ERROR,DOWLAN_152." ".$oldname ." -> ".$newname); + return FALSE; + } + else + { + return TRUE; + } + } + else + { + $ns -> tablerender(LAN_ERROR,$directory ." ".LAN_NOTWRITABLE); + return FALSE; + } + } + +// ------------------------------------------------------------------------- + + +} // end class. + + +function download_adminmenu($parms) { + global $download; + global $action; + $download->show_options($action); +} + + + + + +?> diff --git a/e107_admin/e107_update.php b/e107_admin/e107_update.php new file mode 100644 index 000000000..a9db8406a --- /dev/null +++ b/e107_admin/e107_update.php @@ -0,0 +1,117 @@ + $rmks) { + $installed = call_user_func("update_".$func); + if ((LAN_UPDATE == $_POST[$func]) && !$installed) { + if (function_exists("update_".$func)) { + $message .= LAN_UPDATE_7." {$rmks}
    "; + $error=call_user_func("update_".$func, "do"); + if ($error!='') { + $message = $error; + } + } + } + } + if ($message) { + $ns->tablerender(LAN_UPDATE, $message); + } +} + +function show_updates($dbupdate, $additional = false) { + global $ns; + $text = "
    +
    + + + + + + "; + + $updates = 0; + + foreach($dbupdate as $func => $rmks) { + if (function_exists("update_".$func)) { + $text .= ""; + if (call_user_func("update_".$func)) { + $text .= ""; + } else { + $updates++; + $text .= ""; + } + $text .= ""; + } + } + + $text .= "
    ".LAN_UPDATE."".LAN_UPDATE_2."
    {$rmks}".LAN_UPDATE_3."
    "; + $ns->tablerender(($additional ? (defined("LAN_UPDATE_11") ? LAN_UPDATE_11 : '.617 to .7 Update Continued') : LAN_UPDATE_10), $text); +} + +if ($_POST) { + $message = run_updates($dbupdate); +} + +if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'forum' AND plugin_installflag='1' ")) { + if(file_exists(e_PLUGIN.'forum/forum_update_check.php')) + { + include_once(e_PLUGIN.'forum/forum_update_check.php'); + } +} +if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) { + if(file_exists(e_PLUGIN.'log/log_update_check.php')) + { + include_once(e_PLUGIN.'log/log_update_check.php'); + } +} + +if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'content' AND plugin_installflag='1' ")) +{ + if(file_exists(e_PLUGIN.'content/content_update_check.php')) + { + include_once(e_PLUGIN.'content/content_update_check.php'); + } +} + +if ($sql->db_Select("plugin", "plugin_version", "plugin_path = 'pm' AND plugin_installflag='1' ")) +{ + if(file_exists(e_PLUGIN.'pm/pm_update_check.php')) + { + include_once(e_PLUGIN.'pm/pm_update_check.php'); + } +} + +if ($_POST) { + $message = run_updates($dbupdatep); +} + +if (isset($dbupdatep)) { + show_updates($dbupdatep, true); +} +show_updates($dbupdate); + +require_once("footer.php"); + +?> \ No newline at end of file diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php new file mode 100644 index 000000000..4be2728a5 --- /dev/null +++ b/e107_admin/emoticon.php @@ -0,0 +1,353 @@ +db_Count("core", "(*)", "e107_name = 'emote_default'")) +{ + $tmp = 'a:28:{s:9:"alien!png";s:6:"!alien";s:10:"amazed!png";s:7:"!amazed";s:9:"angry!png";s:11:"!grr !angry";s:12:"biglaugh!png";s:4:"!lol";s:11:"cheesey!png";s:10:":D :oD :-D";s:12:"confused!png";s:10:":? :o? :-?";s:7:"cry!png";s:19:"&| &-| &o| :(( !cry";s:8:"dead!png";s:21:"x) xo) x-) x( xo( x-(";s:9:"dodge!png";s:6:"!dodge";s:9:"frown!png";s:10:":( :o( :-(";s:7:"gah!png";s:10:":@ :o@ :o@";s:8:"grin!png";s:10:":D :oD :-D";s:9:"heart!png";s:6:"!heart";s:8:"idea!png";s:10:":! :o! :-!";s:7:"ill!png";s:4:"!ill";s:7:"mad!png";s:13:"~:( ~:o( ~:-(";s:12:"mistrust!png";s:9:"!mistrust";s:11:"neutral!png";s:10:":| :o| :-|";s:12:"question!png";s:2:"?!";s:12:"rolleyes!png";s:10:"B) Bo) B-)";s:7:"sad!png";s:4:"!sad";s:10:"shades!png";s:10:"8) 8o) 8-)";s:7:"shy!png";s:4:"!shy";s:9:"smile!png";s:10:":) :o) :-)";s:11:"special!png";s:3:"%-6";s:12:"suprised!png";s:10:":O :oO :-O";s:10:"tongue!png";s:21:":p :op :-p :P :oP :-P";s:8:"wink!png";s:10:";) ;o) ;-)";}'; + $sql->db_Insert("core", "'emote_default', '$tmp' "); +} + +if (isset($_POST['active'])) +{ + if ($pref['smiley_activate'] != $_POST['smiley_activate']) { + $pref['smiley_activate'] = $_POST['smiley_activate']; + save_prefs(); + $update = true; + } + admin_update($update); +} + +/* get packs */ + +require_once(e_HANDLER."file_class.php"); +$fl = new e_file; +$emote = new emotec; +foreach($_POST as $key => $value) +{ + if(strstr($key, "subPack_")) + { + $subpack = str_replace("subPack_", "", $key); + $emote -> emoteConf($subpack); + break; + } + + if(strstr($key, "defPack_")) + { + $pref['emotepack'] = str_replace("defPack_", "", $key); + save_prefs(); + break; + } +} + +$check = TRUE; +$check = $emote -> installCheck(); +if($check!==FALSE){ + $emote -> listPacks(); +} + +class emotec +{ + + var $packArray; + + function emotec() + { + /* constructor */ + global $fl; + $this -> packArray = $fl -> get_dirs(e_IMAGE."emotes"); + + if(isset($_POST['sub_conf'])) + { + $this -> saveConf(); + } + } + + function listPacks() + { + + global $ns, $fl, $pref; + + $text = "
    +
    + + + + + + + + + +
    ".EMOLAN_4.": ".($pref['smiley_activate'] ? "" : "")."
    + +
    +
    +
    + "; + + $ns -> tablerender(EMOLAN_1, $text); + + + $text = " +
    + + + + + + + "; + + $reject = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$', 'emoteconf*'); + foreach($this -> packArray as $pack) + { + $emoteArray = $fl -> get_files(e_IMAGE."emotes/".$pack, "", $reject); + + $text .= " + + + + + + + "; + } + + $text .= " +
    ".EMOLAN_2."".EMOLAN_3."".EMOLAN_8."".EMOLAN_9."
    $pack + "; + + foreach($emoteArray as $emote) + { + $text .= " "; + } + + $text .= "".($pref['emotepack'] == $pack ? EMOLAN_10 : "")."
    +
    + "; + $ns -> tablerender(EMOLAN_13, $text); + } + + function emoteConf($packID) + { + + global $ns, $fl, $pref, $sysprefs, $tp; + $corea = "emote_".$packID; + + $emotecode = $sysprefs -> getArray($corea); + + $reject = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$', 'emoteconf*', '*\.txt', '*\.html', '*\.pak', '*php*', '.cvsignore'); + $emoteArray = $fl -> get_files(e_IMAGE."emotes/".$packID, "", $reject); + + $eArray = array(); + foreach($emoteArray as $value) + { + if(!strstr($value['fname'], ".php") && !strstr($value['fname'], ".txt") && !strstr($value['fname'], ".pak") && !strstr($value['fname'], ".xml") && !strstr($value['fname'], "phpBB") && !strstr($value['fname'], ".html")) + { + $eArray[] = array('path' => $value['path'], 'fname' => $value['fname']); + } + } + + $text = " +
    + + + + + + + "; + + foreach($eArray as $emote) + { + $ename = $emote['fname']; + $evalue = str_replace(".", "!", $ename); + + $text .= " + + + + + + "; + } + + $text .= " + + + + +
    ".EMOLAN_2."".EMOLAN_5."".EMOLAN_6." ( ".EMOLAN_7." )
    ".$ename."
    + +
    "; + $ns -> tablerender(EMOLAN_15.": '".$packID."'", $text); + + } + + function saveConf() + { + global $ns, $sql, $tp; + + $packID = $_POST['packID']; + unset($_POST['sub_conf'], $_POST['packID']); + + foreach($_POST as $key => $value) + { + $key = str_replace("_", "!", $key); + $_POST[$key] = $value; + } + + $encoded_emotes = $tp -> toDB($_POST); + $tmp = addslashes(serialize($encoded_emotes)); + + if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'")) { + admin_update($sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='emote_".$packID."' "), 'update', EMOLAN_16); + } else { + admin_update($sql->db_Insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16); + } + } + + function installCheck() + { + global $sql, $fl; + foreach($this -> packArray as $value) + { + if(strpos($value,' ')!==FALSE){ + global $ns; + $msg = " +
    ".EMOLAN_17."
    ".EMOLAN_18."


    + + + + + + + + + +
    ".EMOLAN_19."".EMOLAN_20."
    ".$value."".e_IMAGE."emotes/
    +
    "; + $ns->tablerender(EMOLAN_21, $msg); + return FALSE; + } + if(!$sql -> db_Select("core", "*", "e107_name='emote_".$value."' ")) + { + $fileArray = $fl -> get_files(e_IMAGE."emotes/".$value); + foreach($fileArray as $file) + { + if(strstr($file['fname'], ".xml")) + { + $confFile = array('file' => $file['fname'], 'type' => "xml"); + } + else if(strstr($file['fname'], ".pak")) + { + $confFile = array('file' => $file['fname'], 'type' => "pak"); + } + else if(strstr($file['fname'], ".php")) + { + $confFile = array('file' => $file['fname'], 'type' => "php"); + } + } + + /* .pak file ------------------------------------------------------------------------------------------------------------------------------------ */ + if($confFile['type'] == "pak") + { + $filename = e_IMAGE."emotes/".$value."/".$confFile['file']; + $pakconf = file ($filename); + $contentArray = array(); + foreach($pakconf as $line) + { + if(trim($line) && strstr($line, "=+") && !strstr($line, ".txt") && !strstr($line, ".html") && !strstr($line, "cvs")) $contentArray[] = $line; + } + $confArray = array(); + foreach($contentArray as $pakline) + { + $tmp = explode("=+:", $pakline); + $confIC = str_replace(".", "!", $tmp[0]); + $confArray[$confIC] = trim($tmp[2]); + } + $tmp = addslashes(serialize($confArray)); + $sql->db_Insert("core", "'emote_".$value."', '$tmp' "); + echo "
    New emote pak found: ' ".$value."'
    "; + } + /* end ----------------------------------------------------------------------------------------------------------------------------------------- */ + + /* .xml file ------------------------------------------------------------------------------------------------------------------------------------ */ + if($confFile['type'] == "xml") + { + $filename = e_IMAGE."emotes/".$value."/".$confFile['file']; + + $handle = fopen ($filename, "r"); + $contents = fread ($handle, filesize ($filename)); + fclose ($handle); + + preg_match_all("#\(.*?)\<\/emoticon\>#si", $contents, $match); + $confArray = array(); + + for($a=0; $a<=(count($match[0])); $a++) + { + preg_match_all("#\(.*?)\<\/string\>#si", $match[0][$a], $match2); + + $codet = ""; + foreach($match2[1] as $code) + { + $codet .= $code." "; + } + + foreach($fileArray as $emote) + { + if(strstr($emote['fname'], $match[1][$a])) + { + $file = str_replace(".", "!", $emote['fname']); + } + } + $confArray[$file] = $codet; + } + + $tmp = addslashes(serialize($confArray)); + $sql->db_Insert("core", "'emote_".$value."', '$tmp' "); + echo "
    New emote xml pak found: ' ".$value."'
    "; + } + + if($confFile['type'] == "php") + { + echo ".conf file found: installing '".$value."'
    "; + include_once(e_IMAGE."emotes/".$value."/".$confFile['file']); + $sql->db_Insert("core", "'emote_".$value."', '$_emoteconf' "); + echo "
    New emote php found: ' ".$value."'
    "; + } + /* end ----------------------------------------------------------------------------------------------------------------------------------------- */ + + } + } + } +} + +require_once("footer.php"); + +?> diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php new file mode 100644 index 000000000..0020331d2 --- /dev/null +++ b/e107_admin/fileinspector.php @@ -0,0 +1,785 @@ + $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY); +foreach ($maindirs as $maindirs_key => $maindirs_value) { + $coredir[$maindirs_key] = substr($maindirs_value, 0, -1); +} + +require_once('core_image.php'); + +if (e_QUERY) { + $fi -> snapshot_interface(); +} else if (isset($_POST['scan'])) { + $fi -> scan_results(); + $fi -> scan_config(); +} else { + $fi -> scan_config(); +} + +class file_inspector { + + var $root_dir; + var $files = array(); + var $parent; + var $count = array(); + var $results = 0; + + function file_inspector() { + global $e107; + set_time_limit(240); + $this -> root_dir = $e107 -> file_path; + if (substr($this -> root_dir, -1) == '/') { + $this -> root_dir = substr($this -> root_dir, 0, -1); + } + if ($_POST['core'] == 'fail') { + $_POST['integrity'] = TRUE; + } + if (MAGIC_QUOTES_GPC && $_POST['regex']) { + $_POST['regex'] = stripslashes($_POST['regex']); + } + if ($_POST['regex']) { + if ($_POST['core'] == 'fail') { + $_POST['core'] = 'all'; + } + $_POST['missing'] = 0; + $_POST['integrity'] = 0; + } + } + + function scan_config() { + global $ns, $rs, $pref; + + $text = "
    +
    + + + + "; + + $text .= " + + + "; + + $text .= " + + + "; + + $text .= " + + + "; + + $text .= " + + + "; + + $text .= " + + "; + + $text .= " + + + "; + + if ($pref['developer']) { + $text .= " + + "; + + $text .= " + + + "; + + $text .= " + + + "; + + $text .= " + + + "; + } + + $text .= " + + +
    ".FC_LAN_2."
    + ".FC_LAN_3." ".FC_LAN_5.": + + ".FC_LAN_4."   + ".FC_LAN_6."   + ".FC_LAN_12."   +
    + ".FC_LAN_3." ".FC_LAN_13.": + + ".FC_LAN_9."   + ".FC_LAN_10."   +
    + ".FC_LAN_3." ".FC_LAN_7.": + + ".FC_LAN_9."   + ".FC_LAN_10."   +
    + ".FC_LAN_3." ".FC_LAN_21.": + + ".FC_LAN_9."   + ".FC_LAN_10."   +
    + ".FC_LAN_8.": + + ".FC_LAN_9."   + ".FC_LAN_10."   +
    + ".FC_LAN_14.": + + ".FC_LAN_15."   + ".FC_LAN_16."   +
    ".FC_LAN_17."
    + ".FC_LAN_18.": + + ## +
    + ".FC_LAN_19.": + + +
    + ".FC_LAN_20.": + + +
    ".$rs -> form_button('submit', 'scan', FC_LAN_11)."
    +
    +
    "; + + $ns -> tablerender(FC_LAN_1, $text); + + } + + function scan($dir, $image) { + $handle = opendir($dir.'/'); + while (false !== ($readdir = readdir($handle))) { + if ($readdir != '.' && $readdir != '..' && $readdir != '/' && $readdir != 'CVS' && $readdir != 'Thumbs.db' && (strpos('._', $readdir) === FALSE)) { + $path = $dir.'/'.$readdir; + if (is_dir($path)) { + $dirs[$path] = $readdir; + } else if (!isset($image[$readdir])) { + $files[$readdir] = $this -> checksum($path, TRUE); + } + } + } + closedir($handle); + + if (isset($dirs)) { + ksort ($dirs); + foreach ($dirs as $dir_path => $dir_list) { + $list[$dir_list] = ($set = $this -> scan($dir_path, $image[$dir_list])) ? $set : array(); + } + } + + if (isset($files)) { + ksort ($files); + foreach ($files as $file_name => $file_list) { + $list[$file_name] = $file_list; + } + } + + return $list; + } + + function inspect($list, $deprecated, $level, $dir, &$tree_end, &$parent_expand) { + global $coredir; + unset ($childOut); + $parent_expand = false; + if (substr($dir, -1) == '/') { + $dir = substr($dir, 0, -1); + } + $dir_id = dechex(crc32($dir)); + $this -> files[$dir_id]['.']['level'] = $level; + $this -> files[$dir_id]['.']['parent'] = $this -> parent; + $this -> files[$dir_id]['.']['file'] = $dir; + $directory = $level ? basename($dir) : SITENAME; + $level++; + + foreach ($list as $key => $value) { + $this -> parent = $dir_id; + if (is_array($value)) { + $path = $dir.'/'.$key; + $child_open = false; + $child_end = true; + $sub_text .= $this -> inspect($value, $deprecated[$key], $level, $path, $child_end, $child_expand); + $tree_end = false; + if ($child_expand) { + $parent_expand = true; + $last_expand = true; + } + } else { + $path = $dir.'/'.$key; + $fid = strtolower($key); + $this -> files[$dir_id][$fid]['file'] = ($_POST['type'] == 'tree') ? $key : $path; + if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE) { + if ($_POST['core'] != 'none') { + $this -> count['core']['num']++; + $this -> count['core']['size'] += $this -> files[$dir_id][$fid]['size']; + if ($_POST['regex']) { + $file_content = file($path); + if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE) { + if ($this -> files[$dir_id][$fid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content)){ + $this -> files[$dir_id][$fid]['file'] = ($_POST['type'] == 'tree') ? $key : $path; + $this -> files[$dir_id][$fid]['icon'] = 'file_core.png'; + $dir_icon = 'fileinspector.png'; + $parent_expand = TRUE; + $this -> results++; + } else { + unset($this -> files[$dir_id][$fid]); + $known[$dir_id][$fid] = true; + $dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png'; + } + } + } else { + //if (strpos($dir.'/'.$key, 'htmlarea') === false) { + if ($_POST['integrity']) { + if ($dir.'/'.$key != $this -> root_dir.'/'.$coredir['admin'].'/core_image.php' && $dir.'/'.$key != $this -> root_dir.'/e107_config.php') { + if ($this -> checksum($path) != $value) { + $this -> count['fail']['num']++; + $this -> count['fail']['size'] += $this -> files[$dir_id][$fid]['size']; + $this -> files[$dir_id][$fid]['icon'] = 'file_fail.png'; + $dir_icon = 'folder_fail.png'; + $parent_expand = TRUE; + } else { + $this -> count['pass']['num']++; + $this -> count['pass']['size'] += $this -> files[$dir_id][$fid]['size']; + if ($_POST['core'] != 'fail') { + $this -> files[$dir_id][$fid]['icon'] = 'file_check.png'; + $dir_icon = ($dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png') ? $dir_icon : 'folder_check.png'; + } else { + unset($this -> files[$dir_id][$fid]); + $known[$dir_id][$fid] = true; + } + } + } else { + $this -> count['uncalculable']['num']++; + $this -> count['uncalculable']['size'] += $this -> files[$dir_id][$fid]['size']; + if ($_POST['core'] != 'fail') { + $this -> files[$dir_id][$fid]['icon'] = 'file_uncalc.png'; + } else { + unset($this -> files[$dir_id][$fid]); + $known[$dir_id][$fid] = true; + } + } + } else { + $this -> files[$dir_id][$fid]['icon'] = 'file_core.png'; + } + //} else { + // $this -> count['warning']['num']++; + // $this -> count['warning']['size'] += $this -> files[$dir_id][$fid]['size']; + // $this -> files[$dir_id][$fid]['icon'] = 'file_warning.png'; + // $dir_icon = 'folder_warning.png'; + // $parent_expand = TRUE; + //} + } + } else { + unset ($this -> files[$dir_id][$fid]); + $known[$dir_id][$fid] = true; + } + } else if ($_POST['missing']) { + $this -> count['missing']['num']++; + $this -> files[$dir_id][$fid]['icon'] = 'file_missing.png'; + $dir_icon = ($dir_icon == 'folder_fail.png') ? $dir_icon : 'folder_missing.png'; + $parent_expand = TRUE; + } else { + unset ($this -> files[$dir_id][$fid]); + } + } + } + + if ($_POST['noncore'] || $_POST['oldcore']) { + $handle = opendir($dir.'/'); + while (false !== ($readdir = readdir($handle))) { + if ($readdir != '.' && $readdir != '..' && $readdir != '/' && $readdir != 'CVS' && $readdir != 'Thumbs.db' && (strpos('._', $readdir) === FALSE)) { + if (is_dir($dir.'/'.$readdir)) { + if (!isset($list[$readdir]) && ($level > 1 || $readdir == 'e107_install')) { + $child_open = false; + $child_end = true; + $sub_text .= $this -> inspect(array(), $deprecated[$readdir], $level, $dir.'/'.$readdir, $child_end, $child_expand); + $tree_end = false; + if ($child_expand) { + $parent_expand = true; + $last_expand = true; + } + } + } else { + $aid = strtolower($readdir); + if (!isset($this -> files[$dir_id][$aid]['file']) && !$known[$dir_id][$aid]) { + if (strpos($dir.'/'.$readdir, 'htmlarea') === false) { + if (isset($deprecated[$readdir])) { + if ($_POST['oldcore']) { + $this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir; + $this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir); + $this -> files[$dir_id][$aid]['icon'] = 'file_old.png'; + $this -> count['deprecated']['num']++; + $this -> count['deprecated']['size'] += $this -> files[$dir_id][$aid]['size']; + } + } else { + if ($_POST['noncore']) { + $this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir; + $this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir); + $this -> files[$dir_id][$aid]['icon'] = 'file_unknown.png'; + $this -> count['unknown']['num']++; + $this -> count['unknown']['size'] += $this -> files[$dir_id][$aid]['size']; + } + } + } else { + $this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir; + $this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir); + $this -> files[$dir_id][$aid]['icon'] = 'file_warning.png'; + $this -> count['warning']['num']++; + $this -> count['warning']['size'] += $this -> files[$dir_id][$aid]['size']; + $this -> count['deprecated']['num']++; + $this -> count['deprecated']['size'] += $this -> files[$dir_id][$aid]['size']; + $dir_icon = 'folder_warning.png'; + $parent_expand = TRUE; + } + if ($_POST['regex']) { + $file_content = file($dir.'/'.$readdir); + if ($this -> files[$dir_id][$aid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content)) { + $dir_icon = 'fileinspector.png'; + $parent_expand = TRUE; + $this -> results++; + } else { + unset($this -> files[$dir_id][$aid]); + $dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png'; + } + } else { + if (isset($deprecated[$readdir])) { + if ($_POST['oldcore']) { + $dir_icon = ($dir_icon == 'folder_warning.png' || $dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png' || $dir_icon == 'folder_old_dir.png') ? $dir_icon : 'folder_old.png'; + $parent_expand = TRUE; + } + } else { + if ($_POST['noncore']) { + $dir_icon = ($dir_icon == 'folder_warning.png' || $dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png' || $dir_icon == 'folder_old.png' || $dir_icon == 'folder_old_dir.png') ? $dir_icon : 'folder_unknown.png'; + $parent_expand = TRUE; + } + } + } + } else if ($_POST['core'] == 'none') { + unset($this -> files[$dir_id][$aid]); + } + } + } + } + closedir($handle); + } + + $dir_icon = $dir_icon ? $dir_icon : 'folder.png'; + $icon = ""; + $hide = ($last_expand && $dir_icon != 'folder_core.png') ? "" : "style='display: none'"; + $text = "
    "; + $text .= $tree_end ? "" : ""; + $text .= " ".$icon." ".$directory.""; + $text .= $tree_end ? "" : "
    ".$sub_text."
    "; + $text .= "
    "; + + $this -> files[$dir_id]['.']['icon'] = $dir_icon; + + return $text; + } + + function scan_results() { + global $ns, $rs, $core_image, $deprecated_image; + $scan_text = $this -> inspect($core_image, $deprecated_image, 0, $this -> root_dir); + + if ($_POST['type'] == 'tree') { + $text = "
    + + + + "; + + $text .= ""; + + $text .= " + + "; + + $text .= "
    ".FR_LAN_2."
    +
    + ".$scan_text." +
    +
    "; + } else { + $text = "
    + + + + "; + + $text .= " + + +
    ".FR_LAN_2."
    "; + } + + $text .= ""; + + if ($_POST['type'] == 'tree') { + $text .= " + "; + } else { + $text .= " + "; + } + + if ($_POST['core'] != 'none') { + $text .= ""; + } + if ($_POST['missing']) { + $text .= ""; + } + if ($_POST['noncore']) { + $text .= ""; + } + if ($_POST['oldcore']) { + $text .= ""; + } + if ($_POST['core'] == 'all') { + $text .= ""; + } + + if ($this -> count['warning']['num']) { + $text .= ""; + $text .= ""; + + $text .= ""; + + $text .= ""; + + } + if ($_POST['integrity'] && $_POST['core'] != 'none') { + $integrity_icon = $this -> count['fail']['num'] ? 'integrity_fail.png' : 'integrity_pass.png'; + $integrity_text = $this -> count['fail']['num'] ? '( '.$this -> count['fail']['num'].' '.FR_LAN_19.' )' : '( '.FR_LAN_20.' )'; + $text .= ""; + $text .= ""; + + $text .= ""; + $text .= ""; + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + } + + if ($_POST['type'] == 'tree' && !$this -> results && $_POST['regex']) { + $text .= " + "; + } + + $text .= "
    +  ".FR_LAN_3." root_dir))."')\"> +
    +  ".FR_LAN_3."
     ".FR_LAN_4.": ".($this -> count['core']['num'] ? $this -> count['core']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['core']['size'], 2)."
     ".FR_LAN_22.": ".($this -> count['missing']['num'] ? $this -> count['missing']['num'] : FR_LAN_21)." 
     ".FR_LAN_5.": ".($this -> count['unknown']['num'] ? $this -> count['unknown']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['unknown']['size'], 2)."
     ".FR_LAN_24.": ".($this -> count['deprecated']['num'] ? $this -> count['deprecated']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['deprecated']['size'], 2)."
     ".FR_LAN_6.": ".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])." ".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)."
     
    +  ".FR_LAN_26."
     ".FR_LAN_28.": ".($this -> count['warning']['num'] ? $this -> count['warning']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['warning']['size'], 2)."
     ".FR_LAN_27."
     
    +  ".FR_LAN_7." ".$integrity_text."
     ".FR_LAN_8.": ".($this -> count['pass']['num'] ? $this -> count['pass']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['pass']['size'], 2)."
     ".FR_LAN_9.": ".($this -> count['fail']['num'] ? $this -> count['fail']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['fail']['size'], 2)."
     ".FR_LAN_25.": ".($this -> count['uncalculable']['num'] ? $this -> count['uncalculable']['num'] : FR_LAN_21)." ".$this -> parsesize($this -> count['uncalculable']['size'], 2)."
     
     ".FR_LAN_10.": 
    + +

    ".FR_LAN_23."
    "; + + if ($_POST['type'] != 'tree') { + $text .= "
    + "; + if (!$this -> results && $_POST['regex']) { + $text .= ""; + } + } + + foreach ($this -> files as $dir_id => $fid) { + ksort($fid); + $text .= ($_POST['type'] == 'tree') ? "
    ".FR_LAN_23."
    " : ""; + $initial = FALSE; + foreach ($fid as $key => $stext) { + if (!$initial) { + if ($_POST['type'] == 'tree') { + $text .= " + "; + } + } else { + if ($_POST['type'] != 'tree') { + $stext['file'] = str_replace($this -> root_dir."/", "", $stext['file']); + } + $text .= " + + "; + } + $initial = TRUE; + } + $text .= ($_POST['type'] == 'tree') ? "" : ""; + } + + if ($_POST['type'] != 'tree') { + $text .= "
    "; + } + + $text .= "
    +
    "; + + $ns -> tablerender(FR_LAN_1.'...', $text); + } + + function create_image($dir) { + global $core_image, $deprecated_image, $coredir; + + foreach ($coredir as $trim_key => $trim_dirs) { + $search[$trim_key] = "'".$trim_dirs."'"; + $replace[$trim_key] = "\$coredir['".$trim_key."']"; + } + + $data = " scan($dir) : $core_image; + $image_array = var_export($scan_current, true); + $image_array = str_replace($search, $replace, $image_array); + $data .= "\$core_image = ".$image_array.";\n\n"; + + $scan_deprecated = ($_POST['snaptype'] == 'deprecated') ? $this -> scan($dir, $core_image) : $deprecated_image; + $image_array = var_export($scan_deprecated, true); + $image_array = str_replace($search, $replace, $image_array); + $data .= "\$deprecated_image = ".$image_array.";\n\n"; + + $data .= "?>"; + $fp = fopen(e_ADMIN.'core_image.php', 'w'); + fwrite($fp, $data); + } + + function snapshot_interface() { + global $ns, $rs; + $text = ""; + if (isset($_POST['create_snapshot'])) { + $this -> create_image($_POST['snapshot_path']); + $text = "
    +
    + + + + "; + + $text .= " + + + + + +
    Snapshot Created
    + The snapshot (".e_ADMIN."core_image.php) was successfully created. +
    ".$rs -> form_button('submit', 'main_page', 'Return To Main Page')."
    +
    +

    "; + } + + $text .= "
    +
    + + + + "; + + $text .= " + + + + + + + + + + + +
    Create Snapshot
    + Absolute path of root directory to create image from: + + root_dir)."' /> +
    + Create snapshot of current or deprecated core files: + + Current   + Deprecated   +
    ".$rs -> form_button('submit', 'create_snapshot', 'Create Snapshot')."
    +
    +
    "; + + $ns -> tablerender('Snapshot', $text); + + } + + function checksum($filename) { + $checksum = md5(str_replace(array(chr(13),chr(10)), "", file_get_contents($filename))); + return $checksum; + } + + function parsesize($size, $dec = 0) { + $size = $size ? $size : 0; + $kb = 1024; + $mb = 1024 * $kb; + $gb = 1024 * $mb; + $tb = 1024 * $gb; + if ($size < $kb) { + return $size." b"; + } else if($size < $mb) { + return round($size/$kb)." kb"; + } else if($size < $gb) { + return round($size/$mb, $dec)." mb"; + } else if($size < $tb) { + return round($size/$gb, $dec)." gb"; + } else { + return round($size/$tb, $dec)." tb"; + } + } + + function regex_match($file) { + $file_content = file_get_contents($file); + $match = preg_match($_POST['regex'], $file_content); + return $match; + } +} + +require_once('footer.php'); + +function headerjs() { +global $e107; +$text = " +\n"; + +return $text; +} + +?> \ No newline at end of file diff --git a/e107_admin/filemanager.php b/e107_admin/filemanager.php new file mode 100644 index 000000000..221ba30dd --- /dev/null +++ b/e107_admin/filemanager.php @@ -0,0 +1,377 @@ +Debug ".$path."
    "; +} + + +// =============================================== + + +foreach($_POST['deleteconfirm'] as $key=>$delfile){ + // check for delete. + if (isset($_POST['selectedfile'][$key]) && isset($_POST['deletefiles'])) { + if (!$_POST['ac'] == md5(ADMINPWCHANGE)) { + exit; + } + $destination_file = e_BASE.$delfile; + if (@unlink($destination_file)) { + $message .= FMLAN_26." '".$destination_file."' ".FMLAN_27.".
    "; + } else { + $message .= FMLAN_28." '".$destination_file."'.
    "; + } + } + + // check for move to downloads or downloadimages. + if (isset($_POST['selectedfile'][$key]) && (isset($_POST['movetodls'])) ){ + $newfile = str_replace($path,"",$delfile); + + // Move file to whatever folder. + if (isset($_POST['movetodls'])){ + + $newpath = $_POST['movepath']; + + if (rename(e_BASE.$delfile,$newpath.$newfile)){ + $message .= FMLAN_38." ".$newpath.$newfile."
    "; + } else { + $message .= FMLAN_39." ".$newpath.$newfile."
    "; + $message .= (!is_writable($newpath)) ? $newpath.LAN_NOTWRITABLE : ""; + } + } + } +} + + + +if (isset($_POST['upload'])) { + if (!$_POST['ac'] == md5(ADMINPWCHANGE)) { + exit; + } + $pref['upload_storagetype'] = "1"; + require_once(e_HANDLER."upload_handler.php"); + $files = $_FILES['file_userfile']; + foreach($files['name'] as $key => $name) { + if ($files['size'][$key]) { + $uploaded = file_upload(e_BASE.$_POST['upload_dir'][$key]); + } + } +} + +if (isset($message)) { + $ns->tablerender("", "
    ".$message."
    "); +} + +if (strpos(e_QUERY, ".") && !is_dir(realpath(e_BASE.$path))){ + echo "

    "; + if (!strpos(e_QUERY, "/")) { + $path = ""; + } else { + $path = substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/"; + } +} + +$files = array(); +$dirs = array(); +$path = explode("?", $path); +$path = $path[0]; +$path = explode(".. ", $path); +$path = $path[0]; + +if ($handle = opendir(e_BASE.$path)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + + if (getenv('windir') && is_file(e_BASE.$path."\\".$file)) { + if (is_file(e_BASE.$path."\\".$file)) { + $files[] = $file; + } else { + $dirs[] = $file; + } + } else { + if (is_file(e_BASE.$path."/".$file)) { + $files[] = $file; + } else { + $dirs[] = $file; + } + } + } + } +} +closedir($handle); + +if (count($files) != 0) { + sort($files); +} +if (count($dirs) != 0) { + sort($dirs); +} + +if (count($files) == 1) { + $cstr = FMLAN_12; +} else { + $cstr = FMLAN_13; +} + +if (count($dirs) == 1) { + $dstr = FMLAN_14; +} else { + $dstr = FMLAN_15; +} + +$pathd = $path; + +$text = "
    \n +
    \n + \n + \n\n + + \n + \n + \n\n + + \n + \n + \n\n + +
    \n + ".FMLAN_32." + \n + \n +
    \n + \n +
    \n +
    \n +
    "; +$ns->tablerender(FMLAN_34, $text); + + +$text = "
    +
    + + "; + +$text .= " + + + + + + "; + +if ($path != e_FILE) { + if (substr_count($path, "/") == 1) { + $pathup = e_SELF; + } else { + $pathup = e_SELF."?".substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/"; + } + $text .= " + "; +} + +$c = 0; +while ($dirs[$c]) { + $dirsize = dirsize($path.$dirs[$c]); + $text .= " + + + + + + + + + "; + $c++; +} + +$c = 0; +while ($files[$c]) { + $img = substr(strrchr($files[$c], "."), 1, 3); + if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) { + $img = "def"; + } + $size = parsesize(filesize(e_BASE.$path."/".$files[$c])); + $text .= " + + "; + $gen = new convert; + $filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum"); + $text .= " + + + "; + $c++; +} + + $text .= "
     ".FMLAN_17."".FMLAN_18."".FMLAN_19."".LAN_OPTIONS."
    \"".FMLAN_30."\" + \"".FMLAN_16."\" +
    + \"".$dirs[$c]." + + ".$dirs[$c]." + ".$dirsize." +  "; + if (FILE_UPLOADS && is_writable(e_BASE.$path.$dirs[$c])) { + $text .= " +
    + + + +
    "; + } else { + $text .= " "; + } + $text .= "
    + \"".$files[$c]."\" + + ".$files[$c]." + ".$size."".$filedate.""; + + $text .= ""; + $text .=""; + + $text .="
    "; + + if ($pubfolder || e_QUERY == ""){ + require_once(e_HANDLER."file_class.php"); + $fl = new e_file; + $dl_dirlist = $fl->get_dirs(e_DOWNLOAD); + $movechoice = array(); + $movechoice[] = e_DOWNLOAD; + foreach($dl_dirlist as $dirs){ + $movechoice[] = e_DOWNLOAD.$dirs."/"; + } + sort($movechoice); + $movechoice[] = e_FILE."downloadimages/"; + if(e_QUERY != str_replace("../","",e_FILE."public/")){ + $movechoice[] = e_FILE."public/"; + } + if(e_QUERY != str_replace("../","",e_FILE."downloadthumbs/")){ + $movechoice[] = e_FILE."downloadthumbs/"; + } + if(e_QUERY != str_replace("../","",e_FILE."misc/")){ + $movechoice[] = e_FILE."misc/"; + } + if(e_QUERY != str_replace("../","",e_IMAGE)){ + $movechoice[] = e_IMAGE; + } + if(e_QUERY != str_replace("../","",e_IMAGE."newspost_images/")){ + $movechoice[] = e_IMAGE."newspost_images/"; + } + + + + + $text .= FMLAN_48."  "; + $text .="toJS(FMLAN_49)."') \" /> + "; + } + + $text .= "toJS(FMLAN_46)."') \" /> +
    + +
    +
    "; + +$ns->tablerender(FMLAN_29.": root/".$pathd."  [ ".count($dirs)." ".$dstr.", ".count($files)." ".$cstr." ]", $text); + +function dirsize($dir) { + $_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir; + $dh = @opendir($_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir); + $size = 0; + while ($file = @readdir($dh)) { + if ($file != "." and $file != "..") { + $path = $dir."/".$file; + if (is_file($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path)) { + $size += filesize($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path); + } else { + $size += dirsize($path."/"); + } + } + } + @closedir($dh); + return parsesize($size); +} + +function parsesize($size) { + $kb = 1024; + $mb = 1024 * $kb; + $gb = 1024 * $mb; + $tb = 1024 * $gb; + if ($size < $kb) { + return $size." b"; + } + else if($size < $mb) { + return round($size/$kb, 2)." kb"; + } + else if($size < $gb) { + return round($size/$mb, 2)." mb"; + } + else if($size < $tb) { + return round($size/$gb, 2)." gb"; + } else { + return round($size/$tb, 2)." tb"; + } +} + +require_once("footer.php"); +?> \ No newline at end of file diff --git a/e107_admin/filetypes_.php b/e107_admin/filetypes_.php new file mode 100644 index 000000000..ff76bf5b2 --- /dev/null +++ b/e107_admin/filetypes_.php @@ -0,0 +1 @@ +zip, gz, jpg, png, gif \ No newline at end of file diff --git a/e107_admin/fla.php b/e107_admin/fla.php new file mode 100644 index 000000000..6989e8131 --- /dev/null +++ b/e107_admin/fla.php @@ -0,0 +1,157 @@ + db_Delete("generic", "gen_id='$delete' "); + } + $message = FLALAN_3.": ".$delcount; + + $bancount = 0; + foreach($_POST['flaban'] as $ban) + { + if($sql -> db_Select("generic", "*", "gen_id=$ban")) + { + $at = $sql -> db_Fetch(); + $banlist_ip = $at['gen_ip']; + $sql->db_Insert("banlist", "'$banlist_ip', '".ADMINID."', '".FLALAN_4."' "); + $sql -> db_Delete("generic", "gen_id='$ban' "); + $bancount ++; + } + } + $message .= ", ".FLALAN_5.": ".$bancount; +} + + +if(e_QUERY == "dabl") +{ + $sql -> db_Delete("generic", "gen_type='auto_banned' "); + $message = FLALAN_17; +} + + +if($sql -> db_Select("generic", "*", "gen_type='auto_banned' ORDER BY gen_datestamp DESC ")) +{ + $abArray = $sql -> db_getList(); + $message = FLALAN_15; + foreach($abArray as $ab) + { + $message .= " - ".$ab['gen_ip']; + } + + $message .= ""; + +} + +if (isset($message)) { + $ns->tablerender("", "
    ".$message."
    "); +} + +$gen = new convert; +$fla_total = $sql->db_Count("generic", "(*)", "WHERE gen_type='failed_login'"); +if(!$sql -> db_Select("generic", "*", "gen_type='failed_login' ORDER BY gen_datestamp DESC LIMIT $from,$amount")) +{ + $text = "
    ".FLALAN_2."
    "; +} +else +{ + + $faArray = $sql -> db_getList('ALL', FALSE, FALSE); + + $text = " +
    + + + + + + + + "; + + foreach($faArray as $fa) + { + extract($fa); + + $host = $e107->get_host_name(getenv($gen_ip)); + $text .= " + + + + + + "; + } + + $text .= " + + + + + + + +
    ".FLALAN_6."".FLALAN_7."".FLALAN_8."".FLALAN_9."
    ".$gen->convert_date($gen_datestamp, "forum")."".str_replace(":::", "
    ", htmlentities($gen_chardata, ENT_QUOTES, CHARSET))."
    ".$fa['gen_ip']."
    {$host}
    + ".LAN_DELETE."
    + ".LAN_BAN." +
    + + ".FLALAN_11." - + ".FLALAN_12." +
    + ".FLALAN_13." - + ".FLALAN_14." + +
    +
    +

    + "; + + $parms = $fla_total.",".$amount.",".$from.",".e_SELF.'?'."[FROM].".$amount; + $text .= $tp->parseTemplate("{NEXTPREV={$parms}}"); + + $text .= "
    "; + + + +} + +$ns->tablerender(FLALAN_1, $text); + +require_once("footer.php"); + +?> diff --git a/e107_admin/footer.php b/e107_admin/footer.php new file mode 100644 index 000000000..0926fe1dc --- /dev/null +++ b/e107_admin/footer.php @@ -0,0 +1,99 @@ +db_Select('generic', '*', "gen_type='empty_cache'")) + { + $sql->db_Insert('generic', "0,'empty_cache','".time()."','0','','0',''"); + } else { + $row = $sql->db_Fetch(); + if (($row['gen_datestamp']+604800) < time()) // If cache not cleared in last 7 days, clear it. + { + require_once(e_HANDLER."cache_handler.php"); + $ec = new ecache; + $ec->clear(); + $sql->db_Update('generic', "gen_datestamp='".time()."' WHERE gen_type='empty_cache'"); + } + } + } +} +if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) { + parse_admin($ADMIN_FOOTER); +} +$eTimingStop = microtime(); +global $eTimingStart, $eTraffic; +$rendertime = number_format($eTraffic->TimeDelta( $eTimingStart, $eTimingStop ), 4); +$db_time = number_format($db_time,4); +$rinfo = ''; + +if($pref['displayrendertime']){ $rinfo .= "Render time: {$rendertime} second(s); {$db_time} of that for queries. "; } +if($pref['displaysql']){ $rinfo .= "DB queries: ".$sql -> db_QueryCount().". "; } +if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; } +echo ($rinfo ? "\n
    {$rinfo}
    \n" : ""); + +if($error_handler->debug == true) { + echo " +

    "; + + echo " +
    +

    PHP Errors:


    + ".$error_handler->return_errors()." +
    + "; + $tmp = $eTraffic->Display(); + if (strlen($tmp)) { + $ns->tablerender('Traffic Counters', $tmp); + } + + $tmp = $db_debug->Show_Performance(); + if (strlen($tmp)) { + $ns->tablerender('Time Analysis', $tmp); + } + $tmp = $db_debug->Show_SQL_Details(); + if (strlen($tmp)) { + $ns->tablerender('SQL Analysis', $tmp); + } +} + +if (function_exists('theme_foot')) +{ + echo theme_foot(); +} + +if(isset($footer_js) && is_array($footer_js)) +{ + $footer_js = array_unique($footer_js); + foreach($footer_js as $fname) + { + echo "\n"; + $js_included[] = $fname; + } +} + +echo ""; + +$sql->db_Close(); + +?> diff --git a/e107_admin/frontpage.php b/e107_admin/frontpage.php new file mode 100644 index 000000000..9ed149919 --- /dev/null +++ b/e107_admin/frontpage.php @@ -0,0 +1,266 @@ + 'news.php', 'title' => ADLAN_0); +$front_page['download'] = array('page' => 'download.php', 'title' => ADLAN_24); +$front_page['wmessage'] = array('page' => 'index.php', 'title' => ADLAN_28); + +if ($sql -> db_Select("page", "*", "page_theme=''")) { + $front_page['custom']['title'] = 'Custom Page'; + while ($row = $sql -> db_Fetch()) { + $front_page['custom']['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']); + } +} + + +foreach($pref['e_frontpage_list'] as $val) +{ + if (is_readable(e_PLUGIN.$val."/e_frontpage.php")) + { + require_once(e_PLUGIN.$val."/e_frontpage.php"); + } +} + + + +if (isset($_POST['edit'])) { + $_POST['type'] = (isset($_POST['edit']['all'])) ? 'all_users' : 'user_class'; + $_POST['class'] = key($_POST['edit']); +} + +if (isset($_POST['updatesettings'])) { + if ($_POST['frontpage'] == 'other') { + $_POST['other_page'] = $tp -> toForm($_POST['other_page']); + $frontpage_value = $_POST['other_page'] ? $_POST['other_page'] : 'news.php'; + } else { + if (is_array($front_page[$_POST['frontpage']]['page'])) { + $frontpage_value = $front_page[$_POST['frontpage']]['page'][$_POST['multipage'][$_POST['frontpage']]]['page']; + } else { + $frontpage_value = $front_page[$_POST['frontpage']]['page']; + } + } + + if ($_POST['type'] == 'all_users') { + unset($pref['frontpage']); + $pref['frontpage']['all'] = $frontpage_value; + } else { + if (isset($pref['frontpage']['all'])) { + $pref['frontpage']['252'] = ($_POST['class'] == '252') ? $frontpage_value : $pref['frontpage']['all']; + $pref['frontpage']['253'] = ($_POST['class'] == '253') ? $frontpage_value : $pref['frontpage']['all']; + $pref['frontpage']['254'] = ($_POST['class'] == '254') ? $frontpage_value : $pref['frontpage']['all']; + $class_list = get_userclass_list(); + foreach ($class_list as $fp_class) { + $pref['frontpage'][$fp_class['userclass_id']] = ($_POST['class'] == $fp_class['userclass_id']) ? $frontpage_value : $pref['frontpage']['all']; + } + unset($pref['frontpage']['all']); + } + $pref['frontpage'][$_POST['class']] = $frontpage_value; + } + + save_prefs(); + $ns -> tablerender(LAN_UPDATED, "
    ".FRTLAN_1."
    "); +} + +$fp = new frontpage; + +if (isset($_POST['select']) || isset($_POST['edit'])) { + $fp -> select_page(); +} else { + $fp -> select_class(); +} + +class frontpage { + function select_class() { + global $rs, $pref, $ns, $front_page; + $text = "
    +
    + "; + + $text .= " + + + "; + + $text .= " + + +
    ".FRTLAN_2.": + ".$rs -> form_radio('type', 'all_users', (isset($pref['frontpage']['all']) ? TRUE : FALSE))." ".FRTLAN_31."  + ".$rs -> form_radio('type', 'user_class', (isset($pref['frontpage']['all']) ? FALSE : TRUE))." ".FRTLAN_32.": + ".r_userclass('class', '', 'off', 'guest,member,admin,classes')."
    + ".$rs -> form_button('submit', 'select', LAN_SELECT)." +
    +
    +
    "; + + $ns -> tablerender(FRTLAN_13, $text); + + $text = "
    +
    + + + + + "; + + if (isset($pref['frontpage']['all'])) { + $text .= " + + + + "; + } else { + foreach ($pref['frontpage'] as $current_key => $current_value) { + if ($current_key == 252) { + $title = FRTLAN_27; + } else if ($current_key == 253) { + $title = FRTLAN_28; + } else if ($current_key == 254) { + $title = FRTLAN_29; + } else { + $class_list = get_userclass_list(); + foreach ($class_list as $fp_class) { + if ($current_key == $fp_class['userclass_id']) { + $title = $fp_class['userclass_name']; + } + } + } + $text .= " + + + + "; + } + } + $text .= "
    ".FRTLAN_32."".FRTLAN_34."".LAN_EDIT."
    All Users".$pref['frontpage']['all']." + +
    ".$title."".$current_value." + +
    +
    +
    "; + + $ns -> tablerender(FRTLAN_33, $text); + + } + + function select_page() { + global $rs, $pref, $ns, $front_page; + + if ($_POST['type'] == 'all_users') { + $title = FRTLAN_26; + } else { + if ($_POST['class'] == 252) { + $title = FRTLAN_27; + } else if ($_POST['class'] == 253) { + $title = FRTLAN_28; + } else if ($_POST['class'] == 254) { + $title = FRTLAN_29; + } else { + $class_list = get_userclass_list(); + foreach ($class_list as $fp_class) { + if ($_POST['class'] == $fp_class['userclass_id']) { + $title = $fp_class['userclass_name']; + } + } + } + } + + $text = "
    +
    + + + + "; + + foreach ($front_page as $front_key => $front_value) { + $type_selected = FALSE; + $current_setting = (isset($pref['frontpage']['all'])) ? $pref['frontpage']['all'] : $pref['frontpage'][$_POST['class']]; + if (is_array($front_value['page'])) { + foreach ($front_value['page'] as $multipage) { + if ($current_setting == $multipage['page']) { + $type_selected = TRUE; + $not_other = TRUE; + } + } + } else { + if ($current_setting == $front_value['page']) { + $type_selected = TRUE; + $not_other = TRUE; + } + } + + $text .= ""; + + if (is_array($front_value['page'])) { + $text .= ""; + $text .= ""; + } else { + $text .= ""; + } + $text .= ""; + } + + $text .= " + + + + "; + + $text .= " + + +
    ".FRTLAN_2." ".$title.":
    "; + $text .= $rs -> form_radio('frontpage', $front_key, $type_selected); + $text .= "".$front_value['title'].""; + $text .= $rs -> form_select_open('multipage['.$front_key.']'); + $type = isset($pref['frontpage']['all']) ? 'all' : $_POST['class']; + foreach ($front_value['page'] as $multipage_key => $multipage_value) { + $sub_selected = ($pref['frontpage'][$type] == $multipage_value['page']) ? TRUE : FALSE; + $text .= $rs -> form_option($multipage_value['title'], $sub_selected, $multipage_key); + } + $text .= $rs -> form_select_close(); + $text .= "".$front_value['title']."
    ".$rs -> form_radio('frontpage', 'other', (!$not_other ? TRUE : FALSE))."".FRTLAN_15." + ".$rs -> form_text('other_page', 50, (!$not_other ? $current_setting : ''))." +
    "; + $text .= $rs -> form_hidden('type', $_POST['type']); + $text .= $rs -> form_hidden('class', $_POST['class']); + $text .= $rs -> form_button('submit', 'updatesettings', FRTLAN_12); + $text .= "
    +
    +
    "; + + $ns -> tablerender(FRTLAN_13, $text); + } +} + +require_once('footer.php'); + +?> \ No newline at end of file diff --git a/e107_admin/header.php b/e107_admin/header.php new file mode 100644 index 000000000..8e7928721 --- /dev/null +++ b/e107_admin/header.php @@ -0,0 +1,336 @@ +"; +if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_header.php')) { + @include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php"); +} else { + @include_once(e_LANGUAGEDIR."English/admin/lan_header.php"); +} +if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php')) { + @include_once(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php'); +} else { + @include_once(e_LANGUAGEDIR.'English/admin/lan_footer.php'); +} +if (!defined('ADMIN_WIDTH')) { + define('ADMIN_WIDTH', 'width: 95%'); +} + +if (!defined('ADMIN_TRUE_ICON')) +{ + define("ADMIN_TRUE_ICON", ""); + define("ADMIN_TRUE_ICON_PATH", e_IMAGE."fileinspector/integrity_pass.png"); +} + +if (!defined('ADMIN_FALSE_ICON')) +{ + define("ADMIN_FALSE_ICON", ""); + define("ADMIN_FALSE_ICON_PATH", e_IMAGE."fileinspector/integrity_fail.png"); +} + + +if (!defined('ADMIN_EDIT_ICON')) +{ + define("ADMIN_EDIT_ICON", ""); + define("ADMIN_EDIT_ICON_PATH", e_IMAGE."admin_images/edit_16.png"); +} + + + +if (!defined('ADMIN_DELETE_ICON')) +{ + define("ADMIN_DELETE_ICON", ""); + define("ADMIN_DELETE_ICON_PATH", e_IMAGE."admin_images/delete_16.png"); +} + +echo " + + + ".SITENAME." : ".LAN_head_4."\n"; +echo " + \n"; +if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) { + $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss']; + echo "\n"; +} else if (isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss'])) { + $css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? THEME_ABS.'admin_'.$pref['themecss'] : THEME_ABS.$pref['themecss']; + echo "\n"; +} else { + $css_file = file_exists(THEME.'admin_style.css') ? THEME_ABS.'admin_style.css' : THEME_ABS.'style.css'; + echo "\n"; +} + +if (!isset($no_core_css) || !$no_core_css) { + echo "\n"; +} + +// ---------- Favicon --------- +if (file_exists(THEME."favicon.ico")) { + echo "\n\n"; +}elseif (file_exists(e_BASE."favicon.ico")) { + echo "\n\n"; +} + + +if (function_exists('theme_head')) { + echo theme_head(); +} +if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) { + echo "\n"; +} +if (file_exists(THEME."theme.js")) { + echo "\n"; +} +if (filesize(e_FILE.'user.js')) { + echo "\n"; +} +if (function_exists("headerjs")) { + echo headerjs(); +} +if (isset($htmlarea_js) && $htmlarea_js) { + echo $htmlarea_js; +} +if (strpos(e_SELF, 'fileinspector.php') === FALSE) { +echo "\n"; +} +if (isset($eplug_js) && $eplug_js) { + echo "\n"; +} +if (isset($eplug_css) && $eplug_css) { + echo "\n\n"; +} +if(check_class($pref['post_html']) && $pref['wysiwyg'] && $e_wysiwyg == TRUE){ + require_once(e_HANDLER."tiny_mce/wysiwyg.php"); + echo wysiwyg($e_wysiwyg); + define("e_WYSIWYG",TRUE); +}else{ + define("e_WYSIWYG",FALSE); +} +// load plugin header-data. +foreach($pref['e_meta_list'] as $val) +{ + if(is_readable(e_PLUGIN.$val."/e_meta.php")) + { + require_once(e_PLUGIN.$val."/e_meta.php"); + } +} + + + +echo " +\n"; + +$ns = new e107table; +$e107_var = array(); + +if (!function_exists('show_admin_menu')) { + function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) { + global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END; + $id_title = "yop_".str_replace(" ", "", $title); + if (!isset($BUTTONS_START)) { + $BUTTONS_START = "
    \n"; + } + if (!isset($BUTTON)) { + $BUTTON = "\n"; + } + if (!isset($BUTTON_OVER)) { + $BUTTON_OVER = "\n"; + } + if (!isset($BUTTONS_END)) { + $BUTTONS_END = "
    \n"; + } + if (!isset($SUB_BUTTON)) { + $SUB_BUTTON = "{LINK_TEXT}
    "; + } + if (!isset($SUB_BUTTON_OVER)) { + $SUB_BUTTON_OVER = " « {LINK_TEXT} »
    "; + } + if (!isset($SUB_BUTTONS_START)) { + $SUB_BUTTONS_START = "
    + +
    {SUB_HEAD}
    "; + } + + if ($sortlist == TRUE) { + $temp = $e107_vars; + unset($e107_vars); + foreach (array_keys($temp) as $key) { + $func_list[] = $temp[$key]['text']; + } + + usort($func_list, 'strcoll'); + + foreach ($func_list as $func_text) { + foreach (array_keys($temp) as $key) { + if ($temp[$key]['text'] == $func_text) { + $e107_vars[] = $temp[$key]; + } + } + } + } + + $search[0] = "/\{LINK_TEXT\}(.*?)/si"; + $search[1] = "/\{LINK_URL\}(.*?)/si"; + $search[2] = "/\{ONCLICK\}(.*?)/si"; + $search[3] = "/\{SUB_HEAD\}(.*?)/si"; + $search[4] = "/\{SUB_HEAD_ID\}(.*?)/si"; + + if ($sub_link) { + $replace[0] = ''; + $replace[1] = ''; + $replace[2] = ''; + $replace[3] = $title; + $replace[4] = $id_title; + $text = preg_replace($search, $replace, $SUB_BUTTONS_START); + } else { + $text = $BUTTONS_START; + } + + foreach (array_keys($e107_vars) as $act) { + if (!isset($e107_vars[$act]['perm']) || !$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm'])) { + if ($active_page == $act || (str_replace("?", "", e_PAGE.e_QUERY) == str_replace("?", "", $act))) { + $BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON_OVER : $BUTTON_OVER; + } else { + $BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON : $BUTTON; + } + $replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']); + $replace[1] = $e107_vars[$act]['link']; + if ($e107_vars[$act]['include']!='') { + $replace[2] = $e107_vars[$act]['include']; + } else { + $replace[2] = $js ? "onclick=\"showhideit('".$act."');\"" : "onclick=\"document.location='".$e107_vars[$act]['link']."'; disabled=true;\""; + } + $replace[3] = $title; + $replace[4] = $id_title; + $text .= preg_replace($search, $replace, $BUTTON_TEMPLATE); + } + } + $text .= $sub_link ? $SUB_BUTTONS_END : $BUTTONS_END; + + if ($title == "" || $sub_link) { + return $text; + } else { + $ns -> tablerender($title, $text, array('id' => $id_title, 'style' => 'button_menu')); + } + } +} + +if (file_exists(THEME.'admin_template.php')) { + require_once(THEME.'admin_template.php'); +} else { + require_once(e_BASE.$THEMES_DIRECTORY.'templates/admin_template.php'); +} + +if (!function_exists("parse_admin")) { + function parse_admin($ADMINLAYOUT) { + global $tp; + $adtmp = explode("\n", $ADMINLAYOUT); + for ($a = 0; $a < count($adtmp); $a++) { + if (preg_match("/{.+?}/", $adtmp[$a])) { + echo $tp->parseTemplate($adtmp[$a]); + } else { + echo $adtmp[$a]; + } + } + } +} + +function admin_update($update, $type = 'update', $success = false, $failed = false) { + global $ns; + if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) { + $caption = LAN_UPDATE; + $text = "".($success ? $success : LAN_UPDATED).""; + } else if ($type == 'delete' && $update) { + $caption = LAN_DELETE; + $text = "".($success ? $success : LAN_DELETED).""; + } else if (!mysql_errno()) { + if ($type == 'update') { + $caption = LAN_UPDATED_FAILED; + $text = "".LAN_NO_CHANGE."
    ".LAN_TRY_AGAIN."
    "; + } else if ($type == 'delete') { + $caption = LAN_DELETE; + $text = "".LAN_DELETED_FAILED.".
    ".LAN_TRY_AGAIN."
    "; + } + } else { + $caption = LAN_UPDATED_FAILED; + $text = "".($failed ? $failed : LAN_UPDATED_FAILED." - ".LAN_TRY_AGAIN)."
    ".LAN_ERROR." ".mysql_errno().": ".mysql_error(); + } + $ns -> tablerender($caption, "
    ".$text."
    "); + return $update; +} + +function admin_purge_related($table, $id) +{ + global $ns, $tp; + $msg = ""; + $tp->parseTemplate(""); + + // Delete any related comments + require_once(e_HANDLER."comment_class.php"); + $_com = new comment; + $num = $_com->delete_comments($table, $id); + if($num) + { + $msg .= $num." ".ADLAN_114." ".LAN_DELETED."
    "; + } + + // Delete any related ratings + require_once(e_HANDLER."rate_class.php"); + $_rate = new rater; + $num = $_rate->delete_ratings($table, $id); + if($num) + { + $msg .= LAN_RATING." ".LAN_DELETED."
    "; + } + + if($msg) + { + $ns->tablerender(LAN_DELETE, $msg); + } +} + +if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) { + parse_admin($ADMIN_HEADER); +} + +?> \ No newline at end of file diff --git a/e107_admin/image.php b/e107_admin/image.php new file mode 100644 index 000000000..38f2f6cb5 --- /dev/null +++ b/e107_admin/image.php @@ -0,0 +1,385 @@ +db_Update("user", "user_image='' WHERE user_image='-upload-$image'"); + $sql->db_Update("user", "user_sess='' WHERE user_sess='$image'"); + $message = $image." ".IMALAN_28; +} + +if (isset($_POST['deleteall'])) { + $handle = opendir(e_FILE."public/avatars/"); + while ($file = readdir($handle)) { + if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db') { + $dirlist[] = $file; + } + } + closedir($handle); + $count = 0; + while (list($key, $image_name) = each($dirlist)) { + if (!$sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) { + unlink(e_FILE."public/avatars/".$image_name); + $count ++; + } + } + $message = $count." ".IMALAN_26; +} + +if (isset($_POST['avdelete'])) { + require_once(e_HANDLER."avatar_handler.php"); + foreach($_POST['avdelete'] as $key => $val) + { + $key = $tp->toDB($key); // We only need the key + if ($sql->db_Select("user", "*", "user_id='$key'")) { + $row = $sql->db_Fetch(); + extract($row); + $avname=avatar($user_image); + if (strpos($avname,"http://")===FALSE) + { // Internal file, so unlink it + @unlink($avname); + } + $sql->db_Update("user","user_image='' WHERE user_id='$key'"); + $message = IMALAN_51.$user_name." ".IMALAN_28; + } + } + $_POST['check_avatar_sizes'] = TRUE; // Force size recheck after doing one or more deletes +} + +if (isset($_POST['update_options'])) { + $pref['image_post'] = $_POST['image_post']; + $pref['resize_method'] = $_POST['resize_method']; + $pref['im_path'] = $tp->toDB($_POST['im_path']); + $pref['image_post_class'] = $_POST['image_post_class']; + $pref['image_post_disabled_method'] = $_POST['image_post_disabled_method']; + $pref['enable_png_image_fix'] = $_POST['enable_png_image_fix']; + + save_prefs(); + $message = IMALAN_9; +} + +if (isset($message)) { + $ns->tablerender("", "
    ".$message."
    "); +} + + +if (isset($_POST['show_avatars'])) { + + $handle = opendir(e_FILE."public/avatars/"); + while ($file = readdir($handle)) { + if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db' && !is_dir($file)) { + $dirlist[] = $file; + } + } + closedir($handle); + + $text = "
    \n"; + + if (!is_array($dirlist)) { + $text .= IMALAN_29; + } else { + + + + while (list($key, $image_name) = each($dirlist)) { + $users = IMALAN_21." | "; + if ($sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) { + while ($row = $sql->db_Fetch()) { + extract($row); + $users .= "$user_name (".($user_sess == $image_name ? IMALAN_24 : IMALAN_23).") | "; + } + } else { + $users = IMALAN_22; + } + + $text .= "
    +
    + + + + + + + + + + +
    $image_name

    + + +
    $users
    +
    +
    "; + } + + $text .= "
    +
    + + + + +
    + +
    +
    +
    "; + + } + + $text .= "
    "; + + $ns->tablerender(IMALAN_18, $text); +} + +if (isset($_POST['check_avatar_sizes'])) { + // + // Set up to track what we've done + // + $iUserCount = 0; + $iAVinternal = 0; + $iAVexternal = 0; + $iAVnotfound = 0; + $iAVtoobig = 0; + require_once(e_HANDLER."avatar_handler.php"); + $text = "
    \n"; + $text .= "
    +
    + + + + + + + + + "; + + // + // Loop through avatar field for every user + // + $iUserCount = $sql->db_Count("user"); + if ($sql->db_Select("user", "*", "user_image!=''")) { + while ($row = $sql->db_Fetch()) { + extract($row); + + // + // Check size + // + $avname=avatar($user_image); + if (strpos($avname,"http://")!==FALSE) + { + $iAVexternal++; + $bAVext=TRUE; + } else { + $iAVinternal++; + $bAVext=FALSE; + } + $image_stats = getimagesize($avname); + $sBadImage=""; + if (!$image_stats) + { + $iAVnotfound++; + // allow delete + $sBadImage=IMALAN_42; + } else { + $imageWidth = $image_stats[0]; + $imageHeight = $image_stats[1]; + if ( ($imageHeight > $pref['im_height']) || ($imageWidth>$pref['im_width']) ) + { // Too tall or too wide + $iAVtoobig++; + if ($imageWidth > $pref['im_width']) { + $sBadImage = IMALAN_40." ($imageWidth)"; + } + if ($imageHeight > $pref['im_height']) { + if (strlen($sBadImage)) + { + $sBadImage .= ", "; + } + $sBadImage .= IMALAN_41." ($imageHeight)"; + } + } + } + + // + // If not found or too big, allow delete + // + if (strlen($sBadImage)) + { + $sBadImage .=" [".$avname."]"; // Show all files that have a problem + $text .= " + + + + "; + } + } + } + // + // Done, so show stats + // + $text .= " + + + + + + + + + + + + + + + + + + + + +
    ".$pref['im_width']."".IMALAN_38."
    ".$pref['im_height']."".IMALAN_39."
    + + ".IMALAN_51."".$user_name." ".$sBadImage."
    ".$iAVnotfound."".IMALAN_45."
    ".$iAVtoobig."".IMALAN_46."
    ".$iAVinternal."".IMALAN_47."
    ".$iAVexternal."".IMALAN_48."
    ".($iAVexternal+$iAVinternal)." (".(int)(100.0*(($iAVexternal+$iAVinternal)/$iUserCount)).'%, '.$iUserCount." ".IMALAN_50.")".IMALAN_49."
    +
    +
    "; + + $text .= "
    "; + + $ns->tablerender(IMALAN_37, $text); +} + + +$text = "
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + ".IMALAN_1."
    + ".IMALAN_2." +
    ". ($pref['image_post'] ? "" : "")." +
    + ".IMALAN_10."
    + ".IMALAN_11." +
    + + + + +
    + ".IMALAN_12."
    + ".IMALAN_13." +
    +
    ".IMALAN_3."
    ".IMALAN_4."
    + +
    ".IMALAN_5."
    ".IMALAN_6."
    + +
    ".IMALAN_34."
    + ".IMALAN_35." +
    ".($pref['enable_png_image_fix'] ? "" : "")." +
    ".IMALAN_16." + +
    ".IMALAN_36." + +
    + +
    "; +$ns->tablerender(IMALAN_7, $text); + + +require_once("footer.php"); + + + +$pref['resize_method'] = $_POST['resize_method']; +$pref['im_path'] = $_POST['im_path']; + + +?> diff --git a/e107_admin/includes/beginner.php b/e107_admin/includes/beginner.php new file mode 100644 index 000000000..90e28687c --- /dev/null +++ b/e107_admin/includes/beginner.php @@ -0,0 +1,89 @@ +

    + "; + + // $newarray[28] = array(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", 2, E_16_PLUGMANAGER, E_32_PLUGMANAGER); + + $selection = array(22,12,17,25,5,19,7,23,28,26); + // $selection = array(21,11,17,24,5,19,7,27,28,25); + foreach($selection as $id) + { + $buts .= render_links($newarray[$id][0],$newarray[$id][1],$newarray[$id][2],$newarray[$id][3],$newarray[$id][6],'beginner'); + } + + $text .= $buts; + $text .= render_clean(); + $text .= "\n

    "; + + $text .= "
    ".ADLAN_144." ".ADLAN_145."  
    "; + + if($buts != '') + { + $ns->tablerender(ADLAN_47." ".ADMINNAME, $text); + } + + + + + + + $text = "
    + "; + + $text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis"); + + if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) + { + while ($row = $sql->db_Fetch()) + { + extract($row); + include(e_PLUGIN.$plugin_path."/plugin.php"); + if ($eplug_conffile) + { + $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off"); + $plugin_icon = $eplug_icon ? "" : E_32_CAT_PLUG; + $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon); + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon); + } + } + + ksort($plugin_array, SORT_STRING); + foreach ($plugin_array as $plug_key => $plug_value) + { + $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis'); + } + + $text .= render_clean(); + $text .= "
    "; + + $ns->tablerender(ADLAN_CL_7, $text); + +?> diff --git a/e107_admin/includes/cascade.php b/e107_admin/includes/cascade.php new file mode 100644 index 000000000..98a39a0a2 --- /dev/null +++ b/e107_admin/includes/cascade.php @@ -0,0 +1,59 @@ + + "; + +while (list($key, $funcinfo) = each($newarray)) { + $text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'adminb'); +} + +$text .= " + + "; + +$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'adminb'); + +if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) { + while ($row = $sql->db_Fetch()) { + extract($row); + include(e_PLUGIN.$plugin_path."/plugin.php"); + if ($eplug_conffile) { + $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off"); + $plugin_icon = $eplug_icon_small ? "" : E_16_PLUGIN; + $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon); + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small); + } +} + +ksort($plugin_array, SORT_STRING); +foreach ($plugin_array as $plug_key => $plug_value) { + $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'adminb'); +} + +$text .= "
    + ".ADLAN_CL_7." +
    "; + +$ns->tablerender(ADLAN_47." ".ADMINNAME, $text); + +?> diff --git a/e107_admin/includes/categories.php b/e107_admin/includes/categories.php new file mode 100644 index 000000000..57ffaa044 --- /dev/null +++ b/e107_admin/includes/categories.php @@ -0,0 +1,83 @@ + + "; + +foreach ($admin_cat['id'] as $cat_key => $cat_id) { + $text_check = FALSE; + $text_cat = " + "; + if ($text_check) { + $text .= $text_cat; + } +} + +$text .= "
    ".$admin_cat['title'][$cat_key]."
    ".$admin_cat['lrg_img'][$cat_key]." + "; + if ($cat_key != 5) { + foreach ($newarray as $key => $funcinfo) { + if ($funcinfo[4] == $cat_key) { + $text_rend = render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default'); + if ($text_rend) { + $text_check = TRUE; + } + $text_cat .= $text_rend; + } + } + } else { + $text_rend = render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default'); + + if ($text_rend) { + $text_check = TRUE; + } + $text_cat .= $text_rend; + if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) { + while ($row = $sql->db_Fetch()) { + extract($row); + include(e_PLUGIN.$plugin_path."/plugin.php"); + if ($eplug_conffile) { + $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off"); + $plugin_icon = $eplug_icon_small ? "".$eplug_caption."" : E_16_PLUGIN; + $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon); + //$text_rend = render_links(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, $plugin_icon, 'default'); + if ($plugin_array[0]) { + $text_check = TRUE; + } + //$text_cat .= $text_rend; + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small); + } + } + ksort($plugin_array, SORT_STRING); + foreach ($plugin_array as $plug_key => $plug_value) { + $text_cat .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default'); + } + } + $text_cat .= render_clean(); + $text_cat .= "
    +
    "; + +$ns->tablerender(ADLAN_47." ".ADMINNAME, $text); + +echo admin_info(); + +?> diff --git a/e107_admin/includes/classis.php b/e107_admin/includes/classis.php new file mode 100644 index 000000000..2f5c65df6 --- /dev/null +++ b/e107_admin/includes/classis.php @@ -0,0 +1,66 @@ + + "; + $text .= $buts; + $text .= render_clean(); + $text .= "
    "; + $ns->tablerender(ADLAN_47." ".ADMINNAME, $text); +} +$text = "
    + "; + +$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis"); + +if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) { + while ($row = $sql->db_Fetch()) { + extract($row); + include(e_PLUGIN.$plugin_path."/plugin.php"); + if ($eplug_conffile) { + $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off"); + $plugin_icon = $eplug_icon ? "" : E_32_CAT_PLUG; + $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon); + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon); + } +} + +ksort($plugin_array, SORT_STRING); +foreach ($plugin_array as $plug_key => $plug_value) { + $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis'); +} + +$text .= render_clean(); + +$text .= "
    "; + +$ns->tablerender(ADLAN_CL_7, $text); + +?> diff --git a/e107_admin/includes/combo.php b/e107_admin/includes/combo.php new file mode 100644 index 000000000..f13a7ef44 --- /dev/null +++ b/e107_admin/includes/combo.php @@ -0,0 +1,70 @@ + + "; +$buts = ""; +while (list($key, $funcinfo) = each($newarray)) { + $buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default'); +} +$text .= $buts; +while ($td <= 5) { + $text .= ""; + $td++; +} +$td = 1; +$text .= "
    "; +if($buts != ""){ + $ns->tablerender(ADLAN_47." ".ADMINNAME, $text); +} + +$text = "
    + "; + +$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis"); + +if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) { + while ($row = $sql->db_Fetch()) { + extract($row); + include(e_PLUGIN.$plugin_path."/plugin.php"); + if ($eplug_conffile) { + $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off"); + $plugin_icon = $eplug_icon ? "" : E_32_CAT_PLUG; + $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon); + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon); + } +} + +ksort($plugin_array, SORT_STRING); +foreach ($plugin_array as $plug_key => $plug_value) { + $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis'); +} + +$text .= render_clean(); + +$text .= "
    "; + +$ns->tablerender(ADLAN_CL_7, $text); + +echo admin_info(); + +?> diff --git a/e107_admin/includes/compact.php b/e107_admin/includes/compact.php new file mode 100644 index 000000000..9d0e5f502 --- /dev/null +++ b/e107_admin/includes/compact.php @@ -0,0 +1,73 @@ + + "; + +while (list($key, $funcinfo) = each($newarray)) { + $buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default'); +} +$text .= $buts; + +$text_cat = ''; +while ($td <= 5) { + $text_cat .= ""; + $td++; +} +$td = 1; + +$text .= "
    "; + +if($buts !=""){ + $ns->tablerender(ADLAN_47." ".ADMINNAME, $text); +} + +$text = "
    + "; + +$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default'); + +if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) { + while ($row = $sql->db_Fetch()) { + extract($row); + include(e_PLUGIN.$plugin_path."/plugin.php"); + if ($eplug_conffile) { + $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off"); + $plugin_icon = $eplug_icon_small ? "" : E_16_PLUGIN; + $plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon); + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small); + } +} + +ksort($plugin_array, SORT_STRING); +foreach ($plugin_array as $plug_key => $plug_value) { + $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default'); +} + +$text .= " +
    "; + +$ns->tablerender(ADLAN_CL_7, $text); + +echo admin_info(); + +?> diff --git a/e107_admin/index.php b/e107_admin/index.php new file mode 100644 index 000000000..a4ee67f4a --- /dev/null +++ b/e107_admin/index.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php new file mode 100644 index 000000000..cd10ee005 --- /dev/null +++ b/e107_admin/lancheck.php @@ -0,0 +1,680 @@ +
    "; + $input .= chr(60)."?php\n"; + if ($old_kom == "") + { + // create CVS compatible description. + $diz = chr(47)."*\n"; + $diz .= "+---------------------------------------------------------------+\n"; + $diz .= "| e107 website system ".$lan." Language File\n"; + $diz .= "| Released under the terms and conditions of the\n"; + $diz .= "| GNU General Public License (http://gnu.org).\n"; + $diz .= "|\n"; + $diz .= "| ".chr(36)."Source: $writeit ".chr(36)."\n"; + $diz .= "| ".chr(36)."Revision: 1.0 ".chr(36)."\n"; + $diz .= "| ".chr(36)."Date: ".date("Y/m/d H:i:s")." ".chr(36)."\n"; + $diz .= "| ".chr(36)."Author: ".USERNAME." ".chr(36)."\n"; + $diz .= "+---------------------------------------------------------------+\n"; + $diz .= "*".chr(47)."\n\n"; + } + else + { + $diz = $old_kom; + } + + $input .= $diz; + $message .= str_replace("\n","
    ",$diz); + + for ($i=0; $i'.$notdef_end; + $input .= $notdef_start."setlocale(".$defvar.",".$deflang.");".$notdef_end; + } + else + { + $message .= $notdef_start.$func.'('.$quote.htmlentities($defvar).$quote.',"'.$deflang.'");
    '.$notdef_end; + $input .= $notdef_start.$func."(".$quote.$defvar.$quote.", ".chr(34).$deflang.chr(34).");".$notdef_end; + } + } + + $message .="
    "; + $message .=""; + $input .= "\n\n?>"; + + // Write to file. + $fp = @fopen($writeit,"w"); + if(!@fwrite($fp, $input)) + { + $caption = LAN_ERROR; + $message = LAN_CHECK_17; + } + else + { + $caption = LAN_SAVED." $lan/".$writeit.""; + } + fclose($writeit); + + $message .= "
    +

    "; + $message .= "

    +
    "; + + + $ns -> tablerender($caption, $message); + require_once(e_ADMIN."footer.php"); + exit; +} + +// ============================================================================ + +// Edit the Language File. + +if($f != ""){ + + if (!$mode) + { + $dir1 = e_BASE.$LANGUAGES_DIRECTORY."English/"; + $f1=$f; + $dir2 = e_BASE.$LANGUAGES_DIRECTORY.$lan."/"; + $f2=$f; + } + else + { + $fullpath_orig = $f; + $fullpath_trans = str_replace("English",$lan,$f); + + $f1 = basename($fullpath_orig); + $f2 = basename($fullpath_trans); + $dir1 = dirname($fullpath_orig)."/"; + $dir2 = dirname($fullpath_trans)."/"; + } + + edit_lanfiles($dir1,$dir2,$f1,$f2); + +} + +// =========================================================================== + +$core_plugins = array( + "alt_auth","banner_menu","blogcalendar_menu","calendar_menu","chatbox_menu", + "clock_menu","comment_menu","compliance_menu","content","counter_menu", + "featurebox","forum","gsitemap","integrity_check","lastseen","links_page", + "linkwords","list_new","log","login_menu","newforumposts_main","newsfeed", + "newsletter","online_extended_menu","online_menu","other_news_menu","pdf", + "pm","poll","powered_by_menu","rss_menu","search_menu","sitebutton_menu", + "trackback","tree_menu","userlanguage_menu","usertheme_menu" + ); + +$core_themes = array("crahan","e107v4a","human_condition","interfectus","jayya", + "khatru","kubrick","lamb","leaf","reline","sebes","vekna_blue"); + + +if(isset($_POST['language_sel']) && isset($_POST['language'])){ + + $ns -> tablerender(LAN_CHECK_3.": ".$_POST['language'],check_core_lanfiles($_POST['language'])); + $ns -> tablerender(LAN_CHECK_3.": ".$_POST['language']."/admin",check_core_lanfiles($_POST['language'],"admin/")); + + $plug_text = " + + + + + "; + + foreach($core_plugins as $plugs) + { + if(is_readable(e_PLUGIN.$plugs)) + { + $plug_text .= check_lanfiles('P',$plugs,"English",$_POST['language']); + } + } + $plug_text .= "
    ".LAN_PLUGIN."".LAN_CHECK_16."".$_POST['language']."".LAN_OPTIONS."
    "; + $ns -> tablerender(ADLAN_CL_7,$plug_text); + + $theme_text = " + + + + + "; + foreach($core_themes as $them) + { + if(is_readable(e_THEME.$them)) + { + $theme_text .= check_lanfiles('T',$them,"English",$_POST['language']); + } + } + $theme_text .= "
    Theme".LAN_CHECK_16."".$_POST['language']."".LAN_OPTIONS."
    "; + + $ns -> tablerender("Themes",$theme_text); + require_once(e_ADMIN."footer.php"); + exit; +} + + +function check_core_lanfiles($checklan,$subdir=''){ + global $lanfiles,$_POST; + + $English = get_comp_lan_phrases(e_LANGUAGEDIR."English/".$subdir,$checklan); + $check = get_comp_lan_phrases(e_LANGUAGEDIR.$checklan."/".$subdir,$checklan); + + $text .= " + + + + "; + + $keys = array_keys($English); + + sort($keys); + + foreach($keys as $k) + { + if($k != "bom") + { + $lnk = $k; + $k_check = str_replace("English",$checklan,$k); + if(array_key_exists($k,$check)) + { + $text .= ""; + $subkeys = array_keys($English[$k]); + + $er=""; + $utf_error = ""; + + $bomkey = str_replace(".php","",$k_check); + $bom_error = ($check['bom'][$bomkey]) ? "".LAN_CHECK_15."
    " : ""; // illegal chars + + foreach($subkeys as $sk) + { + if($utf_error == "" && !is_utf8($check[$k][$sk])) + { + $utf_error = "".LAN_CHECK_19."
    "; + } + + if($sk == "LC_ALL"){ + $check[$k][$sk] = str_replace(chr(34).chr(34),"",$check[$k][$sk]); + } + + if((!array_key_exists($sk,$check[$k]) && $English[$k][$sk] != "") || (trim($check[$k][$sk]) == "" && $English[$k][$sk] != "")) + { + + $er .= ($er) ? "
    " : ""; + $er .= $sk." ".LAN_CHECK_5; + } + } + + $style = ($er) ? "forumheader2" : "forumheader3"; + $text .= ""; + } + else + { + $text .= " + + "; // file missing. + } + // Leave in EDIT button for all entries - to allow re-translation of bad entries. + $subpath = ($subdir!='') ? $subdir.$k : $k; + $text .=""; + } + } + $text .= "
    ".LAN_CHECK_16."".$_POST['language']." File".LAN_OPTIONS."
    {$lnk}
    "; + $text .= $bom_error . $utf_error; + $text .= (!$er && !$bom_error && !$utf_error) ? LAN_OK : $er."
    "; + $text .= "
    {$lnk}".LAN_CHECK_4." + "; + $text .="
    "; + + return $text; +} + + +function get_lan_file_phrases($dir1,$dir2,$file1,$file2){ + + $ret = array(); + $fname = $dir1.$file1; + $type='orig'; + + if(is_file($fname)) + { + $data = file($fname); + $ret=$ret + fill_phrases_array($data,$type); + if(substr($data[0],0,5) != "get_files($comp_dir, ".php","standard",$depth)){ + sort($lang_array); + } + + $regexp = (strpos($comp_dir,e_LANGUAGEDIR) !== FALSE) ? "#.php#" : "#".$lang."#"; + + foreach($lang_array as $f) + { + if(preg_match($regexp,$f['path'].$f['fname']) && is_file($f['path'].$f['fname'])) + { + $data = file($f['path'].$f['fname']); + $relpath = str_replace($comp_dir,"",$f['path']); + if(substr($data[0],0,5) != ""; + $k_check = str_replace("English",$target_lan,$k); + if(array_key_exists($k_check,$check)) + { + $text .= " + ".$comp_name." + ".str_replace("English/","",$lnk).""; + + $subkeys = array_keys($baselang[$k]); + $er=""; + $utf_error = ""; + + $bomkey = str_replace(".php","",$k_check); + $bom_error = ($check['bom'][$bomkey]) ? "".LAN_CHECK_15."
    " : ""; // illegal chars + + foreach($subkeys as $sk) + { + if($utf_error == "" && !is_utf8($check[$k_check][$sk])) + { + $utf_error = "".LAN_CHECK_19."
    "; + } + + if(!array_key_exists($sk,$check[$k_check]) || (trim($check[$k_check][$sk]) == "" && $baselang[$k][$sk] != "")) + { + $er .= ($er) ? "
    " : ""; + $er .= $sk." ".LAN_CHECK_5; + } + } + + $style = ($er) ? "forumheader2" : "forumheader3"; + $text .= "
    "; + $text .= $bom_error . $utf_error; + $text .= (!$er && !$bom_error && !$utf_error) ? LAN_OK : $er."
    "; + $text .= "
    "; + } + else + { + $text .= " + ".$comp_name." + ".str_replace("English/","",$lnk)." + ".LAN_CHECK_4.""; + } + + $text .=" + "; + $text .=""; + } + + + + // if (!$known) {$text = LAN_CHECK_18." : --> ".$fname." :: ".$dname;} + return $text; +} + +function edit_lanfiles($dir1,$dir2,$f1,$f2){ + global $ns,$sql,$lan; + +/* echo "
    dir1 = $dir1"; + echo "
    file1 = $f1"; + + echo "
    dir2 = $dir2"; + echo "
    file2 = $f2";*/ + + if($dir2.$f2 == e_LANGUAGEDIR.$lan."/English.php") // it's a language config file. + { + $f2 = $lan.".php"; + $root_file = e_LANGUAGEDIR.$lan."/".$lan.".php"; + } + else + { + $root_file = $dir2.$f2; + } + + if($dir2.$f2 == e_LANGUAGEDIR.$lan."/English_custom.php") // it's a language config file. + { + $f2 = $lan."_custom.php"; + $root_file = e_LANGUAGEDIR.$lan."/".$lan."_custom.php"; + } + + + $writable = (is_writable($dir2)) ? TRUE : FALSE; + $trans = get_lan_file_phrases($dir1,$dir2,$f1,$f2); + $keys = array_keys($trans); + sort($keys); + + $text = "
    +
    + "; + + $subkeys = array_keys($trans['orig']); + foreach($subkeys as $sk) + { + $rowamount = round(strlen($trans['orig'][$sk])/34)+1; + $hglt1=""; $hglt2=""; + if ($trans['tran'][$sk] == "" && $trans['orig'][$sk]!="") { + $hglt1=""; + $hglt2=""; + } + $text .=" + + "; + $text .= ""; + } + + //Check if directory is writable + if($writable) + { + $text .=" + "; + } + + $text .= " +
    ".$hglt1.htmlentities($sk).$hglt2."".htmlentities(str_replace("ndef++","",$trans['orig'][$sk])) .""; + $text .= ($writable) ? "" : ""; + //echo "orig --> ".$trans['orig'][$sk]."
    "; + if (strpos($trans['orig'][$sk],"ndef++") !== False) + { + //echo "+orig --> ".$trans['orig'][$sk]." <> ".strpos($trans['orig'][$sk],"ndef++")."
    "; + $text .= ""; + } + else + { + $text .= ""; + } + $text .="
    + "; + + if($root_file) + { + $text .= ""; + } + + $text .= "
    +
    +
    "; + + $text .= "
    +

    "; + $text .= (!$writable) ? "
    ".$dir2.$f2.LAN_NOTWRITABLE : ""; + $text .= "

    +
    "; + + + $caption = LAN_CHECK_3." ".$dir2.$f2." -> ".$lan.""; + $ns -> tablerender($caption, $text); + require_once(e_ADMIN."footer.php"); + exit; + +} + +function fill_phrases_array($data,$type) { + + $retloc = array(); + + foreach($data as $line){ + //echo "line--> ".$line."
    "; + if (strpos($line,"define(") !== FALSE && strpos($line,");") === FALSE) + { + $indef=1; + $bigline=""; + // echo "big1 -->".$line."
    "; + } + if ($indef) + { + $bigline.=str_replace("\n","",$line); + // echo "big2 -->".$line."
    "; + } + if (strpos($line,"define(") === FALSE && strpos($line,");") !== FALSE) + { + $indef=0; + $we_have_bigline=1; + // echo "big3 -->".$line."
    "; + } + + if(strpos($line,"setlocale(") !== FALSE) + { + $indef=1; + $we_have_bigline=0; + } + + if ((strpos($line,"define(") !== FALSE && strpos($line,");") !== FALSE && substr(ltrim($line),0,2) != "//") || $we_have_bigline || strpos($line,"setlocale(") !== FALSE) + { + + if ($we_have_bigline) + { + $we_have_bigline=0; + $line=$bigline; + // echo "big -->".$line."
    "; + } + $ndef = ""; + //echo "_ndefline -->".$line."
    "; + if (strpos($line,"defined(") !== FALSE ) + { + $ndef = "ndef++"; + $line = substr($line,strpos($line,"define(")); + } + + if(strpos($line,"setlocale(") !== FALSE) + { + $pos = substr(strstr($line,","),1); + $rep = array(");","\n",'""'); + $val = str_replace($rep,"",$pos); + $retloc[$type]['LC_ALL']= $val; + $retloc['orig']['LC_ALL']= "'en'"; + } + else + { + + //echo "ndefline: ".$line."
    "; + if(preg_match("#\"(.*?)\".*?\"(.*)\"#",$line,$matches) || + preg_match("#\'(.*?)\'.*?\"(.*)\"#",$line,$matches) || + preg_match("#\"(.*?)\".*?\'(.*)\'#",$line,$matches) || + preg_match("#\'(.*?)\'.*?\'(.*)\'#",$line,$matches) || + preg_match("#\((.*?)\,.*?\"(.*)\"#",$line,$matches) || + preg_match("#\((.*?)\,.*?\'(.*)\'#",$line,$matches)){ + //echo "get_lan -->".$matches[1]." :: ".$ndef.$matches[2]."
    "; + $retloc[$type][$matches[1]]= $ndef.$matches[2]; + } + } + } + } + + return $retloc; + } + + +function is_utf8($string) { + // From http://w3.org/International/questions/qa-forms-utf-8.html + if(strtolower(CHARSET) != "utf-8" || $string == "") + { + return TRUE; + } + + return preg_match('%^(?: + [\x09\x0A\x0D\x20-\x7E] + | [\xC2-\xDF][\x80-\xBF] + | \xE0[\xA0-\xBF][\x80-\xBF] + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} + | \xED[\x80-\x9F][\x80-\xBF] + | \xF0[\x90-\xBF][\x80-\xBF]{2} + | [\xF1-\xF3][\x80-\xBF]{3} + | \xF4[\x80-\x8F][\x80-\xBF]{2} + )*$%xs', $string); + +} + + +function lancheck_adminmenu() { + + include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_language.php"); + + global $action,$pref; + if ($action == "") { + $action = "tools"; + } + + if($action == "modify"){ + $action = "db"; + } + $var['main']['text'] = LAN_PREFS; + $var['main']['link'] = e_ADMIN."language.php"; + + if(isset($pref['multilanguage']) && $pref['multilanguage']){ + $var['db']['text'] = LANG_LAN_03; + $var['db']['link'] = e_ADMIN."language.php?db"; + } + + $var['tools']['text'] = ADLAN_CL_6; + $var['tools']['link'] = e_ADMIN."language.php?tools"; + + + show_admin_menu(ADLAN_132, $action, $var); +} + +?> diff --git a/e107_admin/language.php b/e107_admin/language.php new file mode 100644 index 000000000..9d99c1be8 --- /dev/null +++ b/e107_admin/language.php @@ -0,0 +1,465 @@ +tablerender(LAN_SAVED, "
    ".LAN_SETSAVED."
    "); + +} + + +// ----------------- delete tables --------------------------------------------- +if (isset($_POST['del_existing']) && $_POST['lang_choices']) { + + $lang = strtolower($_POST['lang_choices']); + foreach ($tabs as $del_table) { + if (db_Table_exists($lang."_".$del_table)) { + $qry = "DROP TABLE ".$mySQLprefix."lan_".$lang."_".$del_table; + echo $qry; + $message .= (mysql_query($qry)) ? $_POST['lang_choices']." ".$del_table." deleted
    " : + $_POST['lang_choices']." $del_table couldn't be deleted
    "; + } + } + global $cachevar; + unset($cachevar['table_list']); + +} + +// ----------create tables ----------------------------------------------------- + +if (isset($_POST['create_tables']) && $_POST['language']) { + + $table_to_copy = array(); + $lang_to_create = array(); + + + foreach ($tabs as $value) { + $lang = strtolower($_POST['language']); + if (isset($_POST[$value])) { + $copdata = ($_POST['copydata_'.$value]) ? 1 : 0; + if (copy_table($value, "lan_".$lang."_".$value, $_POST['drop'],$copdata)) { + $message .= " ".$_POST['language']." ".$value." created
    "; + } else { + $message .= (!$_POST['drop'])? " ".$_POST['language']." ".$value." ".LANG_LAN_00."
    " : $_POST['language']." ".$value." ".LANG_LAN_01."
    "; + } + } elseif(db_Table_exists($lang."_".$value)) { + if ($_POST['remove']) { + // Remove table. + $message .= (mysql_query("DROP TABLE ".$mySQLprefix."lan_".$lang."_".$value)) ? $_POST['language']." ".$value." ".LAN_DELETED."
    " : $_POST['language']." $value ".LANG_LAN_02."
    "; + } else { + // leave table. + $message = $_POST['language']." ".$value." was disabled but left intact."; + } + } + } + global $cachevar; + unset($cachevar['table_list']); +} + + + + if(isset($message) && $message){ + $ns->tablerender(LAN_OK, $message); + } + + + +unset($text); + + +if (!e_QUERY || $action == 'main' && !$_POST['language'] && !$_POST['edit_existing']) { + multilang_prefs(); +} + +if ($action == 'db') { + multilang_db(); +} + +if($action == "tools"){ + show_tools(); +} + + + + + +// Grab Language configuration. --- +if ($_POST['edit_existing']) { + + $text .= " +
    +
    + \n"; + + foreach ($tabs as $table_name) { + $installed = strtolower($_POST['lang_choices'])."_".$table_name; + if (stristr($_POST['lang_choices'], $installed) === FALSE) { + $text .= " + \n + \n"; + } + } + + $text .= " + "; + + // =========================================================================== + + // Drop tables ? + $text .= " + \n + + + + + + + + + + +
    ".ucfirst(str_replace("_", " ", $table_name))."\n"; + $selected = (db_Table_exists($installed)) ? "checked='checked'" : ""; + $text .= ""; + $text .= ""; + $text .= "
      + +
    ".LANG_LAN_07."".$rs->form_checkbox("drop", 1)."\n + ".LANG_LAN_08."
    ".LANG_LAN_10."".$rs->form_checkbox("remove", 1)."\n + ".LANG_LAN_11."
    "; + + $button_capt = LANG_LAN_06. " / ". LAN_UPDATE; + $text .=""; + + $text .="
    \n"; + + $text .= $rs->form_close(); + $ns->tablerender($_POST['lang_choices'], $text); +} + +require_once(e_ADMIN."footer.php"); + +// --------------------------------------------------------------------------- +function multilang_prefs() { + global $ns, $pref,$lanlist; + + $text = "
    + + "; + + + $text .= " + + + + "; + + $text .= " + + + + + "; + + $text .= " + + + + + "; + + + $text .= " + + +
    ".LANG_LAN_14.": "; + + + $text .= " + +
    ".LANG_LAN_12.": "; + $checked = ($pref['multilanguage'] == 1) ? "checked='checked'" : ""; + $text .= " +
    ".LANG_LAN_18."
    + ".LANG_LAN_19."
    ".LANG_LAN_20."
    www."; + $text .= " +
    "; + $text .= ""; + $text .= "
    + +
    "; + + $caption = LANG_LAN_13; // "Language Preferences"; + $ns->tablerender($caption, $text); +} + +// ---------------------------------------------------------------------------- + +function db_Table_exists($table) +{ + global $mySQLdefaultdb; + $tables = getcachedvars("table_list"); + if(!$tables) + { + $tablist = mysql_list_tables($mySQLdefaultdb); + while($tmp = mysql_fetch_array($tablist)) + { + $tables[] = $tmp[0]; + } + cachevars("table_list", $tables); + } + return in_array(strtolower(MPREFIX."lan_".$table), $tables); +} +// ---------------------------------------------------------------------------- + +function copy_table($oldtable, $newtable, $drop = FALSE, $data = FALSE) +{ + global $sql; + $old = MPREFIX.strtolower($oldtable); + $new = MPREFIX.strtolower($newtable); + if($drop) + { + $sql->db_Select_gen("DROP TABLE IF EXISTS {$new}"); + } + + //Get $old table structure + $sql->db_Select_gen('SET SQL_QUOTE_SHOW_CREATE = 1'); + $qry = "SHOW CREATE TABLE {$old}"; + if($sql->db_Select_gen($qry)) + { + $row = $sql->db_Fetch(); + $qry = $row[1]; + $qry = str_replace($old, $new, $qry); + } + $result = mysql_query($qry); + if(!$result) + { + return FALSE; + } + if ($data) //We need to copy the data too + { + $qry = "INSERT INTO {$new} SELECT * FROM {$old}"; + $sql->db_Select_gen($qry); + } + return TRUE; +} + +// ---------------------------------------------------------------------------- + +function table_list() { + // grab default language lists. + global $mySQLdefaultdb; + + $exclude[] = "banlist"; $exclude[] = "banner"; + $exclude[] = "cache"; $exclude[] = "core"; + $exclude[] = "online"; $exclude[] = "parser"; + $exclude[] = "plugin"; $exclude[] = "user"; + $exclude[] = "upload"; $exclude[] = "userclass_classes"; + $exclude[] = "rbinary"; $exclude[] = "session"; + $exclude[] = "tmp"; $exclude[] = "flood"; + $exclude[] = "stat_info"; $exclude[] = "stat_last"; + $exclude[] = "submit_news"; $exclude[] = "rate"; + $exclude[] = "stat_counter";$exclude[] = "user_extended"; + $exclude[] = "user_extended_struc"; + $exclude[] = "pm_messages"; + $exclude[] = "pm_blocks"; + + $tables = mysql_list_tables($mySQLdefaultdb); + + while (list($temp) = mysql_fetch_array($tables)) + { + if(strpos($temp, MPREFIX) === 0) + { + $e107tab = str_replace(MPREFIX, "", $temp); + if (!in_array($e107tab, $exclude) && stristr($e107tab, "lan_") === FALSE) + { + $tabs[] = $e107tab; + } + } + } + + return $tabs; +} + + +// ------------- render form --------------------------------------------------- +function multilang_db(){ + global $pref,$ns,$tp,$rs,$lanlist,$tabs; + + if(isset($pref['multilanguage']) && $pref['multilanguage']){ + $caption = LANG_LAN_16; // language + $text = MLAD_LAN_4."

    "; + + + // Choose Language to Edit: + $text = "
    +
    + + + + + \n\n"; + sort($lanlist); + for($i = 0; $i < count($lanlist); $i++) + { + $installed = 0; + + $text .= ""; + } + + $text .= "
    ".ADLAN_132."".LANG_LAN_03."".LAN_OPTIONS."
    ".$lanlist[$i]."\n"; + foreach ($tabs as $tab_name) { + if (db_Table_exists(strtolower($lanlist[$i])."_".$tab_name)) { + $text .= $tab_name.", "; + $installed++; + } + } + if($lanlist[$i] == $pref['sitelanguage']){ + $text .= "
    ".LANG_LAN_17."
    "; + }else{ + $text .= (!$installed)? "
    ".LANG_LAN_05."
    " : ""; + } + $text .= "
    \n"; + $text .= $rs->form_open("post", e_SELF."?modify", "lang_form_".str_replace(" ", "_", $lanlist[$i])); + $text .= "
    \n"; + if ($installed) { + $text .= " \n"; + $text .= " \n"; + } elseif($lanlist[$i] != $pref['sitelanguage']) { + $text .= "\n"; + } + $text .= ""; + $text .= "
    "; + $text .= $rs->form_close(); + $text .= "
    "; + + $ns->tablerender($caption, $text); + } +} + + +// ---------------------------------------------------------------------------- + +function show_tools() +{ + global $ns; + + include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_lancheck.php"); + + $text .= " +
    + + + + +
    ".LAN_CHECK_1." + + +
    "; + + $ns->tablerender(LANG_LAN_21, $text); +} + + +// ---------------------------------------------------------------------------- + +function language_adminmenu() { + global $action,$pref; + if ($action == "") { + $action = "main"; + } + + if($action == "modify"){ + $action = "db"; + } + $var['main']['text'] = LAN_PREFS; + $var['main']['link'] = e_SELF; + + if(isset($pref['multilanguage']) && $pref['multilanguage']){ + $var['db']['text'] = LANG_LAN_03; + $var['db']['link'] = e_SELF."?db"; + } + + $lcnt = explode(",",e_LANLIST); + if(count($lcnt) > 1) + { + $var['tools']['text'] = ADLAN_CL_6; + $var['tools']['link'] = e_SELF."?tools"; + } + + show_admin_menu(ADLAN_132, $action, $var); +} + +?> diff --git a/e107_admin/links.php b/e107_admin/links.php new file mode 100644 index 000000000..3af69833e --- /dev/null +++ b/e107_admin/links.php @@ -0,0 +1,790 @@ +form = "linkform"; +$pst->page = "links.php?create"; +$pst->id = "admin_links"; +require_once('auth.php'); +// -------------------- +$pst->save_preset(); + +require_once(e_HANDLER.'userclass_class.php'); +require_once(e_HANDLER.'form_handler.php'); + +$rs = new form; +$linkpost = new links; + +if (e_QUERY) { + $tmp = explode('.', e_QUERY); + $action = $tmp[0]; + $sub_action = $tmp[1]; + $id = $tmp[2]; + unset($tmp); +} + +foreach(array_keys($_POST) as $k) +{ + if (preg_match("#(.*?)_delete_(\d+)(.*)#", $k, $matches)) + { + $delete = $matches[1]; + $del_id = $matches[2]; + } +} + +if(isset($_POST['generate_sublinks']) && isset($_POST['sublink_type']) && $_POST['sublink_parent'] !="" ){ + + $subtype = $_POST['sublink_type']; + $sublink = $linkpost->sublink_list($subtype); + if(!is_object($sql2)){ + $sql2 = new db; + } + + $sql -> db_Select("links", "*", "link_id = '".$_POST['sublink_parent']."'"); + $par = $sql-> db_Fetch(); + extract($par); + + $sql -> db_Select($sublink['table'], "*", $sublink['query']); + $count = 1; + while($row = $sql-> db_Fetch()){ + $subcat = $row[($sublink['fieldid'])]; + $name = $row[($sublink['fieldname'])]; + $subname = $name; // eliminate old embedded hierarchy from names. (e.g. 'submenu.TopName.name') + $suburl = str_replace("#",$subcat,$sublink['url']); + $subicon = ($sublink['fieldicon']) ? $row[($sublink['fieldicon'])] : $link_button; + $subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $link_description; + $subparent = $_POST['sublink_parent']; + + if($sql2->db_Insert("links", "0, '$subname', '$suburl', '$subdiz', '$subicon', '$link_category', '$count', '$subparent', '$link_open', '$link_class' ")){ + $message .= LAN_CREATED. " ($name)
    "; + }else{ + $message .= LAN_CREATED_FAILED. " ($name)
    "; + } + $count++; + } + + if($message){ + $ns -> tablerender(LAN_CREATED, $message); + } +} + +if (isset($_POST['inc'])) { + $qs = explode(".", $_POST['inc']); + $linkid = $qs[0]; + $link_order = $qs[1]; + $sql->db_Update("links", "link_order=link_order+1 WHERE link_order='".($link_order-1)."'"); + $sql->db_Update("links", "link_order=link_order-1 WHERE link_id='".$linkid."'"); +} + +if (isset($_POST['dec'])) { + $qs = explode(".", $_POST['dec']); + $linkid = $qs[0]; + $link_order = $qs[1]; + $sql->db_Update("links", "link_order=link_order-1 WHERE link_order='".($link_order+1)."'"); + $sql->db_Update("links", "link_order=link_order+1 WHERE link_id='".$linkid."'"); +} + +if (isset($_POST['update'])) { + + foreach ($_POST['link_order'] as $loid) { + $tmp = explode(".", $loid); + $sql->db_Update("links", "link_order=".$tmp[1]." WHERE link_id=".$tmp[0]); + } + foreach ($_POST['link_class'] as $lckey => $lcid) { + $sql->db_Update("links", "link_class='".$lcid."' WHERE link_id=".$lckey); + } + $e107cache->clear("sitelinks"); + $linkpost->show_message(LAN_UPDATED); +} + +if (isset($_POST['updateoptions'])) { + $pref['linkpage_screentip'] = $_POST['linkpage_screentip']; + $pref['sitelinks_expandsub'] = $_POST['sitelinks_expandsub']; + save_prefs(); + $e107cache->clear("sitelinks"); + $linkpost->show_message(LCLAN_1); +} + +if ($delete == 'main') +{ + if($sql->db_Select("links", "link_id, link_name, link_order", "link_id='".$del_id."'")){ + $row = $sql->db_Fetch(); + $msg = $linkpost->delete_link($row); + + if($msg){ + $e107cache->clear("sitelinks"); + $linkpost->show_message($msg); + } + } +} + +if (isset($_POST['add_link'])) { + $linkpost->submit_link($sub_action, $_POST['link_id']); + unset($id); +} + +$linkArray = $linkpost->getLinks(); + +if ($action == 'create') { + $linkpost->create_link($sub_action, $id); +} + + +if (!e_QUERY || $action == 'main') { + $linkpost->show_existing_items(); +} + +if ($action == 'opt') { + $linkpost->show_pref_options(); +} + +if($action == "sublinks"){ + $linkpost->show_sublink_generator(); +} + +require_once('footer.php'); +exit; + +// End --------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +class links +{ + var $link_total; + var $aIdOptPrep, $aIdOptData, $aIdOptTest; + + function getLinks() + { + global $sql; + if($this->link_total = $sql->db_Select("links", "*", "ORDER BY link_category,link_order, link_id ASC", "nowhere")) + { + while($row = $sql->db_Fetch()) + { + $ret[$row['link_parent']][] = $row; + } + } + return $ret; + } + + + function linkName($text) + { + // This function is ONLY needed for link databases that have been upgraded from + // before 0.7+ -- all new link collections make use of link_parent instead + // of hierarchy embedded in the link_name. (Unfortunately, the upgraded + // data still includes embedded coding.) + + if(substr($text, 0, 8) == "submenu.") // for backwards compatibility only. + { + $tmp = explode(".",$text); + switch (count($tmp)) { + case 3: // submenu.parent.node + $tmp = $tmp[2]; break; + case 5: // submenu.parent.midlev.child.node + $tmp = $tmp[4]; break; + case 2: // submenu.parent (invalid?) + default: + $parentLen = strlen($tmp[1]); + $tmp = substr($text,8+$parentLen+1); // Skip submenu.parent. + } + return $tmp; + } + else + { + return $text; + } + } + + function dropdown($curval="", $lid=0, $indent=0) + { // Drop-down list using on the parent_id. :) + global $linkArray,$id,$sub_action; + + if(0 == $indent) {$ret = "\n";} + foreach($linkArray[$lid] as $l) + { + $s = ($l['link_id'] == $curval ? " selected='selected' " : "" ); + $thename = $this->linkName($l['link_name']); + // prevent making self the parent. + if ($l['link_id'] == $id) { $thename = "(".$thename.")"; } + if($sub_action == "sub") + { + $thelink = ($l['link_id'] != $lid) ? $l['link_id'] : $l['link_parent'] ; + } + else + { + $thelink = ($l['link_id'] != $id) ? $l['link_id'] : $l['link_parent'] ; + } + $ret .= "\n"; + + if(array_key_exists($l['link_id'], $linkArray)) + { + $ret .= $this->dropdown($curval, $l['link_id'], $indent+1); + } + } + return $ret; + } + + + function existing($id=0, $level=0) + { + global $linkArray; + $ret = ""; + foreach($linkArray[$id] as $l) + { + $s = ($l['link_parent'] == $curval ? " selected='selected' " : "" ); + $ret .= $this->display_row($l, $level); + if(array_key_exists($l['link_id'], $linkArray)) + { + $ret .= $this->existing($l['link_id'], $level+1); + } + } + return $ret; + } + + function show_existing_items() + { + global $sql, $rs, $ns, $tp, $linkArray; + if (count($linkArray)) + { + + $this->prepIdOpts(); // Prepare the options list for all links + $text = $rs->form_open("post", e_SELF, "myform_{$link_id}", "", ""); + $text .= "
    + + + + + + + + + + + + + + + + + "; + $text .= $this->existing(0); + + $text .= " + + "; + $text .= "
    ".LCLAN_89."".LCLAN_15."".LAN_OPTIONS."".LCLAN_95."".LCLAN_91."".LAN_ORDER."
    "; + $text .= $rs->form_close(); + } else { + $text .= "
    ".LCLAN_61."
    "; + } + $ns->tablerender(LCLAN_8, $text); + } + + function prepIdOpts() { + for($a = 1; $a <= $this->link_total; $a++) { + $sTxt = "".$a; + $this->aIdOptData[] = array('val'=>'|||.'.$a, 'txt'=>$sTxt); // Later, ||| becomes Id + $this->aIdOptTest[] = $sTxt; + } + $this->aIdOptPrep = $this->prepOpts($this->aIdOptData); + } + + function display_row($row2, $indent = FALSE) { + global $sql, $rs, $ns, $tp, $linkArray,$previous_cat; + extract($row2); + + // + if($link_category > 1 && $link_category != $previous_cat) + { + $text .= " + + ".LCLAN_89." + ".LCLAN_15." (".LCLAN_12.": ".$link_category.") + ".LAN_OPTIONS." + ".LCLAN_95." + ".LCLAN_91." + ".LAN_ORDER." + "; + $previous_cat = $link_category; + } + + if(strpos($link_name, "submenu.") !== FALSE || $link_parent !=0) // 'submenu' for upgrade compatibility only. + { + $link_name = $this->linkName( $link_name ); + } + + if ($indent) { + $subimage = ""; + $subspacer = ($indent > 1) ? " style='padding-left: ".(($indent - 1) * 16)."px'" : ""; + $subindent = "".$subimage.""; + } + + $text .= ""; + $text .= $link_button ? " ": + ""; + $text .= " + + + ".$subindent." + + +
    ".$link_name."
    + "; + $text .= ""; + $text .= "".LINKLAN_10." "; + $text .= "".ADMIN_EDIT_ICON." "; + $text .= "toJS(LCLAN_58." [ $link_name ]")."') \" />"; + $text .= ""; + $text .= "".r_userclass("link_class[".$link_id."]", $link_class, "off", "public,guest,nobody,member,admin,classes").""; + $text .= ""; + $text .= ""; + $text .= ""; + $text .= ""; + $text .= ""; + $text .= ""; + $text .= ""; + $text .= ""; + + return $text; + + } + + + function show_message($message) { + global $ns; + $ns->tablerender(LAN_UPDATE, "
    ".$message."
    "); + } + + + + function create_link($sub_action, $id) { + global $sql, $rs, $ns, $pst,$tp; + $preset = $pst->read_preset("admin_links"); + extract($preset); + + if ($sub_action == "edit" && !$_POST['submit']) + { + if ($sql->db_Select("links", "*", "link_id='$id' ")) + { + $row = $sql->db_Fetch(); + extract($row); + } + } + + if("sub" == $sub_action) + { + $link_parent = $id; + } + + if(strpos($link_name, "submenu.") !== FALSE){ // 'submenu' for upgrade compatibility only. + $link_name = $this->linkName( $link_name ); + } + + require_once(e_HANDLER."file_class.php"); + $fl = new e_file; + + if($iconlist = $fl->get_files(e_IMAGE."icons/", ".jpg|.gif|.png|.JPG|.GIF|.PNG")){ + sort($iconlist); + } + + $text = "
    +
    + "; + + $text .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".LINKLAN_2.": +
    ".LCLAN_15.": + +
    ".LCLAN_16.": + "; + if(e_MENU == "debug") + { + $text .= $link_url; + } + $text .= " +
    ".LCLAN_17.": + +
    ".LCLAN_18.": + + + +
    ".LCLAN_19.": + +
    ".LCLAN_12.": + ".LCLAN_96." {SITELINKS=flat:[rendertype number]} +
    ".LCLAN_25.":
    (".LCLAN_26.")
    ".r_userclass("link_class", $link_class, "off", "public,guest,nobody,member,admin,classes")." +
    "; + if ($id && $sub_action == "edit") { + $text .= "\n + "; + } else { + $text .= ""; + } + $text .= "
    +
    +
    "; + $ns->tablerender(LCLAN_29, $text); + } + + + function submit_link($sub_action, $id) { + global $sql, $e107cache, $tp; + if(!is_object($tp)) { + $tp=new e_parse; + } + + $parent_id = ($_POST['link_parent']) ? intval($_POST['link_parent']) : 0; + + $link_name = $tp->toDB($_POST['link_name']); + $link_url = $tp->createConstants($_POST['link_url']); + $link_url = str_replace("&","&",$link_url); // xhtml compliant links. + + $link_description = $tp->toDB($_POST['link_description']); + $link_button = $tp->toDB($_POST['link_button']); + + $link_t = $sql->db_Count("links", "(*)"); + if ($id) { + $sql->db_Update("links", "link_parent='$parent_id', link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".$_POST['linkrender']."', link_open='".$_POST['linkopentype']."', link_class='".$_POST['link_class']."' WHERE link_id='$id'"); + //rename all sublinks to eliminate old embedded 'submenu' etc hierarchy. + // this is for upgrade compatibility only. Current hierarchy uses link_parent. + + $e107cache->clear("sitelinks"); + $this->show_message(LCLAN_3); + } else { + $sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$_POST['linkrender'].", ".($link_t+1).", ".$parent_id.", ".$_POST['linkopentype'].", ".$_POST['link_class']); + $e107cache->clear("sitelinks"); + $this->show_message(LCLAN_2); + } + } + + function show_pref_options() { + global $pref, $ns; + $text = "
    +
    \n + + + + + + + + + + + + + + + + + +
    + ".LCLAN_78."
    + ".LCLAN_79." +
    ". ($pref['linkpage_screentip'] ? "" : "")." +
    + ".LCLAN_80."
    + ".LCLAN_81." +
    ". ($pref['sitelinks_expandsub'] ? "" : "")." +
    + +
    +
    +
    "; + $ns->tablerender(LCLAN_88, $text); + } + + function delete_link($linkInfo) { + global $sql; + + if ($sql->db_Select("links", "link_id", "link_order > '{$linkInfo['link_order']}'")){ + $linkList = $sql->db_getList(); + foreach($linkList as $l){ + $sql->db_Update("links", "link_order = link_order -1 WHERE link_id = '{$l['link_id']}'"); + } + } + + + if ($sql->db_Delete("links", "link_id='".$linkInfo['link_id']."'")){ + // Update ophaned sublinks. + $sql->db_Update("links", "link_name = SUBSTRING_INDEX(link_name, '.', -1) , link_parent = '0', link_class='255' WHERE link_parent= '".$linkInfo['link_id']."'"); + + return LCLAN_53." #".$linkInfo['link_id']." ".LCLAN_54."
    "; + }else{ + return DELETED_FAILED; + } + + + } + +// -------------------------- Sub links generator -------------> + +function show_sublink_generator() { + global $ns,$sql; + + $sublinks = $this->sublink_list(); + + $text = "
    +
    \n + + + + + + + + + + + + + + + + +
    + ".LINKLAN_6."
    +
    + \n +
    + ".LINKLAN_7."
    +
    + \n +
    + +
    +
    +
    "; + $ns->tablerender("Sublinks Generator", $text); +} + + + +function sublink_list($name=""){ + global $sql,$PLUGINS_DIRECTORY; + $sublink_type['news']['title'] = LINKLAN_8; // "News Categories"; + $sublink_type['news']['table'] = "news_category"; + $sublink_type['news']['query'] = "category_id !='-2' ORDER BY category_name ASC"; + $sublink_type['news']['url'] = "news.php?cat.#"; + $sublink_type['news']['fieldid'] = "category_id"; + $sublink_type['news']['fieldname'] = "category_name"; + $sublink_type['news']['fieldicon'] = "category_icon"; + + $sublink_type['downloads']['title'] = LINKLAN_9; //"Download Categories"; + $sublink_type['downloads']['table'] = "download_category"; + $sublink_type['downloads']['query'] = "download_category_parent ='0' ORDER BY download_category_name ASC"; + $sublink_type['downloads']['url'] = "download.php?list.#"; + $sublink_type['downloads']['fieldid'] = "download_category_id"; + $sublink_type['downloads']['fieldname'] = "download_category_name"; + $sublink_type['downloads']['fieldicon'] = "download_category_icon"; + + + if ($sql -> db_Select("plugin", "plugin_path", "plugin_installflag = '1'")) { + while ($row = $sql -> db_Fetch()) { + $sublink_plugs[] = $row['plugin_path']; + } + } + + foreach ($sublink_plugs as $plugin_id) { + if (is_readable(e_PLUGIN.$plugin_id.'/e_linkgen.php')) { + require_once(e_PLUGIN.$plugin_id.'/e_linkgen.php'); + } + } + if($name){ + return $sublink_type[$name]; + } + + return $sublink_type; + +} + +function prepOpts($aData) +{ +// +// Prepare an array that can rapidly (no looping) +// generate an HTML option string, with one item possibly selected. +// prepOpts returns a prepared array containing the possible values in this form: +// +// +// +// $aData is an array containing value/text pairs: +// each entry is array( 'val'=>value, 'txt'=>text ) +// + +$i=0; + foreach($aData as $aVal) + { + $sVal = $aVal['val']; + $sTxt = $aVal['txt']; + $sOut=""; + + if ($i) $sOut = '>'.$sTxtPrev.''; + $sOut .= '"; + } + + function form_hidden($form_name, $form_value) { + return "\n"; + } + + function form_close() { + return "\n"; + } +} + +/* +Usage +echo $rs->form_open("post", e_SELF, "_blank"); +echo $rs->form_text("testname", 100, "this is the value", 100, 0, "tooltip"); +echo $rs->form_button("submit", "testsubmit", "SUBMIT!", "", "Click to submit"); +echo $rs->form_button("reset", "testreset", "RESET!", "", "Click to reset"); +echo $rs->form_textarea("textareaname", 10, 10, "Value", "overflow:hidden"); +echo $rs->form_checkbox("testcheckbox", 1, 1); +echo $rs->form_checkbox("testcheckbox2", 2); +echo $rs->form_hidden("hiddenname", "hiddenvalue"); +echo $rs->form_radio("testcheckbox", 1, 1); +echo $rs->form_radio("testcheckbox", 1); +echo $rs->form_file("testfile", "20"); +echo $rs->form_select_open("testselect"); +echo $rs->form_option("Option 1"); +echo $rs->form_option("Option 2"); +echo $rs->form_option("Option 3", 1, "defaultvalue"); +echo $rs->form_option("Option 4"); +echo $rs->form_select_close(); +echo $rs->form_close(); +*/ + + +?> \ No newline at end of file diff --git a/e107_handlers/forum.php b/e107_handlers/forum.php new file mode 100644 index 000000000..45d5202d4 --- /dev/null +++ b/e107_handlers/forum.php @@ -0,0 +1,593 @@ + +
    \n + + + + + + + + + +
    + ".FORLAN_106."
    + ".FORLAN_2." +
    + ".FORLAN_3."
    + ".FORLAN_4." +
    + + + +
    +
    + "; + $ns->tablerender(FORLAN_7, $text); + require_once("footer.php"); + } +} + +if (isset($_POST['doprune'])) { + if ($_POST['prune_type'] == "delete") { + $prunedate = time() - ($_POST['prune_days'] * 86400); + if ($sql->db_Select("forum_t", "*", "thread_lastpost < {$prunedate} AND thread_parent=0 AND thread_s!=1")) { + while ($row = $sql->db_Fetch()) { + extract($row); + $sql2->db_Delete("forum_t", "thread_parent = '{$thread_id}' "); + // delete replies + $sql2->db_Delete("forum_t", "thread_id = '{$thread_id}' "); + // delete thread + } + + $sql->db_Select("forum", "*", "forum_parent != 0"); + while ($row = $sql->db_Fetch()) { + extract($row); + $threads = $sql2->db_Count("forum_t", "(*)", "WHERE thread_forum_id = {$forum_id} AND thread_parent = 0"); + $replies = $sql2->db_Count("forum_t", "(*)", "WHERE thread_forum_id = {$forum_id} AND thread_parent != 0"); + $sql2->db_Update("forum", "forum_threads = '{$threads}', forum_replies = '{$replies}' WHERE forum_id = '{$forum_id}'"); + } + $message = FORLAN_8; + } else { + $message = FORLAN_9; + } + } else { + $prunedate = time() - ($_POST['prune_days'] * 86400); + $sql->db_Update("forum_t", "thread_active = 0 WHERE thread_lastpost < {$prunedate} AND thread_parent=0 "); + $message = FORLAN_8; + } +} + +if (isset($_POST['update_order'])) { + extract($_POST); + while (list($key, $id) = each($forum_order_)) { + $tmp = explode(".", $id); + $sql->db_Update("forum", "forum_order = {$tmp[1]} WHERE forum_id = {$tmp[0]}"); + echo "forum_order = {$tmp[1]} WHERE forum_id = {$tmp[0]}
    "; + } + $message = FORLAN_73; +} + + + +$sql->db_Select("forum", "forum_id, forum_order", "forum_parent=0 ORDER BY forum_order ASC"); +$c = 1; +while ($row = $sql->db_Fetch()) { + extract($row); + $sql2->db_Update("forum", "forum_order = '{$c}' WHERE forum_id = '{$forum_id}'"); + $c++; +} +$sql->db_Select("forum", "forum_id, forum_order", "forum_parent != 0 ORDER BY forum_order ASC"); +while ($row = $sql->db_Fetch()) { + extract($row); + $sql2->db_Update("forum", "forum_order = '{$c}' WHERE forum_id = '{$forum_id}' "); + $c++; +} + +if (isset($_POST['updateoptions'])) { + $pref['email_notify'] = $_POST['email_notify']; + $pref['forum_poll'] = $_POST['forum_poll']; + $pref['forum_popular'] = $_POST['forum_popular']; + $pref['forum_track'] = $_POST['forum_track']; + $pref['forum_eprefix'] = $_POST['forum_eprefix']; + $pref['forum_enclose'] = $_POST['forum_enclose']; + $pref['forum_title'] = $_POST['forum_title']; + $pref['forum_postspage'] = $_POST['forum_postspage']; + $pref['forum_levels'] = $_POST['forum_levels']; + $pref['image_post'] = $_POST['image_post']; + $pref['html_post'] = $_POST['html_post']; + $pref['forum_attach'] = $_POST['forum_attach']; + save_prefs(); + $message = FORLAN_10; +} + +If(isset($_POST['submit'])) { + + $c = 0; + while ($_POST['mod'][$c]) { + $mods .= $_POST['mod'][$c].", "; + $c++; + } + $mods = preg_replace("/, $/", ".", $mods); + + $sql->db_Select("forum", "*", "forum_name='".$_POST['parentforum']."' "); + $row = $sql->db_Fetch(); + $forum_parent = $row['forum_id']; + $_POST['forum_name'] = $aj->formtpa($_POST['forum_name'], "admin"); + $_POST['forum_description'] = $aj->formtpa($_POST['forum_description'], "admin"); + + $sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$forum_parent."', '".time()."', '".$mods."', 0, 0, 0, '".$_POST['forum_class']."', 0 "); + unset($forum_name, $forum_description, $forum_parent); + $message = FORLAN_11; +} + +If(isset($_POST['update'])) { + + $c = 0; + while ($_POST['mod'][$c]) { + $mods .= $_POST['mod'][$c].", "; + $c++; + } + $mods = preg_replace("/, $/", ".", $mods); + $sql->db_Select("forum", "*", "forum_name='".$_POST['parentforum']."' "); + $row = $sql->db_Fetch(); + $_POST['forum_name'] = $aj->formtpa($_POST['forum_name'], "admin"); + $_POST['forum_description'] = $aj->formtpa($_POST['forum_description'], "admin"); + $forum_parent = $row['forum_id']; + $sql->db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_description='".$_POST['forum_description']."', forum_parent='".$forum_parent."', forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."' WHERE forum_id='".$_POST['forum_id']."' "); + unset($forum_name, $forum_description, $forum_parent, $forum_active); + $message = FORLAN_12; +} + +If(isset($_POST['psubmit'])) { + $_POST['parent'] = $aj->formtpa($_POST['parent'], "admin"); + $sql->db_Insert("forum", "0, '".$_POST['parent']."', '', '', '".time()."', '0', '0', '0', '', '".$_POST['parent_class']."', 0 "); + unset($parent); + $message = FORLAN_13; +} + +If(isset($_POST['pupdate'])) { + $_POST['parent'] = $aj->formtpa($_POST['parent'], "admin"); + $sql->db_Update("forum", "forum_name='".$_POST['parent']."', forum_class='".$_POST['parent_class']."' WHERE forum_id='".$_POST['existing']."' "); + unset($parent); + $message = FORLAN_14; +} + +If(isset($_POST['pedit'])) { + $sql->db_Select("forum", "*", "forum_id='".$_POST['existing']."' "); + list($forum_id, $parent, $forum_description, $forum_parent, $forum_datestamp, $forum_moderators, $forum_threads, $forum_replies, $forum_lastpost, $parent_class) = $sql->db_Fetch(); + $parent = stripslashes($parent); +} + +If(isset($_POST['edit'])) { + $sql->db_Select("forum", "*", "forum_id='".$_POST['existing']."' "); + list($forum_id, $forum_name, $forum_description, $forum_parent, $forum_datestamp, $forum_moderators, $forum_threads, $forum_replies, $forum_lastpost, $forum_class) = $sql->db_Fetch(); + $parent = stripslashes($parent); +} + +If(isset($_POST['delete'])) { + if ($_POST['confirm']) { + $sql->db_Select("forum", "forum_id, forum_parent", "forum_id='".$_POST['existing']."' "); + $row = $sql->db_Fetch(); + extract($row); + $tt = ($forum_parent ? "" : "parent"); + $sql->db_Delete("forum", "forum_id='".$_POST['existing']."' "); + $message = FORLAN_107.$tt.FORLAN_108; + } else { + $message = FORLAN_15; + } +} + + +if (isset($message)) { + $ns->tablerender("", "
    {$message}
    "); +} + +$ns->tablerender("
    ".FORLAN_16."
    ", $text); + +$text = "
    +
    \n + + + + + + + + + + + + + + +
    "; + +$forum_parent_total = $sql->db_Select("forum", "*", "forum_parent = '0' "); +if ($forum_parent_total == 0) { + $text .= "".FORLAN_17.""; +} else { + $text .= "".FORLAN_18.": + + + + ".FORLAN_21." + "; +} +$text .= " +
    ".FORLAN_22.": + +
    ".FORLAN_23.":
    (".FORLAN_24.")
    ".r_userclass("parent_class", $parent_class); + +$text .= "
    "; + +if (isset($_POST['pedit'])) { + $text .= " + "; +} else { + $text .= ""; +} + +$text .= "
    +
    +
    "; + +$ns->tablerender("Parents", $text); + +if ($forum_parent_total == 0) { + $text = "
    ".FORLAN_27."
    "; + $ns->tablerender(FORLAN_28, $text); + require_once("footer.php"); + exit; +} + + +$forum_total = $sql->db_Select("forum", "*", "forum_parent!='0' "); + +$text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    "; + +if ($forum_total == "0") { + $text .= "".FORLAN_29.""; +} else { + $text .= "".FORLAN_30.": + + + + ".FORLAN_21." + "; +} + +$text .= " +
    ".FORLAN_22.": + +
    ".FORLAN_31.": + +
    ".FORLAN_32.": + +
    ".FORLAN_23.":
    (".FORLAN_24.")
    ".r_userclass("forum_class", $forum_class, "on")." +
    ".FORLAN_33.":
    (".FORLAN_34.")
    "; +$admin_no = $sql->db_Select("user", "*", "user_admin='1' AND user_perms REGEXP('A.') OR user_perms='0' "); +while ($row = $sql->db_Fetch()) { + extract($row); + $text .= " + "; +} else { + $text .= ""; +} + +$text .= "
    +
    +
    "; +$ns->tablerender("Forums", $text); + + +$text = "
    + + + + + + "; + +if (!$parent_amount = $sql->db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC")) { + $text .= ""; +} else { + $sql2 = new db; + $sql3 = new db; + while ($row = $sql->db_Fetch()) { + extract($row); + if ($forum_class == 255) { + $text .= ""; + } + else if($forum_class == 254) { + $text .= ""; + } + else if($forum_class) { + $text .= ""; + } else { + $text .= ""; + } + + $text .= "\n"; + + $forums = $sql2->db_Select("forum", "*", "forum_parent = '{$forum_id}' ORDER BY forum_order ASC"); + if (!$forums) { + $text .= ""; + } else { + while ($row = $sql2->db_Fetch()) { + extract($row); + + $text .= "\n + \n"; + } + } + } +} + +$text .= " + + + +
    ".FORLAN_28."".FORLAN_37."
    ".FORLAN_29."
    {$forum_name} (".FORLAN_38.")
    {$forum_name} (".FORLAN_39.")
    {$forum_name} (".FORLAN_40.")
    {$forum_name}\n
    ".FORLAN_29."
    ".$forum_name."
    ".$forum_description."
    \n\n
    + +
    "; +$ns->tablerender(FORLAN_43, $text); + + +$text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + ".FORLAN_44."
    + ".FORLAN_45." +
    ". ($pref['forum_enclose'] ? "" : "")." +
    + ".FORLAN_65."
    + ".FORLAN_46." +
    + +
    + ".FORLAN_47."
    + ".FORLAN_48." +
    ". ($pref['email_notify'] ? "" : "")." +
    + ".FORLAN_68."
    + ".FORLAN_69." +
    ". ($pref['html_post'] ? "" : "")." +
    + ".FORLAN_49."
    + ".FORLAN_50." +
    ". ($pref['forum_poll'] ? "" : "")." +
    + ".FORLAN_70."
    + ".FORLAN_71." +
    ". ($pref['forum_attach'] ? "" : "")." +
    + ".FORLAN_51."
    + ".FORLAN_52." +
    ". ($pref['forum_track'] ? "" : "")." +
    + ".FORLAN_53."
    + ".FORLAN_54." +
    + +
    + ".FORLAN_55."
    + ".FORLAN_56." +
    + +
    + ".FORLAN_57."
    + ".FORLAN_58." +
    + +
    + ".FORLAN_63."
    + ".FORLAN_64." +
    + +
    + ".FORLAN_59."
    + ".FORLAN_60." +
    + ".FORLAN_109." + +
    + +
    +
    +
    "; +$ns->tablerender(FORLAN_62, $text); + +require_once("footer.php"); + +?> \ No newline at end of file diff --git a/e107_handlers/forum_include.php b/e107_handlers/forum_include.php new file mode 100644 index 000000000..10d9ced12 --- /dev/null +++ b/e107_handlers/forum_include.php @@ -0,0 +1,61 @@ + \ No newline at end of file diff --git a/e107_handlers/forum_mod.php b/e107_handlers/forum_mod.php new file mode 100644 index 000000000..d79bc3307 --- /dev/null +++ b/e107_handlers/forum_mod.php @@ -0,0 +1,101 @@ + $val) { + if (preg_match("#(.*?)_(\d+)_x#", $key, $matches)) { + $act = $matches[1]; + $id = $matches[2]; + + switch($act) { + case 'lock' : + $sql->db_Update("forum_t", "thread_active='0' WHERE thread_id='".intval($id)."' "); + return FORLAN_CLOSE; + break; + + case 'unlock' : + $sql->db_Update("forum_t", "thread_active='1' WHERE thread_id='".intval($id)."' "); + return FORLAN_OPEN; + break; + + case 'stick' : + $sql->db_Update("forum_t", "thread_s='1' WHERE thread_id='".intval($id)."' "); + return FORLAN_STICK; + break; + + case 'unstick' : + $sql->db_Update("forum_t", "thread_s='0' WHERE thread_id='".intval($id)."' "); + return FORLAN_UNSTICK; + break; + + case 'delete' : + return forum_delete_thread($id); + break; + + } + } + } +} + +function forum_delete_thread($thread_id) { + global $sql; + $sql->db_Select("forum_t", "*", "thread_id='".intval($thread_id)."' "); + $row = $sql->db_Fetch(); + extract($row); + if ($thread_parent) { + // is post a reply? + $sql->db_Delete("forum_t", "thread_id = '".intval($thread_id)."' "); + // delete reply only + $sql->db_Update("forum", "forum_replies=forum_replies-1 WHERE forum_id='{$thread_forum_id}'"); + // dec reply count by 1 + + $sql->db_Select("forum_t", "*", "thread_id = ".intval($thread_id)); + $row = $sql->db_Fetch(); + extract($row); + $replies = $sql->db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_parent."'"); + $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10); + + $pages = 0; + if ($replies) { + $pages = ((ceil($replies / $pref['forum_postspage']) -1) * $pref['forum_postspage']); + } + + $url = e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_parent.($pages ? ".$pages" : ""); + // set return url + return FORLAN_26; + } else { + // post is thread + $sql->db_Delete("poll", "poll_datestamp='".intval($thread_id)."'"); + // delete poll if there is one + $count = $sql->db_Delete("forum_t", "thread_parent='".intval($thread_id)."'"); + // delete replies and grab how many there were + $sql->db_Delete("forum_t", "thread_id='".intval($thread_id)."'"); + // delete the post itself + $sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies = forum_replies - {$count} WHERE forum_id = '{$thread_forum_id}'"); + // update thread/reply counts + $url = e_BASE."forum_viewforum.php?".$forum_id; + // set return url + return FORLAN_6.($count ? ", ".$count." ".FORLAN_7."." : "."); + } +} + \ No newline at end of file diff --git a/e107_handlers/index.html b/e107_handlers/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_handlers/input_class.php b/e107_handlers/input_class.php new file mode 100644 index 000000000..0d99f00e1 --- /dev/null +++ b/e107_handlers/input_class.php @@ -0,0 +1,78 @@ + \ No newline at end of file diff --git a/e107_handlers/language_class.php b/e107_handlers/language_class.php new file mode 100644 index 000000000..b4ae88ec7 --- /dev/null +++ b/e107_handlers/language_class.php @@ -0,0 +1,248 @@ + "Afar", + "ab" => "Abkhazian", + "af" => "Afrikaans", + "am" => "Amharic", + "ar" => "Arabic", + "as" => "Assamese", + "ae" => "Avestan", + "ay" => "Aymara", + "az" => "Azerbaijani", + "ba" => "Bashkir", + "be" => "Belarusian", + "bn" => "Bengali", + "bh" => "Bihari", + "bi" => "Bislama", + "bo" => "Tibetan", + "bs" => "Bosnian", + "br" => "Breton", + "bg" => "Bulgarian", + "ca" => "Catalan", + "cs" => "Czech", + "ch" => "Chamorro", + "ce" => "Chechen", + "cn" => "Chinese-Simp", + + "cv" => "Chuvash", + "kw" => "Cornish", + "co" => "Corsican", + "cy" => "Welsh", + "da" => "Danish", + "de" => "German", + "dz" => "Dzongkha", + "el" => "Greek", + "en" => "English", + "eo" => "Esperanto", + "et" => "Estonian", + "eu" => "Basque", + "fo" => "Faroese", + "fa" => "Persian", + "fj" => "Fijian", + "fi" => "Finnish", + "fr" => "French", + "fy" => "Frisian", + "gd" => "Gaelic", + "ga" => "Irish", + "gl" => "Gallegan", + "gv" => "Manx", + "gn" => "Guarani", + "gu" => "Gujarati", + "ha" => "Hausa", + "he" => "Hebrew", + "hz" => "Herero", + "hi" => "Hindi", + "ho" => "Hiri Motu", + "hr" => "Croatian", + "hu" => "Hungarian", + "hy" => "Armenian", + "iu" => "Inuktitut", + "ie" => "Interlingue", + "id" => "Indonesian", + "ik" => "Inupiaq", + "is" => "Icelandic", + "it" => "Italian", + "jw" => "Javanese", + "ja" => "Japanese", + "kl" => "Kalaallisut", + "kn" => "Kannada", + "ks" => "Kashmiri", + "ka" => "Georgian", + "kk" => "Kazakh", + "km" => "Khmer", + "ki" => "Kikuyu", + "rw" => "Kinyarwanda", + "ky" => "Kirghiz", + "kv" => "Komi", + "ko" => "Korean", + "ku" => "Kurdish", + "lo" => "Lao", + "la" => "Latin", + "lv" => "Latvian", + "ln" => "Lingala", + "lt" => "Lithuanian", + "lb" => "Letzeburgesch", + "mh" => "Marshall", + "ml" => "Malayalam", + "mr" => "Marathi", + "mk" => "Macedonian", + "mg" => "Malagasy", + "mt" => "Maltese", + "mo" => "Moldavian", + "mn" => "Mongolian", + "mi" => "Maori", + "ms" => "Malay", + "my" => "Burmese", + "na" => "Nauru", + "nv" => "Navajo", + + "ng" => "Ndonga", + "ne" => "Nepali", + "nl" => "Dutch", + "nb" => "Norwegian", + + "ny" => "Chichewa", + "or" => "Oriya", + "om" => "Oromo", + "pa" => "Panjabi", + "pi" => "Pali", + "pl" => "Polish", + "pt" => "Portuguese", + "ps" => "Pushto", + "qu" => "Quechua", + "ro" => "Romanian", + "rn" => "Rundi", + "ru" => "Russian", + "sg" => "Sango", + "sa" => "Sanskrit", + "si" => "Sinhalese", + "sk" => "Slovak", + "sl" => "Slovenian", + + "sm" => "Samoan", + "sn" => "Shona", + "sd" => "Sindhi", + "so" => "Somali", + + "es" => "Spanish", + "sq" => "Albanian", + "sc" => "Sardinian", + "sr" => "Serbian", + "ss" => "Swati", + "su" => "Sundanese", + "sw" => "Swahili", + "sv" => "Swedish", + "ty" => "Tahitian", + "ta" => "Tamil", + "tt" => "Tatar", + "te" => "Telugu", + "tg" => "Tajik", + "tl" => "Tagalog", + "th" => "Thai", + "ti" => "Tigrinya", + + "tn" => "Tswana", + "ts" => "Tsonga", + "tk" => "Turkmen", + "tr" => "Turkish", + "tw" => "Chinese-Trad", + "ug" => "Uighur", + "uk" => "Ukrainian", + "ur" => "Urdu", + "uz" => "Uzbek", + "vi" => "Vietnamese", + + "wo" => "Wolof", + "xh" => "Xhosa", + "yi" => "Yiddish", + "yo" => "Yoruba", + "za" => "Zhuang", + "zh" => "Chinese", + "zu" => "Zulu" + ); + + if(strlen($data) > 2) + { + $tmp = array_flip($lang); + return $tmp[$data]; + } + else + { + return $lang[$data]; + } + } + + + + + // ------------------------------------------------------------------- + + function toNative($lang){ + + $name = array( + "Arabic" => "العربية", + "Bulgarian" => "Български", + "Croatian" => "Hrvatski", + "Dutch" => "Nederlands", + "English" => "English", + "Farsi" => "فارسي", + "French" => "Français", + "German" => "Deutsch", + "Greek" => "Ελληνικά", + "Hebrew" => "עִבְרִית", + "Hungarian" => "Magyar", + "Italian" => "Italiano", + "Japanese" => "日本語", + "Korean" => "한국어", + "Mongolian" => "монгол", + "Nepali" => "नेपाली", + "Portuguese" => "Português", + "Polish" => "Polski", + "Romanian" => "Romanesc", + "Russian" => "Pусский", + "Serbian" => "Srpski", + "Spanish" => "Español", + "Slovenian" => "Slovensko", + "Slovakian" => "Slovensky", + "Slovak" => "Slovensky", + "Swedish" => "Svenska", + "Thai" => " าษาไทย", + "Turkish" => "Türkçe" + ); + + return ($name[$lang]) ? $name[$lang] : $lang; + + } + + + function subdomainUrl($language) + { + global $pref; + $codelnk = ($language == $pref['sitelanguage']) ? "www" : $this->convert($language); + $urlval = str_replace($_SERVER['HTTP_HOST'],$codelnk.$pref['multilanguage_subdomain'],e_SELF); + return $urlval; + } + +} + + + + +?> \ No newline at end of file diff --git a/e107_handlers/level_handler.php b/e107_handlers/level_handler.php new file mode 100644 index 000000000..df17ee5ab --- /dev/null +++ b/e107_handlers/level_handler.php @@ -0,0 +1,119 @@ +".IMAGE_rank_moderator_image.""; + $data[0] = "
    ".IMAGE_rank_moderator_image."
    "; + } + if ($user_admin) + { + if ($user_perms == "0") + { + $data['special'] = IMAGE_rank_main_admin_image."
    "; + $data[0] = IMAGE_rank_main_admin_image."
    "; + } + else + { + $data['special'] = IMAGE_rank_admin_image."
    "; + $data[0] = IMAGE_rank_admin_image."
    "; + } + } + $data[0] = "".LAN_195." #".$user_id."
    "; + $data['userid'] = "".LAN_195." #".$user_id."
    "; + + $level_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600)); + + $level_images = explode(",", $pref['forum_images']); + $level_names = explode(",", $pref['forum_levels']); + if(!$pref['forum_images']) + { + if(!$level_names[0]) + { + $level_images = array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png"); + } + } + + $daysregged = max(1, round((time() - $user_join) / 86400))."days"; + $level = ceil((($user_forums * 5) + ($user_comments * 5) + ($user_chats * 2) + $user_visits)/4); + $ltmp = $level; + + if ($level <= $level_thresholds[0]) { + $rank = 0; + } + else if($level >= ($level_thresholds[0]+1) && $level <= $level_thresholds[1]) { + $rank = 1; + } + else if($level >= ($level_thresholds[1]+1) && $level <= $level_thresholds[2]) { + $rank = 2; + } + else if($level >= ($level_thresholds[2]+1) && $level <= $level_thresholds[3]) { + $rank = 3; + } + else if($level >= ($level_thresholds[3]+1) && $level <= $level_thresholds[4]) { + $rank = 4; + } + else if($level >= ($level_thresholds[4]+1) && $level <= $level_thresholds[5]) { + $rank = 5; + } + else if($level >= ($level_thresholds[5]+1) && $level <= $level_thresholds[6]) { + $rank = 6; + } + else if($level >= ($level_thresholds[6]+1) && $level <= $level_thresholds[7]) { + $rank = 7; + } + else if($level >= ($level_thresholds[7]+1) && $level <= $level_thresholds[8]) { + $rank = 8; + } + else if($level >= ($level_thresholds[8]+1)) { + $rank = 9; + } + + $data['pic'] = (file_exists(THEME."forum/".$level_images[$rank]) ? THEME."forum/".$level_images[$rank] : e_IMAGE."rate/".IMODE."/".$level_images[$rank]); + $data['name'] = "[ ".$tp->toHTML($level_names[$rank], FALSE, 'defs')." ]"; + + if($level_names[$rank]) + { + $data[1] = "
    {$data['name']}
    "; + $img_title = "title='{$data['name']}'"; + $data['pic'] = ""; + } + else + { + $data['pic'] = ""; + $data[1] = "
    {$data['pic']}
    "; + } + + if($data['special']) { $data[0] = $data['special'];} + return ($data); +} + + + +?> \ No newline at end of file diff --git a/e107_handlers/login.php b/e107_handlers/login.php new file mode 100644 index 000000000..a8cd288d7 --- /dev/null +++ b/e107_handlers/login.php @@ -0,0 +1,205 @@ +getip(); + if($sql -> db_Select("banlist", "*", "banlist_ip='{$fip}' ")) { + exit; + } + + $autologin = intval($autologin); + + if ($pref['auth_method'] && $pref['auth_method'] != "e107") { + $auth_file = e_PLUGIN."alt_auth/".$pref['auth_method']."_auth.php"; + if (file_exists($auth_file)) { + require_once(e_PLUGIN."alt_auth/alt_auth_login_class.php"); + $result = new alt_login($pref['auth_method'], $username, $userpass); + } + } + + if ($pref['logcode'] && extension_loaded("gd")) { + require_once(e_HANDLER."secure_img_handler.php"); + $sec_img = new secure_image; + if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) { + define("LOGINMESSAGE", LAN_303."

    "); + return FALSE; + } + } + if ($username != "" && $userpass != "") { + $username = preg_replace("/\sOR\s|\=|\#/", "", $username); + $ouserpass = $userpass; + $userpass = md5($ouserpass); + + $username = substr($username, 0, 30); + + // This is only required for upgrades and only for those not using utf-8 to begin with.. + if(isset($pref['utf-compatmode']) && (CHARSET == "utf-8" || CHARSET == "UTF-8")){ + $username = utf8_decode($username); + $userpass = md5(utf8_decode($ouserpass)); + } + + if (!$sql->db_Select("user", "*", "user_loginname = '".$tp -> toDB($username)."'")) { + define("LOGINMESSAGE", LAN_300."

    "); + $sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '{$fip}', 0, '".LAN_LOGIN_14." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username)."'"); + $this -> checkibr($fip); + return FALSE; + } + else if(!$sql->db_Select("user", "*", "user_loginname = '".$tp -> toDB($username)."' AND user_password = '{$userpass}'")) { + define("LOGINMESSAGE", LAN_300."

    "); + return FALSE; + } + else if(!$sql->db_Select("user", "*", "user_loginname = '".$tp -> toDB($username)."' AND user_password = '{$userpass}' AND user_ban!=2 ")) { + define("LOGINMESSAGE", LAN_302."

    "); + $sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '{$fip}', 0, '".LAN_LOGIN_15." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username)."'"); + $this -> checkibr($fip); + return FALSE; + } else { + $ret = $e_event->trigger("preuserlogin", $username); + if ($ret!='') { + define("LOGINMESSAGE", $ret."

    "); + return FALSE; + } else { + $lode = $sql -> db_Fetch(); + $user_id = $lode['user_id']; + $user_name = $lode['user_name']; + $user_xup = $lode['user_xup']; + + /* restrict more than one person logging in using same us/pw */ + if($pref['disallowMultiLogin']) { + if($sql -> db_Select("online", "online_ip", "online_user_id='".$user_id.".".$user_name."'")) { + define("LOGINMESSAGE", LAN_304."

    "); + $sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '$fip', '$user_id', '".LAN_LOGIN_16." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' "); + $this -> checkibr($fip); + return FALSE; + } + } + + $cookieval = $user_id.".".md5($userpass); + if($user_xup) { + $this->update_xup($user_id, $user_xup); + } + + if ($pref['user_tracking'] == "session") { + $_SESSION[$pref['cookie_name']] = $cookieval; + } else { + if ($autologin == 1) { + cookie($pref['cookie_name'], $cookieval, (time() + 3600 * 24 * 30)); + } else { + cookie($pref['cookie_name'], $cookieval); + } + } + $edata_li = array("user_id" => $user_id, "user_name" => $username); + $e_event->trigger("login", $edata_li); + $redir = (e_QUERY ? e_SELF."?".e_QUERY : e_SELF); + if (strstr($_SERVER['SERVER_SOFTWARE'], "Apache")) { + header("Location: ".$redir); + exit; + } else { + echo "\n"; + } + } + } + } else { + define("LOGINMESSAGE", LAN_27."

    "); + return FALSE; + } + } + + function checkibr($fip) { + global $sql, $pref, $tp; + if($pref['autoban'] == 1 || $pref['autoban'] == 3){ // Flood + Login or Login Only. + $fails = $sql -> db_Count("generic", "(*)", "WHERE gen_ip='$fip' AND gen_type='failed_login' "); + if($fails > 10) { + $sql -> db_Insert("banlist", "'$fip', '1', '".LAN_LOGIN_18."' "); + $sql -> db_Insert("generic", "0, 'auto_banned', '".time()."', 0, '$fip', '$user_id', '".LAN_LOGIN_20.": ".$tp -> toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' "); + } + } + } + + function update_xup($user_id, $user_xup = "") { + global $sql, $tp; + if($user_xup) { + require_once(e_HANDLER."xml_class.php"); + $xml = new parseXml; + if($rawData = $xml -> getRemoteXmlFile($user_xup)) { + preg_match_all("#\#si", $rawData, $match); + $count = 0; + foreach($match[1] as $value) { + $$value = $tp -> toDB($match[2][$count]); + $count++; + } + + $sql -> db_Update("user", "user_login='{$FN}', user_hideemail='{EMAILHIDE}', user_signature='{$SIG}', user_sess='{$PHOTO}', user_image='{$AV}', user_timezone='{$TZ}' WHERE user_id='".intval($user_id)."'"); + + $ue_fields = ""; + $fields = array("URL" => "homepage", + "ICQ" => "icq", + "AIM" => "aim", + "MSN" => "msn", + "YAHOO" => "yahoo", + "GEO" => "location", + "BDAY" => "birthday"); + include_once(e_HANDLER."user_extended_class.php"); + $usere = new e107_user_extended; + $extList = $usere->user_extended_get_fieldList(); + $extName = array(); + foreach($extList as $ext) + { + $extName[] = $ext['user_extended_struct_name']; + } + foreach($fields as $keyxup => $keydb) + { + if (in_array($keydb, $extName)) + { + $key = "user_".$keydb; + $key = $tp->toDB($key); + $val = $tp->toDB($$keyxup); + $ue_fields .= ($ue_fields) ? ", " : ""; + $ue_fields .= $key."='".$val."'"; + } + } + $sql -> db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('".intval($user_id)."')"); + $sql -> db_Update("user_extended", $ue_fields." WHERE user_extended_id = '".intval($user_id)."'"); + } + } + } +} + +?> diff --git a/e107_handlers/magpie_rss.php b/e107_handlers/magpie_rss.php new file mode 100644 index 000000000..74d1f4429 --- /dev/null +++ b/e107_handlers/magpie_rss.php @@ -0,0 +1,630 @@ + +* @version 0.7a +* @license GPL +* +*/ + +define('RSS', 'RSS'); +define('ATOM', 'Atom'); + +/** +* Hybrid parser, and object, takes RSS as a string and returns a simple object. +* +* see: rss_fetch.inc for a simpler interface with integrated caching support +* +*/ +class MagpieRSS { + var $parser; + + var $current_item = array(); // item currently being parsed + var $items = array(); // collection of parsed items + var $channel = array(); // hash of channel fields + var $textinput = array(); + var $image = array(); + var $feed_type; + var $feed_version; + var $encoding = ''; // output encoding of parsed rss + + var $_source_encoding = ''; // only set if we have to parse xml prolog + + var $ERROR = ""; + var $WARNING = ""; + + // define some constants + + var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); + var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1'); + + // parser variables, useless if you're not a parser, treat as private + var $stack = array(); // parser stack + var $inchannel = false; + var $initem = false; + var $incontent = false; // if in Atom field + var $intextinput = false; + var $inimage = false; + var $current_field = ''; + var $current_namespace = false; + + + /** + * Set up XML parser, parse source, and return populated RSS object.. + * + * @param string $source string containing the RSS to be parsed + * + * NOTE: Probably a good idea to leave the encoding options alone unless + * you know what you're doing as PHP's character set support is + * a little weird. + * + * NOTE: A lot of this is unnecessary but harmless with PHP5 + * + * + * @param string $output_encoding output the parsed RSS in this character + * set defaults to ISO-8859-1 as this is PHP's + * default. + * + * NOTE: might be changed to UTF-8 in future + * versions. + * + * @param string $input_encoding the character set of the incoming RSS source. + * Leave blank and Magpie will try to figure it + * out. + * + * + * @param bool $detect_encoding if false Magpie won't attempt to detect + * source encoding. (caveat emptor) + * + */ + function MagpieRSS ($source, $output_encoding = CHARSET, + $input_encoding=null, $detect_encoding = true) + { + # if PHP xml isn't compiled in, die + # + if (!function_exists('xml_parser_create')) { + $this->error( "Failed to load PHP's XML Extension. " . + "http://www.php.net/manual/en/ref.xml.php", + E_USER_ERROR ); + } + + list($parser, $source) = $this->create_parser($source, + $output_encoding, $input_encoding, $detect_encoding); + + + if (!is_resource($parser)) { + $this->error( "Failed to create an instance of PHP's XML parser. " . + "http://www.php.net/manual/en/ref.xml.php", + E_USER_ERROR ); + } + + + $this->parser = $parser; + + # pass in parser, and a reference to this object + # setup handlers + # + xml_set_object( $this->parser, $this ); + xml_set_element_handler($this->parser, + 'feed_start_element', 'feed_end_element' ); + + xml_set_character_data_handler( $this->parser, 'feed_cdata' ); + + $status = xml_parse( $this->parser, $source ); + + if (! $status ) { + $errorcode = xml_get_error_code( $this->parser ); + if ( $errorcode != XML_ERROR_NONE ) { + $xml_error = xml_error_string( $errorcode ); + $error_line = xml_get_current_line_number($this->parser); + $error_col = xml_get_current_column_number($this->parser); + $errormsg = "{$xml_error} at line {$error_line}, column {$error_col}"; + + $this->error( $errormsg ); + } + } + + xml_parser_free( $this->parser ); + + $this->normalize(); + } + + function feed_start_element($p, $element, &$attrs) { + $el = $element = strtolower($element); + $attrs = array_change_key_case($attrs, CASE_LOWER); + + // check for a namespace, and split if found + $ns = false; + if ( strpos( $element, ':' ) ) { + list($ns, $el) = split( ':', $element, 2); + } + if ( $ns and $ns != 'rdf' ) { + $this->current_namespace = $ns; + } + + # if feed type isn't set, then this is first element of feed + # identify feed from root element + # + if (!isset($this->feed_type) ) { + if ( $el == 'rdf' ) { + $this->feed_type = RSS; + $this->feed_version = '1.0'; + } + elseif ( $el == 'rss' ) { + $this->feed_type = RSS; + $this->feed_version = $attrs['version']; + } + elseif ( $el == 'feed' ) { + $this->feed_type = ATOM; + $this->feed_version = $attrs['version']; + $this->inchannel = true; + } + return; + } + + if ( $el == 'channel' ) + { + $this->inchannel = true; + } + elseif ($el == 'item' or $el == 'entry' ) + { + $this->initem = true; + if ( isset($attrs['rdf:about']) ) { + $this->current_item['about'] = $attrs['rdf:about']; + } + } + + // if we're in the default namespace of an RSS feed, + // record textinput or image fields + elseif ( + $this->feed_type == RSS and + $this->current_namespace == '' and + $el == 'textinput' ) + { + $this->intextinput = true; + } + + elseif ( + $this->feed_type == RSS and + $this->current_namespace == '' and + $el == 'image' ) + { + $this->inimage = true; + } + + # handle atom content constructs + elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) + { + // avoid clashing w/ RSS mod_content + if ($el == 'content' ) { + $el = 'atom_content'; + } + + $this->incontent = $el; + + + } + + // if inside an Atom content construct (e.g. content or summary) field treat tags as text + elseif ($this->feed_type == ATOM and $this->incontent ) + { + // if tags are inlined, then flatten + $attrs_str = join(' ', + array_map('map_attrs', + array_keys($attrs), + array_values($attrs) ) ); + + $this->append_content( "<{$element} {$attrs_str}>" ); + + array_unshift( $this->stack, $el ); + } + + // Atom support many links per containging element. + // Magpie treats link elements of type rel='alternate' + // as being equivalent to RSS's simple link element. + // + elseif ($this->feed_type == ATOM and $el == 'link' ) + { + if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) + { + $link_el = 'link'; + } + else { + $link_el = 'link_' . $attrs['rel']; + } + + $this->append($link_el, $attrs['href']); + } + // set stack[0] to current element + else { + array_unshift($this->stack, $el); + } + } + + + + function feed_cdata ($p, $text) { + + if ($this->feed_type == ATOM and $this->incontent) + { + $this->append_content( $text ); + } + else { + $current_el = join('_', array_reverse($this->stack)); + $this->append($current_el, $text); + } + } + + function feed_end_element ($p, $el) { + $el = strtolower($el); + + if ( $el == 'item' or $el == 'entry' ) + { + $this->items[] = $this->current_item; + $this->current_item = array(); + $this->initem = false; + } + elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) + { + $this->intextinput = false; + } + elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) + { + $this->inimage = false; + } + elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) + { + $this->incontent = false; + } + elseif ($el == 'channel' or $el == 'feed' ) + { + $this->inchannel = false; + } + elseif ($this->feed_type == ATOM and $this->incontent ) { + // balance tags properly + // note: i don't think this is actually neccessary + if ( $this->stack[0] == $el ) + { + $this->append_content(""); + } + else { + $this->append_content("<{$el} />"); + } + + array_shift( $this->stack ); + } + else { + array_shift( $this->stack ); + } + + $this->current_namespace = false; + } + + function concat (&$str1, $str2 = "") { + if (!isset($str1) ) { + $str1 = ""; + } + $str1 .= $str2; + } + + + + function append_content($text) { + if ( $this->initem ) { + $this->concat( $this->current_item[ $this->incontent ], $text ); + } + elseif ( $this->inchannel ) { + $this->concat( $this->channel[ $this->incontent ], $text ); + } + } + + // smart append - field and namespace aware + function append($el, $text) { + if (!$el) { + return; + } + if ( $this->current_namespace ) + { + if ( $this->initem ) { + $this->concat( + $this->current_item[ $this->current_namespace ][ $el ], $text); + } + elseif ($this->inchannel) { + $this->concat( + $this->channel[ $this->current_namespace][ $el ], $text ); + } + elseif ($this->intextinput) { + $this->concat( + $this->textinput[ $this->current_namespace][ $el ], $text ); + } + elseif ($this->inimage) { + $this->concat( + $this->image[ $this->current_namespace ][ $el ], $text ); + } + } + else { + if ( $this->initem ) { + $this->concat( + $this->current_item[ $el ], $text); + } + elseif ($this->intextinput) { + $this->concat( + $this->textinput[ $el ], $text ); + } + elseif ($this->inimage) { + $this->concat( + $this->image[ $el ], $text ); + } + elseif ($this->inchannel) { + $this->concat( + $this->channel[ $el ], $text ); + } + + } + } + + function normalize () { + // if atom populate rss fields + if ( $this->is_atom() ) { + $this->channel['description'] = $this->channel['tagline']; + for ( $i = 0; $i < count($this->items); $i++) { + $item = $this->items[$i]; + if ( isset($item['summary']) ) + $item['description'] = $item['summary']; + if ( isset($item['atom_content'])) + $item['content']['encoded'] = $item['atom_content']; + + $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified']; + if ( $atom_date ) { + $epoch = @parse_w3cdtf($item['modified']); + if ($epoch and $epoch > 0) { + $item['date_timestamp'] = $epoch; + } + } + + $this->items[$i] = $item; + } + } + elseif ( $this->is_rss() ) { + $this->channel['tagline'] = $this->channel['description']; + for ( $i = 0; $i < count($this->items); $i++) { + $item = $this->items[$i]; + if ( isset($item['description'])) + $item['summary'] = $item['description']; + if ( isset($item['content']['encoded'] ) ) + $item['atom_content'] = $item['content']['encoded']; + + if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) { + $epoch = @parse_w3cdtf($item['dc']['date']); + if ($epoch and $epoch > 0) { + $item['date_timestamp'] = $epoch; + } + } + elseif ( isset($item['pubdate']) ) { + $epoch = @strtotime($item['pubdate']); + if ($epoch > 0) { + $item['date_timestamp'] = $epoch; + } + } + + $this->items[$i] = $item; + } + } + } + + + function is_rss () { + if ( $this->feed_type == RSS ) { + return $this->feed_version; + } + else { + return false; + } + } + + function is_atom() { + if ( $this->feed_type == ATOM ) { + return $this->feed_version; + } + else { + return false; + } + } + + /** + * return XML parser, and possibly re-encoded source + * + */ + function create_parser($source, $out_enc, $in_enc, $detect) { + if ( substr(phpversion(), 0, 1) == 5) { + $parser = $this->php5_create_parser($in_enc, $detect); + } + else { + list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect); + } + if ($out_enc) { + $this->encoding = $out_enc; + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc); + } + + return array($parser, $source); + } + + /** + * Instantiate an XML parser under PHP5 + * + * PHP5 will do a fine job of detecting input encoding + * if passed an empty string as the encoding. + * + * All hail libxml2! + * + */ + function php5_create_parser($in_enc, $detect) { + // by default php5 does a fine job of detecting input encodings + if(!$detect && $in_enc) { + return xml_parser_create($in_enc); + } + else { + return xml_parser_create(''); + } + } + + /** + * Instaniate an XML parser under PHP4 + * + * Unfortunately PHP4's support for character encodings + * and especially XML and character encodings sucks. As + * long as the documents you parse only contain characters + * from the ISO-8859-1 character set (a superset of ASCII, + * and a subset of UTF-8) you're fine. However once you + * step out of that comfy little world things get mad, bad, + * and dangerous to know. + * + * The following code is based on SJM's work with FoF + * @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss + * + */ + function php4_create_parser($source, $in_enc, $detect) { + if ( !$detect ) { + return array(xml_parser_create($in_enc), $source); + } + + if (!$in_enc) { + if (preg_match('//m', $source, $m)) { + $in_enc = strtoupper($m[1]); + $this->source_encoding = $in_enc; + } + else { + $in_enc = 'UTF-8'; + } + } + + if ($this->known_encoding($in_enc)) { + return array(xml_parser_create($in_enc), $source); + } + + // the dectected encoding is not one of the simple encodings PHP knows + + // attempt to use the iconv extension to + // cast the XML to a known encoding + // @see http://php.net/iconv + + if (function_exists('iconv')) { + $encoded_source = iconv($in_enc,'UTF-8', $source); + if ($encoded_source) { + return array(xml_parser_create('UTF-8'), $encoded_source); + } + } + + // iconv didn't work, try mb_convert_encoding + // @see http://php.net/mbstring + if(function_exists('mb_convert_encoding')) { + $encoded_source = mb_convert_encoding($source, 'UTF-8', $in_enc ); + if ($encoded_source) { + return array(xml_parser_create('UTF-8'), $encoded_source); + } + } + + // else + $this->error("Feed is in an unsupported character encoding. ({$in_enc}) " . + "You may see strange artifacts, and mangled characters.", + E_USER_NOTICE); + + return array(xml_parser_create(), $source); + } + + function known_encoding($enc) { + $enc = strtoupper($enc); + if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) { + return $enc; + } + else { + return false; + } + } + + function error ($errormsg, $lvl=E_USER_WARNING) { + // append PHP's error message if track_errors enabled + if ( $php_errormsg ) { + $errormsg .= " ({$php_errormsg})"; + } + if ( MAGPIE_DEBUG ) { + trigger_error( $errormsg, $lvl); + } + else { + error_log( $errormsg, 0); + } + + $notices = E_USER_NOTICE|E_NOTICE; + if ( $lvl&$notices ) { + $this->WARNING = $errormsg; + } else { + $this->ERROR = $errormsg; + } + } + + +} // end class RSS + +function map_attrs($k, $v) { + return "$k=\"$v\""; +} + +function parse_w3cdtf ( $date_str ) { + + # regex to match wc3dtf + $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; + + if ( preg_match( $pat, $date_str, $match ) ) { + list( $year, $month, $day, $hours, $minutes, $seconds) = + array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); + + # calc epoch for current date assuming GMT + $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year); + + $offset = 0; + if ( $match[10] == 'Z' ) { + # zulu time, aka GMT + } + else { + list( $tz_mod, $tz_hour, $tz_min ) = + array( $match[8], $match[9], $match[10]); + + # zero out the variables + if ( ! $tz_hour ) { $tz_hour = 0; } + if ( ! $tz_min ) { $tz_min = 0; } + + $offset_secs = (($tz_hour * 60) + $tz_min) * 60; + + # is timezone ahead of GMT? then subtract offset + # + if ( $tz_mod == '+' ) { + $offset_secs = $offset_secs * -1; + } + + $offset = $offset_secs; + } + $epoch = $epoch + $offset; + return $epoch; + } + else { + return -1; + } +} + +?> diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php new file mode 100644 index 000000000..ee73de155 --- /dev/null +++ b/e107_handlers/mail.php @@ -0,0 +1,194 @@ +parseTemplate($EMAIL_HEADER); + $EMAIL_FOOTER = $tp->parseTemplate($EMAIL_FOOTER); + } +/* +Please note that mailed attachments have been found to be corrupted using php 4.3.3 +php 4.3.6 does NOT have this problem. +*/ +// Comment out the line below if you have trouble with some people not receiving emails. +// e107_ini_set(sendmail_path, "/usr/sbin/sendmail -t -f ".$pref['siteadminemail']); + +function sendemail($send_to, $subject, $message, $to_name, $send_from, $from_name, $attachments, $Cc, $Bcc, $returnpath, $returnreceipt,$inline ="") { + global $pref,$mailheader_e107id; + + require_once(e_HANDLER."phpmailer/class.phpmailer.php"); + + $mail = new PHPMailer(); + + if($mailheader_e107id){ + $mail->AddCustomHeader("X-e107-id: {$mailheader_e107id}"); + } + + if ($pref['mailer']== 'smtp') { + + if(isset($pref['smtp_pop3auth']) && $pref['smtp_pop3auth']){ + // http://www.corephp.co.uk/archives/18-POP-before-SMTP-Authentication-for-PHPMailer.html + require_once(e_HANDLER."phpmailer/class.pop3.php"); + $pop = new POP3(); + $pop->Authorise($pref['smtp_server'], 110, 30, $pref['smtp_username'], $pref['smtp_password'], 1); + } + + $mail->Mailer = "smtp"; + $mail->SMTPKeepAlive = FALSE; + $mail->Host = $pref['smtp_server']; + if($pref['smtp_username'] && $pref['smtp_password']){ + $mail->SMTPAuth = (isset($pref['smtp_pop3auth']) && $pref['smtp_pop3auth']) ? FALSE : TRUE; + $mail->Username = $pref['smtp_username']; + $mail->Password = $pref['smtp_password']; + $mail->PluginDir = e_HANDLER."phpmailer/"; + } + + } elseif ($pref['mailer']== 'sendmail'){ + $mail->Mailer = "sendmail"; + $mail->Sendmail = ($pref['sendmail']) ? $pref['sendmail'] : "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail']; + } else { + $mail->Mailer = "mail"; + } + + $to_name = ($to_name) ? $to_name: $send_to; + + $mail->CharSet = CHARSET; + $mail->From = ($send_from)? $send_from: $pref['siteadminemail']; + $mail->FromName = ($from_name)? $from_name: $pref['siteadmin']; + $mail->Subject = $subject; + $mail->SetLanguage("en",e_HANDLER."phpmailer/language/"); + + $lb = "\n"; + + + // Clean up the HTML. == + + if (preg_match('/<(font|br|a|img|b)/i', $message)) { + $Html = $message; // Assume html if it begins with one of these tags + } else { + $Html = htmlspecialchars($message); + $Html = preg_replace('%(http|ftp|https)(://\S+)%', '\1\2', $Html); + $Html = preg_replace('/([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i', '\\1\\2', $Html); + $Html = preg_replace('/([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})/i', '\\1', $Html); + $Html = str_replace("\n", "
    \n", $Html); + } + if (strpos($message,"") !== FALSE){ + $text = strstr($message,""); + }else{ + $text = $message; + } + $text = str_replace("
    ", "\n", $text); + $text = strip_tags(str_replace("
    ", "\n", $text)); + + $mail->Body = $Html; //Main message is HTML + $mail->IsHTML(TRUE); + $mail->AltBody = $text; //Include regular plaintext as well + + + $tmp = explode(",",$send_to); + foreach($tmp as $adr){ + $mail->AddAddress($adr, $to_name); + } + + + if ($attachments){ + if (is_array($attachments)) { + foreach($attachments as $attach){ + if(is_readable($attach)){ + $mail->AddAttachment($attach, basename($attach),"base64",mime_content_type($attach)); + } + } + }else{ + if(is_readable($attachments)){ + $mail->AddAttachment($attachments, basename($attachments),"base64",mime_content_type($attachments)); + } + } + } + + if($inline){ + $tmp = explode(",",$inline); + foreach($tmp as $inline_img){ + if(is_readable($inline_img) && !is_dir($inline_img)){ + $mail->AddEmbeddedImage($inline_img, md5($inline_img), basename($inline_img),"base64",mime_content_type($inline_img)); + } + } + } + + + if($Cc){ + if($mail->Mailer == "mail"){ + $mail->AddCustomHeader("Cc: {$Cc}"); + }else{ + $tmp = explode(",",$Cc); + foreach($tmp as $addc){ + $mail->AddCC($addc); + } + } + } + + if($Bcc){ + if($mail->Mailer == "mail"){ + $mail->AddCustomHeader("Bcc: {$Bcc}"); + }else{ + $tmp = explode(",",$Bcc); + foreach($tmp as $addbc){ + $mail->AddBCC($addbc); + } + } + } + + if($pref['mail_bounce_email'] !=''){ + $mail->Sender = $pref['mail_bounce_email']; + } + + if (!$mail->Send()) { + // echo "There has been a mail error sending to " . $row["email"] . "
    "; + return FALSE; + // Clear all addresses and attachments for next loop + $mail->ClearAddresses(); + $mail->ClearAttachments(); + } else { + // Clear all addresses and attachments for next loop + $mail->ClearAddresses(); + $mail->ClearAttachments(); + return TRUE; + } + +} + +/* Deprecated. + Use mail_validation_class.php instead. +function validatemail($Email) { + +} +*/ + + + +?> \ No newline at end of file diff --git a/e107_handlers/mail_validation_class.php b/e107_handlers/mail_validation_class.php new file mode 100644 index 000000000..bb70795e0 --- /dev/null +++ b/e107_handlers/mail_validation_class.php @@ -0,0 +1,232 @@ +next_token; + } + for($character=0;$characternext_token=substr($string,$found+1); + return(substr($string,0,$found)); + } + else + { + $this->next_token=""; + return($string); + } + } + + Function OutputDebug($message) + { + $message.="\n"; + if($this->html_debug) + $message=str_replace("\n","
    \n",HtmlEntities($message)); + echo $message; + flush(); + } + + Function GetLine($connection) + { + for($line="";;) + { + if(feof($connection)) + return(0); + $line.=fgets($connection,100); + $length=strlen($line); + if($length>=2 + && substr($line,$length-2,2)=="\r\n") + { + $line=substr($line,0,$length-2); + if($this->debug) + $this->OutputDebug("S $line"); + return($line); + } + } + } + + Function PutLine($connection,$line) + { + if($this->debug) + $this->OutputDebug("C $line"); + return(fputs($connection,"$line\r\n")); + } + + Function ValidateEmailAddress($email) + { + if(IsSet($this->preg)) + { + if(strlen($this->preg)) + return(preg_match($this->preg,$email)); + } + else + { + $this->preg=(function_exists("preg_match") ? "/".str_replace("/", "\\/", $this->email_regular_expression)."/" : ""); + return($this->ValidateEmailAddress($email)); + } + return(eregi($this->email_regular_expression,$email)!=0); + } + + Function ValidateEmailHost($email,&$hosts) + { + if(!$this->ValidateEmailAddress($email)) + return(0); + $user=$this->Tokenize($email,"@"); + $domain=$this->Tokenize(""); + $hosts=$weights=array(); + $getmxrr=$this->getmxrr; + if(function_exists($getmxrr) + && $getmxrr($domain,$hosts,$weights)) + { + $mxhosts=array(); + for($host=0;$hostexclude_address)==0 + || strcmp(@gethostbyname($this->exclude_address),$ip))) + $hosts[]=$domain; + } + return(count($hosts)!=0); + } + + Function VerifyResultLines($connection,$code) + { + while(($line=$this->GetLine($connection))) + { + $this->last_code=$this->Tokenize($line," -"); + if(strcmp($this->last_code,$code)) + return(0); + if(!strcmp(substr($line, strlen($this->last_code), 1)," ")) + return(1); + } + return(-1); + } + + Function ValidateEmailBox($email) + { + if(!$this->ValidateEmailHost($email,$hosts)) + return(0); + if(!strcmp($localhost=$this->localhost,"") + && !strcmp($localhost=getenv("SERVER_NAME"),"") + && !strcmp($localhost=getenv("HOST"),"")) + $localhost="localhost"; + if(!strcmp($localuser=$this->localuser,"") + && !strcmp($localuser=getenv("USERNAME"),"") + && !strcmp($localuser=getenv("USER"),"")) + $localuser="root"; + for($host=0;$hostdebug) + $this->OutputDebug("Resolving host name \"".$hosts[$host]."\"..."); + if(!strcmp($ip=@gethostbyname($domain),$domain)) + { + if($this->debug) + $this->OutputDebug("Could not resolve host name \"".$hosts[$host]."\"."); + continue; + } + } + if(strlen($this->exclude_address) + && !strcmp(@gethostbyname($this->exclude_address),$ip)) + { + if($this->debug) + $this->OutputDebug("Host address of \"".$hosts[$host]."\" is the exclude address"); + continue; + } + if($this->debug) + $this->OutputDebug("Connecting to host address \"".$ip."\"..."); + if(($connection=($this->timeout ? @fsockopen($ip,25,$errno,$error,$this->timeout) : @fsockopen($ip,25)))) + { + $timeout=($this->data_timeout ? $this->data_timeout : $this->timeout); + if($timeout + && function_exists("socket_set_timeout")) + socket_set_timeout($connection,$timeout,0); + if($this->debug) + $this->OutputDebug("Connected."); + if($this->VerifyResultLines($connection,"220")>0 + && $this->PutLine($connection,"HELO $localhost") + && $this->VerifyResultLines($connection,"250")>0 + && $this->PutLine($connection,"MAIL FROM: <$localuser@$localhost>") + && $this->VerifyResultLines($connection,"250")>0 + && $this->PutLine($connection,"RCPT TO: <$email>") + && ($result=$this->VerifyResultLines($connection,"250"))>=0) + { + if($result) + { + if($this->PutLine($connection,"DATA")) + $result=($this->VerifyResultLines($connection,"354")!=0); + } + else + { + if(strlen($this->last_code) + && !strcmp($this->last_code[0],"4")) + $result=-1; + } + if($this->debug) + $this->OutputDebug("This host states that the address is ".($result ? ($result>0 ? "valid" : "undetermined") : "not valid")."."); + $this->PutLine($connection,"QUIT"); + fclose($connection); + if($this->debug) + $this->OutputDebug("Disconnected."); + return($result); + } + if($this->debug) + $this->OutputDebug("Unable to validate the address with this host."); + fclose($connection); + if($this->debug) + $this->OutputDebug("Disconnected."); + } + else + { + if($this->debug) + $this->OutputDebug("Failed."); + } + } + return(-1); + } +}; + +?> \ No newline at end of file diff --git a/e107_handlers/message_handler.php b/e107_handlers/message_handler.php new file mode 100644 index 000000000..b58297ecb --- /dev/null +++ b/e107_handlers/message_handler.php @@ -0,0 +1,95 @@ +".LAN_ERROR_25.""; + $emessage[2] = "".LAN_ERROR_26.""; + $emessage[3] = "".LAN_ERROR_27.""; + $emessage[4] = "".LAN_ERROR_28.""; + $emessage[5] = LAN_ERROR_29; + $emessage[6] = "".LAN_ERROR_30.""; + $emessage[7] = "".LAN_ERROR_31.""; + $emessage[8] = " +
    ".LAN_ERROR_32."

    + ".chr(36)."ADMIN_DIRECTORY = \"e107_admin/\";
    + ".chr(36)."FILES_DIRECTORY = \"e107_files/\";
    + ".chr(36)."IMAGES_DIRECTORY = \"e107_images/\";
    + ".chr(36)."THEMES_DIRECTORY = \"e107_themes/\";
    + ".chr(36)."PLUGINS_DIRECTORY = \"e107_plugins/\";
    + ".chr(36)."HANDLERS_DIRECTORY = \"e107_handlers/\";
    + ".chr(36)."LANGUAGES_DIRECTORY = \"e107_languages/\";
    + ".chr(36)."HELP_DIRECTORY = \"e107_docs/help/\";
    + ".chr(36)."DOWNLOADS_DIRECTORY = \"e107_files/downloads/\";\n +
    "; + + if (class_exists('e107table')) { + $ns = new e107table; + } + switch($mode) { + case "CRITICAL_ERROR": + $message = $emessage[$message] ? $emessage[$message] : $message; + echo "
    CRITICAL_ERROR:
    Line $line $file

    Error reported as: ".$message."
    "; + break; + + case "MESSAGE": + if(strstr(e_SELF, "forum_post.php")) + { + return; + } + $ns->tablerender("", "
    {$message}
    "); + break; + + case "ADMIN_MESSAGE": + $ns->tablerender("Admin Message", "
    {$message}
    "); + break; + + case "ALERT": + $message = $emessage[$message] ? $emessage[$message] : $message; + echo "\n"; exit; + break; + + case "P_ALERT": + echo "\n"; + break; + + case "POPUP": + + $mtext = "Message
    --- Message ---

    ".$message."

    "; + + echo " + "; + + break; + + } +} + +?> diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php new file mode 100644 index 000000000..3a27b3e42 --- /dev/null +++ b/e107_handlers/mysql_class.php @@ -0,0 +1,734 @@ +BumpWho('Create db object', 1); + $langid = 'e107language_'.$pref['cookie_name']; + if ($pref['user_tracking'] == 'session') { + if (!isset($_SESSION[$langid])) { return; } + $this->mySQLlanguage = $_SESSION[$langid]; + } else { + if (!isset($_COOKIE[$langid])) { return; } + $this->mySQLlanguage = $_COOKIE[$langid]; + } + } + + /** + * @return null or string error code + * @param string $mySQLserver IP Or hostname of the MySQL server + * @param string $mySQLuser MySQL username + * @param string $mySQLpassword MySQL Password + * @param string $mySQLdefaultdb The database schema to connect to + * @desc Connects to mySQL server and selects database - generally not required if your table is in the main DB.
    + *
    + * Example using e107 database with variables defined in config.php:
    + * $sql = new db; + * $sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb); + *
    + * OR to connect an other database:
    + * $sql = new db; + * $sql->db_Connect('url_server_database', 'user_database', 'password_database', 'name_of_database'); + * + * @access public + */ + function db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb) { + global $eTraffic; + $eTraffic->BumpWho('db Connect', 1); + + $this->mySQLserver = $mySQLserver; + $this->mySQLuser = $mySQLuser; + $this->mySQLpassword = $mySQLpassword; + $this->mySQLdefaultdb = $mySQLdefaultdb; + + $temp = $this->mySQLerror; + $this->mySQLerror = FALSE; + if(defined("USE_PERSISTANT_DB") && USE_PERSISTANT_DB == true){ + if (!$this->mySQLaccess = @mysql_pconnect($this->mySQLserver, $this->mySQLuser, $this->mySQLpassword)) { + return 'e1'; + } else { + if (!@mysql_select_db($this->mySQLdefaultdb)) { + return 'e2'; + } else { + $this->dbError('dbConnect/SelectDB'); + } + } + } else { + if (!$this->mySQLaccess = @mysql_connect($this->mySQLserver, $this->mySQLuser, $this->mySQLpassword)) { + return 'e1'; + } else { + if (!@mysql_select_db($this->mySQLdefaultdb)) { + return 'e2'; + } else { + $this->dbError('dbConnect/SelectDB'); + } + } + } + } + + /** + * @return void + * @param unknown $sMarker + * @desc Enter description here... + * @access private + */ + function db_Mark_Time($sMarker) { + if (E107_DEBUG_LEVEL > 0) { + global $db_debug; + $db_debug->Mark_Time($sMarker); + } + } + + /** + * @return void + * @desc Enter description here... + * @access private + */ + function db_Show_Performance() { + return $db_debug->Show_Performance(); + } + + /** + * @return void + * @desc add query to dblog table + * @access private + */ + function db_Write_log($log_type = '', $log_remark = '', $log_query = '') { + global $tp, $e107; + $d = time(); + $uid = (USER) ? USERID : '0'; + $ip = $e107->getip(); + $qry = $tp->toDB($log_query); + $this->db_Insert('dblog', "0, '{$log_type}', {$d}, {$uid}, '{$ip}', '{$qry}', '{$log_remark}'"); + } + + /** + * @return unknown + * @param unknown $query + * @param unknown $rli + * @desc Enter description here... + * @access private + */ + function db_Query($query, $rli = NULL, $qry_from = '', $debug = FALSE, $log_type = '', $log_remark = '') { + global $db_time,$db_mySQLQueryCount,$queryinfo, $eTraffic; + $db_mySQLQueryCount++; + + if ($debug == 'now') { + echo "** $query"; + } + if ($debug !== FALSE || strstr(e_QUERY, 'showsql')) + { + $queryinfo[] = "{$qry_from}: $query"; + } + if ($log_type != '') { + $this->db_Write_log($log_type, $log_remark, $query); + } + + $b = microtime(); + $sQryRes = is_null($rli) ? @mysql_query($query) : @mysql_query($query, $rli); + $e = microtime(); + + $eTraffic->Bump('db_Query', $b, $e); + $mytime = $eTraffic->TimeDelta($b,$e); + $db_time += $mytime; + $this->mySQLresult = $sQryRes; + if (E107_DEBUG_LEVEL) { + global $db_debug; + $aTrace = debug_backtrace(); + $pTable = $this->mySQLcurTable; + if (!strlen($pTable)) { + $pTable = '(complex query)'; + } else { + $this->mySQLcurTable = ''; // clear before next query + } + if(is_object($db_debug)) { + $nFields = $db_debug->Mark_Query($query, $rli, $sQryRes, $aTrace, $mytime, $pTable); + } else { + echo "what happened to db_debug??!!
    "; + } + } + return $sQryRes; + } + + /** + * @return int Number of rows or false on error + * + * @param string $table Table name to select data from + * @param string $fields Table fields to be retrieved, default * (all in table) + * @param string $arg Query arguments, default null + * @param string $mode Argument has WHERE or not, default=default (WHERE) + * + * @param bool $debug Debug mode on or off + * + * @desc Perform a mysql_query() using the arguments suplied by calling db::db_Query()
    + *
    + * If you need more requests think to call the class.
    + *
    + * Example using a unique connection to database:
    + * $sql->db_Select("comments", "*", "comment_item_id = '$id' AND comment_type = '1' ORDER BY comment_datestamp");
    + *
    + * OR as second connection:
    + * $sql2 = new db; + * $sql2->db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT $from, ".$view, 'no_where'); + * + * @access public + */ + function db_Select($table, $fields = '*', $arg = '', $mode = 'default', $debug = FALSE, $log_type = '', $log_remark = '') { + global $db_mySQLQueryCount; + $table = $this->db_IsLang($table); + $this->mySQLcurTable = $table; + if ($arg != '' && $mode == 'default') + { + if ($this->mySQLresult = $this->db_Query('SELECT '.$fields.' FROM '.MPREFIX.$table.' WHERE '.$arg, NULL, 'db_Select', $debug, $log_type, $log_remark)) { + $this->dbError('dbQuery'); + return $this->db_Rows(); + } else { + $this->dbError("db_Select (SELECT $fields FROM ".MPREFIX."{$table} WHERE {$arg})"); + return FALSE; + } + } elseif ($arg != '' && $mode != 'default') { + if ($this->mySQLresult = $this->db_Query('SELECT '.$fields.' FROM '.MPREFIX.$table.' '.$arg, NULL, 'db_Select', $debug, $log_type, $log_remark)) { + $this->dbError('dbQuery'); + return $this->db_Rows(); + } else { + $this->dbError("db_Select (SELECT {$fields} FROM ".MPREFIX."{$table} {$arg})"); + return FALSE; + } + } else { + if ($this->mySQLresult = $this->db_Query('SELECT '.$fields.' FROM '.MPREFIX.$table, NULL, 'db_Select', $debug, $log_type, $log_remark)) { + $this->dbError('dbQuery'); + return $this->db_Rows(); + } else { + $this->dbError("db_Select (SELECT {$fields} FROM ".MPREFIX."{$table})"); + return FALSE; + } + } + } + + /** + * @return int Last insert ID or false on error + * @param string $table + * @param string $arg + * @param string $debug + * @desc Insert a row into the table
    + *
    + * Example:
    + * $sql->db_Insert("links", "0, 'News', 'news.php', '', '', 1, 0, 0, 0"); + * + * @access public + */ + function db_Insert($table, $arg, $debug = FALSE, $log_type = '', $log_remark = '') { + $table = $this->db_IsLang($table); + $this->mySQLcurTable = $table; + if(is_array($arg)) + { + foreach($arg as $k => $v) + { + $keyList .= ($keyList ? ",`{$k}`" : "`{$k}`"); + $valList .= ($valList ? ",'{$v}'" : "'{$v}'"); + } + $query = "INSERT INTO `".MPREFIX."{$table}` ({$keyList}) VALUES ({$valList})"; + } + else + { + $query = 'INSERT INTO '.MPREFIX."{$table} VALUES ({$arg})"; + } + + if ($result = $this->mySQLresult = $this->db_Query($query, NULL, 'db_Insert', $debug, $log_type, $log_remark )) { + $tmp = mysql_insert_id(); + return $tmp; + } else { + $this->dbError("db_Insert ($query)"); + return FALSE; + } + } + + /** + * @return int number of affected rows, or false on error + * @param string $table + * @param string $arg + * @param bool $debug + * @desc Update fields in ONE table of the database corresponding to your $arg variable
    + *
    + * Think to call it if you need to do an update while retrieving data.
    + *
    + * Example using a unique connection to database:
    + * $sql->db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' "); + *
    + * OR as second connection
    + * $sql2 = new db; + * $sql2->db_Update("user", "user_viewed = '$u_new' WHERE user_id = '".USERID."' ");
    + * + * @access public + */ + function db_Update($table, $arg, $debug = FALSE, $log_type = '', $log_remark = '') { + $table = $this->db_IsLang($table); + $this->mySQLcurTable = $table; + if ($result = $this->mySQLresult = $this->db_Query('UPDATE '.MPREFIX.$table.' SET '.$arg, NULL, 'db_Update', $debug, $log_type, $log_remark)) { + $result = mysql_affected_rows(); + return $result; + } else { + $this->dbError("db_Update ($query)"); + return FALSE; + } + } + + /** + * @return array MySQL row + * @param string $mode + * @desc Fetch an array containing row data (see PHP's mysql_fetch_array() docs)
    + *
    + * Example :
    + * while($row = $sql->db_Fetch()){ + * $text .= $row['username']; + * } + * + * @access public + */ + function db_Fetch() { + global $eTraffic; + $b = microtime(); + $row = @mysql_fetch_array($this->mySQLresult); + $eTraffic->Bump('db_Fetch', $b); + if ($row) { + $this->dbError('db_Fetch'); + return $row; + } else { + $this->dbError('db_Fetch'); + return FALSE; + + } + } + + /** + * @return int number of affected rows or false on error + * @param string $table + * @param string $fields + * @param string $arg + * @desc Count the number of rows in a select
    + *
    + * Example:
    + * $topics = $sql->db_Count("forum_t", "(*)", " WHERE thread_forum_id='".$forum_id."' AND thread_parent='0' "); + * + * @access public + */ + function db_Count($table, $fields = '(*)', $arg = '', $debug = FALSE, $log_type = '', $log_remark = '') { + $table = $this->db_IsLang($table); + + if ($fields == 'generic') { + $query=$table; + if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Count', $debug, $log_type, $log_remark)) { + $rows = $this->mySQLrows = @mysql_fetch_array($this->mySQLresult); + return $rows['COUNT(*)']; + } else { + $this->dbError("dbCount ($query)"); + return FALSE; + } + } + + $this->mySQLcurTable = $table; + $query='SELECT COUNT'.$fields.' FROM '.MPREFIX.$table.' '.$arg; + if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Count', $debug, $log_type, $log_remark)) { + $rows = $this->mySQLrows = @mysql_fetch_array($this->mySQLresult); + return $rows[0]; + } else { + $this->dbError("dbCount ($query)"); + return FALSE; + } + } + + /** + * @return void + * @desc Closes the mySQL server connection.
    + *
    + * Only required if you open a second connection.
    + * Native e107 connection is closed in the footer.php file
    + *
    + * Example :
    + * $sql->db_Close(); + * + * @access public + */ + function db_Close() { + global $eTraffic; + $eTraffic->BumpWho('db Close', 1); + mysql_close(); + $this->dbError('dbClose'); + } + + /** + * @return int number of affected rows, or false on error + * @param string $table + * @param string $arg + * @desc Delete rows from a table
    + *
    + * Example: + * $sql->db_Delete("tmp", "tmp_ip='$ip'");
    + *
    + * @access public + */ + function db_Delete($table, $arg = '', $debug = FALSE, $log_type = '', $log_remark = '') { + $table = $this->db_IsLang($table); + $this->mySQLcurTable = $table; + if (!$arg) { + if ($result = $this->mySQLresult = $this->db_Query('DELETE FROM '.MPREFIX.$table, NULL, 'db_Delete', $debug, $log_type, $log_remark)) { + return $result; + } else { + $this->dbError("db_Delete ($arg)"); + return FALSE; + } + } else { + if ($result = $this->mySQLresult = $this->db_Query('DELETE FROM '.MPREFIX.$table.' WHERE '.$arg, NULL, 'db_Delete', $debug, $log_type, $log_remark)) { + $tmp = mysql_affected_rows(); + return $tmp; + } else { + $this->dbError('db_Delete ('.$arg.')'); + return FALSE; + } + } + } + + /** + * @return unknown + * @desc Enter description here... + * @access private + */ + function db_Rows() { + $rows = $this->mySQLrows = @mysql_num_rows($this->mySQLresult); + return $rows; + $this->dbError('db_Rows'); + } + + /** + * @return unknown + * @param unknown $from + * @desc Enter description here... + * @access private + */ + function dbError($from) { + if ($error_message = @mysql_error()) { + if ($this->mySQLerror == TRUE) { + message_handler('ADMIN_MESSAGE', 'mySQL Error! Function: '.$from.'. ['.@mysql_errno().' - '.$error_message.']', __LINE__, __FILE__); + return $error_message; + } + } + } + + /** + * @return void + * @param unknown $mode + * @desc Enter description here... + * @access private + */ + function db_SetErrorReporting($mode) { + $this->mySQLerror = $mode; + } + + + /** + * @return unknown + * @param unknown $arg + * @desc Enter description here... + * @access private + */ + function db_Select_gen($query, $debug = FALSE, $log_type = '', $log_remark = '') { + + /* + changes by jalist 19/01/05: + added string replace on table prefix to tidy up long database queries + usage: instead of sending "SELECT * FROM ".MPREFIX."table", do "SELECT * FROM #table" + */ + + $this->tabset = FALSE; + if(strpos($query,'#') !== FALSE) { + $query = preg_replace_callback("/\s#([\w]*?)\W/", array($this, 'ml_check'), $query); + } + if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Select_gen', $debug, $log_type, $log_remark)) { + $this->dbError('db_Select_gen'); + return $this->db_Rows(); + } else { + $this->dbError('dbQuery ('.$query.')'); + return FALSE; + } + } + + function ml_check($matches) { + $table = $this->db_IsLang($matches[1]); + if($this->tabset == false) { + $this->mySQLcurTable = $table; + $this->tabset = true; + } + return " ".MPREFIX.$table.substr($matches[0],-1); + } + + /** + * @return unknown + * @param unknown $offset + * @desc Enter description here... + * @access private + */ + function db_Fieldname($offset) { + $result = @mysql_field_name($this->mySQLresult, $offset); + return $result; + } + + /** + * @return unknown + * @desc Enter description here... + * @access private + */ + function db_Field_info() { + $result = @mysql_fetch_field($this->mySQLresult); + return $result; + } + + /** + * @return unknown + * @desc Enter description here... + * @access private + */ + function db_Num_fields() { + $result = @mysql_num_fields($this->mySQLresult); + return $result; + } + + /** + * @return unknown + * @param unknown $table + * @desc Enter description here... + * @access private + */ + function db_IsLang($table,$multiple=FALSE) { + global $pref, $mySQLtablelist; + if ((!$this->mySQLlanguage || !$pref['multilanguage']) && $multiple==FALSE) { + return $table; + } + + if (!$mySQLtablelist) { + $tablist = mysql_list_tables($this->mySQLdefaultdb); + while (list($temp) = mysql_fetch_array($tablist)) { + $mySQLtablelist[] = $temp; + } + } + + $mltable = "lan_".strtolower($this->mySQLlanguage.'_'.$table); + + // ---- Find all multi-language tables. + + if($multiple == TRUE){ // return an array of all matching language tables. eg [french]->e107_lan_news + if(!is_array($table)){ + $table = array($table); + } + + foreach($mySQLtablelist as $tab){ + if(stristr($tab, MPREFIX."lan_") !== FALSE){ + $tmp = explode("_",str_replace(MPREFIX."lan_","",$tab)); + $lng = $tmp[0]; + foreach($table as $t){ + if(eregi($t."$",$tab)){ + $lanlist[$lng][MPREFIX.$t] = $tab; + } + } + } + } + return ($lanlist) ? $lanlist : FALSE; + } + // ------------------------- + + if (in_array(MPREFIX.$mltable, $mySQLtablelist)) { + return $mltable; + } + return $table; + } + + /** + * @return array + * @param string fields to retrieve + * @desc returns fields as structured array + * @access public + */ + function db_getList($fields = 'ALL', $amount = FALSE, $maximum = FALSE, $ordermode=FALSE) { + $list = array(); + $counter = 1; + while ($row = $this->db_Fetch()) { + foreach($row as $key => $value) { + if (is_string($key)) { + if (strtoupper($fields) == 'ALL' || in_array ($key, $fields)) { + + if(!$ordermode) + { + $list[$counter][$key] = $value; + } + else + { + $list[$row[$ordermode]][$key] = $value; + } + } + } + } + if ($amount && $amount == $counter || ($maximum && $counter > $maximum)) { + break; + } + $counter++; + } + return $list; + } + + /** + * @return integer + * @desc returns total number of queries made so far + * @access public + */ + function db_QueryCount() { + global $db_mySQLQueryCount; + return $db_mySQLQueryCount; + } + + + /* + Multi-language Query Function. + */ + + + function db_Query_all($query,$debug=""){ + $error = ""; + + $query = str_replace("#",MPREFIX,$query); + + if(!$this->db_Query($query)){ // run query on the default language first. + $error .= $query. " failed"; + } + + $tmp = explode(" ",$query); + foreach($tmp as $val){ + if(strpos($val,MPREFIX) !== FALSE){ + $table[] = str_replace(MPREFIX,"",$val); + $search[] = $val; + } + } + + // Loop thru relevant language tables and replace each tablename within the query. + if($tablist = $this->db_IsLang($table,TRUE)){ + foreach($tablist as $key=>$tab){ + $querylan = $query; + foreach($search as $find){ + $lang = $key; + $replace = ($tab[$find] !="") ? $tab[$find] : $find; + $querylan = str_replace($find,$replace,$querylan); + } + + if(!$this->db_Query($querylan)){ // run query on other language tables. + $error .= $querylan." failed for language"; + } + if($debug){ echo "
    ** lang= ".$querylan; } + } + } + + + return ($error)? FALSE : TRUE; + } + + // Determines if a plugin field (and key) exist. OR if fieldid is numeric - return the field name in that position. + function db_Field($table,$fieldid="",$key=""){ + if(!$this->mySQLdefaultdb){ + global $mySQLdefaultdb; + $this->mySQLdefaultdb = $mySQLdefaultdb; + } + $convert = array("PRIMARY"=>"PRI","INDEX"=>"MUL","UNIQUE"=>"UNI"); + $key = ($convert[$key]) ? $convert[$key] : "OFF"; + + $result = mysql_query("SHOW COLUMNS FROM ".MPREFIX.$table); + if (mysql_num_rows($result) > 0) { + $c=0; + while ($row = mysql_fetch_assoc($result)) { + if(is_numeric($fieldid)) + { + if($c == $fieldid) + { + return $row['Field']; // field number matches. + } + } + else + { + if(($key == "") && ($fieldid == $row['Field'])) + { + return TRUE; // key not in use, but field matches. + } + elseif(($fieldid == $row['Field']) && $key == $row['Key']) + { + return TRUE; + } + + } + $c++; + } + } + + return FALSE; + + } + + /** + * A pointer to mysql_real_escape_string() - see http://www.php.net/mysql_real_escape_string + * + * @param string $data + * @return string + */ + function escape($data, $strip = true) { + if ($strip) { + $data = strip_if_magic($data); + } + return mysql_real_escape_string($data); + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php new file mode 100644 index 000000000..5b762374d --- /dev/null +++ b/e107_handlers/news_class.php @@ -0,0 +1,203 @@ +toDB($news['news_title']); + $news['news_body'] = $tp->toDB($news['data']); + $news['news_extended'] = $tp->toDB($news['news_extended']); + $news['news_summary'] = $tp->toDB($news['news_summary']); + $news['news_userid'] = ($news['news_userid']) ? $news['news_userid'] : USERID; + if(!isset($news['news_sticky'])) {$news['news_sticky'] = 0;} + $author_insert = ($news['news_author'] == 0) ? "news_author = '".USERID."'," : ""; + $news['news_author'] = ($news['news_author']) ? $news['news_author'] : USERID; + + if ($news['news_id']) { + $vals = "news_datestamp = '".intval($news['news_datestamp'])."', ".$author_insert." news_title='".$news['news_title']."', news_body='".$news['news_body']."', news_extended='".$news['news_extended']."', news_category='".intval($news['cat_id'])."', news_allow_comments='".intval($news['news_allow_comments'])."', news_start='".intval($news['news_start'])."', news_end='".intval($news['news_end'])."', news_class='".$tp->toDB($news['news_class'])."', news_render_type='".intval($news['news_rendertype'])."' , news_summary='".$news['news_summary']."', news_thumbnail='".$tp->toDB($news['news_thumbnail'])."', news_sticky='".intval($news['news_sticky'])."' WHERE news_id='".intval($news['news_id'])."' "; + if ($sql -> db_Update('news', $vals)) { + $e_event -> trigger('newsupd', $news); + $message = LAN_NEWS_21; + $e107cache -> clear('news.php'); + } else { + $message = "".(!mysql_errno() ? LAN_NEWS_46 : LAN_NEWS_5).""; + } + } else { + if ($sql ->db_Insert('news', "0, '".$news['news_title']."', '".$news['news_body']."', '".$news['news_extended']."', ".intval($news['news_datestamp']).", ".intval($news['news_author']).", '".intval($news['cat_id'])."', '".intval($news['news_allow_comments'])."', '".intval($news['news_start'])."', '".intval($news['news_end'])."', '".$tp->toDB($news['news_class'])."', '".intval($news['news_rendertype'])."', '0' , '".$news['news_summary']."', '".$tp->toDB($news['news_thumbnail'])."', '".intval($news['news_sticky'])."' ")) { + $e_event -> trigger('newspost', $news); + $message = LAN_NEWS_6; + $e107cache -> clear('news.php'); + } else { + $message = "".LAN_NEWS_7.""; + } + } + + /* trackback */ + if($pref['trackbackEnabled']) + { + $excerpt = substr($news['news_body'], 0, 100)."..."; + $id=mysql_insert_id(); + $permLink = $e107->base_path."comment.php?comment.news.{$id}"; + + require_once(e_PLUGIN."trackback/trackbackClass.php"); + $trackback = new trackbackClass(); + + if($_POST['trackback_urls']) + { + $urlArray = explode("\n", $_POST['trackback_urls']); + foreach($urlArray as $pingurl) { + if(!$error = $trackback -> sendTrackback($permLink, $pingurl, $news['news_title'], $excerpt)) + { + $message .= "
    successfully pinged {$pingurl}."; + } else { + $message .= "
    was unable to ping {$pingurl}
    [ Error message returned was : '{$error}'. ]"; + } + } + } + + if(isset($_POST['pingback_urls'])) + { + if ($urlArray = $trackback -> getPingUrls($news['news_body'])) + { + foreach($urlArray as $pingurl) + { + + if ($trackback -> sendTrackback($permLink, $pingurl, $news['news_title'], $excerpt)) + { + $message .= "
    successfully pinged {$pingurl}."; + } + else + { + $message .= "Pingback to {$pingurl} failed ..."; + } + } + } + else + { + $message .= "
    No pingback addresses were discovered"; + } + } + } + + /* end trackback */ + + return $message; + } + + function render_newsitem($news, $mode = 'default', $n_restrict = '', $NEWS_TEMPLATE = '', $param='') { + global $tp, $sql, $override, $pref, $ns, $NEWSSTYLE, $NEWSLISTSTYLE, $news_shortcodes, $loop_uid; + if ($override_newsitem = $override -> override_check('render_newsitem')) { + $result = call_user_func($override_newsitem, $news, $mode, $n_restrict, $NEWS_TEMPLATE, $param); + if ($result == 'return') { + return; + } + } + if (!is_object($tp)) $tp = new e_parse; + + if ($n_restrict == 'userclass') { + $news['news_id'] = 0; + $news['news_title'] = LAN_NEWS_1; + $news['data'] = LAN_NEWS_2; + $news['news_extended'] = ""; + $news['news_allow_comments'] = 1; + $news['news_start'] = 0; + $news['news_end'] = 0; + $news['news_render_type'] = 0; + $news['comment_total'] = 0; + } + + if (!$param) { + if (!defined("IMAGE_nonew_small")){ + define("IMAGE_nonew_small", (file_exists(THEME."images/nonew_comments.png") ? " " : "")); + } + if (!defined("IMAGE_new_small")) { + define("IMAGE_new_small", (file_exists(THEME."images/new_comments.png") ? " " : " ")); + } + if (!defined("IMAGE_sticky")){ + define("IMAGE_sticky", (file_exists(THEME."images/sticky.png") ? " " : " ")); + } + + $param['image_nonew_small'] = IMAGE_nonew_small; + $param['image_new_small'] = IMAGE_new_small; + $param['image_sticky'] = IMAGE_sticky; + $param['caticon'] = ICONSTYLE; + $param['commentoffstring'] = COMMENTOFFSTRING; + $param['commentlink'] = COMMENTLINK; + $param['trackbackstring'] = (defined("TRACKBACKSTRING") ? TRACKBACKSTRING : ""); + $param['trackbackbeforestring'] = (defined("TRACKBACKBEFORESTRING") ? TRACKBACKBEFORESTRING : ""); + $param['trackbackafterstring'] = (defined("TRACKBACKAFTERSTRING") ? TRACKBACKAFTERSTRING : ""); + $param['itemlink'] = (defined("NEWSLIST_ITEMLINK")) ? NEWSLIST_ITEMLINK : ""; + $param['thumbnail'] =(defined("NEWSLIST_THUMB")) ? NEWSLIST_THUMB : "border:0px"; + $param['catlink'] = (defined("NEWSLIST_CATLINK")) ? NEWSLIST_CATLINK : ""; + $param['caticon'] = (defined("NEWSLIST_CATICON")) ? NEWSLIST_CATICON : ICONSTYLE; + } + + cachevars('current_news_item', $news); + cachevars('current_news_param', $param); + + if ($news['news_render_type'] == 1 && $mode != "extend") { + if (function_exists("news_list")) { + $NEWS_PARSE = news_list($news); + } else if ($NEWSLISTSTYLE) { + $NEWS_PARSE = $NEWSLISTSTYLE; + } else { + $NEWS_PARSE = "{NEWSICON} {NEWSTITLELINK}
    {NEWSAUTHOR} ".LAN_NEWS_100." {NEWSDATE} | {NEWSCOMMENTS}
    "; + } + } else { + if ($NEWS_TEMPLATE) { + $NEWS_PARSE = $NEWS_TEMPLATE; + } else { + if (function_exists("news_style")) { + $NEWS_PARSE = news_style($news); + } else { + $NEWS_PARSE = $NEWSSTYLE; + } + } + } + $loop_uid = $news['news_author']; + + require_once(e_FILE.'shortcode/batch/news_shortcodes.php'); + $text = $tp -> parseTemplate($NEWS_PARSE, TRUE, $news_shortcodes); + + if ($mode == 'return') { + return $text; + } else { + echo $text; + return TRUE; + } + } + + function make_xml_compatible($original) { + global $tp, $ml; + if (!is_object($tp)) $tp = new e_parse; + $original = $tp->toHTML($original, TRUE); + $original = str_replace('£', '&#163;', $original); + $original = str_replace('©', '(c)', $original); + return htmlspecialchars($original); + } +} + +?> diff --git a/e107_handlers/notify_class.php b/e107_handlers/notify_class.php new file mode 100644 index 000000000..fcc6ca831 --- /dev/null +++ b/e107_handlers/notify_class.php @@ -0,0 +1,158 @@ + notify_prefs = $sysprefs -> get('notify_prefs'); + $this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs); + foreach ($this -> notify_prefs['event'] as $id => $status) { + if ($status['type'] != 'off') { + $e_event -> register($id, 'notify_'.$id); + } + } + + if(defined("e_LANGUAGE") && is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php')) { + include_once(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php'); + } else { + include_once(e_LANGUAGEDIR.'English/lan_notify.php'); + } + } + + function send($id, $subject, $message) { + global $sql,$tp; + e107_require_once(e_HANDLER.'mail.php'); + $subject = SITENAME.': '.$subject; + if ($this -> notify_prefs['event'][$id]['type'] == 'main') { + sendemail(SITEADMINEMAIL, $tp->toEmail($subject), $tp->toEmail($message)); + } else if ($this -> notify_prefs['event'][$id]['type'] == 'class') { + if ($this -> notify_prefs['event'][$id]['class'] == '254') { + $sql -> db_Select('user', 'user_email', "user_admin = 1"); + } else if ($this -> notify_prefs['event'][$id]['class'] == '253') { + $sql -> db_Select('user', 'user_email'); + } else { + $sql -> db_Select('user', 'user_email', "user_class REGEXP '(^|,)(".$this -> notify_prefs['event'][$id]['class'].")(,|$)'"); + } + while ($email = $sql -> db_Fetch()) { + sendemail($email['user_email'], $tp->toEmail($subject), $tp->toEmail($message)); + } + } else if ($this -> notify_prefs['event'][$id]['type'] == 'email') { + sendemail($this -> notify_prefs['event'][$id]['email'], $tp->toEmail($subject), $tp->toEmail($message)); + } + } +} + +global $nt; +$nt = new notify; + +function notify_usersup($data) { + global $nt; + foreach ($data as $key => $value) + { + if($key != "password1" && $key != "password2" && $key != "email_confirm" && $key != "register") + { + if(is_array($value)) // show user-extended values. + { + foreach($value as $k => $v) + { + $message .= str_replace("user_","",$k).': '.$v.'
    '; + } + } + else + { + $message .= $key.': '.$value.'
    '; + } + } + } + $nt -> send('usersup', NT_LAN_US_1, $message); +} + +function notify_userveri($data) { + global $nt, $e107; + $msgtext = NT_LAN_UV_2.$data['user_id']."\n"; + $msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n"; + $msgtext .= NT_LAN_UV_2.$e107->getip(); + $nt -> send('userveri', NT_LAN_UV_1, $msgtext); +} + +function notify_login($data) { + global $nt; + foreach ($data as $key => $value) { + $message .= $key.': '.$value.'
    '; + } + $nt -> send('login', NT_LAN_LI_1, $message); +} + +function notify_logout() { + global $nt; + $nt -> send('logout', NT_LAN_LO_1, USERID.'. '.USERNAME.' '.NT_LAN_LO_2); +} + +function notify_flood($data) { + global $nt; + $nt -> send('flood', NT_LAN_FL_1, NT_LAN_FL_2.': '.$data); +} + +function notify_subnews($data) { + global $nt,$tp; + foreach ($data as $key => $value) { + $message .= $key.': '.$value.'
    '; + } + $nt -> send('subnews', NT_LAN_SN_1, $message); +} + +function notify_newspost($data) { + global $nt; + $message = ''.$data['news_title'].'

    '.$data['news_summary'].'

    '.$data['data'].'

    '.$data['news_extended']; + $nt -> send('newspost', $data['news_title'], $message); +} + +function notify_newsupd($data) { + global $nt; + $message = ''.$data['news_title'].'

    '.$data['news_summary'].'

    '.$data['data'].'

    '.$data['news_extended']; + $nt -> send('newsupd', NT_LAN_NU_1.': '.$data['news_title'], $message); +} + +function notify_newsdel($data) { + global $nt; + $nt -> send('newsdel', NT_LAN_ND_1, NT_LAN_ND_2.': '.$data); +} + + +function notify_fileupload($data) { + global $nt; + $message = ''.$data['upload_name'].'

    '.$data['upload_description'].'

    '.$data['upload_size'].'

    '.$data['upload_user']; + $nt -> send('fileupload', $data['upload_name'], $message); +} + +if (isset($nt -> notify_prefs['plugins'])) { + foreach ($nt -> notify_prefs['plugins'] as $plugin_id => $plugin_settings) { + if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php')) + { + require_once(e_PLUGIN.$plugin_id.'/e_notify.php'); + } + } +} + +?> diff --git a/e107_handlers/np_class.php b/e107_handlers/np_class.php new file mode 100644 index 000000000..aea81114c --- /dev/null +++ b/e107_handlers/np_class.php @@ -0,0 +1,99 @@ + $view) { + $pages = ceil($total / $view); + } else { + $pages = FALSE; + } + + if ($pages) { + $nppage = NP_3." "; + if ($pages > 10) { + $current = ($from/$view)+1; + + for($c = 0; $c <= 2; $c++) { + $nppage .= ($view * $c == $from ? "[".($c + 1)."] " : "".($c + 1)." "); + } + + if ($current >= 3 && $current <= 5) { + for($c = 3; $c <= $current; $c++) { + $nppage .= ($view * $c == $from ? "[".($c+1)."] " : "".($c + 1)." "); + } + } + else if($current >= 6 && $current <= ($pages-5)) { + $nppage .= " ... "; + for($c = ($current-2); $c <= $current; $c++) { + $nppage .= ($view * $c == $from ? "[".($c+1)."] " : "".($c + 1)." "); + } + } + $nppage .= " ... "; + + + if (($current + 5) > $pages && $current != $pages) { + $tmp = ($current-2); + } else { + $tmp = $pages-3; + } + + for($c = $tmp; $c <= ($pages-1); $c++) { + $nppage .= ($view * $c == $from ? "[".($c + 1)."] " : "".($c + 1)." "); + } + + } else { + for($c = 0; $c < $pages; $c++) { + if ($view * $c == $from ? $nppage .= "[".($c + 1)."] " : $nppage .= "".($c + 1)." "); + } + } + $text = "
    {$nppage}
    \n

    \n"; + if($return == true){ + return $text; + } else { + echo $text; + return null; + } + } + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/override_class.php b/e107_handlers/override_class.php new file mode 100644 index 000000000..266489621 --- /dev/null +++ b/e107_handlers/override_class.php @@ -0,0 +1,65 @@ +override_function('original_func_name','mynew_function_name',['optional_include_file_from_root']); + * + * In e107 code... + * if ($over_func_name = $override->override_check('original_func_name')) { + * $result=call_user_func($over_func_name, params...); + * } + * + */ + +class override { + var $functions = array(); + var $includes = array(); + + function override_function($override, $function, $include) { + if ($include) { + $this->includes[$override] = $include; + } + else if (isset($this->includes[$override])) { + unset($this->includes[$override]); + } + $this->functions[$override] = $function; + } + + function override_check($override) { + if (isset($this->includes[$override])) { + if (file_exists($this->includes[$override])) { + include_once($this->includes[$override]); + } + if (function_exists($this->functions[$override])) { + return $this->functions[$override]; + } else { + return false; + } + } else { + return false; + } + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/parser_functions.php b/e107_handlers/parser_functions.php new file mode 100644 index 000000000..f6d9d477f --- /dev/null +++ b/e107_handlers/parser_functions.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/e107_handlers/parser_handler.php b/e107_handlers/parser_handler.php new file mode 100644 index 000000000..c9622fb70 --- /dev/null +++ b/e107_handlers/parser_handler.php @@ -0,0 +1,69 @@ +db_Select("parser", "*", "parser_pluginname = '{$plugin_name}' AND parser_regexp = '{$regexp}'"); + if ($row = $oursql->db_Fetch()) { + // Already exists, handle error if needed. + } else { + $regexp = str_replace("\\" , "\\\\", $regexp); + $oursql->db_Insert("parser", "0, '{$plugin_name}', '{$regexp}'"); + return 1; + } + } else { + // handle error if wanted to - not a valid regexp + } + } else { + // handle error if wanted to - function does not exist + } + } else { + // handle error if wanted to - Unable to include file + } + } else { + // handle error if wanted to - plugin name or regexp value empty + } +} + +function IsRegExp($sREGEXP) { + $sPREVIOUSHANDLER = Set_Error_Handler("TrapError"); + Preg_Match ($sREGEXP, ""); + Restore_Error_Handler ($sPREVIOUSHANDLER); + Return !TrapError (); +} + +function TrapError () { + Static $iERRORES; + if (!Func_Num_Args()) { + $iRETORNO = $iERRORES; + $iERRORES = 0; + return $iRETORNO; + } else { + $iERRORES++; + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/pclerror.lib.php b/e107_handlers/pclerror.lib.php new file mode 100644 index 000000000..0c19d642d --- /dev/null +++ b/e107_handlers/pclerror.lib.php @@ -0,0 +1,134 @@ +"; + $v_message .= "

    PclError Library has detected a fatal error on file '{$p_file}', line {$p_line}

    "; + $v_message .= "

    {$p_error_string}

    "; + $v_message .= ""; + die($v_message); + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclErrorReset() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function PclErrorReset() + { + global $g_pcl_error_string; + global $g_pcl_error_code; + + $g_pcl_error_code = 1; + $g_pcl_error_string = ""; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclErrorCode() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function PclErrorCode() + { + global $g_pcl_error_string; + global $g_pcl_error_code; + + return($g_pcl_error_code); + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclErrorString() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function PclErrorString() + { + global $g_pcl_error_string; + global $g_pcl_error_code; + + return($g_pcl_error_string." [code {$g_pcl_error_code}]"); + } + // -------------------------------------------------------------------------------- + + +// ----- End of double include look +} +?> diff --git a/e107_handlers/pcltar.lib.php b/e107_handlers/pcltar.lib.php new file mode 100644 index 000000000..899950992 --- /dev/null +++ b/e107_handlers/pcltar.lib.php @@ -0,0 +1,3559 @@ +"; + // -------------------------------------------------------------------------------- + function PclTarList($p_tarname, $p_mode="") + { + TrFctStart(__FILE__, __LINE__, "PclTarList", "tar={$p_tarname}, mode='{$p_mode}'"); + $v_result=1; + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode != "tar") && ($p_mode != "tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Call the extracting fct + $p_list = array(); + if (($v_result = PclTarHandleExtract($p_tarname, 0, $p_list, "list", "", $p_mode, "")) != 1) + { + unset($p_list); + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarExtract() + // Description : + // Extract all the files present in the archive $p_tarname, in the directory + // $p_path. The relative path of the archived files are keep and become + // relative to $p_path. + // If a file with the same name already exists it will be replaced. + // If the path to the file does not exist, it will be created. + // Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the + // function will determine the type of the archive. + // Parameters : + // $p_tarname : Name of an existing tar file. + // $p_path : Path where the files will be extracted. The files will use + // their memorized path from $p_path. + // If $p_path is "", files will be extracted in "./". + // $p_remove_path : Path to remove (from the file memorized path) while writing the + // extracted files. If the path does not match the file path, + // the file is extracted with its memorized path. + // $p_path and $p_remove_path are commulative. + // $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension + // Return Values : + // Same as PclTarList() + // -------------------------------------------------------------------------------- + function PclTarExtract($p_tarname, $p_path="./", $p_remove_path="", $p_mode="") + { + TrFctStart(__FILE__, __LINE__, "PclTarExtract", "tar='{$p_tarname}', path='{$p_path}', remove_path='{$p_remove_path}', mode='{$p_mode}'"); + $v_result=1; + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Call the extracting fct + if (($v_result = PclTarHandleExtract($p_tarname, 0, &$p_list, "complete", $p_path, $v_tar_mode, $p_remove_path)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarExtractList() + // Description : + // Extract the files present in the archive $p_tarname and specified in + // $p_filelist, in the directory + // $p_path. The relative path of the archived files are keep and become + // relative to $p_path. + // If a directory is spcified in the list, all the files from this directory + // will be extracted. + // If a file with the same name already exists it will be replaced. + // If the path to the file does not exist, it will be created. + // Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the + // function will determine the type of the archive. + // Parameters : + // $p_tarname : Name of an existing tar file + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_path : Path where the files will be extracted. The files will use + // their memorized path from $p_path. + // If $p_path is "", files will be extracted in "./". + // $p_remove_path : Path to remove (from the file memorized path) while writing the + // extracted files. If the path does not match the file path, + // the file is extracted with its memorized path. + // $p_path and $p_remove_path are commulative. + // $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension + // Return Values : + // Same as PclTarList() + // -------------------------------------------------------------------------------- + function PclTarExtractList($p_tarname, $p_filelist, $p_path="./", $p_remove_path="", $p_mode="") + { + TrFctStart(__FILE__, __LINE__, "PclTarExtractList", "tar={$p_tarname}, list, path={$p_path}, remove_path='{$p_remove_path}', mode='{$p_mode}'"); + $v_result=1; + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) + { + // ----- Call the extracting fct + if (($v_result = PclTarHandleExtract($p_tarname, $p_filelist, &$p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) + { + // ----- Create a list with the elements from the string + $v_list = explode(" ", $p_filelist); + + // ----- Call the extracting fct + if (($v_result = PclTarHandleExtract($p_tarname, $v_list, &$p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Invalid variable + else + { + // ----- Error log + PclErrorLog(-3, "Invalid variable type p_filelist"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarExtractIndex() + // Description : + // Extract the files present in the archive $p_tarname and specified at + // the indexes in $p_index, in the directory + // $p_path. The relative path of the archived files are keep and become + // relative to $p_path. + // If a directory is specified in the list, the directory only is created. All + // the file stored in this archive for this directory + // are not extracted. + // If a file with the same name already exists it will be replaced. + // If the path to the file does not exist, it will be created. + // Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the + // function will determine the type of the archive. + // Parameters : + // $p_tarname : Name of an existing tar file + // $p_index : A single index (integer) or a string of indexes of files to + // extract. The form of the string is "0,4-6,8-12" with only numbers + // and '-' for range or ',' to separate ranges. No spaces or ';' + // are allowed. + // $p_path : Path where the files will be extracted. The files will use + // their memorized path from $p_path. + // If $p_path is "", files will be extracted in "./". + // $p_remove_path : Path to remove (from the file memorized path) while writing the + // extracted files. If the path does not match the file path, + // the file is extracted with its memorized path. + // $p_path and $p_remove_path are commulative. + // $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension + // Return Values : + // Same as PclTarList() + // -------------------------------------------------------------------------------- + function PclTarExtractIndex($p_tarname, $p_index, $p_path="./", $p_remove_path="", $p_mode="") + { + TrFctStart(__FILE__, __LINE__, "PclTarExtractIndex", "tar={$p_tarname}, index='{$p_index}', path={$p_path}, remove_path='{$p_remove_path}', mode='{$p_mode}'"); + $v_result=1; + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Look if the $p_index is really an integer + if (is_integer($p_index)) + { + // ----- Call the extracting fct + if (($v_result = PclTarHandleExtractByIndexList($p_tarname, $p_index, &$p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_index)) + { + // ----- Call the extracting fct + if (($v_result = PclTarHandleExtractByIndexList($p_tarname, $p_index, &$p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Invalid variable + else + { + // ----- Error log + PclErrorLog(-3, "Invalid variable type {$p_index}"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarDelete() + // Description : + // This function deletes from the archive $p_tarname the files which are listed + // in $p_filelist. $p_filelist can be a string with file names separated by + // spaces, or an array containing the file names. + // Parameters : + // $p_tarname : Name of an existing tar file + // $p_filelist : An array or a string containing file names to remove from the + // archive. + // $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension + // Return Values : + // List of the files which are kept in the archive (same format as PclTarList()) + // -------------------------------------------------------------------------------- + function PclTarDelete($p_tarname, $p_filelist, $p_mode="") + { + TrFctStart(__FILE__, __LINE__, "PclTarDelete", "tar='{$p_tarname}', list='{$p_filelist}', mode='{$p_mode}'"); + $v_result=1; + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) + { + // ----- Call the extracting fct + if (($v_result = PclTarHandleDelete($p_tarname, $p_filelist, &$p_list, $p_mode)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) + { + // ----- Create a list with the elements from the string + $v_list = explode(" ", $p_filelist); + + // ----- Call the extracting fct + if (($v_result = PclTarHandleDelete($p_tarname, $v_list, &$p_list, $p_mode)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Invalid variable + else + { + // ----- Error log + PclErrorLog(-3, "Invalid variable type p_filelist"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarUpdate() + // Description : + // This function updates the files in $p_filelist which are already in the + // $p_tarname archive with an older last modified date. If the file does not + // exist, it is added at the end of the archive. + // Parameters : + // $p_tarname : Name of an existing tar file + // $p_filelist : An array or a string containing file names to update from the + // archive. + // $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension + // Return Values : + // List of the files contained in the archive. The field status contains + // "updated", "not_updated", "added" or "ok" for the files not concerned. + // -------------------------------------------------------------------------------- + function PclTarUpdate($p_tarname, $p_filelist, $p_mode="", $p_add_dir="", $p_remove_dir="") + { + TrFctStart(__FILE__, __LINE__, "PclTarUpdate", "tar='{$p_tarname}', list='{$p_filelist}', mode='{$p_mode}'"); + $v_result=1; + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Look if the $p_filelist is really an array + if (is_array($p_filelist)) + { + // ----- Call the extracting fct + if (($v_result = PclTarHandleUpdate($p_tarname, $p_filelist, &$p_list, $p_mode, $p_add_dir, $p_remove_dir)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) + { + // ----- Create a list with the elements from the string + $v_list = explode(" ", $p_filelist); + + // ----- Call the extracting fct + if (($v_result = PclTarHandleUpdate($p_tarname, $v_list, &$p_list, $p_mode, $p_add_dir, $p_remove_dir)) != 1) + { + TrFctEnd(__FILE__, __LINE__, 0, PclErrorString()); + return(0); + } + } + + // ----- Invalid variable + else + { + // ----- Error log + PclErrorLog(-3, "Invalid variable type p_filelist"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + + // -------------------------------------------------------------------------------- + // Function : PclTarMerge() + // Description : + // This function add the content of $p_tarname_add at the end of $p_tarname. + // Parameters : + // $p_tarname : Name of an existing tar file + // $p_tarname_add : Name of an existing tar file taht will be added at the end + // of $p_tarname. + // $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension + // $p_mode_add : 'tar' or 'tgz', if not set, will be determined by $p_tarname_add + // extension + // Return Values : + // List of the files contained in the archive. The field status contains + // "updated", "not_updated", "added" or "ok" for the files not concerned. + // -------------------------------------------------------------------------------- + function PclTarMerge($p_tarname, $p_tarname_add, $p_mode="", $p_mode_add="") + { + TrFctStart(__FILE__, __LINE__, "PclTarMerge", "tar='{$p_tarname}', tar_add='{$p_tarname_add}', mode='{$p_mode}', mode_add='{$p_mode_add}'"); + $v_result=1; + + // ----- Check the parameters + if (($p_tarname == "") || ($p_tarname_add == "")) + { + // ----- Error log + PclErrorLog(-3, "Invalid empty archive name"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Extract the tar format from the extension + if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz"))) + { + if (($p_mode = PclTarHandleExtension($p_tarname)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + if (($p_mode_add == "") || (($p_mode_add!="tar") && ($p_mode_add!="tgz"))) + { + if (($p_mode_add = PclTarHandleExtension($p_tarname_add)) == "") + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return 0; + } + } + + // ----- Clear filecache + clearstatcache(); + + // ----- Check the file size + if ((!is_file($p_tarname)) || + (((($v_size = filesize($p_tarname)) % 512) != 0) && ($p_mode=="tar"))) + { + // ----- Error log + if (!is_file($p_tarname)) + PclErrorLog(-4, "Archive '$p_tarname' does not exist"); + else + PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname)."(not a 512 block multiple)"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + if ((!is_file($p_tarname_add)) || + (((($v_size_add = filesize($p_tarname_add)) % 512) != 0) && ($p_mode_add=="tar"))) + { + // ----- Error log + if (!is_file($p_tarname_add)) + PclErrorLog(-4, "Archive '$p_tarname_add' does not exist"); + else + PclErrorLog(-6, "Archive '$p_tarname_add' has invalid size ".filesize($p_tarname_add)."(not a 512 block multiple)"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Look for compressed archive + if ($p_mode == "tgz") + { + // ----- Open the file in read mode + if (($p_tar = @gzopen($p_tarname, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Open a temporary file in write mode + $v_temp_tarname = uniqid("pcltar-").".tmp"; + TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); + if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0) + { + // ----- Close tar file + gzclose($p_tar); + + // ----- Error log + PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Read the first 512 bytes block + $v_buffer = gzread($p_tar, 512); + + // ----- Read the following blocks but not the last one + if (!gzeof($p_tar)) + { + TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file"); + $i=1; + + // ----- Read new 512 block and write the already read + do{ + // ----- Write the already read block + $v_binary_data = pack("a512", "$v_buffer"); + gzputs($v_temp_tar, $v_binary_data); + + $i++; + TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i"); + + // ----- Read next block + $v_buffer = gzread($p_tar, 512); + + } while (!gzeof($p_tar)); + + TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks"); + } + } + + // ----- Look for uncompressed tar file + else if ($p_mode=="tar") + { + // ----- Open the tar file + if (($p_tar = fopen($p_tarname, "r+b")) == 0) + { + // ----- Error log + PclErrorLog(-1, "Unable to open file '$p_tarname' in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Go to the beginning of last block + TrFctMessage(__FILE__, __LINE__, 4, "Position before :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + fseek($p_tar, $v_size-512); + TrFctMessage(__FILE__, __LINE__, 4, "Position after :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + } + + // ----- Look for unknown type + else + { + // ----- Error log + PclErrorLog(-3, "Invalid tar mode $p_mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Look for type of archive to add + if ($p_mode_add == "tgz") + { + TrFctMessage(__FILE__, __LINE__, 4, "Opening file $p_tarname_add"); + + // ----- Open the file in read mode + if (($p_tar_add = @gzopen($p_tarname_add, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_tarname_add' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Read the first 512 bytes block + $v_buffer = gzread($p_tar_add, 512); + + // ----- Read the following blocks but not the last one + if (!gzeof($p_tar_add)) + { + TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file"); + $i=1; + + // ----- Read new 512 block and write the already read + do{ + // ----- Write the already read block + $v_binary_data = pack("a512", "$v_buffer"); + if ($p_mode=="tar") + fputs($p_tar, $v_binary_data); + else + gzputs($v_temp_tar, $v_binary_data); + + $i++; + TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i"); + + // ----- Read next block + $v_buffer = gzread($p_tar_add, 512); + + } while (!gzeof($p_tar_add)); + + TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks"); + } + + // ----- Close the files + gzclose($p_tar_add); + } + + // ----- Look for uncompressed tar file + else if ($p_mode=="tar") + { + // ----- Open the file in read mode + if (($p_tar_add = @fopen($p_tarname_add, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_tarname_add' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Read the first 512 bytes block + $v_buffer = fread($p_tar_add, 512); + + // ----- Read the following blocks but not the last one + if (!feof($p_tar_add)) + { + TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file"); + $i=1; + + // ----- Read new 512 block and write the already read + do{ + // ----- Write the already read block + $v_binary_data = pack("a512", "$v_buffer"); + if ($p_mode=="tar") + fputs($p_tar, $v_binary_data); + else + gzputs($v_temp_tar, $v_binary_data); + + $i++; + TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i"); + + // ----- Read next block + $v_buffer = fread($p_tar_add, 512); + + } while (!feof($p_tar_add)); + + TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks"); + } + + // ----- Close the files + fclose($p_tar_add); + } + + // ----- Call the footer of the tar archive + $v_result = PclTarHandleFooter($p_tar, $p_mode); + + // ----- Look for closing compressed archive + if ($p_mode == "tgz") + { + // ----- Close the files + gzclose($p_tar); + gzclose($v_temp_tar); + + // ----- Unlink tar file + if (!@unlink($p_tarname)) + { + // ----- Error log + PclErrorLog(-11, "Error while deleting archive name $p_tarname"); + } + + // ----- Rename tar file + if (!@rename($v_temp_tarname, $p_tarname)) + { + // ----- Error log + PclErrorLog(-12, "Error while renaming temporary file $v_temp_tarname to archive name $p_tarname"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for closing uncompressed tar file + else if ($p_mode=="tar") + { + // ----- Close the tarfile + fclose($p_tar); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + +// -------------------------------------------------------------------------------- +// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** +// ***** ***** +// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** +// -------------------------------------------------------------------------------- + + + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleCreate() + // Description : + // Parameters : + // $p_tarname : Name of the tar file + // $p_list : An array containing the file or directory names to add in the tar + // $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleCreate($p_tarname, $p_list, $p_mode, $p_add_dir="", $p_remove_dir="") + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleCreate", "tar=$p_tarname, list, mode=$p_mode, add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + $v_list_detail = array(); + + // ----- Check the parameters + if (($p_tarname == "") || (($p_mode != "tar") && ($p_mode != "tgz"))) + { + // ----- Error log + if ($p_tarname == "") + PclErrorLog(-3, "Invalid empty archive name"); + else + PclErrorLog(-3, "Unknown mode '$p_mode'"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Look for tar file + if ($p_mode == "tar") + { + // ----- Open the tar file + if (($p_tar = fopen($p_tarname, "wb")) == 0) + { + // ----- Error log + PclErrorLog(-1, "Unable to open file [$p_tarname] in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Call the adding fct inside the tar + if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $v_list_detail, $p_add_dir, $p_remove_dir)) == 1) + { + // ----- Call the footer of the tar archive + $v_result = PclTarHandleFooter($p_tar, $p_mode); + } + + // ----- Close the tarfile + fclose($p_tar); + } + // ----- Look for tgz file + else + { + // ----- Open the tar file + if (($p_tar = @gzopen($p_tarname, "wb")) == 0) + { + // ----- Error log + PclErrorLog(-1, "Unable to open file [$p_tarname] in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Call the adding fct inside the tar + if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $v_list_detail, $p_add_dir, $p_remove_dir)) == 1) + { + // ----- Call the footer of the tar archive + $v_result = PclTarHandleFooter($p_tar, $p_mode); + } + + // ----- Close the tarfile + gzclose($p_tar); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleAppend() + // Description : + // Parameters : + // $p_tarname : Name of the tar file + // $p_list : An array containing the file or directory names to add in the tar + // $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleAppend($p_tarname, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleAppend", "tar=$p_tarname, list, mode=$p_mode"); + $v_result=1; + + // ----- Check the parameters + if ($p_tarname == "") + { + // ----- Error log + PclErrorLog(-3, "Invalid empty archive name"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + clearstatcache(); + + // ----- Check the file size + if ((!is_file($p_tarname)) || + (((($v_size = filesize($p_tarname)) % 512) != 0) && ($p_mode=="tar"))) + { + // ----- Error log + if (!is_file($p_tarname)) + PclErrorLog(-4, "Archive '$p_tarname' does not exist"); + else + PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname)."(not a 512 block multiple)"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Look for compressed archive + if ($p_mode == "tgz") + { + // ----- Open the file in read mode + if (($p_tar = @gzopen($p_tarname, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Open a temporary file in write mode + $v_temp_tarname = uniqid("pcltar-").".tmp"; + TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); + if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0) + { + // ----- Close tar file + gzclose($p_tar); + + // ----- Error log + PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Read the first 512 bytes block + $v_buffer = gzread($p_tar, 512); + + // ----- Read the following blocks but not the last one + if (!gzeof($p_tar)) + { + TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file"); + $i=1; + + // ----- Read new 512 block and write the already read + do{ + // ----- Write the already read block + $v_binary_data = pack("a512", "$v_buffer"); + gzputs($v_temp_tar, $v_binary_data); + + $i++; + TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i"); + + // ----- Read next block + $v_buffer = gzread($p_tar, 512); + + } while (!gzeof($p_tar)); + + TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks"); + } + + // ----- Call the adding fct inside the tar + if (($v_result = PclTarHandleAddList($v_temp_tar, $p_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir)) == 1) + { + // ----- Call the footer of the tar archive + $v_result = PclTarHandleFooter($v_temp_tar, $p_mode); + } + + // ----- Close the files + gzclose($p_tar); + gzclose($v_temp_tar); + + // ----- Unlink tar file + if (!@unlink($p_tarname)) + { + // ----- Error log + PclErrorLog(-11, "Error while deleting archive name $p_tarname"); + } + + // ----- Rename tar file + if (!@rename($v_temp_tarname, $p_tarname)) + { + // ----- Error log + PclErrorLog(-12, "Error while renaming temporary file $v_temp_tarname to archive name $p_tarname"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for uncompressed tar file + else if ($p_mode=="tar") + { + // ----- Open the tar file + if (($p_tar = fopen($p_tarname, "r+b")) == 0) + { + // ----- Error log + PclErrorLog(-1, "Unable to open file '$p_tarname' in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Go to the beginning of last block + TrFctMessage(__FILE__, __LINE__, 4, "Position before :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + fseek($p_tar, $v_size-512); + TrFctMessage(__FILE__, __LINE__, 4, "Position after :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + + // ----- Call the adding fct inside the tar + if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir)) == 1) + { + // ----- Call the footer of the tar archive + $v_result = PclTarHandleFooter($p_tar, $p_mode); + } + + // ----- Close the tarfile + fclose($p_tar); + } + + // ----- Look for unknown type + else + { + // ----- Error log + PclErrorLog(-3, "Invalid tar mode $p_mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleAddList() + // Description : + // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is + // different from the real path of the file. This is usefull if you want to have PclTar + // running in any directory, and memorize relative path from an other directory. + // Parameters : + // $p_tar : File descriptor of the tar archive + // $p_list : An array containing the file or directory names to add in the tar + // $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive + // $p_list_detail : list of added files with their properties (specially the status field) + // $p_add_dir : Path to add in the filename path archived + // $p_remove_dir : Path to remove in the filename path archived + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleAddList($p_tar, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleAddList", "tar='$p_tar', list, mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + $v_header = array(); + + // ----- Recuperate the current number of elt in list + $v_nb = sizeof($p_list_detail); + + // ----- Check the parameters + if ($p_tar == 0) + { + // ----- Error log + PclErrorLog(-3, "Invalid file descriptor in file ".__FILE__.", line ".__LINE__); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Check the arguments + if (sizeof($p_list) == 0) + { + // ----- Error log + PclErrorLog(-3, "Invalid file list parameter (invalid or empty list)"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Loop on the files + for ($j=0; ($j 99) + { + // ----- Error log + PclErrorLog(-5, "File name is too long (max. 99) : '$p_filename'"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + TrFctMessage(__FILE__, __LINE__, 4, "File position before header =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + + // ----- Add the file + if (($v_result = PclTarHandleAddFile($p_tar, $p_filename, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) + { + // ----- Return status + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the file infos + $p_list_detail[$v_nb++] = $v_header; + + // ----- Look for directory + if (is_dir($p_filename)) + { + TrFctMessage(__FILE__, __LINE__, 2, "$p_filename is a directory"); + + // ----- Look for path + if ($p_filename != ".") + $v_path = $p_filename."/"; + else + $v_path = ""; + + // ----- Read the directory for files and sub-directories + $p_hdir = opendir($p_filename); + $p_hitem = readdir($p_hdir); // '.' directory + $p_hitem = readdir($p_hdir); // '..' directory + while ($p_hitem = readdir($p_hdir)) + { + // ----- Look for a file + if (is_file($v_path.$p_hitem)) + { + TrFctMessage(__FILE__, __LINE__, 4, "Add the file '".$v_path.$p_hitem."'"); + + // ----- Add the file + if (($v_result = PclTarHandleAddFile($p_tar, $v_path.$p_hitem, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) + { + // ----- Return status + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the file infos + $p_list_detail[$v_nb++] = $v_header; + } + + // ----- Recursive call to PclTarHandleAddFile() + else + { + TrFctMessage(__FILE__, __LINE__, 4, "'".$v_path.$p_hitem."' is a directory"); + + // ----- Need an array as parameter + $p_temp_list[0] = $v_path.$p_hitem; + $v_result = PclTarHandleAddList($p_tar, $p_temp_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir); + } + } + + // ----- Free memory for the recursive loop + unset($p_temp_list); + unset($p_hdir); + unset($p_hitem); + } + else + { + TrFctMessage(__FILE__, __LINE__, 4, "File position after blocks =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + } + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleAddFile() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleAddFile($p_tar, $p_filename, $p_mode, &$p_header, $p_add_dir, $p_remove_dir) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleAddFile", "tar='$p_tar', filename='$p_filename', p_mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + + // ----- Check the parameters + if ($p_tar == 0) + { + // ----- Error log + PclErrorLog(-3, "Invalid file descriptor in file ".__FILE__.", line ".__LINE__); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Skip empty file names + if ($p_filename == "") + { + // ----- Error log + PclErrorLog(-3, "Invalid file list parameter (invalid or empty list)"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Calculate the stored filename + $v_stored_filename = $p_filename; + if ($p_remove_dir != "") + { + if (substr($p_remove_dir, -1) != '/') + $p_remove_dir .= "/"; + + if ((substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) + { + if ((substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) + $p_remove_dir = "./".$p_remove_dir; + if ((substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./")) + $p_remove_dir = substr($p_remove_dir, 2); + } + + if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) + { + $v_stored_filename = substr($p_filename, strlen($p_remove_dir)); + TrFctMessage(__FILE__, __LINE__, 3, "Remove path '$p_remove_dir' in file '$p_filename' = '$v_stored_filename'"); + } + } + if ($p_add_dir != "") + { + if (substr($p_add_dir, -1) == "/") + $v_stored_filename = $p_add_dir.$v_stored_filename; + else + $v_stored_filename = $p_add_dir."/".$v_stored_filename; + TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); + } + + // ----- Check the path length + if (strlen($v_stored_filename) > 99) + { + // ----- Error log + PclErrorLog(-5, "Stored file name is too long (max. 99) : '$v_stored_filename'"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Look for a file + if (is_file($p_filename)) + { + // ----- Open the source file + if (($v_file = fopen($p_filename, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_filename' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Call the header generation + if (($v_result = PclTarHandleHeader($p_tar, $p_filename, $p_mode, $p_header, $v_stored_filename)) != 1) + { + // ----- Return status + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + TrFctMessage(__FILE__, __LINE__, 4, "File position after header =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + + // ----- Read the file by 512 octets blocks + $i=0; + while (($v_buffer = fread($v_file, 512)) != "") + { + $v_binary_data = pack("a512", "$v_buffer"); + if ($p_mode == "tar") + fputs($p_tar, $v_binary_data); + else + gzputs($p_tar, $v_binary_data); + $i++; + } + TrFctMessage(__FILE__, __LINE__, 2, "$i 512 bytes blocks"); + + // ----- Close the file + fclose($v_file); + + TrFctMessage(__FILE__, __LINE__, 4, "File position after blocks =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + } + + // ----- Look for a directory + else + { + // ----- Call the header generation + if (($v_result = PclTarHandleHeader($p_tar, $p_filename, $p_mode, $p_header, $v_stored_filename)) != 1) + { + // ----- Return status + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + TrFctMessage(__FILE__, __LINE__, 4, "File position after header =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar))); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleHeader() + // Description : + // This function creates in the TAR $p_tar, the TAR header for the file + // $p_filename. + // + // 1. The informations needed to compose the header are recuperated and formatted + // 2. Two binary strings are composed for the first part of the header, before + // and after checksum field. + // 3. The checksum is calculated from the two binary strings + // 4. The header is write in the tar file (first binary string, binary string + // for checksum and last binary string). + // Parameters : + // $p_tar : a valid file descriptor, opened in write mode, + // $p_filename : The name of the file the header is for, + // $p_mode : The mode of the archive ("tar" or "tgz"). + // $p_header : A pointer to a array where will be set the file properties + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleHeader($p_tar, $p_filename, $p_mode, &$p_header, $p_stored_filename) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleHeader", "tar=$p_tar, file='$p_filename', mode='$p_mode', stored_filename='$p_stored_filename'"); + $v_result=1; + + // ----- Check the parameters + if (($p_tar == 0) || ($p_filename == "")) + { + // ----- Error log + PclErrorLog(-3, "Invalid file descriptor in file ".__FILE__.", line ".__LINE__); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Filename (reduce the path of stored name) + if ($p_stored_filename == "") + $p_stored_filename = $p_filename; + $v_reduce_filename = PclTarHandlePathReduction($p_stored_filename); + TrFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_reduce_filename', strlen ".strlen($v_reduce_filename)); + + // ----- Get file info + $v_info = stat($p_filename); + $v_uid = sprintf("%6s ", DecOct($v_info[4])); + $v_gid = sprintf("%6s ", DecOct($v_info[5])); + TrFctMessage(__FILE__, __LINE__, 3, "uid=$v_uid, gid=$v_gid"); + $v_perms = sprintf("%6s ", DecOct(fileperms($p_filename))); + TrFctMessage(__FILE__, __LINE__, 3, "file permissions $v_perms"); + + // ----- File mtime + $v_mtime_data = filemtime($p_filename); + TrFctMessage(__FILE__, __LINE__, 2, "File mtime : $v_mtime_data"); + $v_mtime = sprintf("%11s", DecOct($v_mtime_data)); + + // ----- File typeflag + // '0' or '\0' is the code for regular file + // '5' is directory + if (is_dir($p_filename)) + { + $v_typeflag = "5"; + $v_size = 0; + } + else + { + $v_typeflag = ""; + + // ----- Get the file size + clearstatcache(); + $v_size = filesize($p_filename); + } + + TrFctMessage(__FILE__, __LINE__, 2, "File size : $v_size"); + $v_size = sprintf("%11s ", DecOct($v_size)); + + TrFctMessage(__FILE__, __LINE__, 2, "File typeflag : $v_typeflag"); + + // ----- Linkname + $v_linkname = ""; + + // ----- Magic + $v_magic = ""; + + // ----- Version + $v_version = ""; + + // ----- uname + $v_uname = ""; + + // ----- gname + $v_gname = ""; + + // ----- devmajor + $v_devmajor = ""; + + // ----- devminor + $v_devminor = ""; + + // ----- prefix + $v_prefix = ""; + + // ----- Compose the binary string of the header in two parts arround the checksum position + $v_binary_data_first = pack("a100a8a8a8a12A12", $v_reduce_filename, $v_perms, $v_uid, $v_gid, $v_size, $v_mtime); + $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12", $v_typeflag, $v_linkname, $v_magic, $v_version, $v_uname, $v_gname, $v_devmajor, $v_devminor, $v_prefix, ""); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i=0; $i<148; $i++) + { + $v_checksum += ord(substr($v_binary_data_first,$i,1)); + } + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i=148; $i<156; $i++) + { + $v_checksum += ord(' '); + } + // ..... Last part of the header + for ($i=156, $j=0; $i<512; $i++, $j++) + { + $v_checksum += ord(substr($v_binary_data_last,$j,1)); + } + TrFctMessage(__FILE__, __LINE__, 3, "Calculated checksum : $v_checksum"); + + // ----- Write the first 148 bytes of the header in the archive + if ($p_mode == "tar") + fputs($p_tar, $v_binary_data_first, 148); + else + gzputs($p_tar, $v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%6s ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + if ($p_mode == "tar") + fputs($p_tar, $v_binary_data, 8); + else + gzputs($p_tar, $v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + if ($p_mode == "tar") + fputs($p_tar, $v_binary_data_last, 356); + else + gzputs($p_tar, $v_binary_data_last, 356); + + // ----- Set the properties in the header "structure" + $p_header[filename] = $v_reduce_filename; + $p_header[mode] = $v_perms; + $p_header[uid] = $v_uid; + $p_header[gid] = $v_gid; + $p_header[size] = $v_size; + $p_header[mtime] = $v_mtime; + $p_header[typeflag] = $v_typeflag; + $p_header[status] = "added"; + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleFooter() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleFooter($p_tar, $p_mode) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleFooter", "tar='$p_tar', p_mode=$p_mode"); + $v_result=1; + + // ----- Write the last 0 filled block for end of archive + $v_binary_data = pack("a512", ""); + if ($p_mode == "tar") + fputs($p_tar, $v_binary_data); + else + gzputs($p_tar, $v_binary_data); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleExtract() + // Description : + // Parameters : + // $p_tarname : Filename of the tar (or tgz) archive + // $p_file_list : An array which contains the list of files to extract, this + // array may be empty when $p_mode is 'complete' + // $p_list_detail : An array where will be placed the properties of each extracted/listed file + // $p_mode : 'complete' will extract all files from the archive, + // 'partial' will look for files in $p_file_list + // 'list' will only list the files from the archive without any extract + // $p_path : Path to add while writing the extracted files + // $p_tar_mode : 'tar' for GNU TAR archive, 'tgz' for compressed archive + // $p_remove_path : Path to remove (from the file memorized path) while writing the + // extracted files. If the path does not match the file path, + // the file is extracted with its memorized path. + // $p_remove_path does not apply to 'list' mode. + // $p_path and $p_remove_path are commulative. + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleExtract($p_tarname, $p_file_list, &$p_list_detail, $p_mode, $p_path, $p_tar_mode, $p_remove_path) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleExtract", "archive='$p_tarname', list, mode=$p_mode, path=$p_path, tar_mode=$p_tar_mode, remove_path='$p_remove_path'"); + $v_result=1; + $v_nb = 0; + $v_extract_all = TRUE; + $v_listing = FALSE; + + // ----- Check the path + if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../"))) + $p_path = "./".$p_path; + + // ----- Look for path to remove format (should end by /) + if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) + { + $p_remove_path .= '/'; + } + $p_remove_path_size = strlen($p_remove_path); + + // ----- Study the mode + switch ($p_mode) { + case "complete" : + // ----- Flag extract of all files + $v_extract_all = TRUE; + $v_listing = FALSE; + break; + case "partial" : + // ----- Flag extract of specific files + $v_extract_all = FALSE; + $v_listing = FALSE; + break; + case "list" : + // ----- Flag list of all files + $v_extract_all = FALSE; + $v_listing = TRUE; + break; + default : + // ----- Error log + PclErrorLog(-3, "Invalid extract mode ($p_mode)"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Open the tar file + if ($p_tar_mode == "tar") + { + TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + $v_tar = fopen($p_tarname, "rb"); + } + else + { + TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode"); + $v_tar = @gzopen($p_tarname, "rb"); + } + + // ----- Check that the archive is open + if ($v_tar == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open archive '$p_tarname' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Read the blocks + While (!($v_end_of_file = ($p_tar_mode == "tar"?feof($v_tar):gzeof($v_tar)))) + { + TrFctMessage(__FILE__, __LINE__, 3, "Looking for next header ..."); + + // ----- Clear cache of file infos + clearstatcache(); + + // ----- Reset extract tag + $v_extract_file = FALSE; + $v_extraction_stopped = 0; + + // ----- Read the 512 bytes header + if ($p_tar_mode == "tar") + $v_binary_data = fread($v_tar, 512); + else + $v_binary_data = gzread($v_tar, 512); + + // ----- Read the header properties + if (($v_result = PclTarHandleReadHeader($v_binary_data, $v_header)) != 1) + { + // ----- Close the archive file + if ($p_tar_mode == "tar") + fclose($v_tar); + else + gzclose($v_tar); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for empty blocks to skip + if ($v_header[filename] == "") + { + TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?"); + continue; + } + + TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'"); + + // ----- Look for partial extract + if ((!$v_extract_all) && (is_array($p_file_list))) + { + TrFctMessage(__FILE__, __LINE__, 2, "Look if the file '$v_header[filename]' need to be extracted"); + + // ----- By default no unzip if the file is not found + $v_extract_file = FALSE; + + // ----- Look into the file list + for ($i=0; $i strlen($p_file_list[$i])) && (substr($v_header[filename], 0, strlen($p_file_list[$i])) == $p_file_list[$i])) + { + // ----- The file is in the directory, so extract it + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' is in directory '$p_file_list[$i]' : extract it"); + $v_extract_file = TRUE; + + // ----- End of loop + break; + } + } + + // ----- It is a file, so compare the file names + else if ($p_file_list[$i] == $v_header[filename]) + { + // ----- File found + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' should be extracted"); + $v_extract_file = TRUE; + + // ----- End of loop + break; + } + } + + // ----- Trace + if (!$v_extract_file) + { + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' should not be extracted"); + } + } + else + { + // ----- All files need to be extracted + $v_extract_file = TRUE; + } + + // ----- Look if this file need to be extracted + if (($v_extract_file) && (!$v_listing)) + { + // ----- Look for path to remove + if (($p_remove_path != "") + && (substr($v_header[filename], 0, $p_remove_path_size) == $p_remove_path)) + { + TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '$v_header[filename]'"); + // ----- Remove the path + $v_header[filename] = substr($v_header[filename], $p_remove_path_size); + TrFctMessage(__FILE__, __LINE__, 3, "Reslting file is '$v_header[filename]'"); + } + + // ----- Add the path to the file + if (($p_path != "./") && ($p_path != "/")) + { + // ----- Look for the path end '/' + while (substr($p_path, -1) == "/") + { + TrFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'"); + $p_path = substr($p_path, 0, strlen($p_path)-1); + TrFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]"); + } + + // ----- Add the path + if (substr($v_header[filename], 0, 1) == "/") + $v_header[filename] = $p_path.$v_header[filename]; + else + $v_header[filename] = $p_path."/".$v_header[filename]; + } + + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '$v_header[filename]', size '$v_header[size]'"); + + // ----- Check that the file does not exists + if (file_exists($v_header[filename])) + { + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' already exists"); + + // ----- Look if file is a directory + if (is_dir($v_header[filename])) + { + TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is a directory"); + + // ----- Change the file status + $v_header[status] = "already_a_directory"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + // ----- Look if file is write protected + else if (!is_writeable($v_header[filename])) + { + TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is write protected"); + + // ----- Change the file status + $v_header[status] = "write_protected"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + // ----- Look if the extracted file is older + else if (filemtime($v_header[filename]) > $v_header[mtime]) + { + TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is newer (".date("l dS of F Y h:i:s A", filemtime($v_header[filename])).") than the extracted file (".date("l dS of F Y h:i:s A", $v_header[mtime]).")"); + + // ----- Change the file status + $v_header[status] = "newer_exist"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + } + + // ----- Check the directory availability and create it if necessary + else + { + if ($v_header[typeflag]=="5") + $v_dir_to_check = $v_header[filename]; + else if (!strstr($v_header[filename], "/")) + $v_dir_to_check = ""; + else + $v_dir_to_check = dirname($v_header[filename]); + + if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1) + { + TrFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '$v_header[filename]'"); + + // ----- Change the file status + $v_header[status] = "path_creation_fail"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + } + + // ----- Do the extraction + if (($v_extract_file) && ($v_header[typeflag]!="5")) + { + // ----- Open the destination file in write mode + if (($v_dest_file = @fopen($v_header[filename], "wb")) == 0) + { + TrFctMessage(__FILE__, __LINE__, 2, "Error while opening '$v_header[filename]' in write binary mode"); + + // ----- Change the file status + $v_header[status] = "write_error"; + + // ----- Jump to next file + TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file"); + if ($p_tar_mode == "tar") + fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512)); + } + else + { + TrFctMessage(__FILE__, __LINE__, 2, "Start extraction of '$v_header[filename]'"); + + // ----- Read data + $n = floor($v_header[size]/512); + for ($i=0; $i<$n; $i++) + { + TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($i+1)); + if ($p_tar_mode == "tar") + $v_content = fread($v_tar, 512); + else + $v_content = gzread($v_tar, 512); + fwrite($v_dest_file, $v_content, 512); + } + if (($v_header[size] % 512) != 0) + { + TrFctMessage(__FILE__, __LINE__, 3, "Read last ".($v_header[size] % 512)." bytes in a 512 block"); + if ($p_tar_mode == "tar") + $v_content = fread($v_tar, 512); + else + $v_content = gzread($v_tar, 512); + fwrite($v_dest_file, $v_content, ($v_header[size] % 512)); + } + + // ----- Close the destination file + fclose($v_dest_file); + + // ----- Change the file mode, mtime + touch($v_header[filename], $v_header[mtime]); + //chmod($v_header[filename], DecOct($v_header[mode])); + } + + // ----- Check the file size + clearstatcache(); + if (filesize($v_header[filename]) != $v_header[size]) + { + // ----- Close the archive file + if ($p_tar_mode == "tar") + fclose($v_tar); + else + gzclose($v_tar); + + // ----- Error log + PclErrorLog(-7, "Extracted file '$v_header[filename]' does not have the correct file size '".filesize($v_filename)."' ('$v_header[size]' expected). Archive may be corrupted."); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Extraction done"); + } + + else + { + TrFctMessage(__FILE__, __LINE__, 2, "Extraction of file '$v_header[filename]' skipped."); + + // ----- Jump to next file + TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file"); + if ($p_tar_mode == "tar") + fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512)); + } + } + + // ----- Look for file that is not to be unzipped + else + { + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Jump file '$v_header[filename]'"); + TrFctMessage(__FILE__, __LINE__, 4, "Position avant jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]"); + + // ----- Jump to next file + if ($p_tar_mode == "tar") + fseek($v_tar, ($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))+(ceil(($v_header[size]/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512)); + + TrFctMessage(__FILE__, __LINE__, 4, "Position aprs jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]"); + } + + if ($p_tar_mode == "tar") + $v_end_of_file = feof($v_tar); + else + $v_end_of_file = gzeof($v_tar); + + // ----- File name and properties are logged if listing mode or file is extracted + if ($v_listing || $v_extract_file || $v_extraction_stopped) + { + TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'"); + + // ----- Log extracted files + if (($v_file_dir = dirname($v_header[filename])) == $v_header[filename]) + $v_file_dir = ""; + if ((substr($v_header[filename], 0, 1) == "/") && ($v_file_dir == "")) + $v_file_dir = "/"; + + // ----- Add the array describing the file into the list + $p_list_detail[$v_nb] = $v_header; + + // ----- Increment + $v_nb++; + } + } + + // ----- Close the tarfile + if ($p_tar_mode == "tar") + fclose($v_tar); + else + gzclose($v_tar); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleExtractByIndexList() + // Description : + // Extract the files which are at the indexes specified. If the 'file' at the + // index is a directory, the directory only is created, not all the files stored + // for that directory. + // Parameters : + // $p_index_string : String of indexes of files to extract. The form of the + // string is "0,4-6,8-12" with only numbers and '-' for + // for range, and ',' to separate ranges. No spaces or ';' + // are allowed. + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleExtractByIndexList($p_tarname, $p_index_string, &$p_list_detail, $p_path, $p_remove_path, $p_tar_mode) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleExtractByIndexList", "archive='$p_tarname', index_string='$p_index_string', list, path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode"); + $v_result=1; + $v_nb = 0; + + // ----- TBC : I should check the string by a regexp + + // ----- Check the path + if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path, 0, 2) != "./"))) + $p_path = "./".$p_path; + + // ----- Look for path to remove format (should end by /) + if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) + { + $p_remove_path .= '/'; + } + $p_remove_path_size = strlen($p_remove_path); + + // ----- Open the tar file + if ($p_tar_mode == "tar") + { + TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + $v_tar = @fopen($p_tarname, "rb"); + } + else + { + TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode"); + $v_tar = @gzopen($p_tarname, "rb"); + } + + // ----- Check that the archive is open + if ($v_tar == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open archive '$p_tarname' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Manipulate the index list + $v_list = explode(",", $p_index_string); + sort($v_list); + + // ----- Loop on the index list + $v_index=0; + for ($i=0; ($i $p_index_stop) + { + TrFctMessage(__FILE__, __LINE__, 2, "Stop extraction, past stop index"); + break; + } + + // ----- Clear cache of file infos + clearstatcache(); + + // ----- Reset extract tag + $v_extract_file = FALSE; + $v_extraction_stopped = 0; + + // ----- Read the 512 bytes header + if ($p_tar_mode == "tar") + $v_binary_data = fread($v_tar, 512); + else + $v_binary_data = gzread($v_tar, 512); + + // ----- Read the header properties + if (($v_result = PclTarHandleReadHeader($v_binary_data, $v_header)) != 1) + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for empty blocks to skip + if ($v_header[filename] == "") + { + TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?"); + continue; + } + + TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'"); + + // ----- Look if file is in the range to be extracted + if (($p_index_current >= $p_index_start) && ($p_index_current <= $p_index_stop)) + { + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' is in the range to be extracted"); + $v_extract_file = TRUE; + } + else + { + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' is out of the range"); + $v_extract_file = FALSE; + } + + // ----- Look if this file need to be extracted + if ($v_extract_file) + { + if (($v_result = PclTarHandleExtractFile($v_tar, $v_header, $p_path, $p_remove_path, $p_tar_mode)) != 1) + { + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + } + + // ----- Look for file that is not to be extracted + else + { + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Jump file '$v_header[filename]'"); + TrFctMessage(__FILE__, __LINE__, 4, "Position avant jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]"); + + // ----- Jump to next file + if ($p_tar_mode == "tar") + fseek($v_tar, ($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))+(ceil(($v_header[size]/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512)); + + TrFctMessage(__FILE__, __LINE__, 4, "Position aprs jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]"); + } + + if ($p_tar_mode == "tar") + $v_end_of_file = feof($v_tar); + else + $v_end_of_file = gzeof($v_tar); + + // ----- File name and properties are logged if listing mode or file is extracted + if ($v_extract_file) + { + TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'"); + + // ----- Log extracted files + if (($v_file_dir = dirname($v_header[filename])) == $v_header[filename]) + $v_file_dir = ""; + if ((substr($v_header[filename], 0, 1) == "/") && ($v_file_dir == "")) + $v_file_dir = "/"; + + // ----- Add the array describing the file into the list + $p_list_detail[$v_nb] = $v_header; + + // ----- Increment + $v_nb++; + } + + // ----- Increment the current file index + $p_index_current++; + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleExtractFile() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleExtractFile($p_tar, &$v_header, $p_path, $p_remove_path, $p_tar_mode) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleExtractFile", "archive_descr='$p_tar', path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode"); + $v_result=1; + + // TBC : I should replace all $v_tar by $p_tar in this function .... + $v_tar = $p_tar; + $v_extract_file = 1; + + $p_remove_path_size = strlen($p_remove_path); + + // ----- Look for path to remove + if (($p_remove_path != "") + && (substr($v_header[filename], 0, $p_remove_path_size) == $p_remove_path)) + { + TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '$v_header[filename]'"); + // ----- Remove the path + $v_header[filename] = substr($v_header[filename], $p_remove_path_size); + TrFctMessage(__FILE__, __LINE__, 3, "Resulting file is '$v_header[filename]'"); + } + + // ----- Add the path to the file + if (($p_path != "./") && ($p_path != "/")) + { + // ----- Look for the path end '/' + while (substr($p_path, -1) == "/") + { + TrFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'"); + $p_path = substr($p_path, 0, strlen($p_path)-1); + TrFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]"); + } + + // ----- Add the path + if (substr($v_header[filename], 0, 1) == "/") + $v_header[filename] = $p_path.$v_header[filename]; + else + $v_header[filename] = $p_path."/".$v_header[filename]; + } + + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '$v_header[filename]', size '$v_header[size]'"); + + // ----- Check that the file does not exists + if (file_exists($v_header[filename])) + { + TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' already exists"); + + // ----- Look if file is a directory + if (is_dir($v_header[filename])) + { + TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is a directory"); + + // ----- Change the file status + $v_header[status] = "already_a_directory"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + // ----- Look if file is write protected + else if (!is_writeable($v_header[filename])) + { + TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is write protected"); + + // ----- Change the file status + $v_header[status] = "write_protected"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + // ----- Look if the extracted file is older + else if (filemtime($v_header[filename]) > $v_header[mtime]) + { + TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is newer (".date("l dS of F Y h:i:s A", filemtime($v_header[filename])).") than the extracted file (".date("l dS of F Y h:i:s A", $v_header[mtime]).")"); + + // ----- Change the file status + $v_header[status] = "newer_exist"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + } + + // ----- Check the directory availability and create it if necessary + else + { + if ($v_header[typeflag]=="5") + $v_dir_to_check = $v_header[filename]; + else if (!strstr($v_header[filename], "/")) + $v_dir_to_check = ""; + else + $v_dir_to_check = dirname($v_header[filename]); + + if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1) + { + TrFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '$v_header[filename]'"); + + // ----- Change the file status + $v_header[status] = "path_creation_fail"; + + // ----- Skip the extract + $v_extraction_stopped = 1; + $v_extract_file = 0; + } + } + + // ----- Do the real bytes extraction (if not a directory) + if (($v_extract_file) && ($v_header[typeflag]!="5")) + { + // ----- Open the destination file in write mode + if (($v_dest_file = @fopen($v_header[filename], "wb")) == 0) + { + TrFctMessage(__FILE__, __LINE__, 2, "Error while opening '$v_header[filename]' in write binary mode"); + + // ----- Change the file status + $v_header[status] = "write_error"; + + // ----- Jump to next file + TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file"); + if ($p_tar_mode == "tar") + fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512)); + } + else + { + TrFctMessage(__FILE__, __LINE__, 2, "Start extraction of '$v_header[filename]'"); + + // ----- Read data + $n = floor($v_header[size]/512); + for ($i=0; $i<$n; $i++) + { + TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($i+1)); + if ($p_tar_mode == "tar") + $v_content = fread($v_tar, 512); + else + $v_content = gzread($v_tar, 512); + fwrite($v_dest_file, $v_content, 512); + } + if (($v_header[size] % 512) != 0) + { + TrFctMessage(__FILE__, __LINE__, 3, "Read last ".($v_header[size] % 512)." bytes in a 512 block"); + if ($p_tar_mode == "tar") + $v_content = fread($v_tar, 512); + else + $v_content = gzread($v_tar, 512); + fwrite($v_dest_file, $v_content, ($v_header[size] % 512)); + } + + // ----- Close the destination file + fclose($v_dest_file); + + // ----- Change the file mode, mtime + touch($v_header[filename], $v_header[mtime]); + //chmod($v_header[filename], DecOct($v_header[mode])); + } + + // ----- Check the file size + clearstatcache(); + if (filesize($v_header[filename]) != $v_header[size]) + { + // ----- Error log + PclErrorLog(-7, "Extracted file '$v_header[filename]' does not have the correct file size '".filesize($v_filename)."' ('$v_header[size]' expected). Archive may be corrupted."); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Extraction done"); + } + else + { + TrFctMessage(__FILE__, __LINE__, 2, "Extraction of file '$v_header[filename]' skipped."); + + // ----- Jump to next file + TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file"); + if ($p_tar_mode == "tar") + fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512)); + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTarHandleDelete() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function PclTarHandleDelete($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode) + { + TrFctStart(__FILE__, __LINE__, "PclTarHandleDelete", "archive='$p_tarname', list, tar_mode=$p_tar_mode"); + $v_result=1; + $v_nb=0; + + // ----- Look for regular tar file + if ($p_tar_mode == "tar") + { + // ----- Open file + TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_tar = @fopen($p_tarname, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Open a temporary file in write mode + $v_temp_tarname = uniqid("pcltar-").".tmp"; + TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); + if (($v_temp_tar = @fopen($v_temp_tarname, "wb")) == 0) + { + // ----- Close tar file + fclose($v_tar); + + // ----- Error log + PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + } + + // ----- Look for compressed tar file + else + { + // ----- Open the file in read mode + TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode"); + if (($v_tar = @gzopen($p_tarname, "rb")) == 0) + { + // ----- Error log + PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + + // ----- Open a temporary file in write mode + $v_temp_tarname = uniqid("pcltar-").".tmp"; + TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname"); + if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0) + { + // ----- Close tar file + gzclose($v_tar); + + // ----- Error log + PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode"); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString()); + return PclErrorCode(); + } + } + + // ----- Read the blocks + While (!($v_end_of_file = ($p_tar_mode == "tar"?feof($v_tar):gzeof($v_tar)))) + { + TrFctMessage(__FILE__, __LINE__, 3, "Looking for next header ..."); + + // ----- Clear cache of file infos + clearstatcache(); + + // ----- Reset delete tag + $v_delete_file = FALSE; + + // ----- Read the first 512 block header + if ($p_tar_mode == "tar") + $v_binary_data = fread($v_tar, 512); + else + $v_binary_data = gzread($v_tar, 512); + + // ----- Read the header properties + if (($v_result = PclTarHandleReadHeader($v_binary_data, &$v_header)) != 1) + { + // ----- Close the archive file + if ($p_tar_mode == "tar") + { + fclose($v_tar); + fclose($v_temp_tar); + } + else + { + gzclose($v_tar); + gzclose($v_temp_tar); + } + @unlink($v_temp_tarname); + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for empty blocks to skip + if ($v_header[filename] == "") + { + TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?"); + continue; + } + + TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'"); + + // ----- Look for filenames to delete + for ($i=0, $v_delete_file=FALSE; ($i $v_header[mtime]) + { + TrFctMessage(__FILE__, __LINE__, 3, "File '$p_file_list[$i]' need to be updated"); + $v_update_file = TRUE; + } + else + { + TrFctMessage(__FILE__, __LINE__, 3, "File '$p_file_list[$i]' does not need to be updated"); + $v_update_file = FALSE; + } + + // ----- Flag the name in order not to add the file at the end + $v_found_list[$i] = 1; + } + else + { + TrFctMessage(__FILE__, __LINE__, 4, "File '$p_file_list[$i]' is not '$v_header[filename]'"); + } + } + + // ----- Copy files that do not need to be updated + if (!$v_update_file) + { + TrFctMessage(__FILE__, __LINE__, 2, "Keep file '$v_header[filename]'"); + + // ----- Write the file header + if ($p_tar_mode == "tar") + { + fputs($v_temp_tar, $v_binary_data, 512); + } + else + { + gzputs($v_temp_tar, $v_binary_data, 512); + } + + // ----- Write the file data + $n = ceil($v_header[size]/512); + for ($j=0; $j<$n; $j++) + { + TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($j+1)); + if ($p_tar_mode == "tar") + { + $v_content = fread($v_tar, 512); + fwrite($v_temp_tar, $v_content, 512); + } + else + { + $v_content = gzread($v_tar, 512); + gzwrite($v_temp_tar, $v_content, 512); + } + } + + // ----- File name and properties are logged if listing mode or file is extracted + TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'"); + + // ----- Add the array describing the file into the list + $p_list_detail[$v_nb] = $v_header; + $p_list_detail[$v_nb][status] = ($v_found_file?"not_updated":"ok"); + + // ----- Increment + $v_nb++; + } + + // ----- Look for file that need to be updated + else + { + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Start update of file '$v_current_filename'"); + + // ----- Store the old file size + $v_old_size = $v_header[size]; + + // ----- Add the file + if (($v_result = PclTarHandleAddFile($v_temp_tar, $v_current_filename, $p_tar_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1) + { + // ----- Close the tarfile + if ($p_tar_mode == "tar") + { + fclose($v_tar); + fclose($v_temp_tar); + } + else + { + gzclose($v_tar); + gzclose($v_temp_tar); + } + @unlink($p_temp_tarname); + + // ----- Return status + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Trace + TrFctMessage(__FILE__, __LINE__, 2, "Skip old file '$v_header[filename]'"); + + // ----- Jump to next file + if ($p_tar_mode == "tar") + fseek($v_tar, ftell($v_tar)+(ceil(($v_old_size/512))*512)); + else + gzseek($v_tar, gztell($v_tar)+(ceil(($v_old_size/512))*512)); + + // ----- Add the array describing the file into the list + $p_list_detail[$v_nb] = $v_header; + $p_list_detail[$v_nb][status] = "updated"; + + // ----- Increment + $v_nb++; + } + + // ----- Look for end of file + if ($p_tar_mode == "tar") + $v_end_of_file = feof($v_tar); + else + $v_end_of_file = gzeof($v_tar); + } + + // ----- Look for files that does not exists in the archive and need to be added + for ($i=0; $i=0; $i--) + { + // ----- Look for current path + if ($v_list[$i] == ".") + { + // ----- Ignore this directory + // Should be the first $i=0, but no check is done + } + else if ($v_list[$i] == "..") + { + // ----- Ignore it and ignore the $i-1 + $i--; + } + else if (($v_list[$i] == "") && ($i!=(sizeof($v_list)-1)) && ($i!=0)) + { + // ----- Ignore only the double '//' in path, + // but not the first and last '/' + } + else + { + $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); + } + } + } + + // ----- Return + TrFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + +// ----- End of double include look +} +?> \ No newline at end of file diff --git a/e107_handlers/pcltrace.lib.php b/e107_handlers/pcltrace.lib.php new file mode 100644 index 000000000..cc9824cc2 --- /dev/null +++ b/e107_handlers/pcltrace.lib.php @@ -0,0 +1,456 @@ +"; + echo ""; + echo ""; + echo ""; + echo "
    Trace
    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + // ----- Content header + echo ""; + + // ----- Display + $v_again=0; + for ($i=0; $i"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + // ----- Content footer + echo "
    "; + $n = ($g_pcl_trace_entries[$i][index]+1)*10; + echo ""; + + echo ""; + switch ($g_pcl_trace_entries[$i][type]) { + case 1: + echo ""; + break; + case 2: + echo ""; + break; + case 3: + case 4: + echo ""; + break; + default: + echo ""; + } + echo "
    "; + + for ($j=0; $j<=$g_pcl_trace_entries[$i][index]; $j++) + { + if ($j==$g_pcl_trace_entries[$i][index]) + { + if (($g_pcl_trace_entries[$i][type] == 1) || ($g_pcl_trace_entries[$i][type] == 2)) + echo ""; + } + else + echo ""; + } + //echo ""; + echo "
    +
    |
     
    ".$g_pcl_trace_entries[$i][name]."(".$g_pcl_trace_entries[$i][param].")".$g_pcl_trace_entries[$i][name]."()=".$g_pcl_trace_entries[$i][param]."
    "; + echo "".$g_pcl_trace_entries[$i][message].""; + echo "
    ".$g_pcl_trace_entries[$i][name]."(".$g_pcl_trace_entries[$i][param].")
    ".basename($g_pcl_trace_entries[$i][file])."".$g_pcl_trace_entries[$i][line]."
    "; + + // ----- Trace footer + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
     
    "; + echo ""; + echo ""; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclTraceAction() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function PclTraceAction($p_entry) + { + global $g_pcl_trace_level; + global $g_pcl_trace_mode; + global $g_pcl_trace_filename; + global $g_pcl_trace_name; + global $g_pcl_trace_index; + global $g_pcl_trace_entries; + + if ($g_pcl_trace_mode == "normal") + { + for ($i=0; $i<$p_entry[index]; $i++) + echo "---"; + if ($p_entry[type] == 1) + echo "".$p_entry[name]."(".$p_entry[param].") : ".$p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]
    "; + else if ($p_entry[type] == 2) + echo "".$p_entry[name]."()=".$p_entry[param]." : ".$p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]
    "; + else + echo $p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]
    "; + } + } + // -------------------------------------------------------------------------------- + +// ----- End of double include look +} +?> \ No newline at end of file diff --git a/e107_handlers/pclzip.lib.php b/e107_handlers/pclzip.lib.php new file mode 100644 index 000000000..679c05c7b --- /dev/null +++ b/e107_handlers/pclzip.lib.php @@ -0,0 +1,5209 @@ +zipname = $p_zipname; + $this->zip_fd = 0; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1); + return; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // create($p_filelist, $p_add_dir="", $p_remove_dir="") + // create($p_filelist, $p_option, $p_option_value, ...) + // Description : + // This method supports two different synopsis. The first one is historical. + // This method creates a Zip Archive. The Zip file is created in the + // filesystem. The files and directories indicated in $p_filelist + // are added in the archive. See the parameters description for the + // supported format of $p_filelist. + // When a directory is in the list, the directory and its content is added + // in the archive. + // In this synopsis, the function takes an optional variable list of + // options. See bellow the supported options. + // Parameters : + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or one directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_add_dir : A path to add before the real path of the archived file, + // in order to have it memorized in the archive. + // $p_remove_dir : A path to remove from the real path of the file to archive, + // in order to have a shorter path memorized in the archive. + // When $p_add_dir and $p_remove_dir are set, $p_remove_dir + // is removed first, before $p_add_dir is added. + // Options : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_COMMENT : + // PCLZIP_CB_PRE_ADD : + // PCLZIP_CB_POST_ADD : + // Return Values : + // 0 on failure, + // The list of the added files, with a status of the add action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- +// function create($p_filelist, $p_add_dir="", $p_remove_dir="") + function create($p_filelist /*, options */) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ..."); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Set default values + $v_options = array(); + $v_add_path = ""; + $v_remove_path = ""; + $v_remove_all_path = false; + $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = &func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_ADD => 'optional', + PCLZIP_CB_POST_ADD => 'optional', + PCLZIP_OPT_NO_COMPRESSION => 'optional', + PCLZIP_OPT_COMMENT => 'optional' + //, PCLZIP_OPT_CRYPT => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + $v_add_path = $v_options[PCLZIP_OPT_ADD_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_add_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, + "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "add_path='$v_add_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_all_path?'true':'false')."'"); + + // ----- Look if the $p_filelist is really an array + $p_result_list = array(); + if (is_array($p_filelist)) + { + // ----- Call the create fct + $v_result = $this->privCreate($p_filelist, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options); + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) + { + // ----- Create a list with the elements from the string + $v_list = explode(PCLZIP_SEPARATOR, $p_filelist); + + // ----- Call the create fct + $v_result = $this->privCreate($v_list, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options); + } + + // ----- Invalid variable + else + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + if ($v_result != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); + return $p_result_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // add($p_filelist, $p_add_dir="", $p_remove_dir="") + // add($p_filelist, $p_option, $p_option_value, ...) + // Description : + // This method supports two synopsis. The first one is historical. + // This methods add the list of files in an existing archive. + // If a file with the same name already exists, it is added at the end of the + // archive, the first one is still present. + // If the archive does not exist, it is created. + // Parameters : + // $p_filelist : An array containing file or directory names, or + // a string containing one filename or one directory name, or + // a string containing a list of filenames and/or directory + // names separated by spaces. + // $p_add_dir : A path to add before the real path of the archived file, + // in order to have it memorized in the archive. + // $p_remove_dir : A path to remove from the real path of the file to archive, + // in order to have a shorter path memorized in the archive. + // When $p_add_dir and $p_remove_dir are set, $p_remove_dir + // is removed first, before $p_add_dir is added. + // Options : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_COMMENT : + // PCLZIP_OPT_ADD_COMMENT : + // PCLZIP_OPT_PREPEND_COMMENT : + // PCLZIP_CB_PRE_ADD : + // PCLZIP_CB_POST_ADD : + // Return Values : + // 0 on failure, + // The list of the added files, with a status of the add action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- +// function add($p_filelist, $p_add_dir="", $p_remove_dir="") + function add($p_filelist /* options */) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ..."); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Set default values + $v_options = array(); + $v_add_path = ""; + $v_remove_path = ""; + $v_remove_all_path = false; + $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = &func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_ADD => 'optional', + PCLZIP_CB_POST_ADD => 'optional', + PCLZIP_OPT_NO_COMPRESSION => 'optional', + PCLZIP_OPT_COMMENT => 'optional', + PCLZIP_OPT_ADD_COMMENT => 'optional', + PCLZIP_OPT_PREPEND_COMMENT => 'optional' + //, PCLZIP_OPT_CRYPT => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + $v_add_path = $v_options[PCLZIP_OPT_ADD_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_add_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "add_path='$v_add_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_all_path?'true':'false')."'"); + + // ----- Look if the $p_filelist is really an array + $p_result_list = array(); + if (is_array($p_filelist)) + { + // ----- Call the create fct + $v_result = $this->privAdd($p_filelist, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options); + } + + // ----- Look if the $p_filelist is a string + else if (is_string($p_filelist)) + { + // ----- Create a list with the elements from the string + $v_list = explode(PCLZIP_SEPARATOR, $p_filelist); + + // ----- Call the create fct + $v_result = $this->privAdd($v_list, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options); + } + + // ----- Invalid variable + else + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + if ($v_result != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); + return $p_result_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : listContent() + // Description : + // This public method, gives the list of the files and directories, with their + // properties. + // The properties of each entries in the list are (used also in other functions) : + // filename : Name of the file. For a create or add action it is the filename + // given by the user. For an extract function it is the filename + // of the extracted file. + // stored_filename : Name of the file / directory stored in the archive. + // size : Size of the stored file. + // compressed_size : Size of the file's data compressed in the archive + // (without the headers overhead) + // mtime : Last known modification date of the file (UNIX timestamp) + // comment : Comment associated with the file + // folder : true | false + // index : index of the file in the archive + // status : status of the action (depending of the action) : + // Values are : + // ok : OK ! + // filtered : the file / dir is not extracted (filtered by user) + // already_a_directory : the file can not be extracted because a + // directory with the same name already exists + // write_protected : the file can not be extracted because a file + // with the same name already exists and is + // write protected + // newer_exist : the file was not extracted because a newer file exists + // path_creation_fail : the file is not extracted because the folder + // does not exists and can not be created + // write_error : the file was not extracted because there was a + // error while writing the file + // read_error : the file was not extracted because there was a error + // while reading the file + // invalid_header : the file was not extracted because of an archive + // format error (bad file header) + // Note that each time a method can continue operating when there + // is an action error on a file, the error is only logged in the file status. + // Return Values : + // 0 on an unrecoverable failure, + // The list of the files in the archive. + // -------------------------------------------------------------------------------- + function listContent() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', ""); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Call the extracting fct + $p_list = array(); + if (($v_result = $this->privList($p_list)) != 1) + { + unset($p_list); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // extract($p_path="./", $p_remove_path="") + // extract([$p_option, $p_option_value, ...]) + // Description : + // This method supports two synopsis. The first one is historical. + // This method extract all the files / directories from the archive to the + // folder indicated in $p_path. + // If you want to ignore the 'root' part of path of the memorized files + // you can indicate this in the optional $p_remove_path parameter. + // By default, if a newer file with the same name already exists, the + // file is not extracted. + // + // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions + // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append + // at the end of the path value of PCLZIP_OPT_PATH. + // Parameters : + // $p_path : Path where the files and directories are to be extracted + // $p_remove_path : First part ('root' part) of the memorized path + // (if any similar) to remove while extracting. + // Options : + // PCLZIP_OPT_PATH : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_CB_PRE_EXTRACT : + // PCLZIP_CB_POST_EXTRACT : + // Return Values : + // 0 or a negative value on failure, + // The list of the extracted files, with a status of the action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + //function extract($p_path="./", $p_remove_path="") + function extract(/* options */) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", ""); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Set default values + $v_options = array(); + $v_path = "./"; + $v_remove_path = ""; + $v_remove_all_path = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Default values for option + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; + + // ----- Look for arguments + if ($v_size > 0) { + // ----- Get the arguments + $v_arg_list = &func_get_args(); + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_PATH => 'optional', + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_EXTRACT => 'optional', + PCLZIP_CB_POST_EXTRACT => 'optional', + PCLZIP_OPT_SET_CHMOD => 'optional', + PCLZIP_OPT_BY_NAME => 'optional', + PCLZIP_OPT_BY_EREG => 'optional', + PCLZIP_OPT_BY_PREG => 'optional', + PCLZIP_OPT_BY_INDEX => 'optional', + PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', + PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', + PCLZIP_OPT_REPLACE_NEWER => 'optional' + ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_PATH])) { + $v_path = $v_options[PCLZIP_OPT_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + // ----- Check for '/' in last path char + if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { + $v_path .= '/'; + } + $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); + + // ----- Call the extracting fct + $p_list = array(); + $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, + $v_remove_all_path, $v_options); + if ($v_result < 1) { + unset($p_list); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + + // -------------------------------------------------------------------------------- + // Function : + // extractByIndex($p_index, $p_path="./", $p_remove_path="") + // extractByIndex($p_index, [$p_option, $p_option_value, ...]) + // Description : + // This method supports two synopsis. The first one is historical. + // This method is doing a partial extract of the archive. + // The extracted files or folders are identified by their index in the + // archive (from 0 to n). + // Note that if the index identify a folder, only the folder entry is + // extracted, not all the files included in the archive. + // Parameters : + // $p_index : A single index (integer) or a string of indexes of files to + // extract. The form of the string is "0,4-6,8-12" with only numbers + // and '-' for range or ',' to separate ranges. No spaces or ';' + // are allowed. + // $p_path : Path where the files and directories are to be extracted + // $p_remove_path : First part ('root' part) of the memorized path + // (if any similar) to remove while extracting. + // Options : + // PCLZIP_OPT_PATH : + // PCLZIP_OPT_ADD_PATH : + // PCLZIP_OPT_REMOVE_PATH : + // PCLZIP_OPT_REMOVE_ALL_PATH : + // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and + // not as files. + // The resulting content is in a new field 'content' in the file + // structure. + // This option must be used alone (any other options are ignored). + // PCLZIP_CB_PRE_EXTRACT : + // PCLZIP_CB_POST_EXTRACT : + // Return Values : + // 0 on failure, + // The list of the extracted files, with a status of the action. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + function extractByIndex($p_index /* $options */) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ..."); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Set default values + $v_options = array(); + $v_path = "./"; + $v_remove_path = ""; + $v_remove_all_path = false; + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Default values for option + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; + + // ----- Look for arguments + if ($v_size > 1) { + // ----- Get the arguments + $v_arg_list = &func_get_args(); + + // ----- Remove form the options list the first argument + array_shift($v_arg_list); + $v_size--; + + // ----- Look for first arg + if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_PATH => 'optional', + PCLZIP_OPT_REMOVE_PATH => 'optional', + PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', + PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', + PCLZIP_OPT_ADD_PATH => 'optional', + PCLZIP_CB_PRE_EXTRACT => 'optional', + PCLZIP_CB_POST_EXTRACT => 'optional', + PCLZIP_OPT_SET_CHMOD => 'optional', + PCLZIP_OPT_REPLACE_NEWER => 'optional' + ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' + )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Set the arguments + if (isset($v_options[PCLZIP_OPT_PATH])) { + $v_path = $v_options[PCLZIP_OPT_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { + $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; + } + if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { + $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; + } + if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { + // ----- Check for '/' in last path char + if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { + $v_path .= '/'; + } + $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; + } + if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { + $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set."); + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set."); + } + } + + // ----- Look for 2 args + // Here we need to support the first historic synopsis of the + // method. + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); + + // ----- Get the first argument + $v_path = $v_arg_list[0]; + + // ----- Look for the optional second argument + if ($v_size == 2) { + $v_remove_path = $v_arg_list[1]; + } + else if ($v_size > 2) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return 0; + } + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); + + // ----- Trick + // Here I want to reuse extractByRule(), so I need to parse the $p_index + // with privParseOptions() + $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); + $v_options_trick = array(); + $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, + array (PCLZIP_OPT_BY_INDEX => 'optional' )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; + + // ----- Call the extracting fct + if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : + // delete([$p_option, $p_option_value, ...]) + // Description : + // Parameters : + // None + // Options : + // PCLZIP_OPT_BY_INDEX : + // Return Values : + // 0 on failure, + // The list of the files which are still present in the archive. + // (see PclZip::listContent() for list entry format) + // -------------------------------------------------------------------------------- + function delete(/* options */) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", ""); + $v_result=1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Set default values + $v_options = array(); + + // ----- Look for variable options arguments + $v_size = func_num_args(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); + + // ----- Look for no arguments + if ($v_size <= 0) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing arguments"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return 0; + } + + // ----- Get the arguments + $v_arg_list = &func_get_args(); + + // ----- Parse the options + $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, + array (PCLZIP_OPT_BY_NAME => 'optional', + PCLZIP_OPT_BY_EREG => 'optional', + PCLZIP_OPT_BY_PREG => 'optional', + PCLZIP_OPT_BY_INDEX => 'optional' )); + if ($v_result != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Check that at least one rule is set + if ( (!isset($v_options[PCLZIP_OPT_BY_NAME])) + && (!isset($v_options[PCLZIP_OPT_BY_EREG])) + && (!isset($v_options[PCLZIP_OPT_BY_PREG])) + && (!isset($v_options[PCLZIP_OPT_BY_INDEX]))) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "At least one filtering rule must be set"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return 0; + } + + // ----- Call the delete fct + $v_list = array(); + if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) + { + unset($v_list); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); + return(0); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list); + return $v_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : deleteByIndex() + // Description : + // ***** Deprecated ***** + // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. + // -------------------------------------------------------------------------------- + function deleteByIndex($p_index) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'"); + + $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); + return $p_list; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : properties() + // Description : + // This method gives the properties of the archive. + // The properties are : + // nb : Number of files in the archive + // comment : Comment associated with the archive file + // status : not_exist, ok + // Parameters : + // None + // Return Values : + // 0 on failure, + // An array with the archive properties. + // -------------------------------------------------------------------------------- + function properties() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", ""); + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Default properties + $v_prop = array(); + $v_prop['comment'] = ''; + $v_prop['nb'] = 0; + $v_prop['status'] = 'not_exist'; + + // ----- Look if file exists + if (@is_file($this->zipname)) + { + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0); + return 0; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return 0; + } + + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Set the user attributes + $v_prop['comment'] = $v_central_dir['comment']; + $v_prop['nb'] = $v_central_dir['entries']; + $v_prop['status'] = 'ok'; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop); + return $v_prop; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : duplicate() + // Description : + // This method creates an archive by copying the content of an other one. If + // the archive already exist, it is replaced by the new one without any warning. + // Parameters : + // $p_archive : The filename of a valid archive, or + // a valid PclZip object. + // Return Values : + // 1 on success. + // 0 or a negative value on error (error code). + // -------------------------------------------------------------------------------- + function duplicate($p_archive) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", ""); + $v_result = 1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Look if the $p_archive is a PclZip object + if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'"); + + // ----- Duplicate the archive + $v_result = $this->privDuplicate($p_archive->zipname); + } + + // ----- Look if the $p_archive is a string (so a filename) + else if (is_string($p_archive)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'"); + + // ----- Check that $p_archive is a valid zip file + // TBC : Should also check the archive format + if (!is_file($p_archive)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); + $v_result = PCLZIP_ERR_MISSING_FILE; + } + else { + // ----- Duplicate the archive + $v_result = $this->privDuplicate($p_archive); + } + } + + // ----- Invalid variable + else + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : merge() + // Description : + // This method merge the $p_archive_to_add archive at the end of the current + // one ($this). + // If the archive ($this) does not exist, the merge becomes a duplicate. + // If the $p_archive_to_add archive does not exist, the merge is a success. + // Parameters : + // $p_archive_to_add : It can be directly the filename of a valid zip archive, + // or a PclZip object archive. + // Return Values : + // 1 on success, + // 0 or negative values on error (see below). + // -------------------------------------------------------------------------------- + function merge($p_archive_to_add) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", ""); + $v_result = 1; + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Check archive + if (!$this->privCheckFormat()) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); + return(0); + } + + // ----- Look if the $p_archive_to_add is a PclZip object + if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object"); + + // ----- Merge the archive + $v_result = $this->privMerge($p_archive_to_add); + } + + // ----- Look if the $p_archive_to_add is a string (so a filename) + else if (is_string($p_archive_to_add)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename"); + + // ----- Create a temporary archive + $v_object_archive = new PclZip($p_archive_to_add); + + // ----- Merge the archive + $v_result = $this->privMerge($v_object_archive); + } + + // ----- Invalid variable + else + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); + $v_result = PCLZIP_ERR_INVALID_PARAMETER; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + + + // -------------------------------------------------------------------------------- + // Function : errorCode() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function errorCode() + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + return(PclErrorCode()); + } + else { + return($this->error_code); + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : errorName() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function errorName($p_with_code=false) + { + $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', + PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', + PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', + PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', + PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', + PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', + PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', + PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', + PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', + PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', + PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', + PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', + PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', + PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', + PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', + PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', + PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', + PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', + PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' ); + + if (isset($v_name[$this->error_code])) { + $v_value = $v_name[$this->error_code]; + } + else { + $v_value = 'NoName'; + } + + if ($p_with_code) { + return($v_value.' ('.$this->error_code.')'); + } + else { + return($v_value); + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : errorInfo() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function errorInfo($p_full=false) + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + return(PclErrorString()); + } + else { + if ($p_full) { + return($this->errorName(true)." : ".$this->error_string); + } + else { + return($this->error_string." [code ".$this->error_code."]"); + } + } + } + // -------------------------------------------------------------------------------- + + +// -------------------------------------------------------------------------------- +// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** +// ***** ***** +// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** +// -------------------------------------------------------------------------------- + + + + // -------------------------------------------------------------------------------- + // Function : privCheckFormat() + // Description : + // This method check that the archive exists and is a valid zip archive. + // Several level of check exists. (futur) + // Parameters : + // $p_level : Level of check. Default 0. + // 0 : Check the first bytes (magic codes) (default value)) + // 1 : 0 + Check the central directory (futur) + // 2 : 1 + Check each file header (futur) + // Return Values : + // true on success, + // false on error, the error code is set. + // -------------------------------------------------------------------------------- + function privCheckFormat($p_level=0) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", ""); + $v_result = true; + + // ----- Reset the file system cache + clearstatcache(); + + // ----- Reset the error handler + $this->privErrorReset(); + + // ----- Look if the file exits + if (!is_file($this->zipname)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); + return(false); + } + + // ----- Check that the file is readeable + if (!is_readable($this->zipname)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); + return(false); + } + + // ----- Check the magic code + // TBC + + // ----- Check the central header + // TBC + + // ----- Check each file header + // TBC + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privParseOptions() + // Description : + // This internal methods reads the variable list of arguments ($p_options_list, + // $p_size) and generate an array with the options and values ($v_result_list). + // $v_requested_options contains the options that can be present and those that + // must be present. + // $v_requested_options is an array, with the option value as key, and 'optional', + // or 'mandatory' as value. + // Parameters : + // See above. + // Return Values : + // 1 on success. + // 0 on failure. + // -------------------------------------------------------------------------------- + function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", ""); + $v_result=1; + + // ----- Read the options + $i=0; + while ($i<$p_size) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'"); + + // ----- Check if the option is requested + if (!isset($v_requested_options[$p_options_list[$i]])) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Look for next option + switch ($p_options_list[$i]) { + // ----- Look for options that request a path value + case PCLZIP_OPT_PATH : + case PCLZIP_OPT_REMOVE_PATH : + case PCLZIP_OPT_ADD_PATH : + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); + $i++; + break; + + // ----- Look for options that request an array of string for value + case PCLZIP_OPT_BY_NAME : + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; + } + else if (is_array($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + } + else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); + $i++; + break; + + // ----- Look for options that request an EREG or PREG expression + case PCLZIP_OPT_BY_EREG : + case PCLZIP_OPT_BY_PREG : + //case PCLZIP_OPT_CRYPT : + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + } + else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); + $i++; + break; + + // ----- Look for options that takes a string + case PCLZIP_OPT_COMMENT : + case PCLZIP_OPT_ADD_COMMENT : + case PCLZIP_OPT_PREPEND_COMMENT : + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, + "Missing parameter value for option '" + .PclZipUtilOptionText($p_options_list[$i]) + ."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + if (is_string($p_options_list[$i+1])) { + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + } + else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, + "Wrong parameter value for option '" + .PclZipUtilOptionText($p_options_list[$i]) + ."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); + $i++; + break; + + // ----- Look for options that request an array of index + case PCLZIP_OPT_BY_INDEX : + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + $v_work_list = array(); + if (is_string($p_options_list[$i+1])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'"); + + // ----- Remove spaces + $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); + + // ----- Parse items + $v_work_list = explode(",", $p_options_list[$i+1]); + } + else if (is_integer($p_options_list[$i+1])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'"); + $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; + } + else if (is_array($p_options_list[$i+1])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array"); + $v_work_list = $p_options_list[$i+1]; + } + else { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Reduce the index list + // each index item in the list must be a couple with a start and + // an end value : [0,3], [5-5], [8-10], ... + // ----- Check the format of each item + $v_sort_flag=false; + $v_sort_value=0; + for ($j=0; $j= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); + $i++; + break; + + // ----- Look for options that request a call-back + case PCLZIP_CB_PRE_EXTRACT : + case PCLZIP_CB_POST_EXTRACT : + case PCLZIP_CB_PRE_ADD : + case PCLZIP_CB_POST_ADD : + /* for futur use + case PCLZIP_CB_PRE_DELETE : + case PCLZIP_CB_POST_DELETE : + case PCLZIP_CB_PRE_LIST : + case PCLZIP_CB_POST_LIST : + */ + // ----- Check the number of parameters + if (($i+1) >= $p_size) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Get the value + $v_function_name = $p_options_list[$i+1]; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'"); + + // ----- Check that the value is a valid existing function + if (!function_exists($v_function_name)) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Set the attribute + $v_result_list[$p_options_list[$i]] = $v_function_name; + $i++; + break; + + default : + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, + "Unknown parameter '" + .$p_options_list[$i]."'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Next options + $i++; + } + + // ----- Look for mandatory options + if ($v_requested_options !== false) { + for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { + // ----- Look for mandatory option + if ($v_requested_options[$key] == 'mandatory') { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); + // ----- Look if present + if (!isset($v_result_list[$key])) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + } + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCreate() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privCreate($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list, result_list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + $v_list_detail = array(); + + // ----- Open the file in write mode + if (($v_result = $this->privOpenFd('wb')) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Add the list of files + $v_result = $this->privAddList($p_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options); + + // ----- Close + $this->privCloseFd(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAdd() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privAdd($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list, result_list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + $v_list_detail = array(); + + // ----- Look if the archive exists or is empty + if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it."); + + // ----- Do a create + $v_result = $this->privCreate($p_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_result=$this->privOpenFd('rb')) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Go to beginning of File + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); + + // ----- Creates a temporay file + $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; + + // ----- Open the temporary file in write mode + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) + { + $this->privCloseFd(); + + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Copy the files from the archive to the temporary file + // TBC : Here I should better append the file and go back to erase the central dir + $v_size = $v_central_dir['offset']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = fread($this->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Swap the file descriptor + // Here is a trick : I swap the temporary fd with the zip fd, in order to use + // the following methods on the temporary fil and not the real archive + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Add the files + $v_header_list = array(); + if (($v_result = $this->privAddFileList($p_list, $v_header_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1) + { + fclose($v_zip_temp_fd); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); + + // ----- Copy the block of file headers from the old archive + $v_size = $v_central_dir['size']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @fread($v_zip_temp_fd, $v_read_size); + @fwrite($this->zip_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Create the Central Dir files header + for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { + fclose($v_zip_temp_fd); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + $v_count++; + } + + // ----- Transform the header to a 'usable' info + $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); + } + + // ----- Zip file comment + $v_comment = $v_central_dir['comment']; + if (isset($p_options[PCLZIP_OPT_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_COMMENT]; + } + if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { + $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; + } + if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; + } + + // ----- Calculate the size of the central header + $v_size = @ftell($this->zip_fd)-$v_offset; + + // ----- Create the central dir footer + if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) + { + // ----- Reset the file list + unset($v_header_list); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Swap back the file descriptor + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Close + $this->privCloseFd(); + + // ----- Close the temporary file + @fclose($v_zip_temp_fd); + + // ----- Delete the zip file + // TBC : I should test the result ... + @unlink($this->zipname); + + // ----- Rename the temporary file + // TBC : I should test the result ... + //@rename($v_zip_temp_name, $this->zipname); + PclZipUtilRename($v_zip_temp_name, $this->zipname); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privOpenFd() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function privOpenFd($p_mode) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode); + $v_result=1; + + // ----- Look if already open + if ($this->zip_fd != 0) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode'); + if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCloseFd() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function privCloseFd() + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", ""); + $v_result=1; + + if ($this->zip_fd != 0) + @fclose($this->zip_fd); + $this->zip_fd = 0; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddList() + // Description : + // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is + // different from the real path of the file. This is usefull if you want to have PclTar + // running in any directory, and memorize relative path from an other directory. + // Parameters : + // $p_list : An array containing the file or directory names to add in the tar + // $p_result_list : list of added files with their properties (specially the status field) + // $p_add_dir : Path to add in the filename path archived + // $p_remove_dir : Path to remove in the filename path archived + // Return Values : + // -------------------------------------------------------------------------------- + function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + + // ----- Add the files + $v_header_list = array(); + if (($v_result = $this->privAddFileList($p_list, $v_header_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($this->zip_fd); + + // ----- Create the Central Dir files header + for ($i=0,$v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + $v_count++; + } + + // ----- Transform the header to a 'usable' info + $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); + } + + // ----- Zip file comment + $v_comment = ''; + if (isset($p_options[PCLZIP_OPT_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_COMMENT]; + } + + // ----- Calculate the size of the central header + $v_size = @ftell($this->zip_fd)-$v_offset; + + // ----- Create the central dir footer + if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) + { + // ----- Reset the file list + unset($v_header_list); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddFileList() + // Description : + // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is + // different from the real path of the file. This is usefull if you want to + // run the lib in any directory, and memorize relative path from an other directory. + // Parameters : + // $p_list : An array containing the file or directory names to add in the tar + // $p_result_list : list of added files with their properties (specially the status field) + // $p_add_dir : Path to add in the filename path archived + // $p_remove_dir : Path to remove in the filename path archived + // Return Values : + // -------------------------------------------------------------------------------- + function privAddFileList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + $v_header = array(); + + // ----- Recuperate the current number of elt in list + $v_nb = sizeof($p_result_list); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have $v_nb elements"); + + // ----- Loop on the files + for ($j=0; ($j 0xFF) + { + // ----- Error log + PclZip::privErrorLog(-5, "File name is too long (max. 255) : '$p_filename'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + */ + + // ----- Look if it is a file or a dir with no all pathnre move + if ((is_file($p_filename)) || ((is_dir($p_filename)) && !$p_remove_all_dir)) { + // ----- Add the file + if (($v_result = $this->privAddFile($p_filename, $v_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1) + { + // ----- Return status + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the file infos + $p_result_list[$v_nb++] = $v_header; + } + + // ----- Look for directory + if (@is_dir($p_filename)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "$p_filename is a directory"); + + // ----- Look for path + if ($p_filename != ".") + $v_path = $p_filename."/"; + else + $v_path = ""; + + // ----- Read the directory for files and sub-directories + if ($p_hdir = @opendir($p_filename)) { + $p_hitem = @readdir($p_hdir); // '.' directory + $p_hitem = @readdir($p_hdir); // '..' directory + while (($p_hitem = @readdir($p_hdir)) !== false) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for $p_hitem in the directory"); + + // ----- Look for a file + if (is_file($v_path.$p_hitem)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Add the file '".$v_path.$p_hitem."'"); + + // ----- Add the file + if (($v_result = $this->privAddFile($v_path.$p_hitem, $v_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1) { + // ----- Return status + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the file infos + $p_result_list[$v_nb++] = $v_header; + } + + // ----- Recursive call to privAddFileList() + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Add the directory '".$v_path.$p_hitem."'"); + + // ----- Need an array as parameter + $p_temp_list[0] = $v_path.$p_hitem; + $v_result = $this->privAddFileList($p_temp_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options); + + // ----- Update the number of elements of the list + $v_nb = sizeof($p_result_list); + } + } + } + + // ----- Free memory for the recursive loop + unset($p_temp_list); + unset($p_hdir); + unset($p_hitem); + } + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have $v_nb elements"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privAddFile() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privAddFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='$p_filename', add_dir='$p_add_dir', remove_dir='$p_remove_dir'"); + $v_result=1; + + if ($p_filename == "") + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Calculate the stored filename + $v_stored_filename = $p_filename; + + // ----- Look for all path to remove + if ($p_remove_all_dir) { + $v_stored_filename = basename($p_filename); + } + // ----- Look for partial path remove + else if ($p_remove_dir != "") + { + if (substr($p_remove_dir, -1) != '/') + $p_remove_dir .= "/"; + + if ((substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) + { + if ((substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) + $p_remove_dir = "./".$p_remove_dir; + if ((substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./")) + $p_remove_dir = substr($p_remove_dir, 2); + } + + $v_compare = PclZipUtilPathInclusion($p_remove_dir, $p_filename); + if ($v_compare > 0) +// if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) + { + + if ($v_compare == 2) { + $v_stored_filename = ""; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder"); + } + else { + $v_stored_filename = substr($p_filename, strlen($p_remove_dir)); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$p_filename' = '$v_stored_filename'"); + } + } + } + // ----- Look for path to add + if ($p_add_dir != "") + { + if (substr($p_add_dir, -1) == "/") + $v_stored_filename = $p_add_dir.$v_stored_filename; + else + $v_stored_filename = $p_add_dir."/".$v_stored_filename; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); + } + + // ----- Filename (reduce the path of stored name) + $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_stored_filename', strlen ".strlen($v_stored_filename)); + + // ----- Set the file properties + clearstatcache(); + $p_header['version'] = 20; + $p_header['version_extracted'] = 10; + $p_header['flag'] = 0; + $p_header['compression'] = 0; + $p_header['mtime'] = filemtime($p_filename); + $p_header['crc'] = 0; + $p_header['compressed_size'] = 0; + $p_header['size'] = filesize($p_filename); + $p_header['filename_len'] = strlen($p_filename); + $p_header['extra_len'] = 0; + $p_header['comment_len'] = 0; + $p_header['disk'] = 0; + $p_header['internal'] = 0; +// $p_header['external'] = (is_file($p_filename)?0xFE49FFE0:0x41FF0010); + $p_header['external'] = (is_file($p_filename)?0x00000000:0x00000010); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'"); + $p_header['offset'] = 0; + $p_header['filename'] = $p_filename; + $p_header['stored_filename'] = $v_stored_filename; + $p_header['extra'] = ''; + $p_header['comment'] = ''; + $p_header['status'] = 'ok'; + $p_header['index'] = -1; + + + // ----- Look for pre-add callback + if (isset($p_options[PCLZIP_CB_PRE_ADD])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction"); + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_header, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); + if ($v_result == 0) { + // ----- Change the file status + $p_header['status'] = "skipped"; + $v_result = 1; + } + + // ----- Update the informations + // Only some fields can be modified + if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { + $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'"); + } + } + + // ----- Look for empty stored filename + if ($p_header['stored_filename'] == "") { + $p_header['status'] = "filtered"; + } + + // ----- Check the path length + if (strlen($p_header['stored_filename']) > 0xFF) { + $p_header['status'] = 'filename_too_long'; + } + + // ----- Look if no error, or file not skipped + if ($p_header['status'] == 'ok') { + + // ----- Look for a file + if (is_file($p_filename)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file"); + // ----- Open the source file + if (($v_file = @fopen($p_filename, "rb")) == 0) { + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed"); + // ----- Read the file content + $v_content_compressed = @fread($v_file, $p_header['size']); + + // ----- Calculate the CRC + $p_header['crc'] = @crc32($v_content_compressed); + + // ----- Set header parameters + $p_header['compressed_size'] = $p_header['size']; + $p_header['compression'] = 0; + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed"); + // ----- Read the file content + $v_content = @fread($v_file, $p_header['size']); + + // ----- Calculate the CRC + $p_header['crc'] = @crc32($v_content); + + // ----- Compress the file + $v_content_compressed = @gzdeflate($v_content); + + // ----- Set header parameters + $p_header['compressed_size'] = strlen($v_content_compressed); + $p_header['compression'] = 8; + } + + // ----- Look for encryption + /* + if ((isset($p_options[PCLZIP_OPT_CRYPT])) + && ($p_options[PCLZIP_OPT_CRYPT] != "")) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ...."); + + // Should be a random header + $v_header = 'xxxxxxxxxxxx'; + $v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed, + $p_header['compressed_size'], + $v_header, + $p_header['crc'], + "test"); + + $p_header['compressed_size'] += 12; + $p_header['flag'] = 1; + + // ----- Add the header to the data + $v_content_compressed = $v_header.$v_content_compressed; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed).""); + } + */ + + // ----- Call the header generation + if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { + @fclose($v_file); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Write the compressed (or not) content + $v_binary_data = pack('a'.$p_header['compressed_size'], + $v_content_compressed); + @fwrite($this->zip_fd, $v_binary_data, $p_header['compressed_size']); + + // ----- Close the file + @fclose($v_file); + } + + // ----- Look for a directory + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder"); + // ----- Look for directory last '/' + if (@substr($p_header['stored_filename'], -1) != '/') { + $p_header['stored_filename'] .= '/'; + } + + // ----- Set the file properties + $p_header['size'] = 0; + //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked + $p_header['external'] = 0x00000010; // Value for a folder : to be checked + + // ----- Call the header generation + if (($v_result = $this->privWriteFileHeader($p_header)) != 1) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + } + } + + // ----- Look for pre-add callback + if (isset($p_options[PCLZIP_CB_POST_ADD])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction"); + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_header, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); + if ($v_result == 0) { + // ----- Ignored + $v_result = 1; + } + + // ----- Update the informations + // Nothing can be modified + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privWriteFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privWriteFileHeader(&$p_header) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); + $v_result=1; + + // TBC + //for(reset($p_header); $key = key($p_header); next($p_header)) { + // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]); + //} + + // ----- Store the offset position of the file + $p_header['offset'] = ftell($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']); + + // ----- Transform UNIX mtime to DOS format mdate/mtime + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); + $v_date = getdate($p_header['mtime']); + $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; + $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; + + // ----- Packed data + $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, + $p_header['version_extracted'], $p_header['flag'], + $p_header['compression'], $v_mtime, $v_mdate, + $p_header['crc'], $p_header['compressed_size'], + $p_header['size'], + strlen($p_header['stored_filename']), + $p_header['extra_len']); + + // ----- Write the first 148 bytes of the header in the archive + fputs($this->zip_fd, $v_binary_data, 30); + + // ----- Write the variable fields + if (strlen($p_header['stored_filename']) != 0) + { + fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); + } + if ($p_header['extra_len'] != 0) + { + fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privWriteCentralFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privWriteCentralFileHeader(&$p_header) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); + $v_result=1; + + // TBC + //for(reset($p_header); $key = key($p_header); next($p_header)) { + // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]); + //} + + // ----- Transform UNIX mtime to DOS format mdate/mtime + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); + $v_date = getdate($p_header['mtime']); + $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; + $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; + + // ----- Packed data + $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, + $p_header['version'], $p_header['version_extracted'], + $p_header['flag'], $p_header['compression'], + $v_mtime, $v_mdate, $p_header['crc'], + $p_header['compressed_size'], $p_header['size'], + strlen($p_header['stored_filename']), + $p_header['extra_len'], $p_header['comment_len'], + $p_header['disk'], $p_header['internal'], + $p_header['external'], $p_header['offset']); + + // ----- Write the 42 bytes of the header in the zip file + fputs($this->zip_fd, $v_binary_data, 46); + + // ----- Write the variable fields + if (strlen($p_header['stored_filename']) != 0) + { + fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); + } + if ($p_header['extra_len'] != 0) + { + fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); + } + if ($p_header['comment_len'] != 0) + { + fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privWriteCentralHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"'); + $v_result=1; + + // ----- Packed data + $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, + $p_nb_entries, $p_size, + $p_offset, strlen($p_comment)); + + // ----- Write the 22 bytes of the header in the zip file + fputs($this->zip_fd, $v_binary_data, 22); + + // ----- Write the variable fields + if (strlen($p_comment) != 0) + { + fputs($this->zip_fd, $p_comment, strlen($p_comment)); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privList() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privList(&$p_list) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list"); + $v_result=1; + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Go to beginning of Central Dir + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); + if (@fseek($this->zip_fd, $v_central_dir['offset'])) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); + + // ----- Read each entry + for ($i=0; $i<$v_central_dir['entries']; $i++) + { + // ----- Read the file header + if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + $v_header['index'] = $i; + + // ----- Get the only interesting attributes + $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); + unset($v_header); + } + + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privConvertHeader2FileInfo() + // Description : + // This function takes the file informations from the central directory + // entries and extract the interesting parameters that will be given back. + // The resulting file infos are set in the array $p_info + // $p_info['filename'] : Filename with full path. Given by user (add), + // extracted in the filesystem (extract). + // $p_info['stored_filename'] : Stored filename in the archive. + // $p_info['size'] = Size of the file. + // $p_info['compressed_size'] = Compressed size of the file. + // $p_info['mtime'] = Last modification date of the file. + // $p_info['comment'] = Comment associated with the file. + // $p_info['folder'] = true/false : indicates if the entry is a folder or not. + // $p_info['status'] = status of the action on the file. + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privConvertHeader2FileInfo($p_header, &$p_info) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'"); + $v_result=1; + + // ----- Get the interesting attributes + $p_info['filename'] = $p_header['filename']; + $p_info['stored_filename'] = $p_header['stored_filename']; + $p_info['size'] = $p_header['size']; + $p_info['compressed_size'] = $p_header['compressed_size']; + $p_info['mtime'] = $p_header['mtime']; + $p_info['comment'] = $p_header['comment']; + $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); + $p_info['index'] = $p_header['index']; + $p_info['status'] = $p_header['status']; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractByRule() + // Description : + // Extract a file or directory depending of rules (by index, by name, ...) + // Parameters : + // $p_file_list : An array where will be placed the properties of each + // extracted file + // $p_path : Path to add while writing the extracted files + // $p_remove_path : Path to remove (from the file memorized path) while writing the + // extracted files. If the path does not match the file path, + // the file is extracted with its memorized path. + // $p_remove_path does not apply to 'list' mode. + // $p_path and $p_remove_path are commulative. + // Return Values : + // 1 on success,0 or less on error (see error code list) + // -------------------------------------------------------------------------------- + function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); + $v_result=1; + + // ----- Check the path + if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path,1,2)!=":/"))) + $p_path = "./".$p_path; + + // ----- Reduce the path last (and duplicated) '/' + if (($p_path != "./") && ($p_path != "/")) + { + // ----- Look for the path end '/' + while (substr($p_path, -1) == "/") + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'"); + $p_path = substr($p_path, 0, strlen($p_path)-1); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]"); + } + } + + // ----- Look for path to remove format (should end by /) + if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) + { + $p_remove_path .= '/'; + } + $p_remove_path_size = strlen($p_remove_path); + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_result = $this->privOpenFd('rb')) != 1) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + // ----- Close the zip file + $this->privCloseFd(); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Start at beginning of Central Dir + $v_pos_entry = $v_central_dir['offset']; + + // ----- Read each entry + $j_start = 0; + for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'"); + + // ----- Read next Central dir entry + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'"); + if (@fseek($this->zip_fd, $v_pos_entry)) + { + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'"); + + // ----- Read the file header + $v_header = array(); + if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) + { + // ----- Close the zip file + $this->privCloseFd(); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Store the index + $v_header['index'] = $i; + + // ----- Store the file position + $v_pos_entry = ftell($this->zip_fd); + + // ----- Look for the specific extract rules + $v_extract = false; + + // ----- Look for extract by name rule + if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) + && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); + + // ----- Look if the filename is in the list + for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) + && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); + $v_extract = true; + } + } + // ----- Look for a filename + elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); + $v_extract = true; + } + } + } + + // ----- Look for extract by ereg rule + else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) + && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); + + if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); + $v_extract = true; + } + } + + // ----- Look for extract by preg rule + else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) + && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); + + if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); + $v_extract = true; + } + } + + // ----- Look for extract by index rule + else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) + && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); + + // ----- Look if the index is in the list + for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); + $v_extract = true; + } + if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); + $j_start = $j+1; + } + + if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); + break; + } + } + } + + // ----- Look for no rule, which means extract all the archive + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)"); + $v_extract = true; + } + + // ----- Check compression method + if ( ($v_extract) + && ( ($v_header['compression'] != 8) + && ($v_header['compression'] != 0))) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")"); + $v_header['status'] = 'unsupported_compression'; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) + && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); + + PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, + "Filename '".$v_header['stored_filename']."' is " + ."compressed by an unsupported compression " + ."method (".$v_header['compression'].") "); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + + // ----- Check encrypted files + if (($v_extract) && (($v_header['flag'] & 1) == 1)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption"); + $v_header['status'] = 'unsupported_encryption'; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) + && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); + + PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, + "Unsupported encryption for " + ." filename '".$v_header['stored_filename'] + ."'"); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + + // ----- Look for real extraction + if (($v_extract) && ($v_header['status'] != 'ok')) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract"); + $v_result = $this->privConvertHeader2FileInfo($v_header, + $p_file_list[$v_nb_extracted++]); + if ($v_result != 1) { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + $v_extract = false; + } + + // ----- Look for real extraction + if ($v_extract) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'"); + + // ----- Go to the file position + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); + if (@fseek($this->zip_fd, $v_header['offset'])) + { + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); + + // ----- Look for extraction as string + if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { + + // ----- Extracting the file + $v_result1 = $this->privExtractFileAsString($v_header, $v_string); + if ($v_result1 < 1) { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); + return $v_result1; + } + + // ----- Get the only interesting attributes + if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) + { + // ----- Close the zip file + $this->privCloseFd(); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Set the file content + $p_file_list[$v_nb_extracted]['content'] = $v_string; + + // ----- Next extracted file + $v_nb_extracted++; + + // ----- Look for user callback abort + if ($v_result1 == 2) { + break; + } + } + // ----- Look for extraction in standard output + elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) + && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { + // ----- Extracting the file in standard output + $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); + if ($v_result1 < 1) { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); + return $v_result1; + } + + // ----- Get the only interesting attributes + if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for user callback abort + if ($v_result1 == 2) { + break; + } + } + // ----- Look for normal extraction + else { + // ----- Extracting the file + $v_result1 = $this->privExtractFile($v_header, + $p_path, $p_remove_path, + $p_remove_all_path, + $p_options); + if ($v_result1 < 1) { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); + return $v_result1; + } + + // ----- Get the only interesting attributes + if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) + { + // ----- Close the zip file + $this->privCloseFd(); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look for user callback abort + if ($v_result1 == 2) { + break; + } + } + } + } + + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFile() + // Description : + // Parameters : + // Return Values : + // + // 1 : ... ? + // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback + // -------------------------------------------------------------------------------- + function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); + $v_result=1; + + // ----- Read the file header + if (($v_result = $this->privReadFileHeader($v_header)) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); + + // ----- Check that the file header is coherent with $p_entry info + if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { + // TBC + } + + // ----- Look for all path to remove + if ($p_remove_all_path == true) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed"); + // ----- Get the basename of the path + $p_entry['filename'] = basename($p_entry['filename']); + } + + // ----- Look for path to remove + else if ($p_remove_path != "") + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove"); + if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'"); + + // ----- Change the file status + $p_entry['status'] = "filtered"; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + $p_remove_path_size = strlen($p_remove_path); + if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'"); + + // ----- Remove the path + $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'"); + } + } + + // ----- Add the path + if ($p_path != '') + { + $p_entry['filename'] = $p_path."/".$p_entry['filename']; + } + + // ----- Look for pre-extract callback + if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + if ($v_result == 0) { + // ----- Change the file status + $p_entry['status'] = "skipped"; + $v_result = 1; + } + + // ----- Look for abort result + if ($v_result == 2) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); + // ----- This status is internal and will be changed in 'skipped' + $p_entry['status'] = "aborted"; + $v_result = PCLZIP_ERR_USER_ABORTED; + } + + // ----- Update the informations + // Only some fields can be modified + $p_entry['filename'] = $v_local_header['filename']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + + // ----- Look for specific actions while the file exist + if (file_exists($p_entry['filename'])) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists"); + + // ----- Look if file is a directory + if (is_dir($p_entry['filename'])) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory"); + + // ----- Change the file status + $p_entry['status'] = "already_a_directory"; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + // For historical reason first PclZip implementation does not stop + // when this kind of error occurs. + if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) + && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); + + PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, + "Filename '".$p_entry['filename']."' is " + ."already used by an existing directory"); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + // ----- Look if file is write protected + else if (!is_writeable($p_entry['filename'])) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected"); + + // ----- Change the file status + $p_entry['status'] = "write_protected"; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + // For historical reason first PclZip implementation does not stop + // when this kind of error occurs. + if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) + && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); + + PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, + "Filename '".$p_entry['filename']."' exists " + ."and is write protected"); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + + // ----- Look if the extracted file is older + else if (filemtime($p_entry['filename']) > $p_entry['mtime']) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); + // ----- Change the file status + if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) + && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced"); + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced"); + $p_entry['status'] = "newer_exist"; + + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR + // For historical reason first PclZip implementation does not stop + // when this kind of error occurs. + if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) + && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); + + PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, + "Newer version of '".$p_entry['filename']."' exists " + ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); + } + } + + // ----- Check the directory availability and create it if necessary + else { + if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) + $v_dir_to_check = $p_entry['filename']; + else if (!strstr($p_entry['filename'], "/")) + $v_dir_to_check = ""; + else + $v_dir_to_check = dirname($p_entry['filename']); + + if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'"); + + // ----- Change the file status + $p_entry['status'] = "path_creation_fail"; + + // ----- Return + ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + //return $v_result; + $v_result = 1; + } + } + } + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010)==0x00000010)) + { + // ----- Look for not compressed file + if ($p_entry['compression'] == 0) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); + + // ----- Opening destination file + if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); + + // ----- Change the file status + $p_entry['status'] = "write_error"; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes"); + + // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks + $v_size = $p_entry['compressed_size']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes"); + $v_buffer = fread($this->zip_fd, $v_read_size); + $v_binary_data = pack('a'.$v_read_size, $v_buffer); + @fwrite($v_dest_file, $v_binary_data, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Closing the destination file + fclose($v_dest_file); + + // ----- Change the file mtime + touch($p_entry['filename'], $p_entry['mtime']); + + + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")"); + // ----- TBC + // Need to be finished + if (($p_entry['flag'] & 1) == 1) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted"); + /* + // ----- Read the encryption header + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes"); + $v_encryption_header = @fread($this->zip_fd, 12); + + // ----- Read the encrypted & compressed file in a buffer + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes"); + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12); + + // ----- Decrypt the buffer + $this->privDecrypt($v_encryption_header, $v_buffer, + $p_entry['compressed_size']-12, $p_entry['crc']); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Buffer is '".$v_buffer."'"); + */ + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes"); + // ----- Read the compressed file in a buffer (one shot) + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); + } + + // ----- Decompress the file + $v_file_content = @gzinflate($v_buffer); + unset($v_buffer); + if ($v_file_content === FALSE) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file"); + + // ----- Change the file status + // TBC + $p_entry['status'] = "error"; + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Opening destination file + if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); + + // ----- Change the file status + $p_entry['status'] = "write_error"; + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Write the uncompressed data + @fwrite($v_dest_file, $v_file_content, $p_entry['size']); + unset($v_file_content); + + // ----- Closing the destination file + @fclose($v_dest_file); + + // ----- Change the file mtime + @touch($p_entry['filename'], $p_entry['mtime']); + } + + // ----- Look for chmod option + if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'"); + + // ----- Change the mode of the file + @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); + } + } + + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } + + // ----- Look for post-extract callback + elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + + // ----- Look for abort result + if ($v_result == 2) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); + $v_result = PCLZIP_ERR_USER_ABORTED; + } + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFileInOutput() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privExtractFileInOutput(&$p_entry, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', ""); + $v_result=1; + + // ----- Read the file header + if (($v_result = $this->privReadFileHeader($v_header)) != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); + + // ----- Check that the file header is coherent with $p_entry info + if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { + // TBC + } + + // ----- Look for pre-extract callback + if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + if ($v_result == 0) { + // ----- Change the file status + $p_entry['status'] = "skipped"; + $v_result = 1; + } + + // ----- Look for abort result + if ($v_result == 2) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); + // ----- This status is internal and will be changed in 'skipped' + $p_entry['status'] = "aborted"; + $v_result = PCLZIP_ERR_USER_ABORTED; + } + + // ----- Update the informations + // Only some fields can be modified + $p_entry['filename'] = $v_local_header['filename']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010)==0x00000010)) { + // ----- Look for not compressed file + if ($p_entry['compressed_size'] == $p_entry['size']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); + + // ----- Read the file in a buffer (one shot) + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Send the file to the output + echo $v_buffer; + unset($v_buffer); + } + else { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes"); + + // ----- Read the compressed file in a buffer (one shot) + $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Decompress the file + $v_file_content = gzinflate($v_buffer); + unset($v_buffer); + + // ----- Send the file to the output + echo $v_file_content; + unset($v_file_content); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); + } + } + + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } + + // ----- Look for post-extract callback + elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + + // ----- Look for abort result + if ($v_result == 2) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); + $v_result = PCLZIP_ERR_USER_ABORTED; + } + } + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privExtractFileAsString() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privExtractFileAsString(&$p_entry, &$p_string) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'"); + $v_result=1; + + // ----- Read the file header + $v_header = array(); + if (($v_result = $this->privReadFileHeader($v_header)) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); + + // ----- Check that the file header is coherent with $p_entry info + if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { + // TBC + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'"); + + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010)==0x00000010)) + { + // ----- Look for not compressed file + if ($p_entry['compressed_size'] == $p_entry['size']) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); + + // ----- Reading the file + $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); + } + else + { + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file"); + + // ----- Reading the file + $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Decompress the file + if (($p_string = @gzinflate($v_data)) === FALSE) { + // TBC + } + } + + // ----- Trace + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); + } + else { + // TBC : error : can not extract a folder in a string + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privReadFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privReadFileHeader(&$p_header) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", ""); + $v_result=1; + + // ----- Read the 4 bytes signature + $v_binary_data = @fread($this->zip_fd, 4); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); + $v_data = unpack('Vid', $v_binary_data); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); + + // ----- Check signature + if ($v_data['id'] != 0x04034b50) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header"); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Read the first 42 bytes of the header + $v_binary_data = fread($this->zip_fd, 26); + + // ----- Look for invalid block size + if (strlen($v_binary_data) != 26) + { + $p_header['filename'] = ""; + $p_header['status'] = "invalid_header"; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Extract the values + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'"); + $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); + + // ----- Get filename + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']); + $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\''); + + // ----- Get extra_fields + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']); + if ($v_data['extra_len'] != 0) { + $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); + } + else { + $p_header['extra'] = ''; + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\''); + + // ----- Extract properties + $p_header['version_extracted'] = $v_data['version']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); + $p_header['compression'] = $v_data['compression']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\''); + $p_header['size'] = $v_data['size']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\''); + $p_header['compressed_size'] = $v_data['compressed_size']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\''); + $p_header['crc'] = $v_data['crc']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); + $p_header['flag'] = $v_data['flag']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\''); + + // ----- Recuperate date in UNIX format + $p_header['mdate'] = $v_data['mdate']; + $p_header['mtime'] = $v_data['mtime']; + if ($p_header['mdate'] && $p_header['mtime']) + { + // ----- Extract time + $v_hour = ($p_header['mtime'] & 0xF800) >> 11; + $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; + $v_seconde = ($p_header['mtime'] & 0x001F)*2; + + // ----- Extract date + $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; + $v_month = ($p_header['mdate'] & 0x01E0) >> 5; + $v_day = $p_header['mdate'] & 0x001F; + + // ----- Get UNIX date format + $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); + } + else + { + $p_header['mtime'] = time(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); + } + + // TBC + //for(reset($v_data); $key = key($v_data); next($v_data)) { + // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]); + //} + + // ----- Set the stored filename + $p_header['stored_filename'] = $p_header['filename']; + + // ----- Set the status field + $p_header['status'] = "ok"; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privReadCentralFileHeader() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privReadCentralFileHeader(&$p_header) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", ""); + $v_result=1; + + // ----- Read the 4 bytes signature + $v_binary_data = @fread($this->zip_fd, 4); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); + $v_data = unpack('Vid', $v_binary_data); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); + + // ----- Check signature + if ($v_data['id'] != 0x02014b50) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature"); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Read the first 42 bytes of the header + $v_binary_data = fread($this->zip_fd, 42); + + // ----- Look for invalid block size + if (strlen($v_binary_data) != 42) + { + $p_header['filename'] = ""; + $p_header['status'] = "invalid_header"; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Extract the values + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'"); + $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); + + // ----- Get filename + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']); + if ($p_header['filename_len'] != 0) + $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); + else + $p_header['filename'] = ''; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\''); + + // ----- Get extra + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']); + if ($p_header['extra_len'] != 0) + $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); + else + $p_header['extra'] = ''; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\''); + + // ----- Get comment + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']); + if ($p_header['comment_len'] != 0) + $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); + else + $p_header['comment'] = ''; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\''); + + // ----- Extract properties + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\''); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\''); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\''); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\''); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\''); + + // ----- Recuperate date in UNIX format + if ($p_header['mdate'] && $p_header['mtime']) + { + // ----- Extract time + $v_hour = ($p_header['mtime'] & 0xF800) >> 11; + $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; + $v_seconde = ($p_header['mtime'] & 0x001F)*2; + + // ----- Extract date + $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; + $v_month = ($p_header['mdate'] & 0x01E0) >> 5; + $v_day = $p_header['mdate'] & 0x001F; + + // ----- Get UNIX date format + $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); + } + else + { + $p_header['mtime'] = time(); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); + } + + // ----- Set the stored filename + $p_header['stored_filename'] = $p_header['filename']; + + // ----- Set default status to ok + $p_header['status'] = 'ok'; + + // ----- Look if it is a directory + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'"); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')'); + if (substr($p_header['filename'], -1) == '/') { + //$p_header['external'] = 0x41FF0010; + $p_header['external'] = 0x00000010; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\''); + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\''); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privCheckFileHeaders() + // Description : + // Parameters : + // Return Values : + // 1 on success, + // 0 on error; + // -------------------------------------------------------------------------------- + function privCheckFileHeaders(&$p_local_header, &$p_central_header) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", ""); + $v_result=1; + + // ----- Check the static values + // TBC + if ($p_local_header['filename'] != $p_central_header['filename']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed'); + } + if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed'); + } + if ($p_local_header['flag'] != $p_central_header['flag']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed'); + } + if ($p_local_header['compression'] != $p_central_header['compression']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed'); + } + if ($p_local_header['mtime'] != $p_central_header['mtime']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed'); + } + if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed'); + } + + // ----- Look for flag bit 3 + if (($p_local_header['flag'] & 8) == 8) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !'); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header'); + $p_local_header['size'] = $p_central_header['size']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\''); + $p_local_header['compressed_size'] = $p_central_header['compressed_size']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\''); + $p_local_header['crc'] = $p_central_header['crc']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\''); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privReadEndCentralDir() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privReadEndCentralDir(&$p_central_dir) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", ""); + $v_result=1; + + // ----- Go to the end of the zip file + $v_size = filesize($this->zipname); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size"); + @fseek($this->zip_fd, $v_size); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\''); + if (@ftell($this->zip_fd) != $v_size) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- First try : look if this is an archive with no commentaries (most of the time) + // in this case the end of central dir is at 22 bytes of the file end + $v_found = 0; + if ($v_size > 26) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment'); + @fseek($this->zip_fd, $v_size-22); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\''); + if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Read for bytes + $v_binary_data = @fread($this->zip_fd, 4); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); + $v_data = @unpack('Vid', $v_binary_data); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); + + // ----- Check signature + if ($v_data['id'] == 0x06054b50) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position."); + $v_found = 1; + } + + $v_pos = ftell($this->zip_fd); + } + + // ----- Go back to the maximum possible size of the Central Dir End Record + if (!$v_found) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir'); + $v_maximum_size = 65557; // 0xFFFF + 22; + if ($v_maximum_size > $v_size) + $v_maximum_size = $v_size; + @fseek($this->zip_fd, $v_size-$v_maximum_size); + if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\''); + + // ----- Read byte per byte in order to find the signature + $v_pos = ftell($this->zip_fd); + $v_bytes = 0x00000000; + while ($v_pos < $v_size) + { + // ----- Read a byte + $v_byte = @fread($this->zip_fd, 1); + + // ----- Add the byte + $v_bytes = ($v_bytes << 8) | Ord($v_byte); + + // ----- Compare the bytes + if ($v_bytes == 0x504b0506) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\''); + $v_pos++; + break; + } + + $v_pos++; + } + + // ----- Look if not found end of central dir + if ($v_pos == $v_size) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature"); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + + // ----- Read the first 18 bytes of the header + $v_binary_data = fread($this->zip_fd, 18); + + // ----- Look for invalid block size + if (strlen($v_binary_data) != 18) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Extract the values + ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'"); + ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'"); + $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); + + // ----- Check the global size + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']); + if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive."); + + // ----- Removed in release 2.2 see readme file + // The check of the file size is a little too strict. + // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. + // While decrypted, zip has training 0 bytes + if (0) { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, + 'The central dir is not at the end of the archive.' + .' Some trailing bytes exists after the archive.'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + } + + // ----- Get comment + if ($v_data['comment_size'] != 0) + $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); + else + $p_central_dir['comment'] = ''; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\''); + + $p_central_dir['entries'] = $v_data['entries']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\''); + $p_central_dir['disk_entries'] = $v_data['disk_entries']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\''); + $p_central_dir['offset'] = $v_data['offset']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\''); + $p_central_dir['size'] = $v_data['size']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\''); + $p_central_dir['disk'] = $v_data['disk']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\''); + $p_central_dir['disk_start'] = $v_data['disk_start']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\''); + + // TBC + //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { + // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]); + //} + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDeleteByRule() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privDeleteByRule(&$p_result_list, &$p_options) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", ""); + $v_result=1; + $v_list_detail = array(); + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_result=$this->privOpenFd('rb')) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Go to beginning of File + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); + + // ----- Scan all the files + // ----- Start at beginning of Central Dir + $v_pos_entry = $v_central_dir['offset']; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); + if (@fseek($this->zip_fd, $v_pos_entry)) + { + // ----- Close the zip file + $this->privCloseFd(); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); + + // ----- Read each entry + $v_header_list = array(); + $j_start = 0; + for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')"); + + // ----- Read the file header + $v_header_list[$v_nb_extracted] = array(); + if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) + { + // ----- Close the zip file + $this->privCloseFd(); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'"); + + // ----- Store the index + $v_header_list[$v_nb_extracted]['index'] = $i; + + // ----- Look for the specific extract rules + $v_found = false; + + // ----- Look for extract by name rule + if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) + && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); + + // ----- Look if the filename is in the list + for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) + && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); + $v_found = true; + } + elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ + && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory"); + $v_found = true; + } + } + // ----- Look for a filename + elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); + $v_found = true; + } + } + } + + // ----- Look for extract by ereg rule + else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) + && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); + + if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); + $v_found = true; + } + } + + // ----- Look for extract by preg rule + else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) + && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); + + if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); + $v_found = true; + } + } + + // ----- Look for extract by index rule + else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) + && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); + + // ----- Look if the index is in the list + for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); + $v_found = true; + } + if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); + $j_start = $j+1; + } + + if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); + break; + } + } + } + + // ----- Look for deletion + if ($v_found) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted"); + unset($v_header_list[$v_nb_extracted]); + } + else + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted"); + $v_nb_extracted++; + } + } + + // ----- Look if something need to be deleted + if ($v_nb_extracted > 0) { + + // ----- Creates a temporay file + $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; + + // ----- Creates a temporary zip archive + $v_temp_zip = new PclZip($v_zip_temp_name); + + // ----- Open the temporary zip file in write mode + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode"); + if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { + $this->privCloseFd(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look which file need to be kept + for ($i=0; $izip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); + if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); + + // ----- Read the file header + $v_local_header = array(); + if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Check that local file header is same as central file header + if ($this->privCheckFileHeaders($v_local_header, + $v_header_list[$i]) != 1) { + // TBC + } + unset($v_local_header); + + // ----- Write the file header + if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'"); + + // ----- Read/write the data block + if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { + // ----- Close the zip file + $this->privCloseFd(); + $v_temp_zip->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($v_temp_zip->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset"); + + // ----- Re-Create the Central Dir files header + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory"); + for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { + $v_temp_zip->privCloseFd(); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Transform the header to a 'usable' info + $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); + } + + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer"); + + // ----- Zip file comment + $v_comment = ''; + if (isset($p_options[PCLZIP_OPT_COMMENT])) { + $v_comment = $p_options[PCLZIP_OPT_COMMENT]; + } + + // ----- Calculate the size of the central header + $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; + + // ----- Create the central dir footer + if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { + // ----- Reset the file list + unset($v_header_list); + $v_temp_zip->privCloseFd(); + $this->privCloseFd(); + @unlink($v_zip_temp_name); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Close + $v_temp_zip->privCloseFd(); + $this->privCloseFd(); + + // ----- Delete the zip file + // TBC : I should test the result ... + @unlink($this->zipname); + + // ----- Rename the temporary file + // TBC : I should test the result ... + //@rename($v_zip_temp_name, $this->zipname); + PclZipUtilRename($v_zip_temp_name, $this->zipname); + + // ----- Destroy the temporary archive + unset($v_temp_zip); + } + + // ----- Remove every files : reset the file + else if ($v_central_dir['entries'] != 0) { + $this->privCloseFd(); + + if (($v_result = $this->privOpenFd('wb')) != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + $this->privCloseFd(); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDirCheck() + // Description : + // Check if a directory exists, if not it creates it and all the parents directory + // which may be useful. + // Parameters : + // $p_dir : Directory path to check. + // Return Values : + // 1 : OK + // -1 : Unable to create directory + // -------------------------------------------------------------------------------- + function privDirCheck($p_dir, $p_is_dir=false) + { + $v_result = 1; + + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'"); + + // ----- Remove the final '/' + if (($p_is_dir) && (substr($p_dir, -1)=='/')) + { + $p_dir = substr($p_dir, 0, strlen($p_dir)-1); + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'"); + + // ----- Check the directory availability + if ((is_dir($p_dir)) || ($p_dir == "")) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory"); + return 1; + } + + // ----- Extract parent directory + $p_parent_dir = dirname($p_dir); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'"); + + // ----- Just a check + if ($p_parent_dir != $p_dir) + { + // ----- Look for parent directory + if ($p_parent_dir != "") + { + if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) + { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + } + } + + // ----- Create the directory + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'"); + if (!@mkdir($p_dir, 0777)) + { + // ----- Error log + PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created"); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privMerge() + // Description : + // If $p_archive_to_add does not exist, the function exit with a success result. + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privMerge(&$p_archive_to_add) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'"); + $v_result=1; + + // ----- Look if the archive_to_add exists + if (!is_file($p_archive_to_add->zipname)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge."); + + // ----- Nothing to merge, so merge is a success + $v_result = 1; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Look if the archive exists + if (!is_file($this->zipname)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add."); + + // ----- Do a duplicate + $v_result = $this->privDuplicate($p_archive_to_add->zipname); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_result=$this->privOpenFd('rb')) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir = array(); + if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) + { + $this->privCloseFd(); + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Go to beginning of File + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); + @rewind($this->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); + + // ----- Open the archive_to_add file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode"); + if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) + { + $this->privCloseFd(); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Read the central directory informations + $v_central_dir_to_add = array(); + if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) + { + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Go to beginning of File + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); + @rewind($p_archive_to_add->zip_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); + + // ----- Creates a temporay file + $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; + + // ----- Open the temporary file in write mode + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) + { + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Copy the files from the archive to the temporary file + // TBC : Here I should better append the file and go back to erase the central dir + $v_size = $v_central_dir['offset']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = fread($this->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Copy the files from the archive_to_add into the temporary file + $v_size = $v_central_dir_to_add['offset']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Store the offset of the central dir + $v_offset = @ftell($v_zip_temp_fd); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); + + // ----- Copy the block of file headers from the old archive + $v_size = $v_central_dir['size']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @fread($this->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Copy the block of file headers from the archive_to_add + $v_size = $v_central_dir_to_add['size']; + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); + @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Merge the file comments + $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; + + // ----- Calculate the size of the (new) central header + $v_size = @ftell($v_zip_temp_fd)-$v_offset; + + // ----- Swap the file descriptor + // Here is a trick : I swap the temporary fd with the zip fd, in order to use + // the following methods on the temporary fil and not the real archive fd + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Create the central dir footer + if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) + { + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + @fclose($v_zip_temp_fd); + $this->zip_fd = null; + + // ----- Reset the file list + unset($v_header_list); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Swap back the file descriptor + $v_swap = $this->zip_fd; + $this->zip_fd = $v_zip_temp_fd; + $v_zip_temp_fd = $v_swap; + + // ----- Close + $this->privCloseFd(); + $p_archive_to_add->privCloseFd(); + + // ----- Close the temporary file + @fclose($v_zip_temp_fd); + + // ----- Delete the zip file + // TBC : I should test the result ... + @unlink($this->zipname); + + // ----- Rename the temporary file + // TBC : I should test the result ... + //@rename($v_zip_temp_name, $this->zipname); + PclZipUtilRename($v_zip_temp_name, $this->zipname); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDuplicate() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privDuplicate($p_archive_filename) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'"); + $v_result=1; + + // ----- Look if the $p_archive_filename exists + if (!is_file($p_archive_filename)) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate."); + + // ----- Nothing to duplicate, so duplicate is a success. + $v_result = 1; + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Open the zip file + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_result=$this->privOpenFd('wb')) != 1) + { + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + + // ----- Open the temporary file in write mode + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); + if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) + { + $this->privCloseFd(); + + PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); + return PclZip::errorCode(); + } + + // ----- Copy the files from the archive to the temporary file + // TBC : Here I should better append the file and go back to erase the central dir + $v_size = filesize($p_archive_filename); + while ($v_size != 0) + { + $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes"); + $v_buffer = fread($v_zip_temp_fd, $v_read_size); + @fwrite($this->zip_fd, $v_buffer, $v_read_size); + $v_size -= $v_read_size; + } + + // ----- Close + $this->privCloseFd(); + + // ----- Close the temporary file + @fclose($v_zip_temp_fd); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privErrorLog() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function privErrorLog($p_error_code=0, $p_error_string='') + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + PclError($p_error_code, $p_error_string); + } + else { + $this->error_code = $p_error_code; + $this->error_string = $p_error_string; + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privErrorReset() + // Description : + // Parameters : + // -------------------------------------------------------------------------------- + function privErrorReset() + { + if (PCLZIP_ERROR_EXTERNAL == 1) { + PclErrorReset(); + } + else { + $this->error_code = 0; + $this->error_string = ''; + } + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : privDecrypt() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function privDecrypt($p_encryption_header, &$p_buffer, $p_size, $p_crc) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size.""); + $v_result=1; + + // ----- To Be Modified ;-) + $v_pwd = "test"; + + $p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header, + $p_crc, $v_pwd); + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + } + // End of class + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclZipUtilPathReduction() + // Description : + // Parameters : + // Return Values : + // -------------------------------------------------------------------------------- + function PclZipUtilPathReduction($p_dir) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'"); + $v_result = ""; + + // ----- Look for not empty path + if ($p_dir != "") + { + // ----- Explode path by directory names + $v_list = explode("/", $p_dir); + + // ----- Study directories from last to first + for ($i=sizeof($v_list)-1; $i>=0; $i--) + { + // ----- Look for current path + if ($v_list[$i] == ".") + { + // ----- Ignore this directory + // Should be the first $i=0, but no check is done + } + else if ($v_list[$i] == "..") + { + // ----- Ignore it and ignore the $i-1 + $i--; + } + else if (($v_list[$i] == "") && ($i!=(sizeof($v_list)-1)) && ($i!=0)) + { + // ----- Ignore only the double '//' in path, + // but not the first and last '/' + } + else + { + $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); + } + } + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclZipUtilPathInclusion() + // Description : + // This function indicates if the path $p_path is under the $p_dir tree. Or, + // said in an other way, if the file or sub-dir $p_path is inside the dir + // $p_dir. + // The function indicates also if the path is exactly the same as the dir. + // This function supports path with duplicated '/' like '//', but does not + // support '.' or '..' statements. + // Parameters : + // Return Values : + // 0 if $p_path is not inside directory $p_dir + // 1 if $p_path is inside directory $p_dir + // 2 if $p_path is exactly the same as $p_dir + // -------------------------------------------------------------------------------- + function PclZipUtilPathInclusion($p_dir, $p_path) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'"); + $v_result = 1; + + // ----- Explode dir and path by directory separator + $v_list_dir = explode("/", $p_dir); + $v_list_dir_size = sizeof($v_list_dir); + $v_list_path = explode("/", $p_path); + $v_list_path_size = sizeof($v_list_path); + + // ----- Study directories paths + $i = 0; + $j = 0; + while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'"); + + // ----- Look for empty dir (path reduction) + if ($v_list_dir[$i] == '') { + $i++; + continue; + } + if ($v_list_path[$j] == '') { + $j++; + continue; + } + + // ----- Compare the items + if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different"); + $v_result = 0; + } + + // ----- Next items + $i++; + $j++; + } + + // ----- Look if everything seems to be the same + if ($v_result) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break"); + // ----- Skip all the empty items + while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; + while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'"); + + if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { + // ----- There are exactly the same + $v_result = 2; + } + else if ($i < $v_list_dir_size) { + // ----- The path is shorter than the dir + $v_result = 0; + } + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclZipUtilCopyBlock() + // Description : + // Parameters : + // $p_mode : read/write compression mode + // 0 : src & dest normal + // 1 : src gzip, dest normal + // 2 : src normal, dest gzip + // 3 : src & dest gzip + // Return Values : + // -------------------------------------------------------------------------------- + function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode"); + $v_result = 1; + + if ($p_mode==0) + { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src))); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest))); + while ($p_size != 0) + { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @fread($p_src, $v_read_size); + @fwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src))); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest))); + } + else if ($p_mode==1) + { + while ($p_size != 0) + { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @gzread($p_src, $v_read_size); + @fwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } + else if ($p_mode==2) + { + while ($p_size != 0) + { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @fread($p_src, $v_read_size); + @gzwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } + else if ($p_mode==3) + { + while ($p_size != 0) + { + $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); + $v_buffer = @gzread($p_src, $v_read_size); + @gzwrite($p_dest, $v_buffer, $v_read_size); + $p_size -= $v_read_size; + } + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclZipUtilRename() + // Description : + // This function tries to do a simple rename() function. If it fails, it + // tries to copy the $p_src file in a new $p_dest file and then unlink the + // first one. + // Parameters : + // $p_src : Old filename + // $p_dest : New filename + // Return Values : + // 1 on success, 0 on failure. + // -------------------------------------------------------------------------------- + function PclZipUtilRename($p_src, $p_dest) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest"); + $v_result = 1; + + // ----- Try to rename the files + if (!@rename($p_src, $p_dest)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink"); + + // ----- Try to copy & unlink the src + if (!@copy($p_src, $p_dest)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file"); + $v_result = 0; + } + else if (!@unlink($p_src)) { + //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename"); + $v_result = 0; + } + } + + // ----- Return + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclZipUtilOptionText() + // Description : + // Translate option value in text. Mainly for debug purpose. + // Parameters : + // $p_option : the option value. + // Return Values : + // The option text value. + // -------------------------------------------------------------------------------- + function PclZipUtilOptionText($p_option) + { + //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'"); + + $v_list = get_defined_constants(); + for (reset($v_list); $v_key = key($v_list); next($v_list)) { + $v_prefix = substr($v_key, 0, 10); + if ((($v_prefix == 'PCLZIP_OPT') || ($v_prefix == 'PCLZIP_CB_')) + && ($v_list[$v_key] == $p_option)) { + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key); + return $v_key; + } + } + + $v_result = 'Unknown'; + + //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; + } + // -------------------------------------------------------------------------------- + + // -------------------------------------------------------------------------------- + // Function : PclZipUtilTranslateWinPath() + // Description : + // Translate windows path by replacing '\' by '/' and optionally removing + // drive letter. + // Parameters : + // $p_path : path to translate. + // $p_remove_disk_letter : true | false + // Return Values : + // The path translated. + // -------------------------------------------------------------------------------- + function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) + { + if (stristr(php_uname(), 'windows')) { + // ----- Look for potential disk letter + if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { + $p_path = substr($p_path, $v_position+1); + } + // ----- Change potential windows directory separator + if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { + $p_path = strtr($p_path, '\\', '/'); + } + } + return $p_path; + } + // -------------------------------------------------------------------------------- + + +?> diff --git a/e107_handlers/php_compatibility_handler.php b/e107_handlers/php_compatibility_handler.php new file mode 100644 index 000000000..bbde66e5c --- /dev/null +++ b/e107_handlers/php_compatibility_handler.php @@ -0,0 +1,79 @@ + 4.3.0, all functions that are used in e107, introduced in newer +// versions than that should be recreated in here for compatabilty reasons.. + +if (!function_exists('file_put_contents')) { + /** + * @return int + * @param string $filename + * @param mixed $data + * @desc Write a string to a file + */ + function file_put_contents($filename, $data) { + if (($h = @fopen($filename, 'w+')) === false) { + return false; + } + if (($bytes = @fwrite($h, $data)) === false) { + return false; + } + fclose($h); + return $bytes; + } +} + +if (!function_exists('stripos')) { + function stripos($haystack, $needle) { + $parts = explode(strtolower($needle), strtolower($haystack), 2); + if (count($parts) == 1) { + return false; + } + return strlen($parts[0]); + } +} + + + +if(!function_exists("mime_content_type")){ + function mime_content_type($filename){ + + $filename = basename($filename); + + $mime[".zip"] = "application/x-zip-compressed"; + $mime[".gif"] = "image/gif"; + $mime[".png"] = "image/x-png"; + $mime[".jpg"] = "image/jpeg"; + $mime[".jpeg"] = "image/jpeg"; + $mime[".tif"] = "image/tiff"; + $mime[".tiff"] = "image/tiff"; + $mime[".pdf"] = "application/pdf"; + $mime[".hqx"] = "application/mac-binhex40"; + $mime[".doc"] = "application/msword"; + $mime[".dot"] = "application/msword"; + $mime[".exe"] = "application/octet-stream"; + $mime[".au"] = "audio/basic"; + $mime[".snd"] = "audio/basic"; + $mime[".mid"] = "audio/mid"; + $mime[".mp3"] = "audio/mpeg"; + $mime[".aif"] = "audio/x-aiff"; + $mime[".ra"] = "audio/x-pn-realaudio"; + $mime[".ram"] = "audio/x-pn-realaudio"; + $mime[".wav"] = "audio/x-wav"; + $mime[".bmp"] = "image/bmp"; + $mime[".ra"] = "audio/x-pn-realaudio"; + $mime[".htm"] = "text/html"; + $mime[".html"] = "text/html"; + $mime[".css"] = "text/css"; + $mime[".txt"] = "text/plain"; + $mime[".mov"] = "video/quicktime"; + $mime[".mpg"] = "video/mpeg"; + $mime[".asx"] = "video/x-ms-asf"; + $mime[".avi"] = "video/x-msvideo"; + + $ext = strrchr($filename, '.'); + return $mime[$ext]; + } +} +?> \ No newline at end of file diff --git a/e107_handlers/phpmailer/class.phpmailer.php b/e107_handlers/phpmailer/class.phpmailer.php new file mode 100644 index 000000000..ccbcc9fb8 --- /dev/null +++ b/e107_handlers/phpmailer/class.phpmailer.php @@ -0,0 +1,1499 @@ +ContentType = "text/html"; + else + $this->ContentType = "text/plain"; + } + + /** + * Sets Mailer to send message using SMTP. + * @return void + */ + function IsSMTP() { + $this->Mailer = "smtp"; + } + + /** + * Sets Mailer to send message using PHP mail() function. + * @return void + */ + function IsMail() { + $this->Mailer = "mail"; + } + + /** + * Sets Mailer to send message using the $Sendmail program. + * @return void + */ + function IsSendmail() { + $this->Mailer = "sendmail"; + } + + /** + * Sets Mailer to send message using the qmail MTA. + * @return void + */ + function IsQmail() { + $this->Sendmail = "/var/qmail/bin/sendmail"; + $this->Mailer = "sendmail"; + } + + + ///////////////////////////////////////////////// + // RECIPIENT METHODS + ///////////////////////////////////////////////// + + /** + * Adds a "To" address. + * @param string $address + * @param string $name + * @return void + */ + function AddAddress($address, $name = "") { + $cur = count($this->to); + $this->to[$cur][0] = trim($address); + $this->to[$cur][1] = $name; + } + + /** + * Adds a "Cc" address. Note: this function works + * with the SMTP mailer on win32, not with the "mail" + * mailer. + * @param string $address + * @param string $name + * @return void + */ + function AddCC($address, $name = "") { + $cur = count($this->cc); + $this->cc[$cur][0] = trim($address); + $this->cc[$cur][1] = $name; + } + + /** + * Adds a "Bcc" address. Note: this function works + * with the SMTP mailer on win32, not with the "mail" + * mailer. + * @param string $address + * @param string $name + * @return void + */ + function AddBCC($address, $name = "") { + $cur = count($this->bcc); + $this->bcc[$cur][0] = trim($address); + $this->bcc[$cur][1] = $name; + } + + /** + * Adds a "Reply-to" address. + * @param string $address + * @param string $name + * @return void + */ + function AddReplyTo($address, $name = "") { + $cur = count($this->ReplyTo); + $this->ReplyTo[$cur][0] = trim($address); + $this->ReplyTo[$cur][1] = $name; + } + + + ///////////////////////////////////////////////// + // MAIL SENDING METHODS + ///////////////////////////////////////////////// + + /** + * Creates message and assigns Mailer. If the message is + * not sent successfully then it returns false. Use the ErrorInfo + * variable to view description of the error. + * @return bool + */ + function Send() { + $header = ""; + $body = ""; + $result = true; + + if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) + { + $this->SetError($this->Lang("provide_address")); + return false; + } + + // Set whether the message is multipart/alternative + if(!empty($this->AltBody)) + $this->ContentType = "multipart/alternative"; + + $this->error_count = 0; // reset errors + $this->SetMessageType(); + $header .= $this->CreateHeader(); + $body = $this->CreateBody(); + + if($body == "") { return false; } + + // Choose the mailer + switch($this->Mailer) + { + case "sendmail": + $result = $this->SendmailSend($header, $body); + break; + case "mail": + $result = $this->MailSend($header, $body); + break; + case "smtp": + $result = $this->SmtpSend($header, $body); + break; + default: + $this->SetError($this->Mailer . $this->Lang("mailer_not_supported")); + $result = false; + break; + } + + return $result; + } + + /** + * Sends mail using the $Sendmail program. + * @access private + * @return bool + */ + function SendmailSend($header, $body) { + if ($this->Sender != "") + $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); + else + $sendmail = sprintf("%s -oi -t", $this->Sendmail); + + if(!@$mail = popen($sendmail, "w")) + { + $this->SetError($this->Lang("execute") . $this->Sendmail); + return false; + } + + fputs($mail, $header); + fputs($mail, $body); + + $result = pclose($mail) >> 8 & 0xFF; + if($result != 0) + { + $this->SetError($this->Lang("execute") . $this->Sendmail); + return false; + } + + return true; + } + + /** + * Sends mail using the PHP mail() function. + * @access private + * @return bool + */ + function MailSend($header, $body) { + $to = ""; + for($i = 0; $i < count($this->to); $i++) + { + if($i != 0) { $to .= ", "; } + $to .= $this->to[$i][0]; + } + + if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1) + { + $old_from = ini_get("sendmail_from"); + e107_ini_set("sendmail_from", $this->Sender); + $params = sprintf("-oi -f %s", $this->Sender); + $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, + $header, $params); + } + else + $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header); + + if (isset($old_from)) + e107_ini_set("sendmail_from", $old_from); + + if(!$rt) + { + $this->SetError($this->Lang("instantiate")); + return false; + } + + return true; + } + + /** + * Sends mail via SMTP using PhpSMTP (Author: + * Chris Ryan). Returns bool. Returns false if there is a + * bad MAIL FROM, RCPT, or DATA input. + * @access private + * @return bool + */ + function SmtpSend($header, $body) { + include_once($this->PluginDir . "class.smtp.php"); + $error = ""; + $bad_rcpt = array(); + + if(!$this->SmtpConnect()) + return false; + + $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender; + if(!$this->smtp->Mail($smtp_from)) + { + $error = $this->Lang("from_failed") . $smtp_from; + $this->SetError($error); + $this->smtp->Reset(); + return false; + } + + // Attempt to send attach all recipients + for($i = 0; $i < count($this->to); $i++) + { + if(!$this->smtp->Recipient($this->to[$i][0])) + $bad_rcpt[] = $this->to[$i][0]; + } + for($i = 0; $i < count($this->cc); $i++) + { + if(!$this->smtp->Recipient($this->cc[$i][0])) + $bad_rcpt[] = $this->cc[$i][0]; + } + for($i = 0; $i < count($this->bcc); $i++) + { + if(!$this->smtp->Recipient($this->bcc[$i][0])) + $bad_rcpt[] = $this->bcc[$i][0]; + } + + if(count($bad_rcpt) > 0) // Create error message + { + for($i = 0; $i < count($bad_rcpt); $i++) + { + if($i != 0) { $error .= ", "; } + $error .= $bad_rcpt[$i]; + } + $error = $this->Lang("recipients_failed") . $error; + $this->SetError($error); + $this->smtp->Reset(); + return false; + } + + if(!$this->smtp->Data($header . $body)) + { + $this->SetError($this->Lang("data_not_accepted")); + $this->smtp->Reset(); + return false; + } + if($this->SMTPKeepAlive == true) + $this->smtp->Reset(); + else + $this->SmtpClose(); + + return true; + } + + /** + * Initiates a connection to an SMTP server. Returns false if the + * operation failed. + * @access private + * @return bool + */ + function SmtpConnect() { + if($this->smtp == NULL) { $this->smtp = new SMTP(); } + + $this->smtp->do_debug = $this->SMTPDebug; + $hosts = explode(";", $this->Host); + $index = 0; + $connection = ($this->smtp->Connected()); + + // Retry while there is no connection + while($index < count($hosts) && $connection == false) + { + if(strstr($hosts[$index], ":")) + list($host, $port) = explode(":", $hosts[$index]); + else + { + $host = $hosts[$index]; + $port = $this->Port; + } + + if($this->smtp->Connect($host, $port, $this->Timeout)) + { + if ($this->Helo != '') + $this->smtp->Hello($this->Helo); + else + $this->smtp->Hello($this->ServerHostname()); + + if($this->SMTPAuth) + { + if(!$this->smtp->Authenticate($this->Username, + $this->Password)) + { + $this->SetError($this->Lang("authenticate")); + $this->smtp->Reset(); + $connection = false; + } + } + $connection = true; + } + $index++; + } + if(!$connection) + $this->SetError($this->Lang("connect_host")); + + return $connection; + } + + /** + * Closes the active SMTP session if one exists. + * @return void + */ + function SmtpClose() { + if($this->smtp != NULL) + { + if($this->smtp->Connected()) + { + $this->smtp->Quit(); + $this->smtp->Close(); + } + } + } + + /** + * Sets the language for all class error messages. Returns false + * if it cannot load the language file. The default language type + * is English. + * @param string $lang_type Type of language (e.g. Portuguese: "br") + * @param string $lang_path Path to the language file directory + * @access public + * @return bool + */ + function SetLanguage($lang_type, $lang_path = "language/") { + if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) + include($lang_path.'phpmailer.lang-'.$lang_type.'.php'); + else if(file_exists($lang_path.'phpmailer.lang-en.php')) + include($lang_path.'phpmailer.lang-en.php'); + else + { + $this->SetError("Could not load language file"); + return false; + } + $this->language = $PHPMAILER_LANG; + + return true; + } + + ///////////////////////////////////////////////// + // MESSAGE CREATION METHODS + ///////////////////////////////////////////////// + + /** + * Creates recipient headers. + * @access private + * @return string + */ + function AddrAppend($type, $addr) { + $addr_str = $type . ": "; + $addr_str .= $this->AddrFormat($addr[0]); + if(count($addr) > 1) + { + for($i = 1; $i < count($addr); $i++) + $addr_str .= ", " . $this->AddrFormat($addr[$i]); + } + $addr_str .= $this->LE; + + return $addr_str; + } + + /** + * Formats an address correctly. + * @access private + * @return string + */ + function AddrFormat($addr) { + if(empty($addr[1])) + $formatted = $addr[0]; + else + { + $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" . + $addr[0] . ">"; + } + + return $formatted; + } + + /** + * Wraps message for use with mailers that do not + * automatically perform wrapping and for quoted-printable. + * Original written by philippe. + * @access private + * @return string + */ + function WrapText($message, $length, $qp_mode = false) { + $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; + + $message = $this->FixEOL($message); + if (substr($message, -1) == $this->LE) + $message = substr($message, 0, -1); + + $line = explode($this->LE, $message); + $message = ""; + for ($i=0 ;$i < count($line); $i++) + { + $line_part = explode(" ", $line[$i]); + $buf = ""; + for ($e = 0; $e $length)) + { + $space_left = $length - strlen($buf) - 1; + if ($e != 0) + { + if ($space_left > 20) + { + $len = $space_left; + if (substr($word, $len - 1, 1) == "=") + $len--; + elseif (substr($word, $len - 2, 1) == "=") + $len -= 2; + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= " " . $part; + $message .= $buf . sprintf("=%s", $this->LE); + } + else + { + $message .= $buf . $soft_break; + } + $buf = ""; + } + while (strlen($word) > 0) + { + $len = $length; + if (substr($word, $len - 1, 1) == "=") + $len--; + elseif (substr($word, $len - 2, 1) == "=") + $len -= 2; + $part = substr($word, 0, $len); + $word = substr($word, $len); + + if (strlen($word) > 0) + $message .= $part . sprintf("=%s", $this->LE); + else + $buf = $part; + } + } + else + { + $buf_o = $buf; + $buf .= ($e == 0) ? $word : (" " . $word); + + if (strlen($buf) > $length and $buf_o != "") + { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + } + $message .= $buf . $this->LE; + } + + return $message; + } + + /** + * Set the body wrapping. + * @access private + * @return void + */ + function SetWordWrap() { + if($this->WordWrap < 1) + return; + + switch($this->message_type) + { + case "alt": + // fall through + case "alt_attachments": + $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->WrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assembles message header. + * @access private + * @return string + */ + function CreateHeader() { + $result = ""; + + // Set the boundaries + $uniq_id = md5(uniqid(time())); + $this->boundary[1] = "b1_" . $uniq_id; + $this->boundary[2] = "b2_" . $uniq_id; + + $result .= $this->HeaderLine("Date", $this->RFCDate()); + if($this->Sender == "") + $result .= $this->HeaderLine("Return-Path", trim($this->From)); + else + $result .= $this->HeaderLine("Return-Path", trim($this->Sender)); + + // To be created automatically by mail() + if($this->Mailer != "mail") + { + if(count($this->to) > 0) + $result .= $this->AddrAppend("To", $this->to); + else if (count($this->cc) == 0) + $result .= $this->HeaderLine("To", "undisclosed-recipients:;"); + if(count($this->cc) > 0) + $result .= $this->AddrAppend("Cc", $this->cc); + } + + $from = array(); + $from[0][0] = trim($this->From); + $from[0][1] = $this->FromName; + $result .= $this->AddrAppend("From", $from); + + // sendmail and mail() extract Bcc from the header before sending + if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0)) + $result .= $this->AddrAppend("Bcc", $this->bcc); + + if(count($this->ReplyTo) > 0) + $result .= $this->AddrAppend("Reply-to", $this->ReplyTo); + + // mail() sets the subject itself + if($this->Mailer != "mail") + $result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject))); + + $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); + $result .= $this->HeaderLine("X-Priority", $this->Priority); + $result .= $this->HeaderLine("X-Mailer", "PHPMailer [version " . $this->Version . "]"); + + if($this->ConfirmReadingTo != "") + { + $result .= $this->HeaderLine("Disposition-Notification-To", + "<" . trim($this->ConfirmReadingTo) . ">"); + } + + // Add custom headers + for($index = 0; $index < count($this->CustomHeader); $index++) + { + $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), + $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); + } + $result .= $this->HeaderLine("MIME-Version", "1.0"); + + switch($this->message_type) + { + case "plain": + $result .= $this->HeaderLine("Content-Transfer-Encoding", $this->Encoding); + $result .= sprintf("Content-Type: %s; charset=\"%s\"", + $this->ContentType, $this->CharSet); + break; + case "attachments": + // fall through + case "alt_attachments": + if($this->InlineImageExists()) + { + $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", + "multipart/related", $this->LE, $this->LE, + $this->boundary[1], $this->LE); + } + else + { + $result .= $this->HeaderLine("Content-Type", "multipart/mixed;"); + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); + } + break; + case "alt": + $result .= $this->HeaderLine("Content-Type", "multipart/alternative;"); + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + } + + if($this->Mailer != "mail") + $result .= $this->LE.$this->LE; + + return $result; + } + + /** + * Assembles the message body. Returns an empty string on failure. + * @access private + * @return string + */ + function CreateBody() { + $result = ""; + + $this->SetWordWrap(); + + switch($this->message_type) + { + case "alt": + $result .= $this->GetBoundary($this->boundary[1], "", + "text/plain", ""); + $result .= $this->EncodeString($this->AltBody, $this->Encoding); + $result .= $this->LE.$this->LE; + $result .= $this->GetBoundary($this->boundary[1], "", + "text/html", ""); + + $result .= $this->EncodeString($this->Body, $this->Encoding); + $result .= $this->LE.$this->LE; + + $result .= $this->EndBoundary($this->boundary[1]); + break; + case "plain": + $result .= $this->EncodeString($this->Body, $this->Encoding); + break; + case "attachments": + $result .= $this->GetBoundary($this->boundary[1], "", "", ""); + $result .= $this->EncodeString($this->Body, $this->Encoding); + $result .= $this->LE; + + $result .= $this->AttachAll(); + break; + case "alt_attachments": + $result .= sprintf("--%s%s", $this->boundary[1], $this->LE); + $result .= sprintf("Content-Type: %s;%s" . + "\tboundary=\"%s\"%s", + "multipart/alternative", $this->LE, + $this->boundary[2], $this->LE.$this->LE); + + // Create text body + $result .= $this->GetBoundary($this->boundary[2], "", + "text/plain", "") . $this->LE; + + $result .= $this->EncodeString($this->AltBody, $this->Encoding); + $result .= $this->LE.$this->LE; + + // Create the HTML body + $result .= $this->GetBoundary($this->boundary[2], "", + "text/html", "") . $this->LE; + + $result .= $this->EncodeString($this->Body, $this->Encoding); + $result .= $this->LE.$this->LE; + + $result .= $this->EndBoundary($this->boundary[2]); + + $result .= $this->AttachAll(); + break; + } + if($this->IsError()) + $result = ""; + + return $result; + } + + /** + * Returns the start of a message boundary. + * @access private + */ + function GetBoundary($boundary, $charSet, $contentType, $encoding) { + $result = ""; + if($charSet == "") { $charSet = $this->CharSet; } + if($contentType == "") { $contentType = $this->ContentType; } + if($encoding == "") { $encoding = $this->Encoding; } + + $result .= $this->TextLine("--" . $boundary); + $result .= sprintf("Content-Type: %s; charset = \"%s\"", + $contentType, $charSet); + $result .= $this->LE; + $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding); + $result .= $this->LE; + + return $result; + } + + /** + * Returns the end of a message boundary. + * @access private + */ + function EndBoundary($boundary) { + return $this->LE . "--" . $boundary . "--" . $this->LE; + } + + /** + * Sets the message type. + * @access private + * @return void + */ + function SetMessageType() { + if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) + $this->message_type = "plain"; + else + { + if(count($this->attachment) > 0) + $this->message_type = "attachments"; + if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) + $this->message_type = "alt"; + if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) + $this->message_type = "alt_attachments"; + } + } + + /** + * Returns a formatted header line. + * @access private + * @return string + */ + function HeaderLine($name, $value) { + return $name . ": " . $value . $this->LE; + } + + /** + * Returns a formatted mail line. + * @access private + * @return string + */ + function TextLine($value) { + return $value . $this->LE; + } + + ///////////////////////////////////////////////// + // ATTACHMENT METHODS + ///////////////////////////////////////////////// + + /** + * Adds an attachment from a path on the filesystem. + * Returns false if the file could not be found + * or accessed. + * @param string $path Path to the attachment. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return bool + */ + function AddAttachment($path, $name = "", $encoding = "base64", + $type = "application/octet-stream") { + if(!@is_file($path)) + { + $this->SetError($this->Lang("file_access") . $path); + return false; + } + + $filename = basename($path); + if($name == "") + $name = $filename; + + $cur = count($this->attachment); + $this->attachment[$cur][0] = $path; + $this->attachment[$cur][1] = $filename; + $this->attachment[$cur][2] = $name; + $this->attachment[$cur][3] = $encoding; + $this->attachment[$cur][4] = $type; + $this->attachment[$cur][5] = false; // isStringAttachment + $this->attachment[$cur][6] = "attachment"; + $this->attachment[$cur][7] = 0; + + return true; + } + + /** + * Attaches all fs, string, and binary attachments to the message. + * Returns an empty string on failure. + * @access private + * @return string + */ + function AttachAll() { + // Return text of body + $mime = array(); + + // Add all attachments + for($i = 0; $i < count($this->attachment); $i++) + { + // Check for string attachment + $bString = $this->attachment[$i][5]; + if ($bString) + $string = $this->attachment[$i][0]; + else + $path = $this->attachment[$i][0]; + + $filename = $this->attachment[$i][1]; + $name = $this->attachment[$i][2]; + $encoding = $this->attachment[$i][3]; + $type = $this->attachment[$i][4]; + $disposition = $this->attachment[$i][6]; + $cid = $this->attachment[$i][7]; + + $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); + $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); + $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); + + if($disposition == "inline") + $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); + + $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", + $disposition, $name, $this->LE.$this->LE); + + // Encode as string attachment + if($bString) + { + $mime[] = $this->EncodeString($string, $encoding); + if($this->IsError()) { return ""; } + $mime[] = $this->LE.$this->LE; + } + else + { + $mime[] = $this->EncodeFile($path, $encoding); + if($this->IsError()) { return ""; } + $mime[] = $this->LE.$this->LE; + } + } + + $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE); + + return join("", $mime); + } + + /** + * Encodes attachment in requested format. Returns an + * empty string on failure. + * @access private + * @return string + */ + function EncodeFile ($path, $encoding = "base64") { + if(!@$fd = fopen($path, "rb")) + { + $this->SetError($this->Lang("file_open") . $path); + return ""; + } + $magic_quotes = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + $file_buffer = fread($fd, filesize($path)); + $file_buffer = $this->EncodeString($file_buffer, $encoding); + fclose($fd); + set_magic_quotes_runtime($magic_quotes); + + return $file_buffer; + } + + /** + * Encodes string to requested format. Returns an + * empty string on failure. + * @access private + * @return string + */ + function EncodeString ($str, $encoding = "base64") { + $encoded = ""; + switch(strtolower($encoding)) { + case "base64": + // chunk_split is found in PHP >= 3.0.6 + $encoded = chunk_split(base64_encode($str), 76, $this->LE); + break; + case "7bit": + case "8bit": + $encoded = $this->FixEOL($str); + if (substr($encoded, -(strlen($this->LE))) != $this->LE) + $encoded .= $this->LE; + break; + case "binary": + $encoded = $str; + break; + case "quoted-printable": + $encoded = $this->EncodeQP($str); + break; + default: + $this->SetError($this->Lang("encoding") . $encoding); + break; + } + return $encoded; + } + + /** + * Encode a header string to best of Q, B, quoted or none. + * @access private + * @return string + */ + function EncodeHeader ($str, $position = 'text') { + $x = 0; + + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + // Can't use addslashes as we don't know what value has magic_quotes_sybase. + $encoded = addcslashes($str, "\0..\37\177\\\""); + + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) + return ($encoded); + else + return ("\"$encoded\""); + } + $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + case 'comment': + $x = preg_match_all('/[()"]/', $str, $matches); + // Fall-through + case 'text': + default: + $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + if ($x == 0) + return ($str); + + $maxlen = 75 - 7 - strlen($this->CharSet); + // Try to select the encoding which should produce the shortest output + if (strlen($str)/3 < $x) { + $encoding = 'B'; + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } else { + $encoding = 'Q'; + $encoded = $this->EncodeQ($str, $position); + $encoded = $this->WrapText($encoded, $maxlen, true); + $encoded = str_replace("=".$this->LE, "\n", trim($encoded)); + } + + $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); + $encoded = trim(str_replace("\n", $this->LE, $encoded)); + + return $encoded; + } + + /** + * Encode string to quoted-printable. + * @access private + * @return string + */ + function EncodeQP ($str) { + $encoded = $this->FixEOL($str); + if (substr($encoded, -(strlen($this->LE))) != $this->LE) + $encoded .= $this->LE; + + // Replace every high ascii, control and = characters + $encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e', + "'='.sprintf('%02X', ord('\\1'))", $encoded); + // Replace every spaces and tabs when it's the last character on a line + $encoded = preg_replace("/([\011\040])".$this->LE."/e", + "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded); + + // Maximum line length of 76 characters before CRLF (74 + space + '=') + $encoded = $this->WrapText($encoded, 74, true); + + return $encoded; + } + + /** + * Encode string to q encoding. + * @access private + * @return string + */ + function EncodeQ ($str, $position = "text") { + // There should not be any EOL in the string + $encoded = preg_replace("[\r\n]", "", $str); + + switch (strtolower($position)) { + case "phrase": + $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + break; + case "comment": + $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + case "text": + default: + // Replace every high ascii, control =, ? and _ characters + $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', + "'='.sprintf('%02X', ord('\\1'))", $encoded); + break; + } + + // Replace every spaces to _ (more readable than =20) + $encoded = str_replace(" ", "_", $encoded); + + return $encoded; + } + + /** + * Adds a string or binary attachment (non-filesystem) to the list. + * This method can be used to attach ascii or binary data, + * such as a BLOB record from a database. + * @param string $string String attachment data. + * @param string $filename Name of the attachment. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return void + */ + function AddStringAttachment($string, $filename, $encoding = "base64", + $type = "application/octet-stream") { + // Append to $attachment array + $cur = count($this->attachment); + $this->attachment[$cur][0] = $string; + $this->attachment[$cur][1] = $filename; + $this->attachment[$cur][2] = $filename; + $this->attachment[$cur][3] = $encoding; + $this->attachment[$cur][4] = $type; + $this->attachment[$cur][5] = true; // isString + $this->attachment[$cur][6] = "attachment"; + $this->attachment[$cur][7] = 0; + } + + /** + * Adds an embedded attachment. This can include images, sounds, and + * just about any other document. Make sure to set the $type to an + * image type. For JPEG images use "image/jpeg" and for GIF images + * use "image/gif". + * @param string $path Path to the attachment. + * @param string $cid Content ID of the attachment. Use this to identify + * the Id for accessing the image in an HTML form. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @return bool + */ + function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", + $type = "application/octet-stream") { + + if(!@is_file($path)) + { + $this->SetError($this->Lang("file_access") . $path); + return false; + } + + $filename = basename($path); + if($name == "") + $name = $filename; + + // Append to $attachment array + $cur = count($this->attachment); + $this->attachment[$cur][0] = $path; + $this->attachment[$cur][1] = $filename; + $this->attachment[$cur][2] = $name; + $this->attachment[$cur][3] = $encoding; + $this->attachment[$cur][4] = $type; + $this->attachment[$cur][5] = false; // isStringAttachment + $this->attachment[$cur][6] = "inline"; + $this->attachment[$cur][7] = $cid; + + return true; + } + + /** + * Returns true if an inline attachment is present. + * @access private + * @return bool + */ + function InlineImageExists() { + $result = false; + for($i = 0; $i < count($this->attachment); $i++) + { + if($this->attachment[$i][6] == "inline") + { + $result = true; + break; + } + } + + return $result; + } + + ///////////////////////////////////////////////// + // MESSAGE RESET METHODS + ///////////////////////////////////////////////// + + /** + * Clears all recipients assigned in the TO array. Returns void. + * @return void + */ + function ClearAddresses() { + $this->to = array(); + } + + /** + * Clears all recipients assigned in the CC array. Returns void. + * @return void + */ + function ClearCCs() { + $this->cc = array(); + } + + /** + * Clears all recipients assigned in the BCC array. Returns void. + * @return void + */ + function ClearBCCs() { + $this->bcc = array(); + } + + /** + * Clears all recipients assigned in the ReplyTo array. Returns void. + * @return void + */ + function ClearReplyTos() { + $this->ReplyTo = array(); + } + + /** + * Clears all recipients assigned in the TO, CC and BCC + * array. Returns void. + * @return void + */ + function ClearAllRecipients() { + $this->to = array(); + $this->cc = array(); + $this->bcc = array(); + } + + /** + * Clears all previously set filesystem, string, and binary + * attachments. Returns void. + * @return void + */ + function ClearAttachments() { + $this->attachment = array(); + } + + /** + * Clears all custom headers. Returns void. + * @return void + */ + function ClearCustomHeaders() { + $this->CustomHeader = array(); + } + + + ///////////////////////////////////////////////// + // MISCELLANEOUS METHODS + ///////////////////////////////////////////////// + + /** + * Adds the error message to the error container. + * Returns void. + * @access private + * @return void + */ + function SetError($msg) { + $this->error_count++; + $this->ErrorInfo = $msg; + } + + /** + * Returns the proper RFC 822 formatted date. + * @access private + * @return string + */ + function RFCDate() { + $tz = date("Z"); + $tzs = ($tz < 0) ? "-" : "+"; + $tz = abs($tz); + $tz = ($tz/3600)*100 + ($tz%3600)/60; + $result = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz); + + return $result; + } + + /** + * Returns the appropriate server variable. Should work with both + * PHP 4.1.0+ as well as older versions. Returns an empty string + * if nothing is found. + * @access private + * @return mixed + */ + function ServerVar($varName) { + global $HTTP_SERVER_VARS; + global $HTTP_ENV_VARS; + + if(!isset($_SERVER)) + { + $_SERVER = $HTTP_SERVER_VARS; + if(!isset($_SERVER["REMOTE_ADDR"])) + $_SERVER = $HTTP_ENV_VARS; // must be Apache + } + + if(isset($_SERVER[$varName])) + return $_SERVER[$varName]; + else + return ""; + } + + /** + * Returns the server hostname or 'localhost.localdomain' if unknown. + * @access private + * @return string + */ + function ServerHostname() { + if ($this->Hostname != "") + $result = $this->Hostname; + elseif ($this->ServerVar('SERVER_NAME') != "") + $result = $this->ServerVar('SERVER_NAME'); + else + $result = "localhost.localdomain"; + + return $result; + } + + /** + * Returns a message in the appropriate language. + * @access private + * @return string + */ + function Lang($key) { + if(count($this->language) < 1) + $this->SetLanguage("en"); // set the default language + + if(isset($this->language[$key])) + return $this->language[$key]; + else + return "Language string failed to load: " . $key; + } + + /** + * Returns true if an error occurred. + * @return bool + */ + function IsError() { + return ($this->error_count > 0); + } + + /** + * Changes every end of line from CR or LF to CRLF. + * @access private + * @return string + */ + function FixEOL($str) { + $str = str_replace("\r\n", "\n", $str); + $str = str_replace("\r", "\n", $str); + $str = str_replace("\n", $this->LE, $str); + return $str; + } + + /** + * Adds a custom header. + * @return void + */ + function AddCustomHeader($custom_header) { + $this->CustomHeader[] = explode(":", $custom_header, 2); + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/phpmailer/class.pop3.php b/e107_handlers/phpmailer/class.pop3.php new file mode 100644 index 000000000..4a5996fb9 --- /dev/null +++ b/e107_handlers/phpmailer/class.pop3.php @@ -0,0 +1,389 @@ +pop_conn = 0; + $this->connected = false; + $this->error = null; + } + + /** + * Combination of public events - connect, login, disconnect + * + * @param string $host + * @param integer $port + * @param integer $tval + * @param string $username + * @param string $password + */ + function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) + { + $this->host = $host; + + // If no port value is passed, retrieve it + if ($port == false) + { + $this->port = $this->POP3_PORT; + } + else + { + $this->port = $port; + } + + // If no port value is passed, retrieve it + if ($tval == false) + { + $this->tval = $this->POP3_TIMEOUT; + } + else + { + $this->tval = $tval; + } + + $this->do_debug = $debug_level; + $this->username = $username; + $this->password = $password; + + // Refresh the error log + $this->error = null; + + // Connect + $result = $this->Connect($this->host, $this->port, $this->tval); + + if ($result) + { + $login_result = $this->Login($this->username, $this->password); + + if ($login_result) + { + $this->Disconnect(); + + return true; + } + + } + + // We need to disconnect regardless if the login succeeded + $this->Disconnect(); + + return false; + } + + /** + * Connect to the POP3 server + * + * @param string $host + * @param integer $port + * @param integer $tval + * @return boolean + */ + function Connect ($host, $port = false, $tval = 30) + { + // Are we already connected? + if ($this->connected) + { + return true; + } + + /* + On Windows this will raise a PHP Warning error if the hostname doesn't exist. + Rather than supress it with @fsockopen, let's capture it cleanly instead + */ + + set_error_handler(array(&$this, 'catchWarning')); + + // Connect to the POP3 server + $this->pop_conn = fsockopen($host, // POP3 Host + $port, // Port # + $errno, // Error Number + $errstr, // Error Message + $tval); // Timeout (seconds) + + // Restore the error handler + restore_error_handler(); + + // Does the Error Log now contain anything? + if ($this->error && $this->do_debug >= 1) + { + $this->displayErrors(); + } + + // Did we connect? + if ($this->pop_conn == false) + { + // It would appear not... + $this->error = array( + 'error' => "Failed to connect to server $host on port $port", + 'errno' => $errno, + 'errstr' => $errstr + ); + + if ($this->do_debug >= 1) + { + $this->displayErrors(); + } + + return false; + } + + // Increase the stream time-out + + // Check for PHP 4.3.0 or later + if (version_compare(phpversion(), '4.3.0', 'ge')) + { + stream_set_timeout($this->pop_conn, $tval, 0); + } + else + { + // Does not work on Windows + if (substr(PHP_OS, 0, 3) !== 'WIN') + { + socket_set_timeout($this->pop_conn, $tval, 0); + } + } + + // Get the POP3 server response + $pop3_response = $this->getResponse(); + + // Check for the +OK + if ($this->checkResponse($pop3_response)) + { + // The connection is established and the POP3 server is talking + $this->connected = true; + return true; + } + + } + + /** + * Login to the POP3 server (does not support APOP yet) + * + * @param string $username + * @param string $password + * @return boolean + */ + function Login ($username = '', $password = '') + { + if ($this->connected == false) + { + $this->error = 'Not connected to POP3 server'; + + if ($this->do_debug >= 1) + { + $this->displayErrors(); + } + } + + if (empty($username)) + { + $username = $this->username; + } + + if (empty($password)) + { + $password = $this->password; + } + + $pop_username = "USER $username" . $this->CRLF; + $pop_password = "PASS $password" . $this->CRLF; + + // Send the Username + $this->sendString($pop_username); + $pop3_response = $this->getResponse(); + + if ($this->checkResponse($pop3_response)) + { + // Send the Password + $this->sendString($pop_password); + $pop3_response = $this->getResponse(); + + if ($this->checkResponse($pop3_response)) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + + /** + * Disconnect from the POP3 server + * + */ + function Disconnect () + { + $this->sendString('QUIT'); + + fclose($this->pop_conn); + } + + /* + --------------- + Private Methods + --------------- + */ + + /** + * Get the socket response back. + * $size is the maximum number of bytes to retrieve + * + * @param integer $size + * @return string + */ + function getResponse ($size = 128) + { + $pop3_response = fgets($this->pop_conn, $size); + + return $pop3_response; + } + + /** + * Send a string down the open socket connection to the POP3 server + * + * @param string $string + * @return integer + */ + function sendString ($string) + { + $bytes_sent = fwrite($this->pop_conn, $string, strlen($string)); + + return $bytes_sent; + + } + + /** + * Checks the POP3 server response for +OK or -ERR + * + * @param string $string + * @return boolean + */ + function checkResponse ($string) + { + if (substr($string, 0, 3) !== '+OK') + { + $this->error = array( + 'error' => "Server reported an error: $string", + 'errno' => 0, + 'errstr' => '' + ); + + if ($this->do_debug >= 1) + { + $this->displayErrors(); + } + + return false; + } + else + { + return true; + } + + } + + /** + * If debug is enabled, display the error message array + * + */ + function displayErrors () + { + echo '
    ';
    +
    +    	foreach ($this->error as $single_error)
    +		{
    +	    	print_r($single_error);
    +		}
    +		
    +    	echo '
    '; + } + + /** + * Takes over from PHP for the socket warning handler + * + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + */ + function catchWarning ($errno, $errstr, $errfile, $errline) + { + $this->error[] = array( + 'error' => "Connecting to the POP3 server raised a PHP warning: ", + 'errno' => $errno, + 'errstr' => $errstr + ); + } + +// End of class +} +?> \ No newline at end of file diff --git a/e107_handlers/phpmailer/class.smtp.php b/e107_handlers/phpmailer/class.smtp.php new file mode 100644 index 000000000..e8f6b9abe --- /dev/null +++ b/e107_handlers/phpmailer/class.smtp.php @@ -0,0 +1,1045 @@ +smtp_conn = 0; + $this->error = null; + $this->helo_rply = null; + + $this->do_debug = 0; + } + + /************************************************************* + * CONNECTION FUNCTIONS * + ***********************************************************/ + + /** + * Connect to the server specified on the port specified. + * If the port is not specified use the default SMTP_PORT. + * If tval is specified then a connection will try and be + * established with the server for that number of seconds. + * If tval is not specified the default is 30 seconds to + * try on the connection. + * + * SMTP CODE SUCCESS: 220 + * SMTP CODE FAILURE: 421 + * @access public + * @return bool + */ + function Connect($host,$port=0,$tval=30) { + # set the error val to null so there is no confusion + $this->error = null; + + # make sure we are __not__ connected + if($this->connected()) { + # ok we are connected! what should we do? + # for now we will just give an error saying we + # are already connected + $this->error = + array("error" => "Already connected to a server"); + return false; + } + + if(empty($port)) { + $port = $this->SMTP_PORT; + } + + #connect to the smtp server + $this->smtp_conn = fsockopen($host, # the host of the server + $port, # the port to use + $errno, # error number if any + $errstr, # error message if any + $tval); # give up after ? secs + # verify we connected properly + if(empty($this->smtp_conn)) { + $this->error = array("error" => "Failed to connect to server", + "errno" => $errno, + "errstr" => $errstr); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": $errstr ($errno)" . $this->CRLF; + } + return false; + } + + # sometimes the SMTP server takes a little longer to respond + # so we will give it a longer timeout for the first read + // Windows still does not have support for this timeout function + if(substr(PHP_OS, 0, 3) != "WIN") + socket_set_timeout($this->smtp_conn, $tval, 0); + + # get any announcement stuff + $announce = $this->get_lines(); + + # set the timeout of any socket functions at 1/10 of a second + //if(function_exists("socket_set_timeout")) + // socket_set_timeout($this->smtp_conn, 0, 100000); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; + } + + return true; + } + + /** + * Performs SMTP authentication. Must be run after running the + * Hello() method. Returns true if successfully authenticated. + * @access public + * @return bool + */ + function Authenticate($username, $password) { + // Start authentication + fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "AUTH not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + // Send encoded username + fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "Username not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + // Send encoded password + fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 235) { + $this->error = + array("error" => "Password not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + return true; + } + + /** + * Returns true if connected to a server otherwise false + * @access private + * @return bool + */ + function Connected() { + if(!empty($this->smtp_conn)) { + $sock_status = socket_get_status($this->smtp_conn); + if($sock_status["eof"]) { + # hmm this is an odd situation... the socket is + # valid but we aren't connected anymore + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE:" . $this->CRLF . + "EOF caught while checking if connected"; + } + $this->Close(); + return false; + } + return true; # everything looks good + } + return false; + } + + /** + * Closes the socket and cleans up the state of the class. + * It is not considered good to use this function without + * first trying to use QUIT. + * @access public + * @return void + */ + function Close() { + $this->error = null; # so there is no confusion + $this->helo_rply = null; + if(!empty($this->smtp_conn)) { + # close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = 0; + } + } + + + /*************************************************************** + * SMTP COMMANDS * + *************************************************************/ + + /** + * Issues a data command and sends the msg_data to the server + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being separated by and additional . + * + * Implements rfc 821: DATA + * + * SMTP CODE INTERMEDIATE: 354 + * [data] + * . + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 552,554,451,452 + * SMTP CODE FAILURE: 451,554 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + function Data($msg_data) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Data() without being connected"); + return false; + } + + fputs($this->smtp_conn,"DATA" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 354) { + $this->error = + array("error" => "DATA command not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + # the server is ready to accept data! + # according to rfc 821 we should not send more than 1000 + # including the CRLF + # characters on a single line so we will break the data up + # into lines by \r and/or \n then if needed we will break + # each of those into smaller lines to fit within the limit. + # in addition we will be looking for lines that start with + # a period '.' and append and additional period '.' to that + # line. NOTE: this does not count towards are limit. + + # normalize the line breaks so we know the explode works + $msg_data = str_replace("\r\n","\n",$msg_data); + $msg_data = str_replace("\r","\n",$msg_data); + $lines = explode("\n",$msg_data); + + # we need to find a good way to determine is headers are + # in the msg_data or if it is a straight msg body + # currently I'm assuming rfc 822 definitions of msg headers + # and if the first field of the first line (':' sperated) + # does not contain a space then it _should_ be a header + # and we can process all lines before a blank "" line as + # headers. + $field = substr($lines[0],0,strpos($lines[0],":")); + $in_headers = false; + if(!empty($field) && !strstr($field," ")) { + $in_headers = true; + } + + $max_line_length = 998; # used below; set here for ease in change + + while(list(,$line) = @each($lines)) { + $lines_out = null; + if($line == "" && $in_headers) { + $in_headers = false; + } + # ok we need to break this line up into several + # smaller lines + while(strlen($line) > $max_line_length) { + $pos = strrpos(substr($line,0,$max_line_length)," "); + + # Patch to fix DOS attack + if(!$pos) { + $pos = $max_line_length - 1; + } + + $lines_out[] = substr($line,0,$pos); + $line = substr($line,$pos + 1); + # if we are processing headers we need to + # add a LWSP-char to the front of the new line + # rfc 822 on long msg headers + if($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + # now send the lines to the server + while(list(,$line_out) = @each($lines_out)) { + if(strlen($line_out) > 0) + { + if(substr($line_out, 0, 1) == ".") { + $line_out = "." . $line_out; + } + } + fputs($this->smtp_conn,$line_out . $this->CRLF); + } + } + + # ok all the message data has been sent so lets get this + # over with aleady + fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "DATA not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Expand takes the name and asks the server to list all the + * people who are members of the _list_. Expand will return + * back and array of the result or false if an error occurs. + * Each value in the array returned has the format of: + * [ ] + * The definition of is defined in rfc 821 + * + * Implements rfc 821: EXPN + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 550 + * SMTP CODE ERROR : 500,501,502,504,421 + * @access public + * @return string array + */ + function Expand($name) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Expand() without being connected"); + return false; + } + + fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "EXPN not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + # parse the reply and place in our array to return to user + $entries = explode($this->CRLF,$rply); + while(list(,$l) = @each($entries)) { + $list[] = substr($l,4); + } + + return $list; + } + + /** + * Sends the HELO command to the smtp server. + * This makes sure that we and the server are in + * the same known state. + * + * Implements from rfc 821: HELO + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500, 501, 504, 421 + * @access public + * @return bool + */ + function Hello($host="") { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Hello() without being connected"); + return false; + } + + # if a hostname for the HELO wasn't specified determine + # a suitable one to send + if(empty($host)) { + # we need to determine some sort of appopiate default + # to send to the server + $host = "localhost"; + } + + // Send extended hello first (RFC 2821) + if(!$this->SendHello("EHLO", $host)) + { + if(!$this->SendHello("HELO", $host)) + return false; + } + + return true; + } + + /** + * Sends a HELO/EHLO command. + * @access private + * @return bool + */ + function SendHello($hello, $host) { + fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => $hello . " not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + $this->helo_rply = $rply; + + return true; + } + + /** + * Gets help information on the keyword specified. If the keyword + * is not specified then returns generic help, ussually contianing + * A list of keywords that help is available on. This function + * returns the results back to the user. It is up to the user to + * handle the returned data. If an error occurs then false is + * returned with $this->error set appropiately. + * + * Implements rfc 821: HELP [ ] + * + * SMTP CODE SUCCESS: 211,214 + * SMTP CODE ERROR : 500,501,502,504,421 + * @access public + * @return string + */ + function Help($keyword="") { + $this->error = null; # to avoid confusion + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Help() without being connected"); + return false; + } + + $extra = ""; + if(!empty($keyword)) { + $extra = " " . $keyword; + } + + fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 211 && $code != 214) { + $this->error = + array("error" => "HELP not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + return $rply; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. + * + * Implements rfc 821: MAIL FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,421 + * @access public + * @return bool + */ + function Mail($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Mail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "MAIL not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Sends the command NOOP to the SMTP server. + * + * Implements from rfc 821: NOOP + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500, 421 + * @access public + * @return bool + */ + function Noop() { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Noop() without being connected"); + return false; + } + + fputs($this->smtp_conn,"NOOP" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "NOOP not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Sends the quit command to the server and then closes the socket + * if there is no error or the $close_on_error argument is true. + * + * Implements from rfc 821: QUIT + * + * SMTP CODE SUCCESS: 221 + * SMTP CODE ERROR : 500 + * @access public + * @return bool + */ + function Quit($close_on_error=true) { + $this->error = null; # so there is no confusion + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Quit() without being connected"); + return false; + } + + # send the quit command to the server + fputs($this->smtp_conn,"quit" . $this->CRLF); + + # get any good-bye messages + $byemsg = $this->get_lines(); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; + } + + $rval = true; + $e = null; + + $code = substr($byemsg,0,3); + if($code != 221) { + # use e as a tmp var cause Close will overwrite $this->error + $e = array("error" => "SMTP server rejected quit command", + "smtp_code" => $code, + "smtp_rply" => substr($byemsg,4)); + $rval = false; + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $e["error"] . ": " . + $byemsg . $this->CRLF; + } + } + + if(empty($e) || $close_on_error) { + $this->Close(); + } + + return $rval; + } + + /** + * Sends the command RCPT to the SMTP server with the TO: argument of $to. + * Returns true if the recipient was accepted false if it was rejected. + * + * Implements from rfc 821: RCPT TO: + * + * SMTP CODE SUCCESS: 250,251 + * SMTP CODE FAILURE: 550,551,552,553,450,451,452 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + function Recipient($to) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Recipient() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250 && $code != 251) { + $this->error = + array("error" => "RCPT not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Sends the RSET command to abort and transaction that is + * currently in progress. Returns true if successful false + * otherwise. + * + * Implements rfc 821: RSET + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500,501,504,421 + * @access public + * @return bool + */ + function Reset() { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Reset() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RSET" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "RSET failed", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. This command + * will send the message to the users terminal if they are logged + * in. + * + * Implements rfc 821: SEND FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + function Send($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Send() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "SEND not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * + * Implements rfc 821: SAML FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + function SendAndMail($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called SendAndMail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "SAML not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. This command + * will send the message to the users terminal if they are logged + * in or mail it to them if they are not. + * + * Implements rfc 821: SOML FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + function SendOrMail($from) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called SendOrMail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250) { + $this->error = + array("error" => "SOML not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return true; + } + + /** + * This is an optional command for SMTP that this class does not + * support. This method is here to make the RFC821 Definition + * complete for this class and __may__ be implimented in the future + * + * Implements from rfc 821: TURN + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 502 + * SMTP CODE ERROR : 500, 503 + * @access public + * @return bool + */ + function Turn() { + $this->error = array("error" => "This method, TURN, of the SMTP ". + "is not implemented"); + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; + } + return false; + } + + /** + * Verifies that the name is recognized by the server. + * Returns false if the name could not be verified otherwise + * the response from the server is returned. + * + * Implements rfc 821: VRFY + * + * SMTP CODE SUCCESS: 250,251 + * SMTP CODE FAILURE: 550,551,553 + * SMTP CODE ERROR : 500,501,502,421 + * @access public + * @return int + */ + function Verify($name) { + $this->error = null; # so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Verify() without being connected"); + return false; + } + + fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + } + + if($code != 250 && $code != 251) { + $this->error = + array("error" => "VRFY failed on name '$name'", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF; + } + return false; + } + return $rply; + } + + /******************************************************************* + * INTERNAL FUNCTIONS * + ******************************************************************/ + + /** + * Read in as many lines as possible + * either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * @access private + * @return string + */ + function get_lines() { + $data = ""; + while($str = fgets($this->smtp_conn,515)) { + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data was \"$data\"" . + $this->CRLF; + echo "SMTP -> get_lines(): \$str is \"$str\"" . + $this->CRLF; + } + $data .= $str; + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; + } + # if the 4th character is a space then we are done reading + # so just break the loop + if(substr($str,3,1) == " ") { break; } + } + return $data; + } + +} + + + ?> diff --git a/e107_handlers/phpmailer/e107.htaccess b/e107_handlers/phpmailer/e107.htaccess new file mode 100644 index 000000000..3d13c9b8d --- /dev/null +++ b/e107_handlers/phpmailer/e107.htaccess @@ -0,0 +1 @@ +mod_gzip_on Off \ No newline at end of file diff --git a/e107_handlers/phpmailer/language/phpmailer.lang-en.php b/e107_handlers/phpmailer/language/phpmailer.lang-en.php new file mode 100644 index 000000000..1205a0228 --- /dev/null +++ b/e107_handlers/phpmailer/language/phpmailer.lang-en.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/e107_handlers/phpmailer/mailout_process.php b/e107_handlers/phpmailer/mailout_process.php new file mode 100644 index 000000000..b819d3b20 --- /dev/null +++ b/e107_handlers/phpmailer/mailout_process.php @@ -0,0 +1,364 @@ + db_Delete("generic", "gen_datestamp='".intval($_POST['mail_id'])."' "); + + $text = "

    ".MAILAN_66; // Cancelled Successfully; + $text .= "
    +
    +
    "; + + $ns -> tablerender(MAILAN_59, $text); + echo ""; + + exit; +} + + ob_implicit_flush(); +/* + if (ob_get_level() == 0) { + ob_start(); + } +*/ + +// -------------------- Configure PHP Mailer ------------------------------> + + require(e_HANDLER."phpmailer/class.phpmailer.php"); + + $mail = new PHPMailer(); + + $mail->From = ($_POST['email_from_email'])? $_POST['email_from_email']: $pref['siteadminemail']; + $mail->FromName = ($_POST['email_from_name'])? $_POST['email_from_name']: $pref['siteadmin']; + // $mail->Host = "smtp1.site.com;smtp2.site.com"; + if ($pref['mailer']== 'smtp') + { + $mail->Mailer = "smtp"; + $mail->SMTPKeepAlive = (isset($pref['smtp_keepalive']) && $pref['smtp_keepalive']==1) ? TRUE : FALSE; + if($pref['smtp_server']) + { + $mail->Host = $pref['smtp_server']; + } + if($pref['smtp_username'] && $pref['smtp_password']) + { + $mail->SMTPAuth = TRUE; + $mail->Username = $pref['smtp_username']; + $mail->Password = $pref['smtp_password']; + $mail->PluginDir = e_HANDLER."phpmailer/"; + } + } + elseif ($pref['mailer']== 'sendmail') + { + $mail->Mailer = "sendmail"; + $mail->Sendmail = ($pref['sendmail']) ? $pref['sendmail'] : "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail']; + } + else + { + $mail->Mailer = "mail"; + } + + $mail->AddCC = ($_POST['email_cc']); + $mail->WordWrap = 50; + $mail->Charset = CHARSET; + $mail->Subject = $_POST['email_subject']; + $mail->IsHTML(TRUE); + $mail->SMTPDebug = (e_MENU == "debug") ? TRUE : FALSE; + + if($_POST['email_cc']) + { + $tmp = explode(",",$_POST['email_cc']); + foreach($tmp as $addc) + { + $mail->AddCC($addc); + } + } + + if($_POST['email_bcc']) + { + $tmp = explode(",",$_POST['email_bcc']); + foreach($tmp as $addbc) + { + $mail->AddBCC($addbc); + } + } + + if($pref['mail_bounce_email'] !='') + { + $mail->Sender = $pref['mail_bounce_email']; + } + + $attach = chop($_POST['email_attachment']); + if (($temp = strrchr($attach,'/')) !== FALSE) + { + $attach = substr($attach,$temp + 1); + } + + if(is_readable(e_DOWNLOAD.$attach)) + { + $attach_link = e_DOWNLOAD.$attach; + } + else + { + $attach_link = e_FILE.'public/'.$attach; + } + + if ($attach != "" && !$mail->AddAttachment($attach_link, $attach)) + { + $mss = MAILAN_58."
    $attach_link"; // problem with attachment. + $ns->tablerender("Error", $mss); + require_once(e_ADMIN."footer.php"); + exit; + } + + + +// ---------------------------- Setup the Email -----------------------------> + + + $message_subject = stripslashes($tp -> toHTML($_POST['email_subject'])); + + $mail_head = "\n"; + $mail_head .= "\n"; + $mail_head .= "\n"; + + if (isset($_POST['use_theme'])) + { + $theme = $THEMES_DIRECTORY.$pref['sitetheme']."/"; + // $mail_head .= "\n"; + $style_css = file_get_contents(e_THEME.$pref['sitetheme']."/style.css"); + $mail_head .= ""; + + $message_body = $mail_head; + $message_body .= "\n\n"; + $message_body .= "
    \n"; + $message_body .= $tp -> toEmail($_POST['email_body'])."
    "; + } + else + { + $message_body = $mail_head; + $message_body .= "\n\n"; + $message_body .= $tp -> toEmail($_POST['email_body']).""; + $message_body = str_replace(""", '"', $message_body); + $message_body = str_replace('src="', 'src="'.SITEURL, $message_body); + } + + $message_body = stripslashes($message_body); + + + +// ---------------- Display Progress and Send Emails. -----------------------> + + + echo "
     ".MAILAN_59."
    "; + $qry = "SELECT g.*,u.* FROM #generic AS g LEFT JOIN #user AS u ON g.gen_user_id = u.user_id WHERE g.gen_type='sendmail' and g.gen_datestamp = '".intval($_POST['mail_id'])."' "; + $count = $sql -> db_Select_gen($qry); + + if(!$count) + { + echo "

    ".MAILAN_61."
    "; + echo ""; + echo "
    + +
    "; + exit; + } + + + $c = 0; $d=0; + $pause_count = 1; + $pause_amount = ($pref['mail_pause']) ? $pref['mail_pause'] : 10; + $pause_time = ($pref['mail_pausetime']) ? $pref['mail_pausetime'] : 1; + $sent = array(); + $failed = array(); + $unit = (1/$count)* 100; + echo "
     
    "; + + stopwatch(); + + while($row = $sql-> db_Fetch()){ + + +// ---------------------- Mailing Part. --------------------------------------> + + $activator = (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$row['user_id'].".".$row['user_sess'] : SITEURL."/signup.php?activate.".$row['user_id'].".".$row['user_sess']); + $signup_link = ($row['user_sess']) ? "$activator" : ""; + + $search = array("|USERNAME|","|USERID|","|SIGNUP_LINK|"); + $replace = array($row['user_name'],$row['user_id'],$signup_link); + + $mes_body = str_replace($search,$replace,$message_body); + $alt_body = str_replace($search,$replace,stripslashes($tp->toText($_POST['email_body']))); + + $mail->Body = $mes_body; + $mail->AltBody = $alt_body; + + $mail->AddAddress($row['user_email'], $row['user_name']); + $mail->AddCustomHeader("X-e107-id: ".$row['user_id']); + + + if ($mail->Send()) { + $sent[] = $row['user_id']; + } else { + $failed[] = $row['user_id']; + } + + $mail->ClearAddresses(); + + +// --------- End of the mailing. ---------------------------------------------> + + $cur = round((($c / $count) * 100) + $unit); + echo str_pad(' ',4096)."
    \n"; + + $d = ($c==0) ? 10 : round($width + $d); + + echo "
    ".($c+1)." / ".$count." (" . $cur . "%)  complete
    "; + + if($cur != $prev){ + echo "\n"; + } + $prev = $cur; + ob_flush(); + flush(); + + if($pause_count > $pause_amount){ + sleep($pause_time); + $pause_count = 1; + } + + // Default sleep to reduce server-load: 1 second. + sleep(1); + + $c++; + $pause_count++; + } + ob_end_flush(); + + echo "

    "; + echo MAILAN_62." ".count($sent)."
    "; + echo MAILAN_63." ".count($failed)."
    "; + echo MAILAN_64." ".stopwatch()." ".MAILAN_65."
    "; + echo "
    "; + + $message = $sql -> db_Delete("generic", "gen_datestamp='".intval($_POST['mail_id'])."' ") ? "deleted" : "deleted_failed"; + + $mail->ClearAttachments(); + if ($pref['mailer']== 'smtp') { + $mail->SmtpClose(); + } + +echo "
    +
    +
    "; +echo ""; + + + + + + +function headerjs(){ + $text = " + "; + +$text .= " + "; + + return $text; +} + + +function stopwatch(){ + static $mt_previous = 0; + list($usec, $sec) = explode(" ",microtime()); + $mt_current = (float)$usec + (float)$sec; + if (!$mt_previous) { + $mt_previous = $mt_current; + return ""; + } else { + $mt_diff = ($mt_current - $mt_previous); + $mt_previous = $mt_current; + return round(sprintf('%.16f',$mt_diff),2); + } +} +?> diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php new file mode 100644 index 000000000..571c8a1b7 --- /dev/null +++ b/e107_handlers/plugin_class.php @@ -0,0 +1,601 @@ +db_Select("plugin","*","plugin_installflag = '".intval($flag)."' ORDER BY plugin_path ASC")) + { + $ret = $sql->db_getList(); + } + + + + return ($ret) ? $ret : FALSE; + } + + /** + * Check for new plugins, create entry in plugin table and remove deleted plugins + * + */ + function update_plugins_table() { + global $sql, $mySQLprefix, $menu_pref, $tp; + + require_once(e_HANDLER.'file_class.php'); + + $fl = new e_file; + $pluginList = $fl->get_files(e_PLUGIN, "^plugin\.php$", "standard", 1); + + foreach($pluginList as $p) + { + foreach($defined_vars as $varname) { + if (substr($varname, 0, 6) == 'eplug_' || substr($varname, 0, 8) == 'upgrade_') { + unset($$varname); + } + } + + include_once("{$p['path']}{$p['fname']}"); + $plugin_path = substr(str_replace(e_PLUGIN,"",$p['path']),0,-1); + + // scan for addons. + $eplug_addons = $this->getAddons($plugin_path); + + if($sql->db_Select("plugin", "plugin_id", "plugin_path = '$plugin_path'")) + { + $sql->db_Update("plugin", "plugin_addons = '{$eplug_addons}' WHERE plugin_path = '$plugin_path'"); + } + + if ((!$sql->db_Select("plugin", "plugin_id", "plugin_path = '".$tp -> toDB($eplug_folder, true)."'")) && $eplug_name){ + if (!$eplug_link_url && !$eplug_link && !$eplug_prefs && !$eplug_table_names && !$eplug_user_prefs && !$eplug_sc && !$eplug_userclass && !$eplug_module && !$eplug_bb && !$eplug_latest && !$eplug_status){ + // new plugin, assign entry in plugin table, install is not necessary so mark it as intalled + $sql->db_Insert("plugin", "0, '".$tp -> toDB($eplug_name, true)."', '".$tp -> toDB($eplug_version, true)."', '".$tp -> toDB($eplug_folder, true)."', 1, '$eplug_addons' "); + } + else + { + // new plugin, assign entry in plugin table, install is necessary + $sql->db_Insert("plugin", "0, '".$tp -> toDB($eplug_name, true)."', '".$tp -> toDB($eplug_version, true)."', '".$tp -> toDB($eplug_folder, true)."', 0, '$eplug_addons' "); + } + } + } + + $sql->db_Select("plugin"); + while ($row = $sql->db_fetch()) { + if (!is_dir(e_PLUGIN.$row['plugin_path'])) { + $sql->db_Delete('plugin', "plugin_path = '{$row['plugin_path']}'"); + } + } + } + + /** + * Returns deatils of a plugin from the plugin table from it's ID + * + * @param int $id + * @return array plugin info + */ + function getinfo($id) { + global $sql; + $id = intval($id); + if ($sql->db_Select('plugin', '*', "plugin_id = {$id}")) { + return $sql->db_Fetch(); + } + } + + function manage_userclass($action, $class_name, $class_description) { + global $sql, $tp; + $class_name = $tp -> toDB($class_name, true); + $class_description = $tp -> toDB($class_description, true); + if ($action == 'add') { + $i = 1; + while ($sql->db_Select('userclass_classes', '*', "userclass_id='{$i}' ") && $i < e_UC_READONLY) { + $i++; + } + if ($i < e_UC_READONLY) { + return $sql->db_Insert('userclass_classes', "{$i},'".strip_tags(strtoupper($class_name))."', '{$class_description}' ,".e_UC_PUBLIC); + } else { + return FALSE; + } + } + if ($action == 'remove') { + if ($sql->db_Select('userclass_classes', 'userclass_id', "userclass_name = '{$class_name}'")) { + $row = $sql->db_Fetch(); + $class_id = $row['userclass_id']; + if ($sql->db_Delete('userclass_classes', "userclass_id = '{$class_id}'")) { + if ($sql->db_Select('user', 'user_id, user_class', "user_class REGEXP('^{$class_id}\.') OR user_class REGEXP('\.{$class_id}\.') OR user_class REGEXP('\.{$class_id}$')")) { + $sql2 = new db; + while ($row = $sql->db_Fetch()) { + $classes = explode(".", $row['user_class']); + unset($classes[$class_id]); + foreach($classes as $k => $v) { + if ($v = '') { + unset($classes[$k]); + } + } + $newclass = '.'.implode('.', $classes).'.'; + $sql2->db_Update('user', "user_class = '{$newclass}' WHERE user_id = '{$row['user_id']}"); + } + } + } + } + } + } + + function manage_link($action, $link_url, $link_name,$link_class=0) { + global $sql, $tp; + $link_url = $tp -> toDB($link_url, true); + $link_name = $tp -> toDB($link_name, true); + if ($action == 'add') { + $path = str_replace("../", "", $link_url); + $link_t = $sql->db_Count('links'); + if (!$sql->db_Count('links', '(*)', "link_name = '{$link_name}'")) { + return $sql->db_Insert('links', "0, '{$link_name}', '{$path}', '', '', '1', '".($link_t + 1)."', '0', '0', '{$link_class}' "); + } else { + return FALSE; + } + } + if ($action == 'remove') { + if ($sql->db_Select('links', 'link_order', "link_name = '{$link_name}'")) { + $row = $sql->db_Fetch(); + $sql->db_Update('links', "link_order = link_order - 1 WHERE link_order > {$row['link_order']}"); + return $sql->db_Delete('links', "link_name = '{$link_name}'"); + } + } + } + + function manage_prefs($action, $var) { + global $pref; + if (is_array($var)) { + if ($action == 'add') { + foreach($var as $k => $v) { + $pref[$k] = $v; + } + } + if ($action == 'remove') { + foreach($var as $k => $v) { + unset($pref[$k]); + } + } + save_prefs(); + } + } + + + function manage_comments($action,$comment_id){ + global $sql, $tp; + if($action == 'remove'){ + foreach($comment_id as $com){ + $tmp[] = "comment_type='".$tp -> toDB($com, true)."'"; + } + $qry = implode(" OR ",$tmp); + return $sql->db_Delete('comments',$qry); + } + } + + + function manage_tables($action, $var) { + global $sql; + if ($action == 'add') { + if (is_array($var)) { + foreach($var as $tab) { + if (!$sql->db_Query($tab)) { + return FALSE; + } + } + return TRUE; + } + return TRUE; + } + if ($action == 'upgrade') { + if (is_array($var)) { + foreach($var as $tab) { + if (!$sql->db_Query_all($tab)) { + return FALSE; + } + } + return TRUE; + } + return TRUE; + } + if ($action == 'remove') { + if (is_array($var)) { + foreach($var as $tab) { + $qry = 'DROP TABLE '.MPREFIX.$tab; + if (!$sql->db_Query_all($qry)) { + return $tab; + } + } + return TRUE; + } + return TRUE; + } + } + + function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '') { + global $pref; + if ($prefname == 'plug_sc' || $prefname == 'plug_bb') { + foreach($varArray as $code) { + $prefvals[] = "$code:$plugin_folder"; + } + } else { + $prefvals[] = $plugin_folder; + } + $curvals = explode(',', $pref[$prefname]); + + if ($action == 'add') { + $newvals = array_merge($curvals, $prefvals); + } + if ($action == 'remove') { + foreach($prefvals as $v) { + if (($i = array_search($v, $curvals)) !== FALSE) { + unset($curvals[$i]); + } + } + // $newvals = explode(',', $curvals); + $newvals = $curvals; + } + $newvals = array_unique($newvals); + if(count($newvals) < 2) + { + $pref[$prefname] = $newvals[0]; + } + else + { + $pref[$prefname] = implode(',', $newvals); + } + if(substr($pref[$prefname], 0, 1) == ",") + { + $pref[$prefname] = substr($pref[$prefname], 1); + } + save_prefs(); + } + + + + + + + function manage_search($action, $eplug_folder) { + global $sql, $sysprefs; + $search_prefs = $sysprefs -> getArray('search_prefs'); + $default = file_exists(e_PLUGIN.$eplug_folder.'/e_search.php') ? TRUE : FALSE; + $comments = file_exists(e_PLUGIN.$eplug_folder.'/search/search_comments.php') ? TRUE : FALSE; + if ($action == 'add'){ + $install_default = $default ? TRUE : FALSE; + $install_comments = $comments ? TRUE : FALSE; + } else if ($action == 'remove'){ + $uninstall_default = isset($search_prefs['plug_handlers'][$eplug_folder]) ? TRUE : FALSE; + $uninstall_comments = isset($search_prefs['comments_handlers'][$eplug_folder]) ? TRUE : FALSE; + } else if ($action == 'upgrade'){ + if (isset($search_prefs['plug_handlers'][$eplug_folder])) { + $uninstall_default = $default ? FALSE : TRUE; + } else { + $install_default = $default ? TRUE : FALSE; + } + if (isset($search_prefs['comments_handlers'][$eplug_folder])) { + $uninstall_comments = $comments ? FALSE : TRUE; + } else { + $install_comments = $comments ? TRUE : FALSE; + } + } + if ($install_default) { + $search_prefs['plug_handlers'][$eplug_folder] = array('class' => 0, 'pre_title' => 1, 'pre_title_alt' => '', 'chars' => 150, 'results' => 10); + } else if ($uninstall_default) { + unset($search_prefs['plug_handlers'][$eplug_folder]); + } + if ($install_comments) { + require_once(e_PLUGIN.$eplug_folder.'/search/search_comments.php'); + $search_prefs['comments_handlers'][$eplug_folder] = array('id' => $comments_type_id, 'class' => 0, 'dir' => $eplug_folder); + } else if ($uninstall_comments) { + unset($search_prefs['comments_handlers'][$eplug_folder]); + } + $tmp = addslashes(serialize($search_prefs)); + $sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'search_prefs' "); + } + + function manage_notify($action, $eplug_folder) { + global $sql, $sysprefs, $eArrayStorage, $tp; + $notify_prefs = $sysprefs -> get('notify_prefs'); + $notify_prefs = $eArrayStorage -> ReadArray($notify_prefs); + $e_notify = file_exists(e_PLUGIN.$eplug_folder.'/e_notify.php') ? TRUE : FALSE; + if ($action == 'add'){ + $install_notify = $e_notify ? TRUE : FALSE; + } else if ($action == 'remove'){ + $uninstall_notify = isset($notify_prefs['plugins'][$eplug_folder]) ? TRUE : FALSE; + } else if ($action == 'upgrade'){ + if (isset($notify_prefs['plugins'][$eplug_folder])) { + $uninstall_notify = $e_notify ? FALSE : TRUE; + } else { + $install_notify = $e_notify ? TRUE : FALSE; + } + } + if ($install_notify) { + $notify_prefs['plugins'][$eplug_folder] = TRUE; + require_once(e_PLUGIN.$eplug_folder.'/e_notify.php'); + foreach ($config_events as $event_id => $event_text) { + $notify_prefs['event'][$event_id] = array('type' => 'off', 'class' => '254', 'email' => ''); + } + } else if ($uninstall_notify) { + unset($notify_prefs['plugins'][$eplug_folder]); + require_once(e_PLUGIN.$eplug_folder.'/e_notify.php'); + foreach ($config_events as $event_id => $event_text) { + unset($notify_prefs['event'][$event_id]); + } + } + $s_prefs = $tp -> toDB($notify_prefs); + $s_prefs = $eArrayStorage -> WriteArray($s_prefs); + $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'"); + } + + /** + * Installs a plugin by ID + * + * @param int $id + */ + function install_plugin($id) { + global $sql, $ns, $sysprefs,$mySQLprefix, $tp; + + // install plugin ... + $plug = $this->getinfo($id); + + if ($plug['plugin_installflag'] == FALSE) { + include_once(e_PLUGIN.$plug['plugin_path'].'/plugin.php'); + + $func = $eplug_folder.'_install'; + if (function_exists($func)) { + $text .= call_user_func($func); + } + + if (is_array($eplug_tables)) { + $result = $this->manage_tables('add', $eplug_tables); + if ($result === TRUE) { + $text .= EPL_ADLAN_19.'
    '; + //success + } else { + $text .= EPL_ADLAN_18.'
    '; + //fail + } + } + + + + if (is_array($eplug_prefs)) { + $this->manage_prefs('add', $eplug_prefs); + $text .= EPL_ADLAN_8.'
    '; + } + + + + if (is_array($eplug_array_pref)){ + foreach($eplug_array_pref as $key => $val){ + $this->manage_plugin_prefs('add', $key, $val); + } + } + + if (is_array($eplug_sc)) { + $this->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc); + } + + if (is_array($eplug_bb)) { + $this->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb); + } + + if (is_array($eplug_user_prefs)) { + $sql->db_Select("core", " e107_value", " e107_name = 'user_entended'"); + $row = $sql->db_Fetch(); + $user_entended = unserialize($row[0]); + while (list($e_user_pref, $default_value) = each($eplug_user_prefs)) { + $user_entended[] = $e_user_pref; + $user_pref['$e_user_pref'] = $default_value; + } + save_prefs("user"); + $tmp = addslashes(serialize($user_entended)); + if ($sql->db_Select("core", "e107_value", " e107_name = 'user_entended'")) { + $sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'user_entended' "); + } else { + $sql->db_Insert("core", "'user_entended', '{$tmp}' "); + } + $text .= EPL_ADLAN_8."
    "; + } + + if ($eplug_link === TRUE && $eplug_link_url != '' && $eplug_link_name != '') { + $plug_perm['everyone'] = e_UC_PUBLIC; + $plug_perm['guest'] = e_UC_GUEST; + $plug_perm['member'] = e_UC_MEMBER; + $plug_perm['admin'] = e_UC_ADMIN; + $plug_perm['nobody'] = e_UC_NOBODY; + $eplug_link_perms = strtolower($eplug_link_perms); + $linkperm = ($plug_perm[$eplug_link_perms]) ? $plug_perm[$eplug_link_perms] : e_UC_PUBLIC; + $this->manage_link('add', $eplug_link_url, $eplug_link_name,$linkperm); + } + + if ($eplug_userclass) { + $this->manage_userclass('add', $eplug_userclass, $eplug_userclass_description); + } + + $this -> manage_search('add', $eplug_folder); + + $this -> manage_notify('add', $eplug_folder); + + $eplug_addons = $this->getAddons($eplug_folder); + + $sql->db_Update('plugin', "plugin_installflag = 1, plugin_addons = '{$eplug_addons}' WHERE plugin_id = '".intval($id)."'"); + if($rssmess){ $text .= $rssmess; } + $text .= (isset($eplug_done) ? "
    {$eplug_done}" : "
    ".LAN_INSTALL_SUCCESSFUL); + } else { + $text = EPL_ADLAN_21; + } + if($eplug_conffile){ $text .= " [".LAN_CONFIGURE."]"; } + $ns->tablerender(EPL_ADLAN_33, $text); + } + + + + function save_addon_prefs(){ // scan the plugin table and create path-array-prefs for each addon. + global $sql,$pref; + $query = "SELECT * FROM #plugin WHERE plugin_installflag = 1 AND plugin_addons !='' ORDER BY plugin_path ASC"; + + // clear all addon prefs before re-creation. + unset($pref['shortcode_list'],$pref['bbcode_list'],$pref['e_sql_list']); + foreach($this->plugin_addons as $plg) + { + unset($pref[$plg."_list"]); + } + + if ($sql -> db_Select_gen($query)) + { + while($row = $sql-> db_Fetch()) + { + $tmp = explode(",",$row['plugin_addons']); + $path = $row['plugin_path']; + + foreach($this->plugin_addons as $val) + { + if(in_array($val,$tmp)) + { + $pref[$val."_list"][$path] = $path; + } + } + // search for .bb and .sc files. + $sc_array = array(); + $bb_array = array(); + $sql_array = array(); + + foreach($tmp as $adds) + { + if(substr($adds,-3) == ".sc") + { + $sc_name = substr($adds, 0,-3); // remove the .sc + $sc_array[$sc_name] = "0"; // default userclass. + } + + if(substr($adds,-3) == ".bb") + { + $bb_name = substr($adds, 0,-3); // remove the .bb + $bb_array[$bb_name] = "0"; // default userclass. + } + + if(substr($adds,-4) == "_sql") + { + $pref['e_sql_list'][$path] = $adds; + } + } + + // Build Bbcode list + if(count($bb_array) > 0) + { + ksort($bb_array); + $pref['bbcode_list'][$path] = $bb_array; + + } + else + { + unset($pref['bbcode_list'][$path]); + } + + // Build shortcode list + if(count($sc_array) > 0){ + ksort($sc_array); + $pref['shortcode_list'][$path] = $sc_array; + } + else + { + unset($pref['shortcode_list'][$path]); + } + + } + } + + save_prefs(); + return; + + } + + // return a list of available plugin addons for the specified plugin. e_xxx etc. + function getAddons($plugin_path,$debug=FALSE){ + global $fl; + + $p_addons = ""; + foreach($this->plugin_addons as $e_xxx) + { + if(is_readable(e_PLUGIN.$plugin_path."/".$e_xxx.".php")) + { + $p_addons[] = $e_xxx; + } + } + + if(!is_object($fl)){ + require_once(e_HANDLER.'file_class.php'); + $fl = new e_file; + } + + // Grab List of Shortcodes & BBcodes + $shortcodeList = $fl->get_files(e_PLUGIN.$plugin_path, ".sc$", "standard", 1); + $bbcodeList = $fl->get_files(e_PLUGIN.$plugin_path, ".bb$", "standard", 1); + $sqlList = $fl->get_files(e_PLUGIN.$plugin_path, "_sql.php$", "standard", 1); + + // Search Shortcodes + foreach($shortcodeList as $sc) + { + if(is_readable(e_PLUGIN.$plugin_path."/".$sc['fname'])) + { + $p_addons[] = $sc['fname']; + } + } + + // Search Bbcodes. + foreach($bbcodeList as $bb) + { + if(is_readable(e_PLUGIN.$plugin_path."/".$bb['fname'])) + { + $p_addons[] = $bb['fname']; + } + } + + // Search _sql files. + foreach($sqlList as $esql) + { + if(is_readable(e_PLUGIN.$plugin_path."/".$esql['fname'])) + { + $p_addons[] = str_replace(".php","",$esql['fname']); + } + } + + + if($debug) + { + echo $plugin_path." = ".implode(",",$p_addons)."
    "; + } + + return implode(",",$p_addons); + } + + +} + +?> diff --git a/e107_handlers/pop3_class.php b/e107_handlers/pop3_class.php new file mode 100644 index 000000000..d86408210 --- /dev/null +++ b/e107_handlers/pop3_class.php @@ -0,0 +1,182 @@ +server = $strConnect; + $this->username = $username; + $this->password = $password; + $this->email = $EmailAddress; + } + function connect() //Connect To the Mail Box + { + $this->marubox=imap_open($this->server,$this->username,$this->password); + } + + function getHeaders($mid) // Get Header info + { + $mail_header=imap_header($this->marubox,$mid); + $sender=$mail_header->from[0]; + $sender_replyto=$mail_header->reply_to[0]; + $stat = (strtolower($sender->mailbox)!='mailer-daemon' && strtolower($sender->mailbox)!='postmaster') ? FALSE : TRUE; + if(strpos($mail_header->subject,"delayed")){ + $stat = FALSE; + } + $mail_details=array( + 'from'=>strtolower($sender->mailbox).'@'.$sender->host, + 'fromName'=>$sender->personal, + 'toOth'=>strtolower($sender_replyto->mailbox).'@'.$sender_replyto->host, + 'toNameOth'=>$sender_replyto->personal, + 'subject'=>$mail_header->subject, + 'to'=>strtolower($mail_header->toaddress), + 'bounce'=>$stat, + 'date'=>$mail_header->date + ); + + return $mail_details; + } + function get_mime_type(&$structure) //Get Mime type Internal Private Use + { + $primary_mime_type = array("TEXT", "MULTIPART", "MESSAGE", "APPLICATION", "AUDIO", "IMAGE", "VIDEO", "OTHER"); + + if($structure->subtype) { + return $primary_mime_type[(int) $structure->type] . '/' . $structure->subtype; + } + return "TEXT/PLAIN"; + } + function get_part($stream, $msg_number, $mime_type, $structure = false, $part_number = false) //Get Part Of Message Internal Private Use + { + if(!$structure) { + $structure = imap_fetchstructure($stream, $msg_number); + } + if($structure) { + if($mime_type == $this->get_mime_type($structure)) + { + if(!$part_number) + { + $part_number = "1"; + } + $text = imap_fetchbody($stream, $msg_number, $part_number); + if($structure->encoding == 3) + { + return imap_base64($text); + } + else if($structure->encoding == 4) + { + return imap_qprint($text); + } + else + { + return $text; + } + } + if($structure->type == 1) /* multipart */ + { + while(list($index, $sub_structure) = each($structure->parts)) + { + if($part_number) + { + $prefix = $part_number . '.'; + } + $data = $this->get_part($stream, $msg_number, $mime_type, $sub_structure, $prefix . ($index + 1)); + if($data) + { + return $data; + } + } + } + } + return false; + } + function getTotalMails() //Get Total Number off Unread Email In Mailbox + { + $headers=imap_headers($this->marubox); + return count($headers); + } + function GetAttach($mid,$path) // Get Atteced File from Mail + { + $struckture = imap_fetchstructure($this->marubox,$mid); + $ar=""; + foreach($struckture->parts as $key => $value) + { + $enc=$struckture->parts[$key]->encoding; + if($struckture->parts[$key]->ifdparameters) + { + $name=$struckture->parts[$key]->dparameters[0]->value; + $message = imap_fetchbody($this->marubox,$mid,$key+1); + if ($enc == 0) + $message = imap_8bit($message); + if ($enc == 1) + $message = imap_8bit ($message); + if ($enc == 2) + $message = imap_binary ($message); + if ($enc == 3) + $message = imap_base64 ($message); + if ($enc == 4) + $message = quoted_printable_decode($message); + if ($enc == 5) + $message = $message; + $fp=fopen($path.$name,"w"); + fwrite($fp,$message); + fclose($fp); + $ar=$ar.$name.","; + } + } + $ar=substr($ar,0,(strlen($ar)-1)); + return $ar; + } + function getBody($mid,$mode="") // Get Message Body + { + if($mode != "plain") + { + $body = $this->get_part($this->marubox, $mid, "TEXT/HTML"); + } + if (($body == "") || $mode == 'plain') + $body = $this->get_part($this->marubox, $mid, "TEXT/PLAIN"); + if ($body == "") { + return ""; + } + return $body; + } + function deleteMails($mid) // Delete That Mail + { + imap_delete($this->marubox,$mid); + } + function close_mailbox() //Close Mail Box + { + imap_close($this->marubox,CL_EXPUNGE); + } +} +?> \ No newline at end of file diff --git a/e107_handlers/popup_handler.php b/e107_handlers/popup_handler.php new file mode 100644 index 000000000..2c0ee1dff --- /dev/null +++ b/e107_handlers/popup_handler.php @@ -0,0 +1,91 @@ +\n"; + // } + // on the page where you want to popup image to appear, + // you need to include this class and create a new object for it: + // require_once(e_HANDLER."popup_handler.php"); + // $pp = new popup; + // then you need to prepare the right paramater in the function call. + // the function returns the image with the popup link as a href on it + // clicking the popup will use the js functions in the included js file to popup the image + // $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText) + + function popup($image, $thumb, $iconwidth='100', $maxwidth='', $title, $text){ + global $tp; + //$image : full path to the large image you want to popup + //$thumb : full path to the small image to show on screen + //$maxwidth : the maximum size (width or height) an image may be popup'ed + //$title : the window title of the popup + //$text : the additional text to add into the popup + + if(file_exists($image)){ + + //use $image if $thumb doesn't exist + if(!file_exists($thumb)){ + $thumb = $image; + } + $imagearray = getimagesize(trim($image)); + //$imagearray holds width and height parameters of the image + //$imagearray[0] is width - $imagearray[1] is height + + if($imagearray[1] > $imagearray[0]){ + if(isset($maxwidth) && $maxwidth!='' && $imagearray[1] > $maxwidth){ + $width = round(($maxwidth*$imagearray[0])/$imagearray[1],0); + $height = $maxwidth; + }else{ + $width = $imagearray[0]; + $height = $imagearray[1]; + } + }else{ + if(isset($maxwidth) && $maxwidth!='' && $imagearray[0] > $maxwidth){ + $width = $maxwidth; + $height = round(($maxwidth*$imagearray[1])/$imagearray[0],0); + }else{ + $width = $imagearray[0]; + $height = $imagearray[1]; + } + } + $iconwidth = ($title == "help" ? "" : ($iconwidth ? "width:".intval($iconwidth)."px;" : "width:100px;") ); + + $width = intval($width); + $search = array("'", '$', '"', '$',''', '\'); + $replace = array("\'", '\$', '"', '\$', "\'", '\\'); + $title = str_replace($search, $replace, $title); + $text = str_replace($search, $replace, $text); + + $popup = "

    "; + + }else{ + $popup = ""; + } + return $popup; + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/pref_class.php b/e107_handlers/pref_class.php new file mode 100644 index 000000000..678d525a9 --- /dev/null +++ b/e107_handlers/pref_class.php @@ -0,0 +1,190 @@ +DefaultRows; + } + if(is_array($RowList)) + { + foreach($RowList as $v) + { + $Args .= ($Args ? " OR e107_name='{$v}'" : "e107_name='{$v}'"); + } + } + $sql->db_Select('core', '*', $Args, 'default'); + while ($row = $sql->db_Fetch()) + { + $this->prefVals['core'][$row['e107_name']] = $row['e107_value']; + } + } + + /** + * Return current pref string $name from $table (only core for now) + * + * - @param string $name -- name of pref row + * - @param string $table -- "core" + * - @return string pref value, slashes already stripped + * - @access public + */ + function get($Name) { + if(isset($this->prefVals['core'][$Name])){ + if($this->prefVals['core'][$Name] != '### ROW CACHE FALSE ###'){ + return $this->prefVals['core'][$Name]; + } else { + return false; + } + } + + $get_sql = new db; // required so sql loops don't break using $tp->toHTML(). + if($get_sql->db_Select('core', '*', "`e107_name` = '{$Name}'", 'default')) { + $row = $get_sql->db_Fetch(); + $this->prefVals['core'][$Name] = $row['e107_value']; + return $this->prefVals['core'][$Name]; + } else { + $this->prefVals['core'][$Name] = '### ROW CACHE FALSE ###'; + return false; + } + } + + /** + * Return current array from pref string $name in $table (core only for now) + * + * - @param: string $name -- name of pref row + * - @param string $table -- "core" only now + * - @return array pref values + * - @access public + */ + // retrieve prefs as an array of values + function getArray($name) { + return unserialize($this->get($name)); + } + + + /** + * Update pref set and cache + * + * @param string val -- pre-serialized string + * @param string $name -- name of pref row + * @param string $table -- "core" or "user" + * @global $$name + * @access public + * + * set("val") == 'core', 'pref' + * set("val","rowname") == 'core', rowname + * set("val","","user") == 'user', 'user_pref' for current user + * set("val","","user",uid) == 'user', 'user_pref' for user uid + * set("val","fieldname","user") == 'user', fieldname + * + */ + function set($val, $name = "", $table = "core", $uid = USERID) { + global $sql; + if (!strlen($name)) { + switch ($table) { + case 'core': + $name = "pref"; + break; + case 'user': + $name = "user_pref"; + break; + } + } + $val = addslashes($val); + + switch ($table ) { + case 'core': + if(!$sql->db_Update($table, "e107_value='$val' WHERE e107_name='$name'")) + { + $sql->db_Insert($table, "'{$name}', '{$val}'"); + } + $this->prefVals[$table][$name] = $val; + unset($this->prefArrays[$table][$name]); + break; + case 'user': + $sql->db_Update($table, "user_prefs='$val' WHERE user_id=$uid"); + break; + } + } + + + /** + * Update pref set and cache + * + * - @param string $name -- name of pref row + * - @param string $table -- "core" or "user" + * - @global $$name + * - @access public + * + * set() == core, pref + * set("rowname") == core, rowname + * set("","user") == user, user_pref for current user + * set("","user",uid) == user, user_pref for user uid + * set("fieldname","user") == user, fieldname + * + * all pref sets other than menu_pref get toDB() + */ + function setArray($name = "", $table = "core", $uid = USERID) { + global $tp; + + if (!strlen($name)) { + switch ($table) { + case 'core': + $name = "pref"; + break; + case 'user': + $name = "user_pref"; + break; + } + } + + global $$name; + if ($name != "menu_pref") { + foreach($$name as $key => $prefvalue) { + $$name[$key] = $tp->toDB($prefvalue); + } + } + + $tmp = serialize($$name); + $this->set($tmp, $name, $table, $uid); + } +} +?> \ No newline at end of file diff --git a/e107_handlers/preset_class.php b/e107_handlers/preset_class.php new file mode 100644 index 000000000..7b8dc89a3 --- /dev/null +++ b/e107_handlers/preset_class.php @@ -0,0 +1,80 @@ +id) ? $this->id : array($this->id); + $uid = $qry[1]; + + if($_POST && $qry[0] =="savepreset"){ + foreach($_POST as $key => $value){ + $value = $tp->toDB($value); + if ($sql -> db_Update("preset", "preset_value='$value' WHERE preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' ")){ + + } elseif ($value !="" && !$sql -> db_Select("preset","*","preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' ")){ + $sql -> db_Insert("preset", "0, '".$unique_id[$uid]."', '$key', '$value' "); + } + + if($value == ""){ + $sql -> db_Delete("preset", "preset_field ='".$key."' "); + } + + } + $ns -> tablerender(LAN_SAVED, LAN_PRESET_SAVED); + } + + if ($_POST['delete_preset'] && e_QUERY=="clr_preset"){ + $del = $_POST['del_id']; + $text = ($sql -> db_Delete("preset", "preset_name ='".$unique_id[$del]."' ")) ? LAN_DELETED : LAN_DELETED_FAILED; + $ns -> tablerender($text, LAN_PRESET_DELETED); + } + + } + +// ------------------------------------------------------------------------ + + function read_preset($unique_id){ + global $sql,$tp; + if (!$_POST){ + if ($sql -> db_Select("preset", "*", "preset_name ='$unique_id' ")){ + while ($row = $sql-> db_Fetch()){ + extract($row); + $val[$preset_field] = $tp->toForm($preset_value); + $_POST[$preset_field] = $tp->toForm($preset_value); + } + return $val; + } + } + } + +// --------------------------------------------------- + + +} + +?> \ No newline at end of file diff --git a/e107_handlers/profanity_filter.php b/e107_handlers/profanity_filter.php new file mode 100644 index 000000000..4bdb75b8c --- /dev/null +++ b/e107_handlers/profanity_filter.php @@ -0,0 +1,69 @@ +profanityList = implode("\b|\b", $word_array); + } + unset($words); + return TRUE; + } + + function filterProfanities($text) { + global $pref; + if (!$this->profanityList) { + return $text; + } + if ($pref['profanity_replace']) { + return preg_replace("#\b".$this->profanityList."\b#is", $pref['profanity_replace'], $text); + } else { + return preg_replace_callback("#\b".$this->profanityList."\b#is", array($this, 'replaceProfanities'), $text); + } + } + + function replaceProfanities($matches) { + /*! + @function replaceProfanities callback + @abstract replaces vowels in profanity words with stars + @param text string - text string to be filtered + @result filtered text + */ + + return preg_replace("#a|e|i|o|u#i", "*" , $matches[0]); + } +} + +?> diff --git a/e107_handlers/rate_class.php b/e107_handlers/rate_class.php new file mode 100644 index 000000000..70b9e21b7 --- /dev/null +++ b/e107_handlers/rate_class.php @@ -0,0 +1,227 @@ + + + + + + + + + + + + + "; + return $str; + } + + function rateradio($table, $id) { + + $table = preg_replace('/\W/', '', $table); + $id = intval($id); + + $str = " + 1 + 2  + 3  + 4  + 5  + 6  + 7  + 8  + 9  + 10"; + return $str; + } + + function checkrated($table, $id) { + + $table = preg_replace('/\W/', '', $table); + $id = intval($id); + + $sql = new db; + if (!$sql->db_Select("rate", "*", "rate_table = '{$table}' AND rate_itemid = '{$id}' ")) { + return FALSE; + } else { + $row = $sql->db_Fetch(); + + if (preg_match("/\.".USERID."\./", $row['rate_voters'])) { + return TRUE; + //added option to split an individual users rating + }else if (preg_match("/\.".USERID.chr(1)."([0-9]{1,2})\./", $row['rate_voters'])) { + return TRUE; + } else { + return FALSE; + } + } + } + + function getrating($table, $id, $userid=FALSE) { + //userid : boolean, get rating for a single user, or get general total rating of the item + + $table = preg_replace('/\W/', '', $table); + $id = intval($id); + + $sql = new db; + if (!$sql->db_Select("rate", "*", "rate_table = '{$table}' AND rate_itemid = '{$id}' ")) { + return FALSE; + } else { + $rowgr = $sql->db_Fetch(); + if($userid==TRUE){ + $rating = ""; + $rateusers = explode(".", $rowgr['rate_voters']); + for($i=0;$i 10 || $qs[3] < 1) { + header("location:".e_BASE."index.php"); + exit; + } + + $table = $tp -> toDB($qs[0], true); + $itemid = intval($qs[1]); + $rate = intval($qs[3]); + + //rating is now stored as userid-rating (to retain individual users rating) + //$sep = "^"; + $sep = chr(1); + $voter = USERID.$sep.intval($qs[3]); + + if ($sql->db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$itemid' ")) { + $row = $sql->db_Fetch(); + $rate_voters = $row['rate_voters'].".".$voter."."; + $sql->db_Update("rate", "rate_votes=rate_votes+1, rate_rating=rate_rating+'$rate', rate_voters='$rate_voters' WHERE rate_itemid='$itemid' "); + } else { + $sql->db_Insert("rate", " 0, '$table', '$itemid', '$rate', '1', '.".$voter.".' "); + } + } + + function composerating($table, $id, $enter=TRUE, $userid=FALSE, $nojump=FALSE){ + //enter : boolean to show (rateselect box + textual info) or not + //userid : used to calculate a users given rating + //nojump : boolean, if present no urljump will be used (needed in comment_rating system) + + $rate = ""; + if($ratearray = $this -> getrating($table, $id, $userid)){ + if($ratearray[1] > 0){ + for($c=1; $c<= $ratearray[1]; $c++){ + $rate .= ""; + } + if($ratearray[1] < 10){ + for($c=9; $c>=$ratearray[1]; $c--){ + $rate .= ""; + } + } + $rate .= ""; + if($ratearray[2] == ""){ $ratearray[2] = 0; } + $rate .= " ".$ratearray[1].".".$ratearray[2]; + if(!$userid){ + $rate .= " - ".$ratearray[0]." "; + $rate .= ($ratearray[0] == 1 ? RATELAN_0 : RATELAN_1); + } + } + }else{ + if($enter===TRUE){ + $rate .= RATELAN_4; + } + } + if($enter===TRUE){ + if(!isset($ratearray[1]) || $ratearray[1] > 0){ + $rate .= " - "; + } + if(!$this -> checkrated($table, $id) && USER){ + $rate .= $this -> rateselect(RATELAN_2, $table, $id, $nojump); + + }else if(USER){ + $rate .= RATELAN_3; + } + } + + return $rate; + + } + + function delete_ratings($table, $id) + { + global $tp, $sql; + $table = $tp->toDB($table, true); + $id = intval($id); + return $sql -> db_Delete("rate", "rate_itemid='{$id}' AND rate_table='{$table}'"); + } +} +?> diff --git a/e107_handlers/ren_help.php b/e107_handlers/ren_help.php new file mode 100644 index 000000000..a1948abb7 --- /dev/null +++ b/e107_handlers/ren_help.php @@ -0,0 +1,328 @@ +".$BBCODE_TEMPLATE; + + if($temp[$mode]) + { + $BBCODE_TEMPLATE = $temp[$mode]; + } + if(is_readable(e_FILE."shortcode/batch/bbcode_shortcodes.php")) + { + require_once(e_FILE."shortcode/batch/bbcode_shortcodes.php"); + return $tp->parseTemplate($BBCODE_TEMPLATE, FALSE, $bbcode_shortcodes); + } + else + { + return "ERROR: ".e_FILE."shortcode/batch/bbcode_shortcodes.php IS NOT READABLE."; + } + +} + + +function Size_Select($formid='size_selector') { + $text =" + \n"; + + return $text; +} + + +function Color_Select($formid='col_selector') { + + $text = " + + "; + + return $text; +} + + +function PreImage_Select($formid) { + global $fl, $tp, $bbcode_imagedir; + + $path = ($bbcode_imagedir) ? $bbcode_imagedir : e_IMAGE."newspost_images/"; + $formid = ($formid) ? ($formid) : "preimage_selector"; + + + if(!is_object($fl)){ + require_once(e_HANDLER."file_class.php"); + $fl = new e_file; + } + + $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*'); + $imagelist = $fl->get_files($path,"",$rejecthumb,2); + sort($imagelist); + + $text =" + \n\n"; + return $text; +} + +function PreFile_Select($formid='prefile_selector',$bbcode_filedir) { + require_once(e_HANDLER."userclass_class.php"); + global $IMAGES_DIRECTORY, $fl, $sql; + $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*'); + + $filelist = array(); + $downloadList = array(); + + $sql->db_Select("download", "*", "download_class != ".e_UC_NOBODY); + while ($row = $sql->db_Fetch()) { + extract($row); + if($download_url) + { + $filelist[] = array("id" => $download_id, "name" => $download_name, "url" => $download_url, "class" => $download_class); + $downloadList[] = $download_url; + } + } + + $tmp = $fl->get_files(e_FILE."downloads/","",$rejecthumb); + foreach($tmp as $value) + { + if(!in_array($value['fname'], $downloadList)) + { + $filelist[] = array("id" => 0, "name" => $value['fname'], "url" => $value['fname']); + } + } + $text =" + \n\n"; + return $text; +} + +function Emoticon_Select($formid='emoticon_selector') { + require_once(e_HANDLER."emote.php"); + $text =" + \n\n"; + return $text; +} + +?> \ No newline at end of file diff --git a/e107_handlers/resize_handler.php b/e107_handlers/resize_handler.php new file mode 100644 index 000000000..bd55bd316 --- /dev/null +++ b/e107_handlers/resize_handler.php @@ -0,0 +1,155 @@ +DEBUG image_stats are null
    "; + return false; + } + + if ($image_stats[2] != 1 && $image_stats[2] != 2 && $image_stats[2] != 3 && ($mode == 'gd1' || $mode == 'gd2')) { + echo "DEBUG Wrong image type
    "; + return FALSE; + } + $imagewidth = $image_stats[0]; + $imageheight = $image_stats[1]; + if ($imagewidth <= $new_size && ($imageheight <= $new_height || $new_height == 0)) { + return TRUE; + } + $ratio = ($imagewidth / $new_size); + $new_imageheight = round($imageheight / $ratio); + if (($new_height <= $new_imageheight) && $new_height > 0) { + $ratio = $new_imageheight / $new_height; + $new_imageheight = $new_height; + $new_size = round($new_size / $ratio); + + } + if ($mode == "ImageMagick") { + if ($destination_file == "stdout") { + /* if destination is stdout, output directly to the browser */ + $destination_file = "jpg:-"; + header("Content-type: image/jpeg"); + passthru ($pref['im_path']."convert -quality ".$im_quality." -antialias -geometry ".$new_size."x".$new_imageheight." ".escapeshellarg($source_file)." '".$destination_file."'"); + } else { + /* otherwise output to file */ + if ($model == "copy") { + $name = substr($destination_file, (strrpos($destination_file, "/")+1)); + $name2 = "thumb_".$name; + $destination_file = str_replace($name, $name2, $destination_file); + } + exec ($pref['im_path']."convert -quality ".$im_quality." -antialias -geometry ".$new_size."x".$new_imageheight." ".escapeshellarg($source_file)." '".$destination_file."'"); + + } + } + else if($mode == "gd1") { + if ($image_stats[2] == 2) + $src_img = imagecreatefromjpeg($source_file); + else + $src_img = imagecreatefrompng($source_file); + if (!$src_img) { + return FALSE; + } + $dst_img = imagecreate($new_size, $new_imageheight); + imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_size, $new_imageheight, $imagewidth, $imageheight); + if ($model == "copy") { + $name = substr($destination_file, (strrpos($destination_file, "/")+1)); + $name2 = "thumb_".$name; + $destination_file = str_replace($name, $name2, $destination_file); + } + + if ($destination_file == "stdout") { + header("Content-type: image/jpeg"); + imagejpeg($dst_img, '', $im_quality); + } else { + imagejpeg($dst_img, $destination_file, $im_quality); + imagedestroy($src_img); + imagedestroy($dst_img); + } + + } + else if($mode == "gd2") { + + if ($image_stats[2] == 2) + $src_img = imagecreatefromjpeg($source_file); + else + $src_img = imagecreatefrompng($source_file); + if (!$src_img) { + return FALSE; + } + + $dst_img = imagecreatetruecolor($new_size, $new_imageheight); + imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_size, $new_imageheight, $imagewidth, $imageheight); + + if ($model == "copy") { + $name = substr($destination_file, (strrpos($destination_file, "/")+1)); + $name2 = "thumb_".$name; + $destination_file = str_replace($name, $name2, $destination_file); + } + if ($destination_file == "stdout") { + header("Content-type: image/jpeg"); + imagejpeg($dst_img, '', $im_quality); + } else { + imagejpeg($dst_img, $destination_file, $im_quality); + imagedestroy($src_img); + imagedestroy($dst_img); + } + } + + @chmod($destination_file, 0644); + if ($pref['image_owner']) { + @chown($destination_file, $pref['image_owner']); + } + + $image_stats = getimagesize($destination_file); + if ($image_stats == null) { + // @unlink($source_file); + return FALSE; + } else { + return TRUE; + } +} +?> \ No newline at end of file diff --git a/e107_handlers/search/advanced_comment.php b/e107_handlers/search/advanced_comment.php new file mode 100644 index 000000000..2e2512d17 --- /dev/null +++ b/e107_handlers/search/advanced_comment.php @@ -0,0 +1,44 @@ + 'all', 'title' => LAN_SEARCH_58); + +$advanced_caption['id'] = 'type'; +$advanced_caption['title']['all'] = LAN_SEARCH_59; + +foreach ($search_prefs['comments_handlers'] as $h_key => $value) { + if (check_class($value['class'])) { + $path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$h_key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php'; + require_once($path); + $advanced['type']['list'][] = array('id' => 's_'.$value['id'], 'title' => $comments_title); + $advanced_caption['title']['s_'.$value['id']] = LAN_SEARCH_60.' '.$comments_title; + } +} + +$advanced['date']['type'] = 'date'; +$advanced['date']['text'] = LAN_SEARCH_50.':'; + +$advanced['author']['type'] = 'author'; +$advanced['author']['text'] = LAN_SEARCH_61.':'; + +?> \ No newline at end of file diff --git a/e107_handlers/search/advanced_download.php b/e107_handlers/search/advanced_download.php new file mode 100644 index 000000000..766971384 --- /dev/null +++ b/e107_handlers/search/advanced_download.php @@ -0,0 +1,47 @@ + 'all', 'title' => LAN_SEARCH_51); + +$advanced_caption['id'] = 'cat'; +$advanced_caption['title']['all'] = LAN_SEARCH_64; + +if ($sql -> db_Select_gen("SELECT download_category_id, download_category_name FROM #download_category WHERE download_category_parent != 0 AND download_category_class IN (".USERCLASS_LIST.")")) { + while ($row = $sql -> db_Fetch()) { + $advanced['cat']['list'][] = array('id' => $row['download_category_id'], 'title' => $row['download_category_name']); + $advanced_caption['title'][$row['download_category_id']] = LAN_SEARCH_65.' -> '.$row['download_category_name']; + } +} + +$advanced['date']['type'] = 'date'; +$advanced['date']['text'] = LAN_SEARCH_66.':'; + +$advanced['author']['type'] = 'author'; +$advanced['author']['text'] = LAN_SEARCH_61.':'; + +$advanced['match']['type'] = 'dropdown'; +$advanced['match']['text'] = LAN_SEARCH_52.':'; +$advanced['match']['list'][] = array('id' => 0, 'title' => LAN_SEARCH_67); +$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54); + +?> \ No newline at end of file diff --git a/e107_handlers/search/advanced_news.php b/e107_handlers/search/advanced_news.php new file mode 100644 index 000000000..6cf8c3c26 --- /dev/null +++ b/e107_handlers/search/advanced_news.php @@ -0,0 +1,44 @@ + 'all', 'title' => LAN_SEARCH_51); + +$advanced_caption['id'] = 'cat'; +$advanced_caption['title']['all'] = LAN_SEARCH_56; + +if ($sql -> db_Select("news_category", "category_id, category_name")) { + while($row = $sql -> db_Fetch()) { + $advanced['cat']['list'][] = array('id' => $row['category_id'], 'title' => $row['category_name']); + $advanced_caption['title'][$row['category_id']] = 'News -> '.$row['category_name']; + } +} + +$advanced['date']['type'] = 'date'; +$advanced['date']['text'] = LAN_SEARCH_50.':'; + +$advanced['match']['type'] = 'dropdown'; +$advanced['match']['text'] = LAN_SEARCH_52.':'; +$advanced['match']['list'][] = array('id' => 0, 'title' => LAN_SEARCH_53); +$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54); + +?> \ No newline at end of file diff --git a/e107_handlers/search/advanced_pages.php b/e107_handlers/search/advanced_pages.php new file mode 100644 index 000000000..375327b1e --- /dev/null +++ b/e107_handlers/search/advanced_pages.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_handlers/search/advanced_user.php b/e107_handlers/search/advanced_user.php new file mode 100644 index 000000000..3044237c7 --- /dev/null +++ b/e107_handlers/search/advanced_user.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_handlers/search/comments_download.php b/e107_handlers/search/comments_download.php new file mode 100644 index 000000000..bda8122a7 --- /dev/null +++ b/e107_handlers/search/comments_download.php @@ -0,0 +1,38 @@ + convert_date($row['comment_datestamp'], "long"); + $res['link'] = "download.php?view.".$row['download_id']; + $res['pre_title'] = $row['download_name'] ? LAN_SEARCH_70.": " : ""; + $res['title'] = $row['download_name'] ? $row['download_name'] : LAN_SEARCH_9; + $res['summary'] = $row['comment_comment']; + preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user); + $res['detail'] = LAN_SEARCH_7."".$user[2]."".LAN_SEARCH_8.$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/comments_news.php b/e107_handlers/search/comments_news.php new file mode 100644 index 000000000..4258b7cb9 --- /dev/null +++ b/e107_handlers/search/comments_news.php @@ -0,0 +1,38 @@ + convert_date($row['comment_datestamp'], "long"); + $res['link'] = "comment.php?comment.news.".$row['comment_item_id']; + $res['pre_title'] = $row['news_title'] ? LAN_SEARCH_71.": " : ""; + $res['title'] = $row['news_title'] ? $row['news_title'] : LAN_SEARCH_9; + $res['summary'] = $row['comment_comment']; + preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user); + $res['detail'] = LAN_SEARCH_7."".$user[2]."".LAN_SEARCH_8.$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/comments_page.php b/e107_handlers/search/comments_page.php new file mode 100644 index 000000000..1d67bdc65 --- /dev/null +++ b/e107_handlers/search/comments_page.php @@ -0,0 +1,38 @@ + convert_date($row['comment_datestamp'], "long"); + $res['link'] = "page.php?".$row['page_id']; + $res['pre_title'] = LAN_SEARCH_76.": "; + $res['title'] = $row['page_title']; + $res['summary'] = $row['comment_comment']; + preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user); + $res['detail'] = LAN_SEARCH_7."".$user[2]."".LAN_SEARCH_8.$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/comments_user.php b/e107_handlers/search/comments_user.php new file mode 100644 index 000000000..d87ac0e17 --- /dev/null +++ b/e107_handlers/search/comments_user.php @@ -0,0 +1,38 @@ + convert_date($row['comment_datestamp'], "long"); + $res['link'] = "user.php?id.".$row['comment_item_id']; + $res['pre_title'] = LAN_SEARCH_77.": "; + $res['title'] = $row['user_name']; + $res['summary'] = $row['comment_comment']; + preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user); + $res['detail'] = LAN_SEARCH_7."".$user[2]."".LAN_SEARCH_8.$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/index.html b/e107_handlers/search/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_handlers/search/search_comment.php b/e107_handlers/search/search_comment.php new file mode 100644 index 000000000..35f77d0c5 --- /dev/null +++ b/e107_handlers/search/search_comment.php @@ -0,0 +1,70 @@ + toDB($_GET['type'])))."' AND"; +} + +if (isset($_GET['time']) && is_numeric($_GET['time'])) { + $advanced_where .= " c.comment_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +if (isset($_GET['author']) && $_GET['author'] != '') { + $advanced_where .= " c.comment_author LIKE '%".$tp -> toDB($_GET['author'])."%' AND"; +} + +//basic +$return_fields = 'c.comment_item_id, c.comment_author, c.comment_datestamp, c.comment_comment, c.comment_type'; + +foreach ($search_prefs['comments_handlers'] as $h_key => $value) { + if (check_class($value['class'])) { + $path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$h_key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php'; + if (is_readable($path)) { + require_once($path); + $in[] = "'".$value['id']."'"; + $join[] = $comments_table[$h_key]; + $return_fields .= ', '.$comments_return[$h_key]; + } + + } +} + +$search_fields = array('c.comment_comment', 'c.comment_author'); +$weights = array('1.2', '0.6'); +$no_results = LAN_198; +$where = "comment_type IN (".implode(',', $in).") AND".$advanced_where; +$order = array('comment_datestamp' => DESC); +$table = "comments AS c ".implode(' ', $join); + +$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_comment', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_comment($row) { + if (is_callable('com_search_'.$row['comment_type'])) { + $res = call_user_func('com_search_'.$row['comment_type'], $row); + return $res; + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/search_download.php b/e107_handlers/search/search_download.php new file mode 100644 index 000000000..9d751c81c --- /dev/null +++ b/e107_handlers/search/search_download.php @@ -0,0 +1,66 @@ +=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +if (isset($_GET['author']) && $_GET['author'] != '') { + $advanced_where .= " (d.download_author = '".$tp -> toDB($_GET['author'])."') AND"; +} + +if (isset($_GET['match']) && $_GET['match']) { + $search_fields = array('d.download_name'); +} else { + $search_fields = array('d.download_name', 'd.download_url', 'd.download_description', 'd.download_author', 'd.download_author_website'); +} + +// basic +$return_fields = 'd.download_id, d.download_category, download_category_id, d.download_name, d.download_description, d.download_author, d.download_author_website, d.download_datestamp, d.download_class, c.download_category_name, c.download_category_class'; +$weights = array('1.2', '0.9', '0.6', '0.6', '0.4'); +$no_results = LAN_198; +$where = "download_active = '1' AND d.download_visible IN (".USERCLASS_LIST.") AND c.download_category_class IN (".USERCLASS_LIST.") AND".$advanced_where; +$order = array('download_datestamp' => DESC); +$table = "download AS d LEFT JOIN #download_category AS c ON d.download_category = c.download_category_id"; + +$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_downloads', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_downloads($row) { + global $con; + $datestamp = $con -> convert_date($row['download_datestamp'], "long"); + $res['link'] = "download.php?view.".$row['download_id']; + $res['pre_title'] = $row['download_category_name']." | "; + $res['title'] = $row['download_name']; + $res['pre_summary'] = ""; + $res['summary'] = $row['download_description']; + $res['detail'] = LAN_SEARCH_15." ".$row['download_author']." | ".LAN_SEARCH_66.": ".$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/search_event.php b/e107_handlers/search/search_event.php new file mode 100644 index 000000000..89be8dd65 --- /dev/null +++ b/e107_handlers/search/search_event.php @@ -0,0 +1,66 @@ + toDB($query); +$results = $sql->db_Select("event", "*", "event_stake REGEXP('".$query."') OR event_ward REGEXP('".$query."') OR event_organisation REGEXP('".$query."') OR event_title REGEXP('".$query."') + OR event_location REGEXP('".$query."') OR event_details REGEXP('".$query."') OR event_thread REGEXP('".$query."') "); +while (list($event_id, $event_stake, $event_ward, $event_organisation, $event_start, $event_end, $event_allday, , , $event_title, $event_location, $event_details, $event_author, $event_contact, $event_category, $event_url ) = $sql->db_Fetch()) { + + $sql2->db_select("event_cat", "event_cat_name, event_cat_icon", "event_cat_id='".$event_category."' "); + list($event_cat_name, $event_cat_icon ) = $sql2->db_Fetch(); + + $event_stake_ = parsesearch($event_stake, $query); + if (!$event_stake_) { + $event_stake_ = $event_stake; + } + + $event_ward_ = parsesearch($event_ward, $query); + if (!$event_ward_) { + $event_ward_ = $event_ward; + } + + $event_organisation_ = parsesearch($event_organisation, $query); + if (!$event_organisation_) { + $event_organisation_ = $event_organisation; + } + + $event_title_ = parsesearch($event_title, $query); + if (!$event_title_) { + $event_title_ = $event_title; + } + + $event_details_ = parsesearch($event_details, $query); + if (!$event_details_) { + $event_details_ = $event_details; + } + + $event_cat_name_ = parsesearch($event_cat_name, $query); + if (!$event_cat_name_) { + $event_cat_name_ = $event_cat_name; + } + $event_threat_ = parsesearch($event_threat, $query); + if (!$event_url_) { + $event_threat_ = $event_threat; + } + $text .= "bullet {$event_title}{$event_details}
    "; +} +$qtype = LAN_911; +?> \ No newline at end of file diff --git a/e107_handlers/search/search_news.php b/e107_handlers/search/search_news.php new file mode 100644 index 000000000..41dd9f9e0 --- /dev/null +++ b/e107_handlers/search/search_news.php @@ -0,0 +1,62 @@ +=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +if (isset($_GET['match']) && $_GET['match']) { + $search_fields = array('news_title'); +} else { + $search_fields = array('news_title', 'news_body', 'news_extended'); +} + +// basic +$return_fields = 'n.news_id, n.news_title, n.news_body, n.news_extended, n.news_allow_comments, n.news_datestamp, n.news_category, c.category_name'; +$weights = array('1.2', '0.6', '0.6'); +$no_results = LAN_198; +$time = time(); + +$where = "(news_start < ".$time.") AND (news_end=0 OR news_end > ".$time.") AND news_class IN (".USERCLASS_LIST.") AND".$advanced_where; +$order = array('news_datestamp' => DESC); +$table = "news AS n LEFT JOIN #news_category AS c ON n.news_category = c.category_id"; + +$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_news', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_news($row) { + global $con; + $res['link'] = $row['news_allow_comments'] ? "news.php?item.".$row['news_id'] : "comment.php?comment.news.".$row['news_id']; + $res['pre_title'] = $row['category_name']." | "; + $res['title'] = $row['news_title']; + $res['summary'] = $row['news_body'].' '.$row['news_extended']; + $res['detail'] = LAN_SEARCH_3.$con -> convert_date($row['news_datestamp'], "long"); + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/search_pages.php b/e107_handlers/search/search_pages.php new file mode 100644 index 000000000..3d78c355b --- /dev/null +++ b/e107_handlers/search/search_pages.php @@ -0,0 +1,52 @@ +=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +// basic +$return_fields = 'page_id, page_title, page_text, page_datestamp'; +$search_fields = array('page_title', 'page_text'); +$weights = array('1.2', '0.6'); +$no_results = LAN_198; + +$where = "page_class IN (".USERCLASS_LIST.") AND".$advanced_where; +$order = array('page_datestamp' => DESC); +$table = "page"; + +$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_pages', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_pages($row) { + global $con; + $res['link'] = "page.php?".$row['page_id']; + $res['pre_title'] = ""; + $res['title'] = $row['page_title']; + $res['summary'] = $row['page_text']; + $res['detail'] = LAN_SEARCH_3.$con -> convert_date($row['page_datestamp'], "long"); + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search/search_user.php b/e107_handlers/search/search_user.php new file mode 100644 index 000000000..24f020c8b --- /dev/null +++ b/e107_handlers/search/search_user.php @@ -0,0 +1,50 @@ +=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +// basic +$return_fields = 'user_id, user_name, user_email, user_signature, user_join'; +$search_fields = array('user_name', 'user_email', 'user_signature'); +$weights = array('1.2', '0.6', '0.6', '0.6', '0.6'); +$no_results = LAN_198; +$where = $advanced_where; +$order = array('user_join' => DESC); + +$ps = $sch -> parsesearch('user', $return_fields, $search_fields, $weights, 'search_user', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_user($row) { + global $con; + $res['link'] = "user.php?id.".$row['user_id']; + $res['pre_title'] = $row['user_id']." | "; + $res['title'] = $row['user_name']; + $res['summary'] = $row['user_signature'] ? LAN_SEARCH_72.": ".$row['user_signature'] : LAN_SEARCH_73; + $res['detail'] = LAN_SEARCH_74.": ".$con -> convert_date($row['user_join'], "long"); + return $res; +} + +?> \ No newline at end of file diff --git a/e107_handlers/search_class.php b/e107_handlers/search_class.php new file mode 100644 index 000000000..8e7671f78 --- /dev/null +++ b/e107_handlers/search_class.php @@ -0,0 +1,307 @@ + query = $query; + $this -> bullet = (defined("BULLET") ? "" : ""); + preg_match_all('/(\W?".*?")|(.*?)(\s|$)/', $this -> query, $boolean_keys); + sort($this -> keywords['split'] = array_unique(array_filter(str_replace('"', '', array_merge($boolean_keys[1], $boolean_keys[2]))))); + foreach ($this -> keywords['split'] as $k_key => $key) { + if (!$this -> stopword($key)) { + if ($key{(strlen($key) - 1)} == '*') { + $this -> keywords['wildcard'][$k_key] = TRUE; + $key = substr($key, 0, -1); + } else { + $this -> keywords['wildcard'][$k_key] = FALSE; + } + if ($key{0} == '+') { + $this -> keywords['boolean'][$k_key] = '+'; + $this -> keywords['match'][$k_key] = substr($key, 1); + } else if ($key{0} == '-') { + $this -> keywords['boolean'][$k_key] = '-'; + $this -> keywords['match'][$k_key] = substr($key, 1); + } else { + $this -> keywords['boolean'][$k_key] = FALSE; + $this -> keywords['match'][$k_key] = $key; + } + $this -> keywords['exact'][$k_key] = (strpos($key, ' ') !== FALSE) ? TRUE : FALSE; + $this -> keywords['match'][$k_key] = $tp -> toDB($this -> keywords['match'][$k_key]); + } else { + unset ($this -> keywords['split'][$k_key]); + } + } + } + + function parsesearch($table, $return_fields, $search_fields, $weights, $handler, $no_results, $where, $order) { + global $sql, $query, $tp, $search_prefs, $pre_title, $search_chars, $search_res, $result_flag; + $this -> query = $tp -> toDB($query); + if (!$search_prefs['mysql_sort']) { + $field_operator = 'AND '; + foreach ($this -> keywords['match'] as $k_key => $key) { + $boolean_regex = ''; + if ($this -> keywords['boolean'][$k_key] == '+') { + $key_operator = 'OR '; + $break = TRUE; + $no_exact = TRUE; + } else if ($this -> keywords['boolean'][$k_key] == '-') { + foreach ($this -> keywords as $unset_key => $unset_value) { + unset($this -> keywords[$unset_key][$k_key]); + } + $key_operator = 'AND '; + $boolean_regex = 'NOT'; + $no_exact = TRUE; + } else if (!isset($break)) { + $key_operator = 'OR '; + if (isset($switch)) { + $field_operator = 'OR '; + } + $switch = TRUE; + } else { + break; + } + $match_query .= isset($uninitial_field) ? " ".$field_operator." (" : "("; + $uninitial_field = TRUE; + if ($this -> keywords['wildcard'][$k_key] || !$search_prefs['boundary']) { + $wildcard = ''; + } else { + $wildcard = '[[:>:]]'; + } + $key_count = 1; + foreach ($search_fields as $field) { + $regexp = $search_prefs['boundary'] ? "[[:<:]]".$key.$wildcard : $key; + $match_query .= " ".$field." ".$boolean_regex." REGEXP '".$regexp."' "; + if ($key_count != count($search_fields)) { + $match_query .= $key_operator; + } + $key_count++; + } + $match_query .= ")"; + } + if ($order) { + $sql_order = 'ORDER BY '; + $order_count = count($order); + $i = 1; + foreach ($order as $sort_key => $sort_value) { + $sql_order .= $sort_key.' '.$sort_value; + if ($i != $order_count) { + $sql_order .= ', '; + } + $i++; + } + } else { + $sql_order = ''; + } + $limit = $search_prefs['php_limit'] ? ' LIMIT 0,'.$search_prefs['php_limit'] : ''; + $sql_query = "SELECT ".$return_fields." FROM #".$table." WHERE ".$where." (".$match_query.") ".$sql_order.$limit.";"; + if ((($keycount = count($this -> keywords['split'])) > 1) && (strpos($query, '"') === FALSE) && (!isset($no_exact))) { + $exact_query[] = $query; + $this -> keywords['split'] = array_merge($exact_query, $this -> keywords['split']); + } + } else { + $this -> query = str_replace('"', '"', $this -> query); + $field_query = implode(',', $search_fields); + foreach ($search_fields as $field_key => $field) { + $search_query[] = "(".$weights[$field_key]." * (MATCH(".$field.") AGAINST ('".$this -> query."' IN BOOLEAN MODE)))"; + } + $match_query = implode(' + ', $search_query); + $sql_order = ''; + foreach ($order as $sort_key => $sort_value) { + $sql_order .= ', '.$sort_key.' '.$sort_value; + } + $limit = " LIMIT ".$result_flag.",".$search_res; + $sql_query = "SELECT SQL_CALC_FOUND_ROWS ".$return_fields.", (".$match_query.") AS relevance FROM #".$table." WHERE ".$where." ( MATCH(".$field_query.") AGAINST ('".$this -> query."' IN BOOLEAN MODE) ) HAVING relevance > 0 ORDER BY relevance DESC ".$sql_order.$limit.";"; + } + + if ($ps['results'] = $sql -> db_Select_gen($sql_query)) { + if (!$search_prefs['mysql_sort']) { + $x = 0; + foreach ($search_fields as $field_key => $field) { + $crop_fields[] = preg_replace('/(.*?)\./', '', $field); + } + while ($row = $sql -> db_Fetch()) { + $weight = 0; + foreach ($crop_fields as $field_key => $field) { + $this -> text = $row[$field]; + foreach ($this -> keywords['match'] as $k_key => $this -> query) { + if (stristr($this -> text, $this -> query) !== FALSE) { + if ($this -> keywords['exact'][$k_key] || $this -> keywords['boolean'][$k_key]) { + $weight += (($weights[$field_key] * 2) * ($keycount)); + $endweight = TRUE; + } else if (!$endweight) { + $weight += $weights[$field_key]; + } + } + } + $endweight = FALSE; + + } + foreach ($row as $r_key => $r_value) { + $qrow[$x][$r_key] = $r_value; + $qrow[$x]['relevance'] = $weight; + $qrow[$x]['search_id'] = $x; + } + $x++; + } + + foreach($qrow as $info) { + $sortarr[] = $info['relevance']; + } + array_multisort($sortarr, SORT_DESC, $qrow, SORT_DESC); + + $result_number = ($x < ($result_flag + $search_res)) ? $x : $result_flag + $search_res; + for ($i = $result_flag; $i < $result_number; $i++) { + $display_row[] = $qrow[$i]; + } + + } else { + $x = 0; + while ($row = $sql -> db_Fetch()) { + $display_row[] = $row; + $x++; + } + } + + foreach ($display_row as $row) { + $res = call_user_func($handler, $row); + if (!$res['omit_result']) { + $matches = array($res['title'], $res['summary']); + $endcrop = FALSE; + $output = ''; + $title = TRUE; + foreach ($matches as $this -> text) { + $this -> text = nl2br($this -> text); + $t_search = $tp -> search; + $t_replace = $tp -> replace; + $s_search = array('
    ', '[', ']'); + $s_replace = array(' ', '<', '>'); + $search = array_merge($t_search, $s_search); + $replace = array_merge($t_replace, $s_replace); + $this -> text = strip_tags(str_replace($search, $replace, $this -> text)); + foreach ($this -> keywords['match'] as $match_id => $this -> query) { + $boundary = $search_prefs['boundary'] ? '\b' : ''; + if ($this -> keywords['wildcard'][$match_id]) { + $regex_append = ".*?".$boundary.")"; + } else { + $regex_append = $boundary.")"; + } + if (($match_start = stristr($this -> text, $this -> query)) !== FALSE) { + $this -> pos = strlen($this -> text) - strlen($match_start); + if (!$endcrop && !$title) { + $this -> parsesearch_crop(); + $endcrop = TRUE; + } + $key = substr($this -> text, $this -> pos, strlen($this -> query)); + $this -> text = preg_replace("#(".$boundary.$this -> query.$regex_append."#i", "\\1", $this -> text); + } + } + if ($title) { + if ($pre_title == 0) { + $pre_title_output = ""; + } else if ($pre_title == 1) { + $pre_title_output = $res['pre_title']; + } else if ($pre_title == 2) { + $pre_title_output = $pre_title; + } + $this -> text = $this -> bullet." ".$pre_title_output.$this -> text."
    ".$res['pre_summary']; + } else if (!$endcrop) { + $this -> parsesearch_crop(); + } + $output .= $this -> text; + $title = FALSE; + } + $display_rel = $search_prefs['relevance'] ? " | ".LAN_SEARCH_69.": ".round($row['relevance'], 1) : ""; + $output_array['text'][] = $output.$res['post_summary']."
    ".$res['detail'].$display_rel."

    "; + } else { + $ps['results']--; + $res['omit_result'] = FALSE; + } + } + $ps_limit = $output_array['text']; + $result_number = ($x < $search_res) ? $x : $search_res; + for ($i = 0; $i < $result_number; $i++) { + $ps['text'] .= $ps_limit[$i]; + } + } else { + $ps['text'] = $no_results; + } + if ($search_prefs['mysql_sort']) { + $sql -> db_Query("SELECT FOUND_ROWS()"); + $frows = $sql -> db_Fetch(); + $ps['results'] = $frows[0]; + } + return $ps; + } + + function parsesearch_crop() { + global $search_chars; + if (strlen($this -> text) > $search_chars) { + if ($this -> pos < ($search_chars - strlen($this -> query))) { + $this -> text = substr($this -> text, 0, $search_chars)."..."; + } else if ($this -> pos > (strlen($this -> text) - ($search_chars - strlen($this -> query)))) { + $this -> text = "...".substr($this -> text, (strlen($this -> text) - ($search_chars - strlen($this -> query)))); + } else { + $this -> text = "...".substr($this -> text, ($this -> pos - round(($search_chars / 3))), $search_chars)."..."; + } + $match_start = stristr($this -> text, $this -> query); + $this -> pos = strlen($this -> text) - strlen($match_start); + } + } + + function stopword($key) { + global $search_prefs; + if ($search_prefs['mysql_sort'] && ($key{0} == '+')) { + $key = substr($key, 1); + } + if (($key{(strlen($key) - 1)} != '*') && ($key{0} != '+')) { + if (strlen($key) > 2) { + if ($search_prefs['mysql_sort']) { + $stopword_list = $this -> stopwords_mysql; + } else { + $stopword_list = $this -> stopwords_php; + } + if (strpos($stopword_list, '|'.$key.'|') !== FALSE) { + $this -> stop_keys[] = $key; + return TRUE; + } else { + return FALSE; + } + } else { + $this -> stop_keys[] = $key; + return TRUE; + } + } else { + return FALSE; + } + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/secure_img_handler.php b/e107_handlers/secure_img_handler.php new file mode 100644 index 000000000..818cf2216 --- /dev/null +++ b/e107_handlers/secure_img_handler.php @@ -0,0 +1,69 @@ +random_number = str_replace(".", "", $sec.$usec); + } + + function create_code() { + global $pref, $sql, $IMAGES_DIRECTORY, $HANDLERS_DIRECTORY; + + require_once('e107_class.php'); + $e107 = new e107(false, false); + $e107->set_paths(); + + $imgpy = str_replace($HANDLERS_DIRECTORY, "", $e107->file_path); + + $imgp = $imgpy.$IMAGES_DIRECTORY; + mt_srand ((double)microtime() * 1000000); + $maxran = 1000000; + $rand_num = mt_rand(0, $maxran); + $datekey = date("r"); + $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref). $rand_num . $datekey)); + $code = substr($rcode, 2, 6); + $recnum = $this->random_number; + $del_time = time()+1200; + $sql->db_Insert("tmp", "'{$recnum}',{$del_time},'{$code},{$imgp}'"); + return $recnum; + } + + function verify_code($rec_num, $checkstr) { + global $sql, $tp; + if ($sql->db_Select("tmp", "tmp_info", "tmp_ip = '".$tp -> toDB($rec_num)."'")) { + $row = $sql->db_Fetch(); + $sql->db_Delete("tmp", "tmp_ip = '".$tp -> toDB($rec_num)."'"); + list($code, $path) = explode(",", $row[0]); + return ($checkstr == $code); + } + return FALSE; + } + + function r_image() { + global $HANDLERS_DIRECTORY; + $code = $this->create_code(); + return ""; + } +} +?> diff --git a/e107_handlers/secure_img_render.php b/e107_handlers/secure_img_render.php new file mode 100644 index 000000000..32cd3b99d --- /dev/null +++ b/e107_handlers/secure_img_render.php @@ -0,0 +1,145 @@ + \ No newline at end of file diff --git a/e107_handlers/session_handler.php b/e107_handlers/session_handler.php new file mode 100644 index 000000000..9c0cc2176 --- /dev/null +++ b/e107_handlers/session_handler.php @@ -0,0 +1,118 @@ + " . time(), $session_connection)) { + $session_read = mysql_fetch_assoc($result); + return $session_read['session_data']; + } else { + return FALSE; + } +} + +function sess_write($session_id, $session_data) { + if (!$session_data) { + return FALSE; + } + global $session_connection, $session_lifetime, $mySQLprefix, $session_read; + $expiry = time() + $session_lifetime; + if ($session_read && $session_read['session_ip'] != get_full_ip()) { + session_destroy(); + die("Invalid session ID"); + } + $_session_data = mysql_real_escape_string($session_data); + if ($session_read) { + $query = "UPDATE ".$mySQLprefix."session SET session_expire = $expiry, session_data = '$_session_data' WHERE session_id = '$session_id' AND session_expire > " . time(); + $result = mysql_query($query, $session_connection); + } else { + $query = "INSERT INTO ".$mySQLprefix."session VALUES ('$session_id', $expiry, ".time().", '".get_full_ip()."', '$_session_data')"; + $result = mysql_query($query, $session_connection); + } + return TRUE; +} + +function sess_destroy($session_id) { + global $session_connection, $mySQLprefix; + $query = "DELETE FROM ".$mySQLprefix."session WHERE session_id = '$session_id'"; + $result = mysql_query($query, $session_connection); + return TRUE; +} + +function sess_gc($session_lifetime) { + global $session_connection, $mySQLprefix; + $query = "DELETE FROM ".$mySQLprefix."session WHERE session_expire < " . time(); + $result = mysql_query($query, $session_connection); + return mysql_affected_rows($session_connection); +} + +function get_full_ip() { + global $e107; + $ip_addr = $e107->getip(); + $tmp = $_SERVER['REMOTE_ADDR']; + $ip_resolved = $e107->get_host_name($tmp); + $tmp2 = ($tmp != $ip_resolved && $ip_resolved ? $tmp." - ". $ip_resolved : $tmp2 = $tmp); + $full_ip = ($ip_addr != $tmp ? "$ip_addr | $tmp2" : $tmp2); + return $full_ip; +} + +session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); + +e107_ini_set ("session.save_handler", "user" ); +$session_cookie_lifetime = 0; +$session_cookie_path = '/'; +$session_cookie_domain = ''; +$session_cache_expire = 60 * 24 * 30; +//$session_lifetime = ini_get("session.gc_maxlifetime"); +$session_lifetime = 60 * 24 * 30; +session_name("PHPSESSID"); +if ($_SERVER["HTTPS"] == "on") { + $session_cookie_secure = true; +} +session_set_cookie_params($session_cookie_lifetime, $session_cookie_path, $session_cookie_domain, $session_cookie_secure); +if (version_compare(phpversion(), "4.3.0", ">=")) e107_ini_set ("session.use_only_cookies", $session_use_only_cookies ); +if (version_compare(phpversion(), "4.2.0", ">=")) session_cache_expire ($session_cache_expire); +e107_ini_set ("session.url_rewriter.tags", 'a=href,area=href,frame=src,input=src,form=fakeentry'); + +if ($sql->db_Select("session", "session_id", "session_ip='".get_full_ip()."' ")) { + $row = $sql->db_Fetch(); + session_id($row['session_id']); +} + +session_start(); + +?> \ No newline at end of file diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php new file mode 100644 index 000000000..70eb57088 --- /dev/null +++ b/e107_handlers/shortcode_handler.php @@ -0,0 +1,202 @@ + e_sc)) { + $tp->e_sc = new e_shortcode; +} + +class e_shortcode { + var $scList; + var $parseSCFiles; + var $addedCodes; + var $registered_codes; + + function e_shortcode() + { + global $pref, $register_sc; + + if($pref['shortcode_list'] != '') + { + foreach($pref['shortcode_list'] as $path=>$namearray) + { + foreach($namearray as $code=>$uclass) + { + $code = strtoupper($code); + $this->registered_codes[$code]['type'] = 'plugin'; + $this->registered_codes[$code]['path'] = $path; + // $this->registered_codes[$code]['perms'] = $uclass; + } + } + } + + if(isset($register_sc) && is_array($register_sc)) + { + foreach($register_sc as $code) + { + $this->registered_codes[$code]['type'] = 'theme'; + } + } + } + + function parseCodes($text, $useSCFiles = TRUE, $extraCodes = '') { + $this->parseSCFiles = $useSCFiles; + $ret = ''; + if (is_array($extraCodes)) { + foreach($extraCodes as $sc => $code) { + $this->scList[$sc] = $code; + } + } + $tmp = explode("\n", $text); + foreach($tmp as $line) { + if (preg_match("/{.+?}/", $line, $match)) { + $ret .= preg_replace_callback("#\{(\S[^\x02]*?\S)\}#", array($this, 'doCode'), $line); + } else { + $ret .= $line; + } + } + return $ret; + } + + function doCode($matches) + { + global $pref, $e107cache, $menu_pref, $sc_style, $parm; + + if(strpos($matches[1], E_NL) !== false) + { + return $matches[0]; + } + + if (strpos($matches[1], '=')) + { + list($code, $parm) = explode("=", $matches[1], 2); + } + else + { + $code = $matches[1]; + $parm = ''; + } + $parm = trim($parm); + + if (E107_DEBUG_LEVEL) + { + global $db_debug; + $db_debug->logCode(2, $code, $parm, ""); + } + + if (is_array($this->scList) && array_key_exists($code, $this->scList)) + { + $shortcode = $this->scList[$code]; + } + else + { + if ($this->parseSCFiles == TRUE) + { + if (is_array($this -> registered_codes) && array_key_exists($code, $this->registered_codes)) + { + if($this->registered_codes[$code]['type'] == 'plugin') + { + $scFile = e_PLUGIN.strtolower($this->registered_codes[$code]['path']).'/'.strtolower($code).'.sc'; + } + else + { + $scFile = THEME.strtolower($code).'.sc'; + } + } + else + { + $scFile = e_FILE."shortcode/".strtolower($code).".sc"; + } + if (file_exists($scFile)) { + $shortcode = file_get_contents($scFile); + $this->scList[$code] = $shortcode; + } + } + } + + if(E107_DBG_SC){ + echo " sc= ".str_replace(e_FILE."shortcode/","",$scFile)."
    "; + } + + if(E107_DBG_BBSC) + { + trigger_error("starting shortcode {".$code."}", E_USER_ERROR); + } + $ret = (isset($shortcode) ? eval($shortcode) : ""); + + if($ret != '' || is_numeric($ret)) + { + if(isset($sc_style) && is_array($sc_style) && array_key_exists($code,$sc_style)) + { + if(isset($sc_style[$code]['pre'])) + { + $ret = $sc_style[$code]['pre'].$ret; + } + if(isset($sc_style[$code]['post'])) + { + $ret = $ret.$sc_style[$code]['post']; + } + } + } + return $ret; + } + + function parse_scbatch($fname, $type = 'file') { + $ret = array(); + if($type == 'file') + { + $sc_batch = file($fname); + } + else + { + $sc_batch = $fname; + } + $cur_sc = ''; + foreach($sc_batch as $line) { + if (trim($line) == 'SC_END') { + $cur_sc = ''; + } + if ($cur_sc && !$override) { + $ret[$cur_sc] .= $line; + } + if (preg_match("#^SC_BEGIN (\w*).*#", $line, $matches)) { + $cur_sc = $matches[1]; + $ret[$cur_sc]=''; + if (is_array($this -> registered_codes) && array_key_exists($cur_sc, $this -> registered_codes)) { + if ($this -> registered_codes[$cur_sc]['type'] == 'plugin') { + $scFile = e_PLUGIN.strtolower($this -> registered_codes[$cur_sc]['path']).'/'.strtolower($cur_sc).'.sc'; + } else { + $scFile = THEME.strtolower($cur_sc).'.sc'; + } + if (is_readable($scFile)) { + $ret[$cur_sc] = file_get_contents($scFile); + } + $override = TRUE; + } else { + $override = FALSE; + } + } + } + return $ret; + } +} + +?> diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php new file mode 100644 index 000000000..9edbe5818 --- /dev/null +++ b/e107_handlers/sitelinks_class.php @@ -0,0 +1,382 @@ +db_Select('links', '*', "link_category = ".intval($cat)." and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC")){ + while ($row = $sql->db_Fetch()) + { + // if (substr($row['link_name'], 0, 8) == 'submenu.'){ + // $tmp=explode('.', $row['link_name'], 3); + // $this->eLinkList[$tmp[1]][]=$row; + if (isset($row['link_parent']) && $row['link_parent'] != 0){ + $this->eLinkList['sub_'.$row['link_parent']][]=$row; + }else{ + $this->eLinkList['head_menu'][] = $row; + } + } + } + + } + + function get($cat=1, $style='', $css_class = false) + { + global $pref, $ns, $e107cache, $linkstyle; + $usecache = ((trim(defset('LINKSTART_HILITE')) != "" || trim(defset('LINKCLASS_HILITE')) != "") ? false : true); + + if ($usecache && !strpos(e_SELF, e_ADMIN) & ($data = $e107cache->retrieve('sitelinks_'.$cat.md5($linkstyle.e_PAGE.e_QUERY)))) { + return $data; + } + + if (LINKDISPLAY == 4) { + require_once(e_PLUGIN.'ypslide_menu/ypslide_menu.php'); + return; + } + + $this->getlinks($cat); + + // are these defines used at all ? + + if(!defined('PRELINKTITLE')){ + define('PRELINKTITLE', ''); + } + if(!defined('PRELINKTITLE')){ + define('POSTLINKTITLE', ''); + } + // ----------------------------- + + // where did link alignment go? + if (!defined('LINKALIGN')) { define(LINKALIGN, ''); } + + if(!$style){ + $style['prelink'] = defined('PRELINK') ? PRELINK : ''; + $style['postlink'] = defined('POSTLINK') ? POSTLINK : ''; + $style['linkclass'] = defined('LINKCLASS') ? LINKCLASS : ""; + $style['linkclass_hilite'] = defined('LINKCLASS_HILITE') ? LINKCLASS_HILITE : ""; + $style['linkstart_hilite'] = defined('LINKSTART_HILITE') ? LINKSTART_HILITE : ""; + $style['linkstart'] = defined('LINKSTART') ? LINKSTART : ''; + $style['linkdisplay'] = defined('LINKDISPLAY') ? LINKDISPLAY : ''; + $style['linkend'] = defined('LINKEND') ? LINKEND : ''; + $style['linkseparator'] = defined('LINKSEPARATOR') ? LINKSEPARATOR : ''; + } + + // Sublink styles.- replacing the tree-menu. + if(isset($style['sublinkdisplay']) || isset($style['subindent']) || isset($style['sublinkclass']) || isset($style['sublinkstart']) || isset($style['sublinkend']) || isset($style['subpostlink'])){ + foreach($style as $key=>$val){ + $aSubStyle[$key] = ($style["sub".$key]) ? $style["sub".$key] : $style[$key]; + } + }else{ + $style['subindent'] = "  "; + $aSubStyle = $style; + } + + $text = "\n\n\n\n\n\n".$style['prelink']; + + if ($style['linkdisplay'] != 3) { + foreach ($this->eLinkList['head_menu'] as $key => $link){ + $main_linkid = "sub_".$link['link_id']; + + $link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !$style['linkmainonly'] && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE; + + $render_link[$key] = $this->makeLink($link,'', $style, $css_class); + + if(!defined("LINKSRENDERONLYMAIN") && $style['linkmainonly']!= TRUE) /* if this is defined in theme.php only main links will be rendered */ + { + + // if there's a submenu. : + if (isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])){ + $substyle = (strpos(e_SELF, $link['link_url']) !== FALSE || strpos(e_SELF, $link['link_name']) !== FALSE || $link['link_expand'] == FALSE) ? "compact" : "none"; // expanding sub-menus. + $render_link[$key] .= "\n\n\n\n"; + } + } + } + $text .= implode($style['linkseparator'], $render_link); + $text .= $style['postlink']; + if ($style['linkdisplay'] == 2) { + $text = $ns->tablerender(LAN_SITELINKS_183, $text, 'sitelinks', TRUE); + } + } + else + { + foreach($this->eLinkList['head_menu'] as $link) + { + if (!count($this->eLinkList['sub_'.$link['link_id']])) + { + $text .= $this->makeLink($link,'', $style, $css_class); + } + $text .= $style['postlink']; + } + $text = $ns->tablerender(LAN_SITELINKS_183, $text, 'sitelinks_main', TRUE); + foreach(array_keys($this->eLinkList) as $k) + { + $mnu = $style['prelink']; + foreach($this->eLinkList[$k] as $link) + { + if ($k != 'head_menu') + { + $mnu .= $this->makeLink($link, TRUE, $style, $css_class); + } + } + $mnu .= $style['postlink']; + $text .= $ns->tablerender($k, $mnu, 'sitelinks_sub', TRUE); + } + } + $text .= "\n\n\n\n\n\n"; + if($usecache) + { + $e107cache->set('sitelinks_'.$cat.md5($linkstyle.e_PAGE.e_QUERY), $text); + } + return $text; + } + + function makeLink($linkInfo, $submenu = FALSE, $style='', $css_class = false) + { + global $pref,$tp; + + // Start with an empty link + $linkstart = $indent = $linkadd = $screentip = $href = $link_append = ''; + + // If submenu: Fix Name, Add Indentation. + if ($submenu == TRUE) { + if(substr($linkInfo['link_name'],0,8) == "submenu."){ + $tmp = explode('.', $linkInfo['link_name'], 3); + $linkInfo['link_name'] = $tmp[2]; + } + $indent = ($style['linkdisplay'] != 3) ? $style['subindent'] : ""; + } + + $linkInfo['link_url'] = $tp -> replaceConstants($linkInfo['link_url'],TRUE); // replace {e_xxxx} + + if(strpos($linkInfo['link_url'],"{") !== FALSE){ + $linkInfo['link_url'] = $tp->parseTemplate($linkInfo['link_url'], TRUE); // shortcode in URL support - dynamic urls for multilanguage. + } + // By default links are not highlighted. + $linkstart = $style['linkstart']; + $linkadd = ($style['linkclass']) ? " class='".$style['linkclass']."'" : ""; + $linkadd = ($css_class) ? " class='".$css_class."'" : $linkadd; + + // Check for screentip regardless of URL. + if (isset($pref['linkpage_screentip']) && $pref['linkpage_screentip'] && $linkInfo['link_description']){ + $screentip = " title = \"".$tp->toHTML($linkInfo['link_description'],"","value emotes_off defs no_hook")."\""; + } + + // Check if its expandable first. It should override its URL. + if (isset($linkInfo['link_expand']) && $linkInfo['link_expand']){ + $href = " href=\"javascript:expandit('sub_".$linkInfo['link_id']."')\""; + } elseif ($linkInfo['link_url']){ + + // Only add the e_BASE if it actually has an URL. + $linkInfo['link_url'] = (strpos($linkInfo['link_url'], '://') === FALSE && strpos($linkInfo['link_url'], 'mailto:') !== 0 ? e_HTTP.$linkInfo['link_url'] : $linkInfo['link_url']); + + // Only check if its highlighted if it has an URL + if ($this->hilite($linkInfo['link_url'], $style['linkstart_hilite'])== TRUE) { + $linkstart = (isset($style['linkstart_hilite'])) ? $style['linkstart_hilite'] : ""; + $highlighted = TRUE; + } + if ($this->hilite($linkInfo['link_url'], $style['linkclass_hilite'])== TRUE) { + $linkadd = (isset($style['linkclass_hilite'])) ? " class='".$style['linkclass_hilite']."'" : ""; + $highlighted = TRUE; + } + + if ($linkInfo['link_open'] == 4 || $linkInfo['link_open'] == 5){ + $dimen = ($linkInfo['link_open'] == 4) ? "600,400" : "800,600"; + $href = " href=\"javascript:open_window('".$linkInfo['link_url']."',{$dimen})\""; + } else { + $href = " href='".$linkInfo['link_url']."'"; + } + + // Open link in a new window. (equivalent of target='_blank' ) + $link_append = ($linkInfo['link_open'] == 1) ? " rel='external'" : ""; + } + + // Remove default images if its a button and add new image at the start. + if ($linkInfo['link_button']){ + $linkstart = preg_replace('/\/si', '', $linkstart); + $linkstart .= ""; + } + + // mobile phone support. + $accesskey = (isset($style['accesskey']) && $style['accesskey']==TRUE) ? " accesskey='".$linkInfo['link_order']."' " : ""; + $accessdigit = (isset($style['accessdigit'],$style['accesskey']) && $style['accessdigit']==TRUE && $style['accesskey']==TRUE) ? $linkInfo['link_order'].". " : ""; + + // If its a link.. make a link + $_link = ""; + $_link .= $accessdigit; + if (!empty($href) && (($style['hilite_nolink'] && $highlighted)!=TRUE)){ + $_link .= "".$tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook").""; + // If its not a link, but has a class or screentip do span: + }elseif (!empty($linkadd) || !empty($screentip)){ + $_link .= "".$tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook")."
    "; + // Else just the name: + }else { + $_link .= $tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook"); + } + + $_link = $linkstart.$indent.$_link; + + return $_link.$style['linkend']."\n"; + } + + + + + +function hilite($link,$enabled=''){ + global $PLUGINS_DIRECTORY,$tp,$pref; + if(!$enabled){ return FALSE; } + + $link = $tp->replaceConstants($link,TRUE); + $tmp = explode("?",$link); + $link_qry = (isset($tmp[1])) ? $tmp[1] : ""; + $link_slf = (isset($tmp[0])) ? $tmp[0] : ""; + $link_pge = basename($link_slf); + $link_match = strpos(e_SELF,$tmp[0]); + + if(e_MENU == "debug" && getperms('0')) + { + echo "
    link= ".$link; + echo "
    link_q= ".$link_qry; + echo "
    url= ".e_PAGE; + echo "
    url_query= ".e_QUERY."
    "; + + } + +// ----------- highlight overriding - set the link matching in the page itself. + + if(defined("HILITE")){ + if(strpos($link,HILITE)){ + return TRUE; + } + } + + +// --------------- highlighting for 'HOME'. ---------------- + global $pref; + list($fp,$fp_q) = explode("?",$pref['frontpage']['all']."?"); + if(strpos(e_SELF,"/".$pref['frontpage']['all'])!== FALSE && $fp_q == $tmp[1] && $link == e_HTTP."index.php"){ + return TRUE; + } + +// --------------- highlighting for plugins. ---------------- + if(stristr($link, $PLUGINS_DIRECTORY) !== FALSE && stristr($link, "custompages") === FALSE){ + + if($link_qry) + { // plugin links with queries + $subq = explode("?",$link); + if(strpos(e_SELF,$subq[0]) && e_QUERY == $subq[1]){ + return TRUE; + }else{ + return FALSE; + } + } + else + { // plugin links without queries + $link = str_replace("../", "", $link); + if(stristr(dirname(e_SELF), dirname($link)) !== FALSE){ + return TRUE; + } + } + return FALSE; + } + +// --------------- highlight for news items.---------------- +// eg. news.php, news.php?list.1 or news.php?cat.2 etc + if(substr(basename($link),0,8) == "news.php") + { + if (strpos($link, "news.php?") !== FALSE && strpos(e_SELF,"/news.php")!==FALSE) { + + $lnk = explode(".",$link_qry); // link queries. + $qry = explode(".",e_QUERY); // current page queries. + + if($qry[0] == "item"){ + return ($qry[2] == $lnk[1]) ? TRUE : FALSE; + } + + if($lnk[0] == $qry[0] && $lnk[1] == $qry[1]){ + return TRUE; + } + + } + elseif (!e_QUERY && e_PAGE == "news.php") + { + + return TRUE; + } + return FALSE; + + } +// --------------- highlight for Custom Pages.---------------- +// eg. page.php?1 + + if (strpos($link, "page.php?") !== FALSE && strpos(e_SELF,"/page.php")) { + list($custom,$page) = explode(".",$link_qry); + list($q_custom,$q_page) = explode(".",e_QUERY); + if($custom == $q_custom){ + return TRUE; + }else{ + return FALSE; + } + } + +// --------------- highlight default ---------------- + if(strpos($link, "?") !== FALSE){ + + $thelink = str_replace("../", "", $link); + if((strpos(e_SELF,$thelink) !== false) && (strpos(e_QUERY,$link_qry) !== false)){ + return true; + } + } + if(!preg_match("/all|item|cat|list/", e_QUERY) && (strpos(e_SELF, str_replace("../", "",$link)) !== false)){ + return true; + } + + if((!$link_qry && !e_QUERY) && (strpos(e_SELF,$link) !== FALSE)){ + return TRUE; + } + + if(($link_slf == e_SELF && !link_qry) || (e_QUERY && strpos(e_SELF."?".e_QUERY,$link)!== FALSE) ){ + return TRUE; + } + + return FALSE; + } +} +?> diff --git a/e107_handlers/smtp.php b/e107_handlers/smtp.php new file mode 100644 index 000000000..16537ecca --- /dev/null +++ b/e107_handlers/smtp.php @@ -0,0 +1,210 @@ + 1) { + $headers = join("\r\n", $headers); + } else { + $headers = $headers[0]; + } + } + $headers = chop($headers); + + // + // Make sure there are no bare linefeeds in the headers + // + $headers = preg_replace("/(?$errno: $errstr"); + return FALSE; + } + server_parse($socket, "220"); + $myIP = gethostbyname ($_SERVER['SERVER_NAME']); + $myServer = $e107->get_host_name($myIP); + + if (!empty($pref['smtp_username']) && !empty($pref['smtp_password']) ) { + // Send the RFC2554 specified EHLO. + // This improved as provided by SirSir to accomodate + // both SMTP AND ESMTP capable servers + fputs($socket, "EHLO " . $myServer . "\r\n"); + server_parse($socket, "250"); + + fputs($socket, "AUTH LOGIN\r\n"); + server_parse($socket, "334"); + fputs($socket, base64_encode($pref['smtp_username']) . "\r\n"); + server_parse($socket, "334"); + fputs($socket, base64_encode($pref['smtp_password']) . "\r\n"); + server_parse($socket, "235"); + } else { + // Send the RFC821 specified HELO. + fputs($socket, "HELO " . $myServer . "\r\n"); + server_parse($socket, "250"); + } + + // From this point onward most server response codes should be 250 + // Specify who the mail is from.... + fputs($socket, "MAIL FROM: <" . $pref['siteadminemail'] . ">\r\n"); + server_parse($socket, "250"); + + // Specify each user to send to and build to header. + $to_header = "To: "; + @reset($mail_to_array ); + while (list(, $mail_to_address ) = each($mail_to_array )) { + // + // Add an additional bit of error checking to the To field. + // + $mail_to_address = trim($mail_to_address); + if (preg_match('/[^ ]+\@[^ ]+/', $mail_to_address) ) { + fputs($socket, "RCPT TO: <$mail_to_address>\r\n" ); + server_parse($socket, "250" ); + } + $to_header .= "<$mail_to_address>"; + } + // Ok now do the CC and BCC fields... + @reset($bcc ); + while (list(, $bcc_address ) = each($bcc )) { + // + // Add an additional bit of error checking to bcc header... + // + $bcc_address = trim($bcc_address ); + if (preg_match('/[^ ]+\@[^ ]+/', $bcc_address) ) { + fputs($socket, "RCPT TO: <$bcc_address>\r\n" ); + server_parse($socket, "250" ); + } + } + @reset($cc ); + while (list(, $cc_address ) = each($cc )) { + // + // Add an additional bit of error checking to cc header + // + $cc_address = trim($cc_address ); + if (preg_match('/[^ ]+\@[^ ]+/', $cc_address) ) { + fputs($socket, "RCPT TO: <$cc_address>\r\n"); + server_parse($socket, "250"); + } + } + // Ok now we tell the server we are ready to start sending data + fputs($socket, "DATA\r\n"); + + // This is the last response code we look for until the end of the message. + server_parse($socket, "354"); + + // Send the Subject Line... + fputs($socket, "Subject: $subject\r\n"); + + // Now the To Header. + fputs($socket, "$to_header\r\n"); + + // Now any custom headers.... + fputs($socket, "$headers\r\n\r\n"); + + // Ok now we are ready for the message... + fputs($socket, "$message\r\n"); + + // Ok the all the ingredients are mixed in let's cook this puppy... + fputs($socket, ".\r\n"); + server_parse($socket, "250"); + + // Now tell the server we are done and close the socket... + fputs($socket, "QUIT\r\n"); + fclose($socket); + + return TRUE; + +} + +?> \ No newline at end of file diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php new file mode 100644 index 000000000..ccfd7013e --- /dev/null +++ b/e107_handlers/theme_handler.php @@ -0,0 +1,468 @@ + themeUpload(); + } + + $this -> themeArray = $this -> getThemes(); + + foreach($_POST as $key => $post) + { + if(strstr($key,"preview")) + { + $this -> id = str_replace("preview_", "", $key); + $this -> themePreview(); + } + if(strstr($key,"selectmain")) + { + $this -> id = str_replace("selectmain_", "", $key); + $this -> setTheme(); + } + + if(strstr($key,"selectadmin")) + { + $this -> id = str_replace("selectadmin_", "", $key); + $this -> setAdminTheme(); + } + } + + if(isset($_POST['submit_adminstyle'])) + { + $this -> setAdminStyle(); + } + + if(isset($_POST['submit_style'])) + { + $this -> setStyle(); + } + + } + + function getThemes($mode=FALSE) + { + $themeArray = array(); + $tloop = 1; + $handle = opendir(e_THEME); + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && file_exists(e_THEME.$file."/theme.php")) { + if($mode == "id") { + $themeArray[$tloop] = $file; + } else { + $themeArray[$file]['id'] = $tloop; + } + $tloop++; + $STYLESHEET = FALSE; + if(!$mode) { + $handle2 = opendir(e_THEME.$file."/"); + while (false !== ($file2 = readdir($handle2))) { + if ($file2 != "." && $file2 != ".." && $file != "CVS" && !is_dir(e_THEME.$file."/".$file2)) { + $themeArray[$file]['files'][] = $file2; + if(strstr($file2, "preview.")) { + $themeArray[$file]['preview'] = e_THEME.$file."/".$file2; + } + if(strstr($file2, "css") && !strstr($file2, "menu.css") && strpos($file2, "e_") !== 0 && strpos($file2, "admin_") !== 0) + { + /* get information string */ + $fp=fopen(e_THEME.$file."/".$file2, "r"); + $cssContents = fread ($fp, filesize(e_THEME.$file."/".$file2)); + fclose($fp); + $nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false; + preg_match('/\* info:(.*?)\*\//', $cssContents, $match); + $themeArray[$file]['css'][] = array("name" => $file2, "info" => $match[1], "nonadmin" => $nonadmin); + if($STYLESHEET) + { + $themeArray[$file]['multipleStylesheets'] = TRUE; + } + else + { + $STYLESHEET = TRUE; + } + + } + } + $fp=fopen(e_THEME.$file."/theme.php", "r"); + $themeContents = fread ($fp, filesize(e_THEME.$file."/theme.php")); + fclose($fp); + preg_match('/themename(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['name'] = $match[3]; + preg_match('/themeversion(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['version'] = $match[3]; + preg_match('/themeauthor(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['author'] = $match[3]; + preg_match('/themeemail(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['email'] = $match[3]; + preg_match('/themewebsite(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['website'] = $match[3]; + preg_match('/themedate(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['date'] = $match[3]; + preg_match('/themeinfo(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); + $themeArray[$file]['info'] = $match[3]; + + preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); + $xhtml = strtolower($match[2]); + $themeArray[$file]['xhtmlcompliant'] = ($xhtml == "true" ? true : false); + + preg_match('/csscompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); + $css = strtolower($match[2]); + $themeArray[$file]['csscompliant'] = ($css == "true" ? true : false); + + if (!$themeArray[$file]['name']) + { + unset($themeArray[$file]); + } + } + closedir($handle2); + } + } + } + closedir($handle); + return $themeArray; + } + + function themeUpload() + { + if (!$_POST['ac'] == md5(ADMINPWCHANGE)) { + exit; + } + global $ns; + extract($_FILES); + if(!is_writable(e_THEME)) { + $ns->tablerender(TPVLAN_16, TPVLAN_20); + } else { + require_once(e_HANDLER."upload_handler.php"); + $fileName = $file_userfile['name'][0]; + $fileSize = $file_userfile['size'][0]; + $fileType = $file_userfile['type'][0]; + + if(strstr($file_userfile['type'][0], "gzip")) { + $fileType = "tar"; + } else if (strstr($file_userfile['type'][0], "zip")) { + $fileType = "zip"; + } else { + $ns->tablerender(TPVLAN_16, TPVLAN_17); + require_once("footer.php"); + exit; + } + + 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)); + $unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_THEME, PCLZIP_OPT_SET_CHMOD, 0666)); + } else { + require_once(e_HANDLER."pcltar.lib.php"); + $unarc = ($fileList = PclTarExtract($archiveName, e_THEME)); + } + + if(!$unarc) { + if($fileType == "zip") { + $error = "PCLZIP extract error: '".$archive -> errorName(TRUE)."'"; + } else { + $error = "PCLTAR extract error: ".PclErrorString().", code: ".intval(PclErrorCode()); + } + $ns->tablerender(TPVLAN_16, TPVLAN_18." ".$archiveName." ".$error); + require_once("footer.php"); + exit; + } + + $folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/"))); + $ns->tablerender(TPVLAN_16, "
    ".TPVLAN_19."
    "); + + @unlink(e_THEME.$archiveName); + } + } + } + + function showThemes() + { + global $ns, $pref; + echo "
    +
    \n"; + + foreach($this -> themeArray as $key => $theme) + { + if($key == $pref['sitetheme']) + { + $text = $this -> renderTheme(1, $theme); + } + } + + $ns->tablerender(TPVLAN_26." :: ".TPVLAN_33, $text); + + foreach($this -> themeArray as $key => $theme) + { + if($key == $pref['admintheme']) + { + $text = $this -> renderTheme(2, $theme); + } + } + $ns->tablerender(TPVLAN_26." :: ".TPVLAN_34, $text); + + + if(!is_writable(e_THEME)) { + $ns->tablerender(TPVLAN_16, TPVLAN_15); + $text = ""; + } else { + $text = "
    + + + + + + + + +
    ".TPVLAN_13." + + + +
    + +
    +
    \n"; + } + + $ns->tablerender(TPVLAN_26." :: ".TPVLAN_38, $text); + $text = ""; + foreach($this -> themeArray as $key => $theme) + { + if($key != $pref['admintheme'] && $key != $pref['sitetheme']) + { + $text .= $this -> renderTheme(FALSE, $theme); + } + } + + + + $ns->tablerender(TPVLAN_26." :: ".TPVLAN_39, $text); + echo "
    \n
    \n"; + } + + + + + function renderTheme($mode=FALSE, $theme) + { + + /* + mode = 0 :: normal + mode = 1 :: selected site theme + mode = 2 :: selected admin theme + */ + + global $ns, $pref; + + $author = ($theme['email'] ? "".$theme['author']."" : $theme['author']); + $website = ($theme['website'] ? "".$theme['website']."" : ""); + $preview = "".($theme['preview'] ? "" : "").""; + $selectmainbutton = ($mode != 1 ? "" : ""); + $selectadminbutton = ($mode != 2 ? "" : ""); + $previewbutton = (!$mode ? " " : ""); + + $text = "
    + + + + " : ""; + $itext .= $website ? "" : ""; + $itext .= $theme['date'] ? "" : ""; + $itext .= $theme['info'] ? "" : ""; + $itext .= !$mode ? "" : ""; + + + if ($itext) { + $text .= "
    $preview +
    +
    + ".$theme['name']."
    ".TPVLAN_11." ".$theme['version']." +
    +
    "; + + $itext .= $author ? "
    ".TPVLAN_4.":".$author."
    ".TPVLAN_5.":".$website."
    ".TPVLAN_6.":".$theme['date']."
    ".TPVLAN_7.":".$theme['info']."
    ".TPVLAN_8.":".$previewbutton.$selectmainbutton.$selectadminbutton."
    ".$itext."
    "; + } + + if(array_key_exists("multipleStylesheets", $theme)) + { + if($mode) + { + $text .= " +
    ".TPVLAN_27.":\n"; + foreach($theme['css'] as $css) + { + + if($mode == 2) + { + if (!$css['nonadmin']) { + $text .= " + ".$css['name'].":
    ".($css['info'] ? $css['info'] : ($css['name'] == "style.css" ? TPVLAN_23 : TPVLAN_24))."
    \n"; + } + } + + if($mode == 1) + { + $text .= " + ".$css['name'].":
    ".($css['info'] ? $css['info'] : ($css['name'] == "style.css" ? TPVLAN_23 : TPVLAN_24))."
    \n"; + } + } + $text .= "
    "; + + } + else + { + $text .= "
    "; + foreach($theme['css'] as $css) + { + $text .= "\n"; + } + $text .= "
    ".TPVLAN_22.":
    ".$css['name'].": ".($css['info'] ? $css['info'] : ($css['name'] == "style.css" ? TPVLAN_23 : TPVLAN_24))."

    \n"; + } + } + + if($mode == 1) + { + $text .= " + + + + + +
    ".TPVLAN_30." + ".TPVLAN_28."   + ".TPVLAN_29." +
    + ".$selectadminbutton." +
    "; + } + + if($mode == 2) + { + + $astext = ""; + require_once(e_HANDLER."file_class.php"); + $file = new e_file; + + $adminstyles = $file -> get_files(e_ADMIN."includes"); + + $astext = ""; + + $text .= "

    + +
    ".TPVLAN_41.":$astext
    + ".$selectmainbutton." +
    \n"; + } + + if($theme['xhtmlcompliant'] || $theme['xhtmlcompliant']) + { + $text .= "
    "; + $text .= ($theme['xhtmlcompliant']) ? " ": ""; + $text .= ($theme['csscompliant']) ? " " : ""; + $text .= "
    "; + } + + $text .= "
    \n"; + return $text; + + } + + function themePreview() + { + echo "\n"; + exit; + } + + function showPreview() + { + @include_once(e_LANGUAGE."admin/lan_theme.php"); + @include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php"); + $text = "
    ".TPVLAN_1.".

    "; + global $ns; + $ns->tablerender(TPVLAN_2, $text); + } + + function setTheme() + { + global $pref, $e107cache, $ns; + $themeArray = $this -> getThemes("id"); + $pref['sitetheme'] = $themeArray[$this -> id]; + $pref['themecss'] ='style.css'; + $e107cache->clear(); + save_prefs(); + $ns->tablerender("Admin Message", "
    ".TPVLAN_3." '".$themeArray[$this -> id]."'.

    "); + } + + function setAdminTheme() + { + global $pref, $e107cache, $ns; + $themeArray = $this -> getThemes("id"); + $pref['admintheme'] = $themeArray[$this -> id]; + $pref['admincss'] = file_exists(THEME.'admin_style.css') ? 'admin_style.css' : 'style.css'; + $e107cache->clear(); + save_prefs(); + $ns->tablerender("Admin Message", "
    ".TPVLAN_40." '".$themeArray[$this -> id]."'.

    "); + } + + function setStyle() + { + global $pref, $e107cache, $ns; + $pref['themecss'] = $_POST['themecss']; + $pref['image_preload'] = $_POST['image_preload']; + $e107cache->clear(); + save_prefs(); + $ns->tablerender(TPVLAN_36, "
    ".TPVLAN_37.".

    "); + } + + function setAdminStyle() + { + global $pref, $e107cache, $ns; + $pref['admincss'] = $_POST['admincss']; + $pref['adminstyle'] = $_POST['adminstyle']; + $e107cache->clear(); + save_prefs(); + $ns->tablerender(TPVLAN_36, "
    ".TPVLAN_43.".

    "); + } + +} \ No newline at end of file diff --git a/e107_handlers/tiny_mce/blank.htm b/e107_handlers/tiny_mce/blank.htm new file mode 100644 index 000000000..c1ff8352b --- /dev/null +++ b/e107_handlers/tiny_mce/blank.htm @@ -0,0 +1,9 @@ + + + blank_page + + + + + + diff --git a/e107_handlers/tiny_mce/filelist.php b/e107_handlers/tiny_mce/filelist.php new file mode 100644 index 000000000..f7672f8c7 --- /dev/null +++ b/e107_handlers/tiny_mce/filelist.php @@ -0,0 +1,33 @@ +get_files(e_IMAGE."newspost_images/","",$rejecthumb); + +$sql->db_Select("download"); + $c = 0; + while ($row = $sql->db_Fetch()) { + extract($row); + $filelist['id'][$c] = $download_id; + $filelist['url'][$c] = $download_url; + $filelist['name'][$c] = $download_name; + $c++; + } + +echo "var tinyMCELinkList = new Array("; +for ($i=0; $i \ No newline at end of file diff --git a/e107_handlers/tiny_mce/index.html b/e107_handlers/tiny_mce/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_handlers/tiny_mce/langs/en.js b/e107_handlers/tiny_mce/langs/en.js new file mode 100644 index 000000000..c7faa2432 --- /dev/null +++ b/e107_handlers/tiny_mce/langs/en.js @@ -0,0 +1,41 @@ +// UK lang variables + +tinyMCE.addToLang('',{ +bold_desc : 'Bold (Ctrl+B)', +italic_desc : 'Italic (Ctrl+I)', +underline_desc : 'Underline (Ctrl+U)', +striketrough_desc : 'Strikethrough', +justifyleft_desc : 'Align left', +justifycenter_desc : 'Align center', +justifyright_desc : 'Align right', +justifyfull_desc : 'Align full', +bullist_desc : 'Unordered list', +numlist_desc : 'Ordered list', +outdent_desc : 'Outdent', +indent_desc : 'Indent', +undo_desc : 'Undo (Ctrl+Z)', +redo_desc : 'Redo (Ctrl+Y)', +link_desc : 'Insert/edit link', +unlink_desc : 'Unlink', +image_desc : 'Insert/edit image', +cleanup_desc : 'Cleanup messy code', +focus_alert : 'A editor instance must be focused before using this command.', +edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?', +insert_link_title : 'Insert/edit link', +insert : 'Insert', +update : 'Update', +cancel : 'Cancel', +insert_link_url : 'Link URL', +insert_link_target : 'Target', +insert_link_target_same : 'Open link in the same window', +insert_link_target_blank : 'Open link in a new window', +insert_image_title : 'Insert/edit image', +insert_image_src : 'Image URL', +insert_image_alt : 'Image description', +help_desc : 'Help', +bold_img : "bold.gif", +italic_img : "italic.gif", +underline_img : "underline.gif", +clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?', +popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.' +}); diff --git a/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css b/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css new file mode 100644 index 000000000..1466e0e89 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css @@ -0,0 +1,60 @@ +.contextMenuIEPopup { + padding: 0px; + margin: 0px; + border: 0px; + overflow: hidden; +} + +.contextMenu { + position: absolute; + cursor: default; + z-index: 1000; + border: 1px solid #D4D0C8; + background-color: #FFFFFF; +} + +.contextMenuItem, .contextMenuItemOver { +} + +.contextMenuItemOver { + background-color: #B6BDD2; +} + +.contextMenuSeparator { + width: 100%; + background-color: #D4D0C8; + border: 0px; +} + +.contextMenuImage, .contextMenuItemDisabled { + border: 0px; +} + +.contextMenuIcon { + background-color: #F0F0EE; +} + +.contextMenuItemOver .contextMenuIcon { + background-color: #B6BDD2; +} + +.contextMenuIcon { + background-color: #F0F0EE; +} + +.contextMenuItemDisabled img { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + -moz-opacity:0.3; + opacity: 0.3; +} + +.contextMenuText { + font-family: Tahoma, Verdana, Arial, Helvetica; + font-size: 11px; + margin-left: 5px; + margin-right: 10px; +} + +.contextMenuItemDisabled { + color: #AAAAAA; +} diff --git a/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css b/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css new file mode 100644 index 000000000..a4ad1e9b7 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css @@ -0,0 +1,74 @@ +.contextMenuIEPopup { + padding: 0; + margin: 0; + border: 0; + overflow: hidden; +} + +.contextMenu { + position: absolute; + cursor: default; + z-index: 1000; + border: 1px solid #D4D0C8; + background-color: #FFFFFF; +} + +.contextMenuItem, .contextMenuItemOver { +} + +.contextMenuSeparator { + width: 100%; + background-color: #D4D0C8; + border: 0; +} + +.contextMenuImage, .contextMenuItemDisabled { + border: 0; +} + +.contextMenuIcon { + background-color: #F0F0EE; +} + +.contextMenuItemOver .contextMenuIcon { + background-color: #B6BDD2; +} + +.contextMenuIcon { + background-color: #F0F0EE; +} + +.contextMenuItemDisabled img { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + -moz-opacity:0.3; + opacity: 0.3; +} + +.contextMenuText { + font-family: Tahoma, Verdana, Arial, Helvetica; + font-size: 11px; + line-height: 20px; +} + +.contextMenuItemDisabled { + color: #AAAAAA; +} + +.contextMenuText a { + display: block; + line-height: 20px; + width: 100%; + text-decoration: none; + color: black; + font-weight: normal; + margin: 0; + padding: 0; +} + +.contextMenuText a:hover { + background-color: #B6BDD2; + text-decoration: none !important; + font-weight: normal; + margin: 0; + padding: 0; +} diff --git a/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js b/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 000000000..cd65ef8d4 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css")}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst)})}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu)},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst)}},_showContextMenu:function(e,inst){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true))}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.hasPlugin('flash')&&tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else if(tinyMCE.hasPlugin('media')&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm,'class')))contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_media_title","mceMedia");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false)}break}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert")}}contextMenu.show(x,y)},10);tinyMCE.cancelEvent(e);return false},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide()},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value)},100)}else cm.inst.execCommand(command,ui,value)}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){var doc,self=this;function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val}this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('');doc.close()}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML=""},addSeparator:function(){this.html+=''},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='';else html+='';html+='';html+='
    ';html+=' ';html+=title;html+=' ';html+='
    ';html+='';this.html+=html},show:function(x,y){var vp,width,height,yo;if(this.html=="")return;var html='';html+='';html+=this.html;html+='
    ';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='
    '+html+"
    ";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height)}else{vp=this.getViewPort();yo=tinyMCE.isMSIE5_0?document.body.scrollTop:self.pageYOffset;this.contextMenuDiv.style.left=(x>vp.left+vp.width-width?vp.left+vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.top+vp.height-height?vp.top+vp.height-height:y)+'px';this.contextMenuDiv.style.display="block"}},getViewPort:function(){return{left:self.pageXOffset||self.document.documentElement.scrollLeft||self.document.body.scrollLeft,top:self.pageYOffset||self.document.documentElement.scrollTop||self.document.body.scrollTop,width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none"},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);")}}; \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 000000000..1f4119f43 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,357 @@ +/** + * $Id: editor_plugin_src.js,v 1.1.1.1 2006-12-02 04:34:14 mcfly_e107 Exp $ + * + * @author Moxiecode + * @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +if (!tinyMCE.settings['contextmenu_skip_plugin_css']) { + tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css"); +} + +var TinyMCE_ContextMenuPlugin = { + // Private fields + _contextMenu : null, + + getInfo : function() { + return { + longname : 'Context menus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + initInstance : function(inst) { + // Is not working on MSIE 5.0 or Opera no contextmenu event + if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera) + return; + + TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({ + commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler", + spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif" + }); + + // Add hide event handles + tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu); + + // Attach contextmenu event + if (tinyMCE.isGecko) { + tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);}); + } else + tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu); + }, + + // Private plugin internal methods + + _onContextMenu : function(e) { + var elm = tinyMCE.isMSIE ? e.srcElement : e.target; + var targetInst, body; + + // Find instance + if ((body = tinyMCE.getParentElement(elm, "body")) != null) { + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(inst)) + continue; + + if (body == inst.getBody()) { + targetInst = inst; + break; + } + } + + return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst); + } + }, + + _showContextMenu : function(e, inst) { + function getAttrib(elm, name) { + return elm.getAttribute(name) ? elm.getAttribute(name) : ""; + } + + var x, y, elm, contextMenu; + var pos = tinyMCE.getAbsPosition(inst.iframeElement); + + x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft); + y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop); + elm = tinyMCE.isMSIE ? e.srcElement : e.target; + + contextMenu = this._contextMenu; + contextMenu.inst = inst; + + // Mozilla needs some time + window.setTimeout(function () { + var theme = tinyMCE.getParam("theme"); + + contextMenu.clearAll(); + var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG"; + + // Default items + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false); + + if (sel || (elm ? (elm.nodeName == 'A') || (elm.nodeName == 'IMG') : false)) { + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true)); + } + + // Get element + elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : '')); + if (elm) { + switch (elm.nodeName) { + case "IMG": + contextMenu.addSeparator(); + + // If flash + if (tinyMCE.hasPlugin('flash') && tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1) + contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash"); + else if (tinyMCE.hasPlugin('media') && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm, 'class'))) + contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_media_title", "mceMedia"); + else + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage"); + break; + + case "HR": + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr"); + break; + + case "TABLE": + case "TD": + // Is table plugin loaded + if (inst.hasPlugin("table")) { + var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan"); + var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan"); + + colspan = colspan == "" ? "1" : colspan; + rowspan = rowspan == "" ? "1" : rowspan; + + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null); + + /* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/ + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1")); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false); + } + break; + } + } else { + // Add table specific + if (inst.hasPlugin("table")) { + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert"); + } + } + + contextMenu.show(x, y); + }, 10); + + // Cancel default handeling + tinyMCE.cancelEvent(e); + return false; + }, + + _hideContextMenu : function() { + if (TinyMCE_ContextMenuPlugin._contextMenu) + TinyMCE_ContextMenuPlugin._contextMenu.hide(); + }, + + _commandHandler : function(command, value) { + var cm = TinyMCE_ContextMenuPlugin._contextMenu; + + cm.hide(); + + // UI must be true on these + var ui = false; + if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells") + ui = true; + + if (command == "Paste") + value = null; + + if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) { + // Cell properties will generate access denied error is this isn't done?! + window.setTimeout(function() { + cm.inst.execCommand(command, ui, value); + }, 100); + } else + cm.inst.execCommand(command, ui, value); + } +}; + +tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin); + +// Context menu class + +function TinyMCE_ContextMenu(settings) { + var doc, self = this; + + // Default value function + function defParam(key, def_val) { + settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val; + } + + this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); + + // Setup contextmenu div + this.contextMenuDiv = document.createElement("div"); + this.contextMenuDiv.className = "contextMenu"; + this.contextMenuDiv.setAttribute("class", "contextMenu"); + this.contextMenuDiv.style.display = "none"; + this.contextMenuDiv.style.position = 'absolute'; + this.contextMenuDiv.style.zindex = 1000; + this.contextMenuDiv.style.left = '0'; + this.contextMenuDiv.style.top = '0'; + this.contextMenuDiv.unselectable = "on"; + + document.body.appendChild(this.contextMenuDiv); + + // Setup default values + defParam("commandhandler", ""); + defParam("spacer_image", "images/spacer.gif"); + + this.items = new Array(); + this.settings = settings; + this.html = ""; + + // IE Popup + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { + this.pop = window.createPopup(); + doc = this.pop.document; + doc.open(); + doc.write(''); + doc.close(); + } +}; + +TinyMCE_ContextMenu.prototype = { + clearAll : function() { + this.html = ""; + this.contextMenuDiv.innerHTML = ""; + }, + + addSeparator : function() { + this.html += ''; + }, + + addItem : function(icon, title, command, value, disabled) { + if (title.charAt(0) == '$') + title = tinyMCE.getLang(title.substring(1)); + + var onMouseDown = ''; + var html = ''; + + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) + onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;'; + else + onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;'; + + if (icon == "") + icon = this.settings['spacer_image']; + + if (!disabled) + html += ''; + else + html += ''; + + html += ''; + html += ''; + html += ''; + + // Add to main + this.html += html; + }, + + show : function(x, y) { + var vp, width, height, yo; + + if (this.html == "") + return; + + var html = ''; + + html += ''; + html += this.html; + html += '
    '; + + this.contextMenuDiv.innerHTML = html; + + // Get dimensions + this.contextMenuDiv.style.display = "block"; + width = this.contextMenuDiv.offsetWidth; + height = this.contextMenuDiv.offsetHeight; + this.contextMenuDiv.style.display = "none"; + + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { + // Setup popup and show + this.pop.document.body.innerHTML = '
    ' + html + "
    "; + this.pop.document.tinyMCE = tinyMCE; + this.pop.document.contextMenu = this; + this.pop.show(x, y, width, height); + } else { + vp = this.getViewPort(); + yo = tinyMCE.isMSIE5_0 ? document.body.scrollTop : self.pageYOffset; + this.contextMenuDiv.style.left = (x > vp.left + vp.width - width ? vp.left + vp.width - width : x) + 'px'; + this.contextMenuDiv.style.top = (y > vp.top + vp.height - height ? vp.top + vp.height - height : y) + 'px'; + this.contextMenuDiv.style.display = "block"; + } + }, + + getViewPort : function() { + return { + left : self.pageXOffset || self.document.documentElement.scrollLeft || self.document.body.scrollLeft, + top: self.pageYOffset || self.document.documentElement.scrollTop || self.document.body.scrollTop, + width : document.documentElement.offsetWidth || document.body.offsetWidth, + height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + }; + }, + + hide : function() { + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) + this.pop.hide(); + else + this.contextMenuDiv.style.display = "none"; + }, + + execCommand : function(command, value) { + eval(this.settings['commandhandler'] + "(command, value);"); + } +}; diff --git a/e107_handlers/tiny_mce/plugins/contextmenu/images/spacer.gif b/e107_handlers/tiny_mce/plugins/contextmenu/images/spacer.gif new file mode 100644 index 000000000..388486517 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/contextmenu/images/spacer.gif differ diff --git a/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js b/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js new file mode 100644 index 000000000..f05bc502d --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js @@ -0,0 +1,56 @@ + +tinyMCE.importPluginLanguagePack('emoticons', 'en'); + +// Plucin static class +var TinyMCE_emoticonsPlugin = { + getInfo : function() { + return { + longname : 'emoticons', + author : 'CaMer0n', + authorurl : 'http://e107coders.org', + infourl : 'http://www.e107.org', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + /** + * Returns the HTML contents of the emoticons control. + */ + getControlHTML : function(cn) { + switch (cn) { + case "emoticons": + return tinyMCE.getButtonHTML(cn, 'lang_emoticons_desc', '{$pluginurl}/images/emoticons.png', 'mceEmotion'); + } + + return ""; + }, + + /** + * Executes the mceEmotion command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceEmotion": + var template = new Array(); + + template['file'] = '../../plugins/emoticons/emoticons.php'; // Relative to theme + template['width'] = 200; + template['height'] = 200; + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_emoticons_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_emoticons_delta_height', 0); + + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + + return true; + } + + // Pass to next handler in chain + return false; + } +}; + +// Register plugin +tinyMCE.addPlugin('emoticons', TinyMCE_emoticonsPlugin); \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php b/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php new file mode 100644 index 000000000..c24041b91 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php @@ -0,0 +1,48 @@ +getArray("emote_".$pref['emotepack']); + $str = "
    "; + foreach($emotes as $key => $value){ + $key = str_replace("!", ".", $key); + $key = preg_replace("#_(\w{3})$#", ".\\1", $key); + $value2 = substr($value, 0, strpos($value, " ")); + $value = ($value2 ? $value2 : $value); + $str .= "\n\"\" "; + } + + $str .= "
    "; + + echo $str; + +function headerjs(){ + global $pref; + $js = ""; + $js .= " "; + return $js; + +} + +echo ""; + + +?> \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/emoticons/images/emoticons.png b/e107_handlers/tiny_mce/plugins/emoticons/images/emoticons.png new file mode 100644 index 000000000..f82a4ce00 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/emoticons/images/emoticons.png differ diff --git a/e107_handlers/tiny_mce/plugins/emoticons/index.html b/e107_handlers/tiny_mce/plugins/emoticons/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js b/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js new file mode 100644 index 000000000..b88cc6352 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js @@ -0,0 +1,5 @@ +// UK lang variables + +tinyMCELang['lang_insert_emoticons_title'] = 'Insert emotion'; +tinyMCELang['lang_emoticons_desc'] = 'Emotions'; + diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/config.php b/e107_handlers/tiny_mce/plugins/ibrowser/config.php new file mode 100644 index 000000000..5475bef9c --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/ibrowser/config.php @@ -0,0 +1,59 @@ + $IMAGES_DIRECTORY, + 'text' => 'Images Root', + ), + array( + 'value' => $IMAGES_DIRECTORY."newspost_images/", + 'text' => 'Newspost Images', + ), + array( + 'value' => $IMAGES_DIRECTORY."custom/", + 'text' => 'Custom Images', + ), + array( + 'value' => $IMAGES_DIRECTORY."icons/", + 'text' => 'Icons', + ), + array( + 'value' => $IMAGES_DIRECTORY."banners/", + 'text' => 'Banners', + ), + array( + 'value' => $IMAGES_DIRECTORY."generic/", + 'text' => 'Generic', + ), +); +// file to include in img_library.php (useful for setting $tinyMCE_imglibs dynamically +// $tinyMCE_imglib_include = ''; +?> \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js b/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js new file mode 100644 index 000000000..ac6cdbb3e --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js @@ -0,0 +1,92 @@ +// Import theme specific language pack +// $Source: /cvs_backup/e107_0.8/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js,v $ +// $Revision: 1.1.1.1 $ +// $Date: 2006-12-02 04:34:14 $ +// $Author: mcfly_e107 $ + +tinyMCE.importPluginLanguagePack('ibrowser', 'en,es,da,de,fr,nl,pl,sv,ru'); + +// Returns the HTML contents of the ibrowser control. + +var TinyMCE_ibrowserPlugin = { + getInfo : function() { + return { + longname : 'ibrowser', + author : 'Your name', + authorurl : '', + infourl : '', + version : "1.1" + }; + }, + + getControlHTML : function(cn) { + switch (cn) { + case "ibrowser": + return tinyMCE.getButtonHTML(cn, 'lang_ibrowser_desc', '{$pluginurl}/images/ibrowser.gif', 'mceBrowseImage', true); + } + + return ""; + }, + + + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceBrowseImage": + var template = new Array(); + + template['file'] = '../../plugins/ibrowser/ibrowser.php'; // Relative to theme location + template['width'] = 480; + template['height'] = 670; + + var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = ""; + var margin_left = ""; + var margin_right = ""; + var margin_top = ""; + var margin_bottom = ""; + + if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") + tinyMCE.imgElement = tinyMCE.selectedElement; + + if (tinyMCE.imgElement) { + src = tinyMCE.imgElement.getAttribute('src') ? tinyMCE.imgElement.getAttribute('src') : ""; + alt = tinyMCE.imgElement.getAttribute('alt') ? tinyMCE.imgElement.getAttribute('alt') : ""; + } + /* + + border = tinyMCE.imgElement.style.border ? tinyMCE.imgElement.style.border : ""; + hspace = tinyMCE.imgElement.getAttribute('hspace') ? tinyMCE.imgElement.getAttribute('hspace') : ""; + vspace = tinyMCE.imgElement.getAttribute('vspace') ? tinyMCE.imgElement.getAttribute('vspace') : ""; + width = tinyMCE.imgElement.style.width ? tinyMCE.imgElement.style.width.replace('px','') : ""; + height = tinyMCE.imgElement.style.height ? tinyMCE.imgElement.style.height.replace('px','') : ""; + align = tinyMCE.imgElement.getAttribute('align') ? tinyMCE.imgElement.getAttribute('align') : ""; + + margin_left = tinyMCE.imgElement.style.marginLeft ? tinyMCE.imgElement.style.marginLeft.replace('px','') : ""; + margin_right = tinyMCE.imgElement.style.marginRight ? tinyMCE.imgElement.style.marginRight.replace('px','') : ""; + margin_top = tinyMCE.imgElement.style.marginTop ? tinyMCE.imgElement.style.marginTop.replace('px','') : ""; + margin_bottom = tinyMCE.imgElement.style.marginBottom ? tinyMCE.imgElement.style.marginBottom.replace('px','') : ""; + + // Fix for drag-drop/copy paste bug in Mozilla + mceRealSrc = tinyMCE.imgElement.getAttribute('mce_real_src') ? tinyMCE.imgElement.getAttribute('mce_real_src') : ""; + if (mceRealSrc != "") + src = mceRealSrc; + + // src = eval(tinyMCE.settings['urlconvertor_callback'] + "(src, tinyMCE.imgElement, true);"); + } +*/ + tinyMCE.openWindow(template, {editor_id : editor_id, src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align}); + return true; + } + + // Pass to next handler in chain + return false; + } + +}; + + +tinyMCE.addPlugin("ibrowser", TinyMCE_ibrowserPlugin); + + + + diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php b/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php new file mode 100644 index 000000000..23e0dc935 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php @@ -0,0 +1,476 @@ + + + + +{$lang_ibrowser_title} + + + + + + + +
    + + +
    + {$lang_ibrowser_img_sel} + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    {$lang_ibrowser_library}: {$lang_ibrowser_preview}:
      +
    {$lang_ibrowser_images}: 
    dir=".$_root.$imglib; + $d = @dir(e_BASE.$imglib); + + ?> +  
    + + + + +
    + + +
    +
    +
    + {$lang_ibrowser_img_info} + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang_ibrowser_src}:
    {$lang_ibrowser_alt}:
    {$lang_ibrowser_align}:  +
    +

    Lorem + ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum + edipiscing elit, sed diam nonummy nibh euismod tincidunt ut + laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing + elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore + magna aliquam erat volutpat. Ut wisi enim ad minim veniam, + quis nostrud exercitation ullamcorper suscipit. Lorem ipsum, + Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing + elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore + magna aliquam erat volutpat.

    +
    +
    {$lang_ibrowser_size}: 
    {$lang_ibrowser_height}:{$lang_ibrowser_reset}  
    {$lang_ibrowser_width}: 
    {$lang_ibrowser_border}: + px +  
    Margin-left:px +  
    Margin-Right:px +  
    Margin-Top:px +  
    Margin-Bottom:px +  
    +
    + +
    + + +'.$prefix.$lib['text'].''."\n"; + } + return $buf; +} + + +// Return the human readable size of a file +// @param int $size a file size +// @param int $dec a number of decimal places + +function filesize_h($size, $dec = 1) +{ + $sizes = array('byte(s)', 'kb', 'mb', 'gb'); + $count = count($sizes); + $i = 0; + + while ($size >= 1024 && ($i < $count - 1)) { + $size /= 1024; + $i++; + } + + return round($size, $dec) . ' ' . $sizes[$i]; +} + +?> diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/images/constrain.gif b/e107_handlers/tiny_mce/plugins/ibrowser/images/constrain.gif new file mode 100644 index 000000000..2153c8530 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/ibrowser/images/constrain.gif differ diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/images/ibrowser.gif b/e107_handlers/tiny_mce/plugins/ibrowser/images/ibrowser.gif new file mode 100644 index 000000000..1b9413e98 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/ibrowser/images/ibrowser.gif differ diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/images/textflow.gif b/e107_handlers/tiny_mce/plugins/ibrowser/images/textflow.gif new file mode 100644 index 000000000..53bf6890b Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/ibrowser/images/textflow.gif differ diff --git a/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js b/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js new file mode 100644 index 000000000..b52c820c0 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js @@ -0,0 +1,38 @@ +// UK lang variables + +tinyMCELang['lang_ibrowser_title'] = 'Insert / Edit Image'; +tinyMCELang['lang_ibrowser_desc'] = 'Insert / Edit Image'; +tinyMCELang['lang_ibrowser_library'] = 'Library'; +tinyMCELang['lang_ibrowser_preview'] = 'Preview'; +tinyMCELang['lang_ibrowser_img_sel'] = 'Image selection'; +tinyMCELang['lang_ibrowser_img_info'] = 'Image information'; +tinyMCELang['lang_ibrowser_img_upload'] = 'Image upload'; +tinyMCELang['lang_ibrowser_images'] = 'Images'; +tinyMCELang['lang_ibrowser_src'] = 'Source'; +tinyMCELang['lang_ibrowser_alt'] = 'Description'; +tinyMCELang['lang_ibrowser_size'] = 'Size'; +tinyMCELang['lang_ibrowser_align'] = 'Text flow'; +tinyMCELang['lang_ibrowser_height'] = 'Height'; +tinyMCELang['lang_ibrowser_width'] = 'Width'; +tinyMCELang['lang_ibrowser_reset'] = 'Reset Dimensions'; +tinyMCELang['lang_ibrowser_border'] = 'Border'; +tinyMCELang['lang_ibrowser_hspace'] = 'HSpace'; +tinyMCELang['lang_ibrowser_vspace'] = 'VSpace'; +tinyMCELang['lang_ibrowser_select'] = 'Save'; +tinyMCELang['lang_ibrowser_delete'] = 'Delete'; +tinyMCELang['lang_ibrowser_cancel'] = 'Cancel'; +tinyMCELang['lang_ibrowser_uploadtxt'] = 'File'; +tinyMCELang['lang_ibrowser_uploadbt'] = 'Upload'; +// error messages +tinyMCELang['lang_ibrowser_error'] = 'Error'; +tinyMCELang['lang_ibrowser_errornoimg'] = 'Please select an image'; +tinyMCELang['lang_ibrowser_errornodir'] = 'Library doesn\'t physically exist'; +tinyMCELang['lang_ibrowser_errorupload'] = 'An error occured while handling the file upload.\nPlease try again later'; +tinyMCELang['lang_ibrowser_errortype'] = 'Wrong image file type'; +tinyMCELang['lang_ibrowser_errordelete'] = 'Delete failed'; +tinyMCELang['lang_ibrowser_confirmdelete'] = 'Click OK to delete image!'; +tinyMCELang['lang_ibrowser_error_width_nan'] = 'Width is not a number!'; +tinyMCELang['lang_ibrowser_error_height_nan'] = 'Height is not a number!'; +tinyMCELang['lang_ibrowser_error_border_nan'] = 'Border is not a number!'; +tinyMCELang['lang_ibrowser_error_hspace_nan'] = 'Horizontal space is not a number!'; +tinyMCELang['lang_ibrowser_error_vspace_nan'] = 'Vertical space is not a number!'; \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js b/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js new file mode 100644 index 000000000..73bb138a9 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('iespell');var TinyMCE_IESpellPlugin={getInfo:function(){return{longname:'IESpell (MSIE Only)',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){if(cn=="iespell"&&(tinyMCE.isMSIE&&!tinyMCE.isOpera))return tinyMCE.getButtonHTML(cn,'lang_iespell_desc','{$pluginurl}/images/iespell.gif','mceIESpell');return""},execCommand:function(editor_id,element,command,user_interface,value){if(command=="mceIESpell"){try{var ieSpell=new ActiveXObject("ieSpell.ieSpellExtension");ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement)}catch(e){if(e.number==-2146827859){if(confirm(tinyMCE.getLang("lang_iespell_download","",true)))window.open('http://www.iespell.com/download.php','ieSpellDownload','')}else alert("Error Loading ieSpell: Exception "+e.number)}return true}return false}};tinyMCE.addPlugin("iespell",TinyMCE_IESpellPlugin); \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js b/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js new file mode 100644 index 000000000..7f715f223 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js @@ -0,0 +1,58 @@ +/** + * $Id: editor_plugin_src.js,v 1.1.1.1 2006-12-02 04:34:14 mcfly_e107 Exp $ + * + * @author Moxiecode + * @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('iespell'); + +var TinyMCE_IESpellPlugin = { + getInfo : function() { + return { + longname : 'IESpell (MSIE Only)', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + /** + * Returns the HTML contents of the iespell control. + */ + getControlHTML : function(cn) { + // Is it the iespell control and is the brower MSIE. + if (cn == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera)) + return tinyMCE.getButtonHTML(cn, 'lang_iespell_desc', '{$pluginurl}/images/iespell.gif', 'mceIESpell'); + + return ""; + }, + + /** + * Executes the mceIESpell command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle ieSpellCommand + if (command == "mceIESpell") { + try { + var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension"); + ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement); + } catch (e) { + if (e.number == -2146827859) { + if (confirm(tinyMCE.getLang("lang_iespell_download", "", true))) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + } else + alert("Error Loading ieSpell: Exception " + e.number); + } + + return true; + } + + // Pass to next handler in chain + return false; + } +}; + +tinyMCE.addPlugin("iespell", TinyMCE_IESpellPlugin); diff --git a/e107_handlers/tiny_mce/plugins/iespell/images/iespell.gif b/e107_handlers/tiny_mce/plugins/iespell/images/iespell.gif new file mode 100644 index 000000000..a9a289189 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/iespell/images/iespell.gif differ diff --git a/e107_handlers/tiny_mce/plugins/iespell/langs/en.js b/e107_handlers/tiny_mce/plugins/iespell/langs/en.js new file mode 100644 index 000000000..119bce9d0 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/iespell/langs/en.js @@ -0,0 +1,7 @@ +// UK lang variables + +tinyMCE.addToLang('',{ +iespell_desc : 'Run spell checking', +iespell_download : "ieSpell not detected. Click OK to go to download page." +}); + diff --git a/e107_handlers/tiny_mce/plugins/media/css/content.css b/e107_handlers/tiny_mce/plugins/media/css/content.css new file mode 100644 index 000000000..7873235e7 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/media/css/content.css @@ -0,0 +1,26 @@ +.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia { + border: 1px dotted #cc0000; + background-position: center; + background-repeat: no-repeat; + background-color: #ffffcc; +} + +.mceItemShockWave { + background-image: url('../images/shockwave.gif'); +} + +.mceItemFlash { + background-image: url('../images/flash.gif'); +} + +.mceItemQuickTime { + background-image: url('../images/quicktime.gif'); +} + +.mceItemWindowsMedia { + background-image: url('../images/windowsmedia.gif'); +} + +.mceItemRealMedia { + background-image: url('../images/realmedia.gif'); +} diff --git a/e107_handlers/tiny_mce/plugins/media/css/media.css b/e107_handlers/tiny_mce/plugins/media/css/media.css new file mode 100644 index 000000000..62d666a5f --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,68 @@ +#id, #name, #hspace, #vspace, #class_name, #align { + width: 100px; +} + +#hspace, #vspace { + width: 50px; +} + +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { + width: 100px; +} + +#flash_base, #flash_flashvars { + width: 240px; +} + +#width, #height { + width: 40px; +} + +#src, #media_type { + width: 250px; +} + +#class { + width: 120px; +} + +#prev { + margin: 0; + border: 1px solid black; + width: 99%; + height: 230px; + overflow: auto; +} + +.panel_wrapper div.current { + height: 390px; + overflow: auto; +} + +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { + display: none; +} + +.mceAddSelectValue { + background-color: #DDDDDD; +} + +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { + width: 70px; +} + +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { + width: 70px; +} + +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { + width: 70px; +} + +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { + width: 90px; +} + +#qt_qtsrc { + width: 200px; +} diff --git a/e107_handlers/tiny_mce/plugins/media/editor_plugin.js b/e107_handlers/tiny_mce/plugins/media/editor_plugin.js new file mode 100644 index 000000000..67dc81fb3 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('media');var TinyMCE_MediaPlugin={getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_media.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(!tinyMCE.settings['media_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/media/css/content.css")},getControlHTML:function(cn){switch(cn){case"media":return tinyMCE.getButtonHTML(cn,'lang_media_desc','{$pluginurl}/images/media.gif','mceMedia')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceMedia":tinyMCE.openWindow({file:'../../plugins/media/media.htm',width:430+tinyMCE.getLang('lang_media_delta_width',0),height:470+tinyMCE.getLang('lang_media_delta_height',0)},{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content,inst){var nl,img,i,ne,d,s,ci;switch(type){case"insert_to_editor":img=tinyMCE.getParam("theme_href")+'/images/spacer.gif';content=content.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,'');content=content.replace(/]*)>/gi,'
    ');content=content.replace(/]*)>/gi,'
    ');content=content.replace(/<\/(object|embed)([^>]*)>/gi,'
    ');content=content.replace(/]*)>/gi,'
    ');content=content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>','gi'),'class="mceItemParam">
    ');break;case"insert_to_editor_dom":d=inst.getDoc();nl=content.getElementsByTagName("img");for(i=0;i',startPos);attribs=TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos+4,endPos));if(!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))continue;endPos+=2;at=attribs['title'];if(at){at=at.replace(/'/g,"'");at=at.replace(/&#quot;/g,'"');try{pl=eval('x={'+at+'};')}catch(ex){pl={}}}if(!tinyMCE.getParam('media_use_script',false)){switch(attribs['class']){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166B1BCA-3F9C-11CF-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=tinyMCE.getParam('media_wmp6_compatible')?'05589FA1-C356-11CE-BF01-00AA0055595A':'6BF52A52-394A-11D3-B153-00C04F79FAA6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break}if(!tinyMCE.getParam("relative_urls"))pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);embedHTML=TinyMCE_MediaPlugin._getEmbed(ci,cb,mt,pl,attribs)}else{switch(attribs['class']){case'mceItemFlash':s='writeFlash';break;case'mceItemShockWave':s='writeShockWave';break;case'mceItemWindowsMedia':s='writeWindowsMedia';break;case'mceItemQuickTime':s='writeQuickTime';break;case'mceItemRealMedia':s='writeRealMedia';break}if(attribs.width)at=at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g,"width:'"+attribs.width+"'");if(attribs.height)at=at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g,"height:'"+attribs.height+"'");if(!tinyMCE.getParam("relative_urls")){pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);at=at.replace(new RegExp("src:'[^']*'","g"),"src:'"+pl.src+"'")}embedHTML=''}chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node,'class'))){tinyMCE.switchClass(editor_id+'_media','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_media','mceButtonNormal');return true},_createImgFromEmbed:function(n,d,cl){var ne,at,i,ti='',an;ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;at=n.attributes;for(i=0;i0?ti.substring(0,ti.length-1):ti;ne.title=ti;n.parentNode.replaceChild(ne,n)},_createImg:function(cl,d,n){var i,nl,ti="",an,av,al=new Array();ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;al.id=tinyMCE.getAttrib(n,'id');al.name=tinyMCE.getAttrib(n,'name');al.width=tinyMCE.getAttrib(n,'width');al.height=tinyMCE.getAttrib(n,'height');al.bgcolor=tinyMCE.getAttrib(n,'bgcolor');al.align=tinyMCE.getAttrib(n,'align');al.class_name=tinyMCE.getAttrib(n,'mce_class');nl=n.getElementsByTagName('div');for(i=0;i0?ti.substring(0,ti.length-1):ti;ne.title=ti;return ne},_getEmbed:function(cls,cb,mt,p,at){var h='',n;p.width=at.width?at.width:p.width;p.height=at.height?at.height:p.height;h+='';if(n=='src'&&p[n].indexOf('://')!=-1&&mt=='application/x-mplayer2')h+=''}}h+=']*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, ''); + content = content.replace(/]*)>/gi, '
    '); + content = content.replace(/]*)>/gi, '
    '); + content = content.replace(/<\/(object|embed)([^>]*)>/gi, '
    '); + content = content.replace(/]*)>/gi, '
    '); + content = content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>', 'gi'), 'class="mceItemParam">
    '); + break; + + case "insert_to_editor_dom": + d = inst.getDoc(); + nl = content.getElementsByTagName("img"); + for (i=0; i', startPos); + attribs = TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos + 4, endPos)); + + // Is not flash, skip it + if (!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class'])) + continue; + + endPos += 2; + + // Parse attributes + at = attribs['title']; + if (at) { + at = at.replace(/'/g, "'"); + at = at.replace(/&#quot;/g, '"'); + + try { + pl = eval('x={' + at + '};'); + } catch (ex) { + pl = {}; + } + } + + // Use object/embed + if (!tinyMCE.getParam('media_use_script', false)) { + switch (attribs['class']) { + case 'mceItemFlash': + ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; + cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + mt = 'application/x-shockwave-flash'; + break; + + case 'mceItemShockWave': + ci = '166B1BCA-3F9C-11CF-8075-444553540000'; + cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; + mt = 'application/x-director'; + break; + + case 'mceItemWindowsMedia': + ci = tinyMCE.getParam('media_wmp6_compatible') ? '05589FA1-C356-11CE-BF01-00AA0055595A' : '6BF52A52-394A-11D3-B153-00C04F79FAA6'; + cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + mt = 'application/x-mplayer2'; + break; + + case 'mceItemQuickTime': + ci = '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; + cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; + mt = 'video/quicktime'; + break; + + case 'mceItemRealMedia': + ci = 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; + cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + mt = 'audio/x-pn-realaudio-plugin'; + break; + } + + // Force absolute URL + if (!tinyMCE.getParam("relative_urls")) + pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); + + embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs); + } else { + // Use script version + switch (attribs['class']) { + case 'mceItemFlash': + s = 'writeFlash'; + break; + + case 'mceItemShockWave': + s = 'writeShockWave'; + break; + + case 'mceItemWindowsMedia': + s = 'writeWindowsMedia'; + break; + + case 'mceItemQuickTime': + s = 'writeQuickTime'; + break; + + case 'mceItemRealMedia': + s = 'writeRealMedia'; + break; + } + + if (attribs.width) + at = at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g, "width:'" + attribs.width + "'"); + + if (attribs.height) + at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'"); + + // Force absolute URL + if (!tinyMCE.getParam("relative_urls")) { + pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); + at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'"); + } + + embedHTML = ''; + } + + // Insert embed/object chunk + chunkBefore = content.substring(0, startPos); + chunkAfter = content.substring(endPos); + content = chunkBefore + embedHTML + chunkAfter; + } + break; + } + + return content; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (node == null) + return; + + do { + if (node.nodeName == "IMG" && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node, 'class'))) { + tinyMCE.switchClass(editor_id + '_media', 'mceButtonSelected'); + return true; + } + } while ((node = node.parentNode)); + + tinyMCE.switchClass(editor_id + '_media', 'mceButtonNormal'); + + return true; + }, + + _createImgFromEmbed : function(n, d, cl) { + var ne, at, i, ti = '', an; + + ne = d.createElement('img'); + ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; + ne.width = tinyMCE.getAttrib(n, 'width'); + ne.height = tinyMCE.getAttrib(n, 'height'); + ne.className = cl; + + at = n.attributes; + for (i=0; i 0 ? ti.substring(0, ti.length - 1) : ti; + ne.title = ti; + + n.parentNode.replaceChild(ne, n); + }, + + _createImg : function(cl, d, n) { + var i, nl, ti = "", an, av, al = new Array(); + + ne = d.createElement('img'); + ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif'; + ne.width = tinyMCE.getAttrib(n, 'width'); + ne.height = tinyMCE.getAttrib(n, 'height'); + ne.className = cl; + + al.id = tinyMCE.getAttrib(n, 'id'); + al.name = tinyMCE.getAttrib(n, 'name'); + al.width = tinyMCE.getAttrib(n, 'width'); + al.height = tinyMCE.getAttrib(n, 'height'); + al.bgcolor = tinyMCE.getAttrib(n, 'bgcolor'); + al.align = tinyMCE.getAttrib(n, 'align'); + al.class_name = tinyMCE.getAttrib(n, 'mce_class'); + + nl = n.getElementsByTagName('div'); + for (i=0; i 0 ? ti.substring(0, ti.length - 1) : ti; + ne.title = ti; + + return ne; + }, + + _getEmbed : function(cls, cb, mt, p, at) { + var h = '', n; + + p.width = at.width ? at.width : p.width; + p.height = at.height ? at.height : p.height; + + h += ''; + + // Add extra url parameter if it's an absolute URL on WMP + if (n == 'src' && p[n].indexOf('://') != -1 && mt == 'application/x-mplayer2') + h += ''; + } + } + + h += ''; + + h += ''); +} + +function init() { + var pl = "", f, val; + var type = "flash", fe, i; + + tinyMCEPopup.resizeToInnerSize(); + f = document.forms[0] + + fe = tinyMCE.selectedInstance.getFocusElement(); + if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) { + pl = "x={" + fe.title + "};"; + + switch (tinyMCE.getAttrib(fe, 'class')) { + case 'mceItemFlash': + type = 'flash'; + break; + + case 'mceItemShockWave': + type = 'shockwave'; + break; + + case 'mceItemWindowsMedia': + type = 'wmp'; + break; + + case 'mceItemQuickTime': + type = 'qt'; + break; + + case 'mceItemRealMedia': + type = 'rmp'; + break; + } + + document.forms[0].insert.value = tinyMCE.getLang('lang_update', 'Insert', true); + } + + document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var html = getMediaListHTML('filebrowser','src','media','media'); + if (html == "") + document.getElementById("linklistrow").style.display = 'none'; + else + document.getElementById("linklistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('filebrowsercontainer')) + document.getElementById('src').style.width = '230px'; + + // Setup form + if (pl != "") { + pl = eval(pl); + + switch (type) { + case "flash": + setBool(pl, 'flash', 'play'); + setBool(pl, 'flash', 'loop'); + setBool(pl, 'flash', 'menu'); + setBool(pl, 'flash', 'swliveconnect'); + setStr(pl, 'flash', 'quality'); + setStr(pl, 'flash', 'scale'); + setStr(pl, 'flash', 'salign'); + setStr(pl, 'flash', 'wmode'); + setStr(pl, 'flash', 'base'); + setStr(pl, 'flash', 'flashvars'); + break; + + case "qt": + setBool(pl, 'qt', 'loop'); + setBool(pl, 'qt', 'autoplay'); + setBool(pl, 'qt', 'cache'); + setBool(pl, 'qt', 'controller'); + setBool(pl, 'qt', 'correction'); + setBool(pl, 'qt', 'enablejavascript'); + setBool(pl, 'qt', 'kioskmode'); + setBool(pl, 'qt', 'autohref'); + setBool(pl, 'qt', 'playeveryframe'); + setBool(pl, 'qt', 'tarsetcache'); + setStr(pl, 'qt', 'scale'); + setStr(pl, 'qt', 'starttime'); + setStr(pl, 'qt', 'endtime'); + setStr(pl, 'qt', 'tarset'); + setStr(pl, 'qt', 'qtsrcchokespeed'); + setStr(pl, 'qt', 'volume'); + setStr(pl, 'qt', 'qtsrc'); + break; + + case "shockwave": + setBool(pl, 'shockwave', 'sound'); + setBool(pl, 'shockwave', 'progress'); + setBool(pl, 'shockwave', 'autostart'); + setBool(pl, 'shockwave', 'swliveconnect'); + setStr(pl, 'shockwave', 'swvolume'); + setStr(pl, 'shockwave', 'swstretchstyle'); + setStr(pl, 'shockwave', 'swstretchhalign'); + setStr(pl, 'shockwave', 'swstretchvalign'); + break; + + case "wmp": + setBool(pl, 'wmp', 'autostart'); + setBool(pl, 'wmp', 'enabled'); + setBool(pl, 'wmp', 'enablecontextmenu'); + setBool(pl, 'wmp', 'fullscreen'); + setBool(pl, 'wmp', 'invokeurls'); + setBool(pl, 'wmp', 'mute'); + setBool(pl, 'wmp', 'stretchtofit'); + setBool(pl, 'wmp', 'windowlessvideo'); + setStr(pl, 'wmp', 'balance'); + setStr(pl, 'wmp', 'baseurl'); + setStr(pl, 'wmp', 'captioningid'); + setStr(pl, 'wmp', 'currentmarker'); + setStr(pl, 'wmp', 'currentposition'); + setStr(pl, 'wmp', 'defaultframe'); + setStr(pl, 'wmp', 'playcount'); + setStr(pl, 'wmp', 'rate'); + setStr(pl, 'wmp', 'uimode'); + setStr(pl, 'wmp', 'volume'); + break; + + case "rmp": + setBool(pl, 'rmp', 'autostart'); + setBool(pl, 'rmp', 'loop'); + setBool(pl, 'rmp', 'autogotourl'); + setBool(pl, 'rmp', 'center'); + setBool(pl, 'rmp', 'imagestatus'); + setBool(pl, 'rmp', 'maintainaspect'); + setBool(pl, 'rmp', 'nojava'); + setBool(pl, 'rmp', 'prefetch'); + setBool(pl, 'rmp', 'shuffle'); + setStr(pl, 'rmp', 'console'); + setStr(pl, 'rmp', 'controls'); + setStr(pl, 'rmp', 'numloop'); + setStr(pl, 'rmp', 'scriptcallbacks'); + break; + } + + setStr(pl, null, 'src'); + setStr(pl, null, 'id'); + setStr(pl, null, 'name'); + setStr(pl, null, 'vspace'); + setStr(pl, null, 'hspace'); + setStr(pl, null, 'bgcolor'); + setStr(pl, null, 'align'); + setStr(pl, null, 'width'); + setStr(pl, null, 'height'); + + if ((val = tinyMCE.getAttrib(fe, "width")) != "") + pl.width = f.width.value = val; + + if ((val = tinyMCE.getAttrib(fe, "height")) != "") + pl.height = f.height.value = val; + + oldWidth = pl.width ? parseInt(pl.width) : 0; + oldHeight = pl.height ? parseInt(pl.height) : 0; + } else + oldWidth = oldHeight = 0; + + selectByValue(f, 'media_type', type); + changedType(type); + updateColor('bgcolor_pick', 'bgcolor'); + + TinyMCE_EditableSelects.init(); + generatePreview(); +} + +function insertMedia() { + var fe, f = document.forms[0], h; + + if (!AutoValidator.validate(f)) { + alert(tinyMCE.getLang('lang_invalid_data')); + return false; + } + + f.width.value = f.width.value == "" ? 100 : f.width.value; + f.height.value = f.height.value == "" ? 100 : f.height.value; + + fe = tinyMCE.selectedInstance.getFocusElement(); + if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) { + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + fe.className = "mceItemFlash"; + break; + + case "shockwave": + fe.className = "mceItemShockWave"; + break; + + case "qt": + fe.className = "mceItemQuickTime"; + break; + + case "wmp": + fe.className = "mceItemWindowsMedia"; + break; + + case "rmp": + fe.className = "mceItemRealMedia"; + break; + } + + if (fe.width != f.width.value || fe.height != f.width.height) + tinyMCE.selectedInstance.repaint(); + + fe.title = serializeParameters(); + fe.width = f.width.value; + fe.height = f.height.value; + fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); + fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); + fe.align = f.align.options[f.align.selectedIndex].value; + } else { + h = ' 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; +} + +function getType(v) { + var fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'), i, c, el, x; + + for (i=0; i 0 ? s.substring(0, s.length - 1) : s; + + return s; +} + +function setBool(pl, p, n) { + if (typeof(pl[n]) == "undefined") + return; + + document.forms[0].elements[p + "_" + n].checked = pl[n]; +} + +function setStr(pl, p, n) { + var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; + + if (typeof(pl[n]) == "undefined") + return; + + if (e.type == "text") + e.value = pl[n]; + else + selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); +} + +function getBool(p, n, d, tv, fv) { + var v = document.forms[0].elements[p + "_" + n].checked; + + tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; + fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; + + return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ','); +} + +function getStr(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); +} + +function getInt(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); +} + +function jsEncode(s) { + s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); + s = s.replace(new RegExp('"', 'g'), '\\"'); + s = s.replace(new RegExp("'", 'g'), "\\'"); + + return s; +} + +function generatePreview(c) { + var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; + + p.innerHTML = ''; + + nw = parseInt(f.width.value); + nh = parseInt(f.height.value); + + if (f.width.value != "" && f.height.value != "") { + if (f.constrain.checked) { + if (c == 'width' && oldWidth != 0) { + wp = nw / oldWidth; + nh = Math.round(wp * nh); + f.height.value = nh; + } else if (c == 'height' && oldHeight != 0) { + hp = nh / oldHeight; + nw = Math.round(hp * nw); + f.width.value = nw; + } + } + } + + if (f.width.value != "") + oldWidth = nw; + + if (f.height.value != "") + oldHeight = nh; + + // After constrain + pl = serializeParameters(); + + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + type = 'application/x-shockwave-flash'; + break; + + case "shockwave": + cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; + type = 'application/x-director'; + break; + + case "qt": + cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; + codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; + type = 'video/quicktime'; + break; + + case "wmp": + cls = tinyMCE.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'application/x-mplayer2'; + break; + + case "rmp": + cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'audio/x-pn-realaudio-plugin'; + break; + } + + if (pl == '') { + p.innerHTML = ''; + return; + } + + pl = eval('x={' + pl + '};'); + + if (!pl.src) { + p.innerHTML = ''; + return; + } + + pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); + pl.width = !pl.width ? 100 : pl.width; + pl.height = !pl.height ? 100 : pl.height; + pl.id = !pl.id ? 'obj' : pl.id; + pl.name = !pl.name ? 'eobj' : pl.name; + pl.align = !pl.align ? '' : pl.align; + + h += ''; + + for (n in pl) { + h += ''; + + // Add extra url parameter if it's an absolute URL + if (n == 'src' && pl[n].indexOf('://') != -1) + h += ''; + } + + h += ' + + {$lang_media_title} + + + + + + + + + + +
    + + +
    +
    +
    + {$lang_media_general} + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
     
    +
     
    + + + + + + +
    x   
    +
    +
    + +
    + {$lang_media_preview} + +
    +
    + +
    +
    + {$lang_media_advanced} + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
     
    +
    +
    + +
    + {$lang_media_flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + + + + + + + +
    +
    + +
    + {$lang_media_qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +  
    + + + + + +
     
    +
    +
    + +
    + {$lang_media_wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + {$lang_media_rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +   +
    +
    + +
    + {$lang_media_shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/plugins/table/cell.htm b/e107_handlers/tiny_mce/plugins/table/cell.htm new file mode 100644 index 000000000..14fd0d56b --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/cell.htm @@ -0,0 +1,182 @@ + + + {$lang_table_cell_title} + + + + + + + + +
    + + +
    +
    +
    + {$lang_table_general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + +
    +
    +
    + +
    +
    + {$lang_table_advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/plugins/table/css/cell.css b/e107_handlers/tiny_mce/plugins/table/css/cell.css new file mode 100644 index 000000000..a47cc1a1e --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/css/cell.css @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/table/css/row.css b/e107_handlers/tiny_mce/plugins/table/css/row.css new file mode 100644 index 000000000..0e397db3e --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/css/row.css @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/e107_handlers/tiny_mce/plugins/table/css/table.css b/e107_handlers/tiny_mce/plugins/table/css/table.css new file mode 100644 index 000000000..82bb548ca --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/css/table.css @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 220px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/e107_handlers/tiny_mce/plugins/table/editor_plugin.js b/e107_handlers/tiny_mce/plugins/table/editor_plugin.js new file mode 100644 index 000000000..b476b052d --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/editor_plugin.js @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('table');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler)}inst.tableRowClipboard=null},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_table','table_delete.gif','lang_table_del','mceTableDelete'],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false))}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1",tdElm;var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal')}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal')}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance)},10)}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i0&&inArray(ar[i],v))return true;if(ar[i]==v)return true}return false}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" "}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan}}function getCellPos(grid,td){var x,y;for(y=0;y1){for(var i=x;i1)td.rowSpan=sd.rowspan+1;lastElm=td}deleteMarked(tableElm)}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node}return null}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td)}while((td=nexttd)!=null)}}while((tr=next)!=null)}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD)}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true}lastTDElm=tdElm}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex+1),tinyMCE.isGecko,true);break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm)}lastTDElm=tdElm}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i1)addRows(newTD,trElm,rowspan)}addRows(tdElm,trElm,rowspan)}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y0)rows[rows.length]=rowCells}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i0)rows[rows.length]=rowCells}var curRow=new Array();var lastTR=null;for(var y=0;ycolSpan)colSpan=rowColSpan;lastRowSpan=-1}var lastColSpan=-1;for(var x=0;xrowSpan)rowSpan=colRowSpan;lastColSpan=-1}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm}if(tdElm.rowSpan>1)tdElm.rowSpan--}}}}break}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint()}return true}return false}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin); \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js b/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js new file mode 100644 index 000000000..39474fecd --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js @@ -0,0 +1,1073 @@ +/** + * $Id: editor_plugin_src.js,v 1.1.1.1 2006-12-02 04:34:18 mcfly_e107 Exp $ + * + * @author Moxiecode + * @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('table'); + +var TinyMCE_TablePlugin = { + getInfo : function() { + return { + longname : 'Tables', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + initInstance : function(inst) { + if (tinyMCE.isGecko) { + var doc = inst.getDoc(); + tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler); + } + + inst.tableRowClipboard = null; + }, + + /** + * Returns the HTML contents of the table control. + */ + getControlHTML : function(control_name) { + var controls = new Array( + ['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true], + ['delete_table', 'table_delete.gif', 'lang_table_del', 'mceTableDelete'], + ['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true], + ['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]); + + // Render table control + for (var i=0; i 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;'; + + if (but[0] == control_name) + return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false)); + } + + // Special tablecontrols + if (control_name == "tablecontrols") { + var html = ""; + + html += tinyMCE.getControlHTML("table"); + html += tinyMCE.getControlHTML("separator"); + html += tinyMCE.getControlHTML("row_props"); + html += tinyMCE.getControlHTML("cell_props"); + html += tinyMCE.getControlHTML("separator"); + html += tinyMCE.getControlHTML("row_before"); + html += tinyMCE.getControlHTML("row_after"); + html += tinyMCE.getControlHTML("delete_row"); + html += tinyMCE.getControlHTML("separator"); + html += tinyMCE.getControlHTML("col_before"); + html += tinyMCE.getControlHTML("col_after"); + html += tinyMCE.getControlHTML("delete_col"); + html += tinyMCE.getControlHTML("separator"); + html += tinyMCE.getControlHTML("split_cells"); + html += tinyMCE.getControlHTML("merge_cells"); + + return html; + } + + return ""; + }, + + /** + * Executes the table commands. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Is table command + switch (command) { + case "mceInsertTable": + case "mceTableRowProps": + case "mceTableCellProps": + case "mceTableSplitCells": + case "mceTableMergeCells": + case "mceTableInsertRowBefore": + case "mceTableInsertRowAfter": + case "mceTableDeleteRow": + case "mceTableInsertColBefore": + case "mceTableInsertColAfter": + case "mceTableDeleteCol": + case "mceTableCutRow": + case "mceTableCopyRow": + case "mceTablePasteRowBefore": + case "mceTablePasteRowAfter": + case "mceTableDelete": + var inst = tinyMCE.getInstanceById(editor_id); + + inst.execCommand('mceBeginUndoLevel'); + TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value); + inst.execCommand('mceEndUndoLevel'); + + return true; + } + + // Pass to next handler in chain + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + var colspan = "1", rowspan = "1", tdElm; + + var inst = tinyMCE.getInstanceById(editor_id); + + // Reset table controls + tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled'); + + // Within a td element + if (tdElm = tinyMCE.getParentElement(node, "td,th")) { + tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected'); + tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal'); + + colspan = tinyMCE.getAttrib(tdElm, "colspan"); + rowspan = tinyMCE.getAttrib(tdElm, "rowspan"); + + colspan = colspan == "" ? "1" : colspan; + rowspan = rowspan == "" ? "1" : rowspan; + + if (colspan != "1" || rowspan != "1") + tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal'); + } + + // Within a tr element + if (tinyMCE.getParentElement(node, "tr")) + tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected'); + + // Within table + if (tinyMCE.getParentElement(node, "table")) { + tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected'); + tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal'); + } + }, + + // Private plugin internal methods + + _mouseDownHandler : function(e) { + var elm = tinyMCE.isMSIE ? event.srcElement : e.target; + var focusElm = tinyMCE.selectedInstance.getFocusElement(); + + // If press on special Mozilla create TD/TR thingie + if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) { + window.setTimeout(function() { + var tableElm = tinyMCE.getParentElement(focusElm, "table"); + tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance); + }, 10); + } + }, + + /** + * Executes the table commands. + */ + _doExecCommand : function(editor_id, element, command, user_interface, value) { + var inst = tinyMCE.getInstanceById(editor_id); + var focusElm = inst.getFocusElement(); + var trElm = tinyMCE.getParentElement(focusElm, "tr"); + var tdElm = tinyMCE.getParentElement(focusElm, "td,th"); + var tableElm = tinyMCE.getParentElement(focusElm, "table"); + var doc = inst.contentWindow.document; + var tableBorder = tableElm ? tableElm.getAttribute("border") : ""; + + // Get first TD if no TD found + if (trElm && tdElm == null) + tdElm = trElm.cells[0]; + + // ------- Inner functions --------- + function inArray(ar, v) { + for (var i=0; i 0 && inArray(ar[i], v)) + return true; + + // Found value + if (ar[i] == v) + return true; + } + + return false; + } + + function makeTD() { + var newTD = doc.createElement("td"); + newTD.innerHTML = " "; + } + + function getColRowSpan(td) { + var colspan = tinyMCE.getAttrib(td, "colspan"); + var rowspan = tinyMCE.getAttrib(td, "rowspan"); + + colspan = colspan == "" ? 1 : parseInt(colspan); + rowspan = rowspan == "" ? 1 : parseInt(rowspan); + + return {colspan : colspan, rowspan : rowspan}; + } + + function getCellPos(grid, td) { + var x, y; + + for (y=0; y 1) { // Remove due to colspan + for (var i=x; i 1) + td.rowSpan = sd.rowspan + 1; + + lastElm = td; + } + + deleteMarked(tableElm); + } + } + + function prevElm(node, name) { + while ((node = node.previousSibling) != null) { + if (node.nodeName == name) + return node; + } + + return null; + } + + function nextElm(node, names) { + var namesAr = names.split(','); + + while ((node = node.nextSibling) != null) { + for (var i=0; i 1) { + do { + var nexttd = nextElm(td, "TD,TH"); + + if (td._delete) + td.parentNode.removeChild(td); + } while ((td = nexttd) != null); + } + } while ((tr = next) != null); + } + + function addRows(td_elm, tr_elm, rowspan) { + // Add rows + td_elm.rowSpan = 1; + var trNext = nextElm(tr_elm, "TR"); + for (var i=1; i 1) { + var newTD = cells[x].cloneNode(true); + var sd = getColRowSpan(cells[x]); + + newTD.rowSpan = sd.rowspan - 1; + + var nextTD = nextTR.cells[x]; + + if (nextTD == null) + nextTR.appendChild(newTD); + else + nextTR.insertBefore(newTD, nextTD); + } + } + + // Delete cells + var lastTDElm = null; + for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd.rowspan > 1) { + tdElm.rowSpan = sd.rowspan - 1; + } else { + trElm = tdElm.parentNode; + + if (trElm.parentNode) + trElm._delete = true; + } + + lastTDElm = tdElm; + } + } + + deleteMarked(tableElm); + + cpos.rowindex--; + if (cpos.rowindex < 0) + cpos.rowindex = 0; + + // Recalculate grid and select + grid = getTableGrid(tableElm); + inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko + break; + + case "mceTableInsertColBefore": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(tableElm); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] == 1) { + var newTD = doc.createElement(tdElm.nodeName); + + newTD.innerHTML = " "; + newTD.rowSpan = tdElm.rowSpan; + + tdElm.parentNode.insertBefore(newTD, tdElm); + } else + tdElm.colSpan++; + + lastTDElm = tdElm; + } + } + + grid = getTableGrid(tableElm); + inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex + 1), tinyMCE.isGecko, true); // Only collape on gecko + break; + + case "mceTableInsertColAfter": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(tableElm); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] == 1) { + var newTD = doc.createElement(tdElm.nodeName); + + newTD.innerHTML = " "; + newTD.rowSpan = tdElm.rowSpan; + + var nextTD = nextElm(tdElm, "TD,TH"); + if (nextTD == null) + tdElm.parentNode.appendChild(newTD); + else + nextTD.parentNode.insertBefore(newTD, nextTD); + } else + tdElm.colSpan++; + + lastTDElm = tdElm; + } + } + + grid = getTableGrid(tableElm); + inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko + break; + + case "mceTableDeleteCol": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(tableElm); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + // Only one col, remove whole table + if (grid.length > 1 && grid[0].length <= 1) { + tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody + tableElm.parentNode.removeChild(tableElm); + return true; + } + + // Delete cells + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] > 1) + tdElm.colSpan = sd['colspan'] - 1; + else { + if (tdElm.parentNode) + tdElm.parentNode.removeChild(tdElm); + } + + lastTDElm = tdElm; + } + } + + cpos.cellindex--; + if (cpos.cellindex < 0) + cpos.cellindex = 0; + + // Recalculate grid and select + grid = getTableGrid(tableElm); + inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko + break; + + case "mceTableSplitCells": + if (!trElm || !tdElm) + return true; + + var spandata = getColRowSpan(tdElm); + + var colspan = spandata["colspan"]; + var rowspan = spandata["rowspan"]; + + // Needs splitting + if (colspan > 1 || rowspan > 1) { + // Generate cols + tdElm.colSpan = 1; + for (var i=1; i 1) + addRows(newTD, trElm, rowspan); + } + + addRows(tdElm, trElm, rowspan); + } + + // Apply visual aids + tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table"); + break; + + case "mceTableMergeCells": + var rows = new Array(); + var sel = inst.getSel(); + var grid = getTableGrid(tableElm); + + if (tinyMCE.isMSIE || sel.rangeCount == 1) { + if (user_interface) { + // Setup template + var template = new Array(); + var sp = getColRowSpan(tdElm); + + template['file'] = '../../plugins/table/merge_cells.htm'; + template['width'] = 250; + template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0); + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_table_merge_cells_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_table_merge_cells_delta_height', 0); + + // Open window + tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : "update", numcols : sp.colspan, numrows : sp.rowspan}); + + return true; + } else { + var numRows = parseInt(value['numrows']); + var numCols = parseInt(value['numcols']); + var cpos = getCellPos(grid, tdElm); + + if (("" + numRows) == "NaN") + numRows = 1; + + if (("" + numCols) == "NaN") + numCols = 1; + + // Get rows and cells + var tRows = tableElm.rows; + for (var y=cpos.rowindex; y 0) + rows[rows.length] = rowCells; + } + + //return true; + } + } else { + var cells = new Array(); + var sel = inst.getSel(); + var lastTR = null; + var curRow = null; + var x1 = -1, y1 = -1, x2, y2; + + // Only one cell selected, whats the point? + if (sel.rangeCount < 2) + return true; + + // Get all selected cells + for (var i=0; i 0) + rows[rows.length] = rowCells; + } + + // Find selected cells in grid and box + var curRow = new Array(); + var lastTR = null; + for (var y=0; y colSpan) + colSpan = rowColSpan; + + lastRowSpan = -1; + } + + // Validate vertical and get total rowspan + var lastColSpan = -1; + for (var x=0; x rowSpan) + rowSpan = colRowSpan; + + lastColSpan = -1; + } + + // Setup td + tdElm = rows[0][0]; + tdElm.rowSpan = rowSpan; + tdElm.colSpan = colSpan; + + // Merge cells + for (var y=0; y 0)) + tdElm.innerHTML += html; + + // Not current cell + if (rows[y][x] != tdElm && !rows[y][x]._deleted) { + var cpos = getCellPos(grid, rows[y][x]); + var tr = rows[y][x].parentNode; + + tr.removeChild(rows[y][x]); + rows[y][x]._deleted = true; + + // Empty TR, remove it + if (!tr.hasChildNodes()) { + tr.parentNode.removeChild(tr); + + var lastCell = null; + for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) { + if (cellElm != lastCell && cellElm.rowSpan > 1) + cellElm.rowSpan--; + + lastCell = cellElm; + } + + if (tdElm.rowSpan > 1) + tdElm.rowSpan--; + } + } + } + } + + break; + } + + tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table"); + tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance); + tinyMCE.triggerNodeChange(); + inst.repaint(); + } + + return true; + } + + // Pass to next handler in chain + return false; + } +}; + +tinyMCE.addPlugin("table", TinyMCE_TablePlugin); diff --git a/e107_handlers/tiny_mce/plugins/table/images/buttons.gif b/e107_handlers/tiny_mce/plugins/table/images/buttons.gif new file mode 100644 index 000000000..8c09ff952 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/buttons.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table.gif b/e107_handlers/tiny_mce/plugins/table/images/table.gif new file mode 100644 index 000000000..2911830c3 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_cell_props.gif b/e107_handlers/tiny_mce/plugins/table/images/table_cell_props.gif new file mode 100644 index 000000000..bee7ed652 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_cell_props.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_delete.gif b/e107_handlers/tiny_mce/plugins/table/images/table_delete.gif new file mode 100644 index 000000000..2a00e6ad6 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_delete.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_delete_col.gif b/e107_handlers/tiny_mce/plugins/table/images/table_delete_col.gif new file mode 100644 index 000000000..91f53af02 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_delete_col.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_delete_row.gif b/e107_handlers/tiny_mce/plugins/table/images/table_delete_row.gif new file mode 100644 index 000000000..7025733fe Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_delete_row.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_after.gif b/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_after.gif new file mode 100644 index 000000000..85058080c Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_after.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_before.gif b/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_before.gif new file mode 100644 index 000000000..b669d4fa6 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_before.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_after.gif b/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_after.gif new file mode 100644 index 000000000..b9c144661 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_after.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_before.gif b/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_before.gif new file mode 100644 index 000000000..157d37365 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_before.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_merge_cells.gif b/e107_handlers/tiny_mce/plugins/table/images/table_merge_cells.gif new file mode 100644 index 000000000..6834e611e Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_merge_cells.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_row_props.gif b/e107_handlers/tiny_mce/plugins/table/images/table_row_props.gif new file mode 100644 index 000000000..e5c7cc37a Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_row_props.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/images/table_split_cells.gif b/e107_handlers/tiny_mce/plugins/table/images/table_split_cells.gif new file mode 100644 index 000000000..8ccb1b5f8 Binary files /dev/null and b/e107_handlers/tiny_mce/plugins/table/images/table_split_cells.gif differ diff --git a/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js b/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js new file mode 100644 index 000000000..d0768a04b --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js @@ -0,0 +1,249 @@ +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = tinyMCE.selectedInstance; + var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th"); + var formObj = document.forms[0]; + var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = tinyMCE.getAttrib(tdElm, 'align'); + var valign = tinyMCE.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; + var id = tinyMCE.getAttrib(tdElm, 'id'); + var lang = tinyMCE.getAttrib(tdElm, 'lang'); + var dir = tinyMCE.getAttrib(tdElm, 'dir'); + var scope = tinyMCE.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = tinyMCE.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); +} + +function updateAction() { + tinyMCEPopup.restoreSelection(); + + var inst = tinyMCE.selectedInstance; + var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th"); + var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr"); + var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table"); + var formObj = document.forms[0]; + + inst.execCommand('mceBeginUndoLevel'); + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + if (tinyMCE.getParam("accessibility_warnings")) { + if (celltype == "th" && scope == "") + var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true)); + else + var answer = true; + + if (!answer) + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit})); + return false; + } else if (rowLimit && rows > rowLimit) { + alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit})); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit})); + return false; + } + + // Update table + if (action == "update") { + inst.execCommand('mceBeginUndoLevel'); + + tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true); + tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true); + tinyMCE.setAttrib(elm, 'border', border, true); + tinyMCE.setAttrib(elm, 'align', align); + tinyMCE.setAttrib(elm, 'class', className); + tinyMCE.setAttrib(elm, 'style', style); + tinyMCE.setAttrib(elm, 'id', id); + tinyMCE.setAttrib(elm, 'summary', summary); + tinyMCE.setAttrib(elm, 'dir', dir); + tinyMCE.setAttrib(elm, 'lang', lang); + + // Not inline styles + if (!tinyMCE.getParam("inline_styles")) + tinyMCE.setAttrib(elm, 'width', width, true); + + // Remove these since they are not valid XHTML + tinyMCE.setAttrib(elm, 'borderColor', ''); + tinyMCE.setAttrib(elm, 'bgColor', ''); + tinyMCE.setAttrib(elm, 'background', ''); + tinyMCE.setAttrib(elm, 'height', ''); + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + + if (tinyMCE.getParam("inline_styles")) + elm.style.borderWidth = border + "px"; + + if (tinyMCE.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + } + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = border == "" ? "1px" : border; + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst); + + // Fix for stange MSIE align bug + tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML; + + tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst); + tinyMCE.triggerNodeChange(); + inst.execCommand('mceEndUndoLevel'); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.repaint(); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += '/g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCE.getParam('table_default_border', '0'), cellpadding = tinyMCE.getParam('table_default_cellpadding', ''), cellspacing = tinyMCE.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = ""; + var inst = tinyMCE.selectedInstance; + var formObj = document.forms[0]; + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "table"); + + tinyMCE.tableElm = elm; + action = tinyMCE.getWindowArg('action'); + if (action == null) + action = tinyMCE.tableElm ? "update" : "insert"; + + if (tinyMCE.tableElm && action != "insert") { + var rowsAr = tinyMCE.tableElm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = tinyMCE.parseStyle(tinyMCE.getAttrib(tinyMCE.tableElm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellpadding', ""); + cellspacing = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = tinyMCE.getAttrib(tinyMCE.tableElm, 'align', align); + className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tinyMCE.tableElm, 'class'), false); + id = tinyMCE.getAttrib(tinyMCE.tableElm, 'id'); + summary = tinyMCE.getAttrib(tinyMCE.tableElm, 'summary'); + style = tinyMCE.serializeStyle(st); + dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir'); + lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + } + + addClassesToList('class', "table_styles"); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'class', className); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = tinyMCE.parseStyle(formObj.style.value); + + var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCE.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = ""; + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = tinyMCE.serializeStyle(st); +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = tinyMCE.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = tinyMCE.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = tinyMCE.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && formObj.bordercolor.value != "") + st['border-width'] = formObj.border.value + "px"; + + formObj.style.value = tinyMCE.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = tinyMCE.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; + } + + formObj.style.value = tinyMCE.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = tinyMCE.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} diff --git a/e107_handlers/tiny_mce/plugins/table/langs/en.js b/e107_handlers/tiny_mce/plugins/table/langs/en.js new file mode 100644 index 000000000..c5923ef1f --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/langs/en.js @@ -0,0 +1,78 @@ +// UK lang variables + +tinyMCE.addToLang('table',{ +general_tab : 'General', +advanced_tab : 'Advanced', +general_props : 'General properties', +advanced_props : 'Advanced properties', +desc : 'Inserts a new table', +row_before_desc : 'Insert row before', +row_after_desc : 'Insert row after', +delete_row_desc : 'Delete row', +col_before_desc : 'Insert column before', +col_after_desc : 'Insert column after', +delete_col_desc : 'Remove column', +rowtype : 'Row in table part', +title : 'Insert/Modify table', +width : 'Width', +height : 'Height', +cols : 'Columns', +rows : 'Rows', +cellspacing : 'Cellspacing', +cellpadding : 'Cellpadding', +border : 'Border', +align : 'Alignment', +align_default : 'Default', +align_left : 'Left', +align_right : 'Right', +align_middle : 'Center', +row_title : 'Table row properties', +cell_title : 'Table cell properties', +cell_type : 'Cell type', +row_desc : 'Table row properties', +cell_desc : 'Table cell properties', +valign : 'Vertical alignment', +align_top : 'Top', +align_bottom : 'Bottom', +props_desc : 'Table properties', +bordercolor : 'Border color', +bgcolor : 'Background color', +merge_cells_title : 'Merge table cells', +split_cells_desc : 'Split table cells', +merge_cells_desc : 'Merge table cells', +cut_row_desc : 'Cut table row', +copy_row_desc : 'Copy table row', +paste_row_before_desc : 'Paste table row before', +paste_row_after_desc : 'Paste table row after', +id : 'Id', +style: 'Style', +langdir : 'Language direction', +langcode : 'Language code', +mime : 'Target MIME type', +ltr : 'Left to right', +rtl : 'Right to left', +bgimage : 'Background image', +summary : 'Summary', +td : "Data", +th : "Header", +cell_cell : 'Update current cell', +cell_row : 'Update all cells in row', +cell_all : 'Update all cells in table', +row_row : 'Update current row', +row_odd : 'Update odd rows in table', +row_even : 'Update even rows in table', +row_all : 'Update all rows in table', +thead : 'Table Head', +tbody : 'Table Body', +tfoot : 'Table Foot', +del : 'Delete table', +scope : 'Scope', +row : 'Row', +col : 'Col', +rowgroup : 'Row Group', +colgroup : 'Col Group', +col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.', +row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.', +cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.', +missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.' +}); diff --git a/e107_handlers/tiny_mce/plugins/table/merge_cells.htm b/e107_handlers/tiny_mce/plugins/table/merge_cells.htm new file mode 100644 index 000000000..46e2a1e23 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/merge_cells.htm @@ -0,0 +1,38 @@ + + + {$lang_table_merge_cells_title} + + + + + + + +
    +
    + {$lang_table_merge_cells_title} + + + + + + + + + +
    {$lang_table_cols}: +
    {$lang_table_rows}:
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/plugins/table/row.htm b/e107_handlers/tiny_mce/plugins/table/row.htm new file mode 100644 index 000000000..ea5e13ddc --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/row.htm @@ -0,0 +1,159 @@ + + + {$lang_table_row_title} + + + + + + + + +
    + + +
    +
    +
    + {$lang_table_general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    +
    +
    + +
    +
    + {$lang_table_advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/plugins/table/table.htm b/e107_handlers/tiny_mce/plugins/table/table.htm new file mode 100644 index 000000000..0f9eb5e24 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/table/table.htm @@ -0,0 +1,156 @@ + + + {$lang_table_title} + + + + + + + + + +
    + + +
    +
    +
    + {$lang_table_general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + {$lang_table_advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js b/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js new file mode 100644 index 000000000..9ab93cf56 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js @@ -0,0 +1 @@ +var TinyMCE_ZoomPlugin={getInfo:function(){return{longname:'Zoom',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(control_name){if(!tinyMCE.isMSIE||tinyMCE.isMSIE5_0||tinyMCE.isOpera)return"";switch(control_name){case"zoom":return''}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceZoom":tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom=value;tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom=value;return true}return false}};tinyMCE.addPlugin("zoom",TinyMCE_ZoomPlugin); \ No newline at end of file diff --git a/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js b/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js new file mode 100644 index 000000000..b03897041 --- /dev/null +++ b/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js @@ -0,0 +1,56 @@ +/** + * $Id: editor_plugin_src.js,v 1.1.1.1 2006-12-02 04:34:19 mcfly_e107 Exp $ + * + * @author Moxiecode + * @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +var TinyMCE_ZoomPlugin = { + getInfo : function() { + return { + longname : 'Zoom', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + /** + * Returns the HTML contents of the zoom control. + */ + getControlHTML : function(control_name) { + if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera) + return ""; + + switch (control_name) { + case "zoom": + return ''; + } + + return ""; + }, + + /** + * Executes the mceZoom command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceZoom": + tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value; + tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value; + return true; + } + + // Pass to next handler in chain + return false; + } +}; + +tinyMCE.addPlugin("zoom", TinyMCE_ZoomPlugin); diff --git a/e107_handlers/tiny_mce/themes/advanced/about.htm b/e107_handlers/tiny_mce/themes/advanced/about.htm new file mode 100644 index 000000000..2a86227fb --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/about.htm @@ -0,0 +1,52 @@ + + + {$lang_about_title} + + + + + + + + +
    +
    +

    {$lang_about_title}

    +

    Version: {$tinymce_version} ({$tinymce_releasedate})

    +

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    +

    Copyright © 2003-2006, Moxiecode Systems AB, All rights reserved.

    +

    For more information about this software visit the TinyMCE website.

    + +
    +
    + +
    +
    +

    {$lang_loaded_plugins}

    + +
    +
    + +

     

    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + diff --git a/e107_handlers/tiny_mce/themes/advanced/anchor.htm b/e107_handlers/tiny_mce/themes/advanced/anchor.htm new file mode 100644 index 000000000..988bcb68e --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/anchor.htm @@ -0,0 +1,33 @@ + + + {$lang_insert_anchor_title} + + + + + +
    + + + + + + + + + +
    {$lang_insert_anchor_title}
    {$lang_insert_anchor_name}:
    + +
    +
    + +
    + +
    + +
    +
    + +
    + + diff --git a/e107_handlers/tiny_mce/themes/advanced/charmap.htm b/e107_handlers/tiny_mce/themes/advanced/charmap.htm new file mode 100644 index 000000000..fbd472b19 --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/charmap.htm @@ -0,0 +1,53 @@ + + + {$lang_theme_charmap_title} + + + + + + + + + + + + + + + + + +
    {$lang_theme_charmap_title}
    + + + + + + + + + +
     
     
    +
    + + + + + + + + + + + + + + + + +
    HTML-Code
     
     
    NUM-Code
     
    +
    + + + diff --git a/e107_handlers/tiny_mce/themes/advanced/color_picker.htm b/e107_handlers/tiny_mce/themes/advanced/color_picker.htm new file mode 100644 index 000000000..e5fdc9f5d --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/color_picker.htm @@ -0,0 +1,13 @@ + + + {$lang_theme_colorpicker_title} + + + + + +
    + +
    + + diff --git a/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css b/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css new file mode 100644 index 000000000..5cbe6bbbe --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css @@ -0,0 +1,58 @@ +/* This file contains the CSS data for the editable area(iframe) of TinyMCE */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB !important; +} + +div.mceVisualAid { + background-image:url('../images/spacer.gif'); + visibility: visible !important; +} + +.mceItemAnchor { + width: 12px; + line-height: 6px; + overflow: hidden; + padding-left: 12px; + background-image: url('../images/anchor_symbol.gif'); + background-position: bottom; + background-repeat: no-repeat; +} + +/* Important is needed in Gecko browsers inorder to style links */ +/* +a { + color: green !important; +} +*/ + +/* Style selection range colors in Gecko browsers */ +/* +::-moz-selection { + background-color: red; + color: green; +} +*/ + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css b/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css new file mode 100644 index 000000000..de36e719a --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css @@ -0,0 +1,331 @@ +/* This file contains the CSS data for all popups in TinyMCE */ + +body { + background-color: #F0F0EE; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; + margin: 8px; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; +} + +input { + background: #FFFFFF; + border: 1px solid #cccccc; +} + +td, input, select, textarea { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +input, select, textarea { + border: 1px solid #808080; +} + +.input_noborder { + border: 0; +} + +#insert, .updateButton { + font-weight: bold; + width: 90px; + height: 21px; + border: 0; + background-image: url('../images/insert_button_bg.gif'); + cursor: pointer; +} + +#cancel { + font-weight: bold; + width: 90px; + height: 21px; + border: 0; + background-image: url('../images/cancel_button_bg.gif'); + cursor: pointer; +} + +/* Mozilla only style */ +html>body #insert, html>body #cancel { + padding-bottom: 2px; +} + +.title { + font-size: 12px; + font-weight: bold; + color: #2B6FB6; +} + +table.charmap { + border-style: solid; + border-width: 1px; + border-color: #AAAAAA; +} + +td.charmap, td.charmapOver { + color: #000000; + border-color: #AAAAAA; + border-style: solid; + border-width: 1px; + text-align: center; + font-size: 12px; +} + +td.charmapOver { + background-color: #CCCCCC; + cursor: default; +} + +a.charmap { + color: #000000; + text-decoration: none +} + +.wordWrapCode { + vertical-align: middle; + border: 1px none #000000; + background-color: transparent; +} + +input.radio { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +input.checkbox { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected { + margin-left: 1px; +} + +.mceButtonNormal { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: default; +} + +.mceButtonOver { + border: 1px solid #0A246A; + cursor: default; + background-color: #B6BDD2; +} + +.mceButtonDown { + cursor: default; + border: 1px solid #0A246A; + background-color: #8592B5; +} + +.mceButtonDisabled { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + -moz-opacity:0.3; + opacity: 0.3; + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: default; +} + +.mceActionPanel { + margin-top: 5px; +} + +/* Tabs classes */ + +.tabs { + float: left; + width: 100%; + line-height: normal; + background-image: url("../images/xp/tabs_bg.gif"); +} + +.tabs ul { + margin: 0; + padding: 0 0 0; + list-style: none; +} + +.tabs li { + float: left; + background: url("../images/xp/tab_bg.gif") no-repeat left top; + margin: 0; + margin-left: 0; + margin-right: 2px; + padding: 0 0 0 10px; + line-height: 18px; +} + +.tabs li.current { + background: url("../images/xp/tab_sel_bg.gif") no-repeat left top; + margin-right: 2px; +} + +.tabs span { + float: left; + display: block; + background: url("../images/xp/tab_end.gif") no-repeat right top; + padding: 0px 10px 0 0; +} + +.tabs .current span { + background: url("../images/xp/tab_sel_end.gif") no-repeat right top; +} + +.tabs a { + text-decoration: none; + font-family: Verdana, Arial; + font-size: 10px; +} + +.tabs a:link, .tabs a:visited, .tabs a:hover { + color: black; +} + +.tabs a:hover { +} + +.tabs .current { +} + +.tabs .current a, .tabs .current a:link, .tabs .current a:visited { +} + +.panel_wrapper div.panel { + display: none; +} + +.panel_wrapper div.current { + display: block; + width: 100%; + height: 300px; + overflow: visible; /* Should be auto but that breaks Safari */ +} + +.panel_wrapper { + border: 1px solid #919B9C; + border-top: 0px; + padding: 10px; + padding-top: 5px; + clear: both; + background-color: white; +} + +fieldset { + border: 1px solid #919B9C; + font-family: Verdana, Arial; + font-size: 10px; + padding: 0; + margin: 0; + padding: 4px; +} + +legend { + color: #2B6FB6; + font-weight: bold; +} + +.properties { + width: 100%; +} + +.properties .column1 { +} + +.properties .column2 { + text-align: left; +} + +a:link, a:visited { + color: black; +} + +a:hover { + color: #2B6FB6; +} + +#plugintable thead { + font-weight: bold; + background-color: #DDDDDD; +} + +#plugintable, #about #plugintable td { + border: 1px solid #919B9C; +} + +#plugintable { + width: 99%; + margin-top: 10px; +} + +#pluginscontainer { + height: 290px; + overflow: auto; +} + +/* MSIE Specific styles */ + +* html .panel_wrapper { + width: 100%; +} + +.column { + float: left; +} + +h1, h2, h3, h4 { + color: #2B6FB6; + margin: 0; + padding: 0; + padding-top: 5px; +} + +h3 { + font-size: 14px; +} + +#link .panel_wrapper, #link div.current { + height: 125px; +} + +#image .panel_wrapper, #image div.current { + height: 190px; +} + +label.msg { display: none; } +label.invalid { color: #EE0000; display: inline; } +input.invalid { border: 1px solid #EE0000; } + +/* Disables the advanced tab in the table plugin. */ +/* +#table #advanced_tab { + display: none; +} +*/ + +/* Disables the border input field and label in the table plugin. */ +/* +#table #border, #table #borderlabel { + display: none; +} +*/ diff --git a/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css b/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css new file mode 100644 index 000000000..7a809289f --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css @@ -0,0 +1,97 @@ +/* This file contains the CSS data for the editor UI of TinyMCE instances */ + +.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {border: 0; margin: 0; padding: 0; background: transparent;} +.mceSeparatorLine {border: 0; padding: 0; margin-left: 4px; margin-right: 2px;} +.mceSelectList {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 7pt !important; font-weight: normal; margin-top: 3px; padding: 0; display: inline; vertical-align: top; background-color: #F0F0EE;} +.mceLabel, .mceLabelDisabled {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt;} +.mceLabel {color: #000000;} +.mceLabelDisabled {cursor: text; color: #999999;} +.mceEditor {background: #F0F0EE; border: 1px solid #cccccc; padding: 0; margin: 0;} +.mceEditorArea { font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; background: #FFFFFF; padding: 0; margin: 0; } +.mceToolbarTop, .mceToolbarBottom {background: #F0F0EE; line-height: 1px; font-size: 1px;} +.mceToolbarTop {border-bottom: 1px solid #cccccc; padding-bottom: 1px;} +.mceToolbarBottom {border-top: 1px solid #cccccc;} +.mceToolbarContainer {position: relative; left: 0; top: 0; display: block;} +.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {height: 20px;} +.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; padding: 2px; line-height: 16px; overflow: visible;} +.mceStatusbarTop {border-bottom: 1px solid #cccccc;} +.mceStatusbarBottom {border-top: 1px solid #cccccc;} +.mceStatusbar {border-bottom: 1px solid #cccccc;} +.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {text-decoration: none; font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; color: #000000;} +.mcePathItem:hover {text-decoration: underline;} +.mceStatusbarPathText {float: left;} +.mceStatusbarResize {float: right; background-image: url('../images/statusbar_resize.gif'); background-repeat: no-repeat; width: 11px; height: 20px; cursor: se-resize;} +.mceResizeBox {width: 10px; height: 10px; display: none; border: 1px dotted gray; margin: 0; padding: 0;} +.mceEditorIframe {border: 0;} + +/* Button CSS rules */ + +a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {width: 20px; height: 20px; cursor: default; margin-top: 1px; margin-left: 1px;} +a.mceButtonDisabled img {border: 0 !important;} +a.mceButtonNormal img, a.mceButtonSelected img {border: 1px solid #F0F0EE !important;} +a.mceButtonSelected img {border: 1px solid #6779AA !important; background-color: #D4D5D8;} +a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {border: 1px solid #0A246A !important; cursor: default; background-color: #B6BDD2;} +a.mceButtonDisabled img {-moz-opacity:0.3; opacity: 0.3; border: 1px solid #F0F0EE !important; cursor: default;} +a.mceTiledButton img {background-image: url('../images/buttons.gif'); background-repeat: no-repeat;} + +/* Menu button CSS rules */ + +span.mceMenuButton img, span.mceMenuButtonSelected img {border: 1px solid #F0F0EE; margin-left: 1px;} +span.mceMenuButtonSelected img {border: 1px solid #6779AA; background-color: #B6BDD2;} +span.mceMenuButtonSelected img.mceMenuButton {border: 1px solid #F0F0EE; background-color: transparent;} +span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {border-left: 0; margin-left: 0;} +span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {border: 1px solid #0A246A; background-color: #B6BDD2;} +span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {border-left: 0;} +span.mceMenuButtonFocus img {border: 1px solid gray; border-right: 0; margin-left: 1px; background-color: #F5F4F2;} +span.mceMenuButtonFocus img.mceMenuButton {border: 1px solid gray; border-left: 1px solid #F5F4F2; margin-left: 0;} +span.mceMenuHover img {border: 1px solid #0A246A; background-color: #B6BDD2;} +span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {border: 1px solid #0A246A; background-color: #B6BDD2; border-left: 0;} + +/* Menu */ + +.mceMenu {position: absolute; left: 0; top: 0; display: none; z-index: 100; background-color: white; border: 1px solid gray; font-weight: normal;} +.mceMenu a, .mceMenuTitle, .mceMenuDisabled {display: block; width: 100%; text-decoration: none; background-color: white; font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; line-height: 20px; color: black;} +.mceMenu a:hover {background-color: #B6BDD2; color: black; text-decoration: none !important;} +.mceMenu span {padding-left: 10px; padding-right: 10px; display: block; line-height: 20px;} +.mceMenuSeparator {border-bottom: 1px solid gray; background-color: gray; height: 1px;} +.mceMenuTitle span {padding-left: 5px;} +.mceMenuTitle {background-color: #DDDDDD; font-weight: bold;} +.mceMenuDisabled {color: gray;} +span.mceMenuSelectedItem {background-image: url('../images/menu_check.gif'); background-repeat: no-repeat; background-position: 5px 8px; padding-left: 20px;} +span.mceMenuCheckItem {padding-left: 20px;} +span.mceMenuLine {display: block; position: absolute; left: 0; top: -1px; background-color: #F5F4F2; width: 30px; height: 1px; overflow: hidden; padding-left: 0; padding-right: 0;} +.mceColors table, .mceColors td {margin: 0; padding: 2px;} +a.mceMoreColors {width: 130px; margin: 0; padding: 0; margin-left: 3px; margin-bottom: 3px; text-align: center; border: 1px solid white;} +.mceColorPreview {position: absolute; left: 0; top: 0; margin-left: 3px; margin-top: 15px; width: 16px; height: 4px; background-color: red;} +a.mceMoreColors:hover {border: 1px solid #0A246A;} +.mceColors td a {width: 9px; height: 9px; overflow: hidden; border: 1px solid #808080;} + +/* MSIE 6 specific rules */ + +* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;} +* html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;} +* html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;} +* html a.mceButtonNormal, * html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;} +* html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;} +* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;} +* html .mceSelectList {margin-top: 2px;} +* html span.mceMenuButton, * html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;} +* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {position: relative; top: 1px;} +* html a.mceMoreColors {width: 132px;} +* html .mceColors td a {width: 10px; height: 10px;} +* html .mceColorPreview {margin-left: 2px; margin-top: 14px;} + +/* MSIE 7 specific rules */ + +*:first-child+html a.mceButtonNormal img, *:first-child+html a.mceButtonSelected img, *:first-child+html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;} +*:first-child+html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;} +*:first-child+html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;} +*:first-child+html a.mceButtonNormal, *:first-child+html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;} +*:first-child+html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;} +*:first-child+html a.mceButtonNormal:hover, *:first-child+html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;} +*:first-child+html .mceSelectList {margin-top: 2px;} +*:first-child+html span.mceMenuButton, *:first-child+html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;} +*:first-child+html span.mceMenuButton img, *:first-child+html span.mceMenuButtonSelected img, *:first-child+html span.mceMenuButtonFocus img {position: relative; top: 1px;} +*:first-child+html a.mceMoreColors {width: 132px;} +*:first-child+html .mceColors td a {width: 10px; height: 10px;} +*:first-child+html .mceColorPreview {margin: 0; padding-left: 4px; margin-top: 14px; width: 14px;} diff --git a/e107_handlers/tiny_mce/themes/advanced/editor_content.css b/e107_handlers/tiny_mce/themes/advanced/editor_content.css new file mode 100644 index 000000000..ac7e5a7ae --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/editor_content.css @@ -0,0 +1,27 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} diff --git a/e107_handlers/tiny_mce/themes/advanced/editor_popup.css b/e107_handlers/tiny_mce/themes/advanced/editor_popup.css new file mode 100644 index 000000000..7deb40a92 --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/editor_popup.css @@ -0,0 +1,121 @@ +body { + background-color: #F0F0EE; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; +} + +input { + background: #FFFFFF; + border: 1px solid #cccccc; +} + +td, input, select, textarea { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +input, select, textarea { + border: 1px solid #808080; +} + +.input_noborder { + border: 0px solid #808080; +} + +#insert { + font-weight: bold; +} + +#cancel { + font-weight: bold; +} + +.title { + font-size: 12px; + font-weight: bold; +} + +table.charmap { + border-style: solid; + border-width: 1px; + border-color: #AAAAAA; +} + +td.charmap, td.charmapOver { + color: #000000; + border-color: #AAAAAA; + border-style: solid; + border-width: 1px; + text-align: center; + font-size: 12px; +} + +td.charmapOver { + background-color: #CCCCCC; + cursor: arrow; +} + +a.charmap { + color: #000000; + text-decoration: none +} + +.wordWrapCode { + vertical-align: middle; + border: 1px none #000000; + background-color: transparent; +} + +input.radio { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +input.checkbox { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected { + margin-left: 1px; +} + +.mceButtonNormal { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: arrow; +} + +.mceButtonOver { + border: 1px solid #0A246A; + cursor: arrow; + background-color: #B6BDD2; +} + +.mceButtonDown { + cursor: arrow; + border: 1px solid #0A246A; + background-color: #8592B5; +} + +legend { + font-weight: bold; +} diff --git a/e107_handlers/tiny_mce/themes/advanced/editor_template.js b/e107_handlers/tiny_mce/themes/advanced/editor_template.js new file mode 100644 index 000000000..24277e61d --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/editor_template.js @@ -0,0 +1 @@ +tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_defColors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','bullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lang_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','forecolor',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','HiliteColor',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',getControlHTML:function(button_name){var i,x,but;for(i=0;i4?but[4]:false),(but.length>5?but[5]:null));if(but[0]==button_name)return tinyMCE.getButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null))}switch(button_name){case"formatselect":var html='';return html;case"styleselect":return'';case"fontselect":var fontHTML='';return fontHTML;case"fontsizeselect":return'';case"|":case"separator":return'';case"spacer":return'';case"rowseparator":return'
    '}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case'mceHelp':tinyMCE.openWindow({file:'about.htm',width:480,height:380},{tinymce_version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion,tinymce_releasedate:tinyMCE.releaseDate,inline:"yes"});return true;case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);")}action="update"}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class'])}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"})}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h)}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:""}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);")}action="update"}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout'])}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"forecolor":var fcp=new TinyMCE_Layer(editor_id+'_fcPreview',false),p,img,elm;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!fcp.exists()){fcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=fcp.getElement();elm._editor_id=editor_id;elm._command="forecolor";elm._switchId=editor_id+"_forecolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_forecolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));fcp.moveTo(p.absLeft,p.absTop);fcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).foreColor;fcp.show();return false;case"forecolorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_fcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_text_colors','forecolor'));tinyMCE.switchClass(editor_id+'_forecolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_forecolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"HiliteColor":var bcp=new TinyMCE_Layer(editor_id+'_bcPreview',false),p,img;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!bcp.exists()){bcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=bcp.getElement();elm._editor_id=editor_id;elm._command="HiliteColor";elm._switchId=editor_id+"_backcolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_backcolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));bcp.moveTo(p.absLeft,p.absTop);bcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).backColor;bcp.show();return false;case"HiliteColorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_bcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_background_colors','HiliteColor'));tinyMCE.switchClass(editor_id+'_backcolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_backcolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor})}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();')}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true}return false},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array(),skip;for(var i=0;i 

    ';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i'+key+''}TinyMCE_AdvancedTheme._autoImportCSSClasses=false}switch(layoutManager){case"SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='0){toolbarHTML+="
    ";deltaHeight-=23}}toolbarHTML+='
    ';template['html']='';if(toolbarLocation=="top"){template['html']+=''}if(statusbarLocation=="top"){template['html']+='';deltaHeight-=23}template['html']+='';if(toolbarLocation=="bottom"){template['html']+=''}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='
    '+toolbarHTML+'
    '+statusbarHTML+'
    '+toolbarHTML+'
    '+toolbarHTML+'
    ';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null}if(statusbarLocation=="bottom"){template['html']+=''+statusbarHTML+'';deltaHeight-=23}template['html']+='';break;case"RowLayout":template['html']='';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i';else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom"}else if(i==0){pathClass="mceStatusbar"}else{deltaHeight-=2}template['html']+='';deltaHeight-=22}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);curContainer=removeFromArray(curContainer,tinyMCE.getParam("theme_advanced_disable","",true,','));for(var j=0;j0){curContainerHTML+="
    ";deltaHeight-=23}template['html']+='
    '}}template['html']+='
    '+statusbarHTML+'
    '+curContainerHTML+'
    ';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);")}break}if(resizing)template['html']+='';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template},initInstance:function(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true))}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink')},_handleMenuEvent:function(e){var te=tinyMCE.isMSIE?window.event.srcElement:e.target;tinyMCE._menuButtonEvent(e.type=="mouseover"?"over":"out",document.getElementById(te._switchId));if(e.type=="click")tinyMCE.execInstanceCommand(te._editor_id,te._command)},_hideMenus:function(id){var fcml=new TinyMCE_Layer(id+'_fcMenu'),bcml=new TinyMCE_Layer(id+'_bcMenu');if(fcml.exists()&&fcml.isVisible()){tinyMCE.switchClass(id+'_forecolor','mceMenuButton');fcml.hide()}if(bcml.exists()&&bcml.isVisible()){tinyMCE.switchClass(id+'_backcolor','mceMenuButton');bcml.hide()}},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){var alignNode,breakOut,classNode;function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName.indexOf("html:")==0)nodeName=nodeName.substring(5);if(nodeName=="b"){nodeName="strong"}if(nodeName=="i"){nodeName="em"}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" "}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" "}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" "}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" "}if(path[i].nodeName=='A'&&getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" "}className=tinyMCE.getAttrib(path[i],"class");if((nodeName=="img"||nodeName=="span")&&className.indexOf('mceItem')!=-1){nodeName=className.replace(/mceItem([a-z]+)/gi,'$1').toLowerCase();nodeData=path[i].getAttribute('title')}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData=""}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+=''+nodeName+'';if(i>0){html+=" » "}}pathElm.innerHTML=''+tinyMCE.getLang('lang_theme_path')+": "+html+' '}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal')}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled')}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i");else selectByValue(selectElm,"")}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="")}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"")}else selectByValue(selectElm,"")}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size)}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i0)selectElm.setAttribute('cssImported','true')}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end))},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth';for(i=0;i';if((i+1)%8==0)h+=''}h+='';return h},_insertImage:function(src,alt,border,hspace,vspace,width,height,align,title,onmouseover,onmouseout){tinyMCE.execCommand('mceBeginUndoLevel');if(src=="")return;if(!tinyMCE.imgElement&&tinyMCE.isSafari){var html="";html+=''+alt+'';tinyMCE.execCommand("mceInsertContent",false,html)}else{if(!tinyMCE.imgElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'');else tinyMCE.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL)}}if(tinyMCE.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=tinyMCE.imgElement.getAttribute("width")||height!=tinyMCE.imgElement.getAttribute("height")||align!=tinyMCE.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(tinyMCE.imgElement,'src',src);tinyMCE.setAttrib(tinyMCE.imgElement,'mce_src',msrc);tinyMCE.setAttrib(tinyMCE.imgElement,'alt',alt);tinyMCE.setAttrib(tinyMCE.imgElement,'title',title);tinyMCE.setAttrib(tinyMCE.imgElement,'align',align);tinyMCE.setAttrib(tinyMCE.imgElement,'border',border,true);tinyMCE.setAttrib(tinyMCE.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'width',width,true);tinyMCE.setAttrib(tinyMCE.imgElement,'height',height,true);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseout',onmouseout);if(width&&width!="")tinyMCE.imgElement.style.pixelWidth=width;if(height&&height!="")tinyMCE.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint()}tinyMCE.execCommand('mceEndUndoLevel')},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement)}return}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,''+tinyMCE.selectedInstance.selection.getSelectedHTML()+'')}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i 4 ? but[4] : false), (but.length > 5 ? but[5] : null)); + + if (but[0] == button_name) + return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null)); + } + + // Custom controlls other than buttons + switch (button_name) { + case "formatselect": + var html = ''; + + return html; + + case "styleselect": + return ''; + + case "fontselect": + var fontHTML = ''; + return fontHTML; + + case "fontsizeselect": + return ''; + + case "|": + case "separator": + return ''; + + case "spacer": + return ''; + + case "rowseparator": + return '
    '; + } + + return ""; + }, + + /** + * Theme specific execcommand handling. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + switch (command) { + case 'mceHelp': + tinyMCE.openWindow({ + file : 'about.htm', + width : 480, + height : 380 + }, { + tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion, + tinymce_releasedate : tinyMCE.releaseDate, + inline : "yes" + }); + return true; + + case "mceLink": + var inst = tinyMCE.getInstanceById(editor_id); + var doc = inst.getDoc(); + var selectedText = ""; + + if (tinyMCE.isMSIE) { + var rng = doc.selection.createRange(); + selectedText = rng.text; + } else + selectedText = inst.getSel().toString(); + + if (!tinyMCE.linkElement) { + if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0)) + return true; + } + + var href = "", target = "", title = "", onclick = "", action = "insert", style_class = ""; + + if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a") + tinyMCE.linkElement = tinyMCE.selectedElement; + + // Is anchor not a link + if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "") + tinyMCE.linkElement = null; + + if (tinyMCE.linkElement) { + href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href'); + target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target'); + title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title'); + onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick'); + style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class'); + + // Try old onclick to if copy/pasted content + if (onclick == "") + onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick'); + + onclick = tinyMCE.cleanupEventStr(onclick); + + href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);"); + + // Use mce_href if defined + mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href'); + if (mceRealHref != "") { + href = mceRealHref; + + if (tinyMCE.getParam('convert_urls')) + href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);"); + } + + action = "update"; + } + + var template = new Array(); + + template['file'] = 'link.htm'; + template['width'] = 310; + template['height'] = 200; + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0); + + if (inst.settings['insertlink_callback']) { + var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);"); + if (returnVal && returnVal['href']) + TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']); + } else { + tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"}); + } + + return true; + + case "mceImage": + var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = ""; + var title = "", onmouseover = "", onmouseout = "", action = "insert"; + var img = tinyMCE.imgElement; + var inst = tinyMCE.getInstanceById(editor_id); + + if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") { + img = tinyMCE.selectedElement; + tinyMCE.imgElement = img; + } + + if (img) { + // Is it a internal MCE visual aid image, then skip this one. + if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0) + return true; + + src = tinyMCE.getAttrib(img, 'src'); + alt = tinyMCE.getAttrib(img, 'alt'); + + // Try polling out the title + if (alt == "") + alt = tinyMCE.getAttrib(img, 'title'); + + // Fix width/height attributes if the styles is specified + if (tinyMCE.isGecko) { + var w = img.style.width; + if (w != null && w != "") + img.setAttribute("width", w); + + var h = img.style.height; + if (h != null && h != "") + img.setAttribute("height", h); + } + + border = tinyMCE.getAttrib(img, 'border'); + hspace = tinyMCE.getAttrib(img, 'hspace'); + vspace = tinyMCE.getAttrib(img, 'vspace'); + width = tinyMCE.getAttrib(img, 'width'); + height = tinyMCE.getAttrib(img, 'height'); + align = tinyMCE.getAttrib(img, 'align'); + onmouseover = tinyMCE.getAttrib(img, 'onmouseover'); + onmouseout = tinyMCE.getAttrib(img, 'onmouseout'); + title = tinyMCE.getAttrib(img, 'title'); + + // Is realy specified? + if (tinyMCE.isMSIE) { + width = img.attributes['width'].specified ? width : ""; + height = img.attributes['height'].specified ? height : ""; + } + + //onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover)); + //onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout)); + + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); + + // Use mce_src if defined + mceRealSrc = tinyMCE.getAttrib(img, 'mce_src'); + if (mceRealSrc != "") { + src = mceRealSrc; + + if (tinyMCE.getParam('convert_urls')) + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); + } + + //if (onmouseover != "") + // onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);"); + + //if (onmouseout != "") + // onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);"); + + action = "update"; + } + + var template = new Array(); + + template['file'] = 'image.htm?src={$src}'; + template['width'] = 355; + template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0); + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0); + + if (inst.settings['insertimage_callback']) { + var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);"); + if (returnVal && returnVal['src']) + TinyMCE_AdvancedTheme._insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']); + } else + tinyMCE.openWindow(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"}); + + return true; + + case "forecolor": + var fcp = new TinyMCE_Layer(editor_id + '_fcPreview', false), p, img, elm; + + TinyMCE_AdvancedTheme._hideMenus(editor_id); + + if (!fcp.exists()) { + fcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar')); + elm = fcp.getElement(); + elm._editor_id = editor_id; + elm._command = "forecolor"; + elm._switchId = editor_id + "_forecolor"; + tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent); + tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent); + tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent); + } + + img = tinyMCE.selectNodes(document.getElementById(editor_id + "_forecolor"), function(n) {return n.nodeName == "IMG";})[0]; + p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar')); + + fcp.moveTo(p.absLeft, p.absTop); + fcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).foreColor; + fcp.show(); + + return false; + + case "forecolorMenu": + TinyMCE_AdvancedTheme._hideMenus(editor_id); + + // Create color layer + var ml = new TinyMCE_Layer(editor_id + '_fcMenu'); + + if (!ml.exists()) + ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_text_colors', 'forecolor')); + + tinyMCE.switchClass(editor_id + '_forecolor', 'mceMenuButtonFocus'); + ml.moveRelativeTo(document.getElementById(editor_id + "_forecolor"), 'bl'); + + ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1); + + if (tinyMCE.isOpera) + ml.moveBy(0, -2); + + ml.show(); + return true; + + case "HiliteColor": + var bcp = new TinyMCE_Layer(editor_id + '_bcPreview', false), p, img; + + TinyMCE_AdvancedTheme._hideMenus(editor_id); + + if (!bcp.exists()) { + bcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar')); + elm = bcp.getElement(); + elm._editor_id = editor_id; + elm._command = "HiliteColor"; + elm._switchId = editor_id + "_backcolor"; + tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent); + tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent); + tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent); + } + + img = tinyMCE.selectNodes(document.getElementById(editor_id + "_backcolor"), function(n) {return n.nodeName == "IMG";})[0]; + p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar')); + + bcp.moveTo(p.absLeft, p.absTop); + bcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).backColor; + bcp.show(); + + return false; + + case "HiliteColorMenu": + TinyMCE_AdvancedTheme._hideMenus(editor_id); + + // Create color layer + var ml = new TinyMCE_Layer(editor_id + '_bcMenu'); + + if (!ml.exists()) + ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_background_colors', 'HiliteColor')); + + tinyMCE.switchClass(editor_id + '_backcolor', 'mceMenuButtonFocus'); + ml.moveRelativeTo(document.getElementById(editor_id + "_backcolor"), 'bl'); + + ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1); + + if (tinyMCE.isOpera) + ml.moveBy(0, -2); + + ml.show(); + return true; + + case "mceColorPicker": + if (user_interface) { + var template = new Array(); + var inputColor = value['document'].getElementById(value['element_id']).value; + + template['file'] = 'color_picker.htm'; + template['width'] = 220; + template['height'] = 190; + template['close_previous'] = "no"; + + template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0); + + if (typeof(value['store_selection']) == "undefined") + value['store_selection'] = true; + + tinyMCE.lastColorPickerValue = value; + tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor}); + } else { + var savedVal = tinyMCE.lastColorPickerValue; + var elm = savedVal['document'].getElementById(savedVal['element_id']); + elm.value = value; + + if (elm.onchange != null && elm.onchange != '') + eval('elm.onchange();'); + } + return true; + + case "mceCodeEditor": + var template = new Array(); + + template['file'] = 'source_editor.htm'; + template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720)); + template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580)); + + tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"}); + return true; + + case "mceCharMap": + var template = new Array(); + + template['file'] = 'charmap.htm'; + template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0); + template['height'] = 250; + + template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0); + + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + return true; + + case "mceInsertAnchor": + var template = new Array(); + + template['file'] = 'anchor.htm'; + template['width'] = 320; + template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0); + + template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0); + + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + return true; + + case "mceNewDocument": + if (confirm(tinyMCE.getLang('lang_newdocument'))) + tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ' '); + + return true; + } + + return false; + }, + + /** + * Editor instance template function. + */ + getEditorTemplate : function(settings, editorId) { + function removeFromArray(in_array, remove_array) { + var outArray = new Array(), skip; + + for (var i=0; i 

    '; + var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout"); + + // Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY! + var styleSelectHTML = ''; + if (settings['theme_advanced_styles']) { + var stylesAr = settings['theme_advanced_styles'].split(';'); + + for (var i=0; i' + key + ''; + } + + TinyMCE_AdvancedTheme._autoImportCSSClasses = false; + } + + switch(layoutManager) { + case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)... + var toolbarHTML = ""; + var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom"); + var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center"); + var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); // Compatiblity + var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation); + var defVals = { + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap" + }; + + // Add accessibility control + toolbarHTML += ' 0) { + toolbarHTML += "
    "; + deltaHeight -= 23; + } + } + + // Add accessibility control + toolbarHTML += '
    '; + + // Setup template html + template['html'] = ''; + + if (toolbarLocation == "top") { + template['html'] += ''; + } + + if (statusbarLocation == "top") { + template['html'] += ''; + deltaHeight -= 23; + } + + template['html'] += ''; + + if (toolbarLocation == "bottom") { + template['html'] += ''; + } + + // External toolbar changes + if (toolbarLocation == "external") { + var bod = document.body; + var elm = document.createElement ("div"); + + toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML); + toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId}); + + elm.className = "mceToolbarExternal"; + elm.id = editorId+"_toolbar"; + elm.innerHTML = '
    ' + toolbarHTML + '
    ' + statusbarHTML + '
    ' + toolbarHTML + '
    '+toolbarHTML+'
    '; + bod.appendChild (elm); + // bod.style.marginTop = elm.offsetHeight + "px"; + + deltaHeight = 0; + tinyMCE.getInstanceById(editorId).toolbarElement = elm; + + //template['html'] = '
    '+toolbarHTML+'
    ' + template["html"]; + } else { + tinyMCE.getInstanceById(editorId).toolbarElement = null; + } + + if (statusbarLocation == "bottom") { + template['html'] += '' + statusbarHTML + ''; + deltaHeight -= 23; + } + + template['html'] += ''; + //"SimpleLayout" + break; + + case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom. + template['html'] = ''; + + var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ","); + var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container"); + var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center"); + + //Render Containers: + for (var i = 0; i < containers.length; i++) + { + if (containers[i] == "mceEditor") //Exceptions for mceEditor and ... + template['html'] += ''; + else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath: + { + var pathClass = "mceStatusbar"; + + if (i == containers.length-1) + { + pathClass = "mceStatusbarBottom"; + } + else if (i == 0) + { + pathClass = "mceStatusbar"; + } + else + { + deltaHeight-=2; + } + + template['html'] += ''; + deltaHeight -= 22; + } else { // Render normal Container + var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ','); + var curContainerHTML = ""; + var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign); + var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS); + + curContainer = removeFromArray(curContainer, tinyMCE.getParam("theme_advanced_disable", "", true, ',')); + + for (var j=0; j 0) { + curContainerHTML += "
    "; + deltaHeight -= 23; + } + + template['html'] += '
    '; + } + } + + template['html'] += '
    ' + statusbarHTML + '
    ' + curContainerHTML + '
    '; + //RowLayout + break; + + case "CustomLayout" : //User defined layout callback... + var customLayout = tinyMCE.getParam("theme_advanced_custom_layout",""); + + if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") { + template = eval(customLayout + "(template);"); + } + break; + } + + if (resizing) + template['html'] += ''; + + template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML); + template['delta_width'] = 0; + template['delta_height'] = deltaHeight; + + return template; + }, + + initInstance : function(inst) { + if (tinyMCE.getParam("theme_advanced_resizing", false)) { + if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) { + var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width"); + var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height"); + + TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true)); + } + } + + inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink'); + }, + + _handleMenuEvent : function(e) { + var te = tinyMCE.isMSIE ? window.event.srcElement : e.target; + tinyMCE._menuButtonEvent(e.type == "mouseover" ? "over" : "out", document.getElementById(te._switchId)); + + if (e.type == "click") + tinyMCE.execInstanceCommand(te._editor_id, te._command); + }, + + _hideMenus : function(id) { + var fcml = new TinyMCE_Layer(id + '_fcMenu'), bcml = new TinyMCE_Layer(id + '_bcMenu'); + + if (fcml.exists() && fcml.isVisible()) { + tinyMCE.switchClass(id + '_forecolor', 'mceMenuButton'); + fcml.hide(); + } + + if (bcml.exists() && bcml.isVisible()) { + tinyMCE.switchClass(id + '_backcolor', 'mceMenuButton'); + bcml.hide(); + } + }, + + /** + * Node change handler. + */ + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) { + var alignNode, breakOut, classNode; + + function selectByValue(select_elm, value, first_index) { + first_index = typeof(first_index) == "undefined" ? false : true; + + if (select_elm) { + for (var i=0; i=0; i--) { + var nodeName = path[i].nodeName.toLowerCase(); + var nodeData = ""; + + if (nodeName.indexOf("html:") == 0) + nodeName = nodeName.substring(5); + + if (nodeName == "b") { + nodeName = "strong"; + } + + if (nodeName == "i") { + nodeName = "em"; + } + + if (nodeName == "span") { + var cn = tinyMCE.getAttrib(path[i], "class"); + if (cn != "" && cn.indexOf('mceItem') == -1) + nodeData += "class: " + cn + " "; + + var st = tinyMCE.getAttrib(path[i], "style"); + if (st != "") { + st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st)); + nodeData += "style: " + st + " "; + } + } + + if (nodeName == "font") { + if (tinyMCE.getParam("convert_fonts_to_spans")) + nodeName = "span"; + + var face = tinyMCE.getAttrib(path[i], "face"); + if (face != "") + nodeData += "font: " + face + " "; + + var size = tinyMCE.getAttrib(path[i], "size"); + if (size != "") + nodeData += "size: " + size + " "; + + var color = tinyMCE.getAttrib(path[i], "color"); + if (color != "") + nodeData += "color: " + color + " "; + } + + if (getAttrib(path[i], 'id') != "") { + nodeData += "id: " + path[i].getAttribute('id') + " "; + } + + var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); + if (className != "" && className.indexOf('mceItem') == -1) + nodeData += "class: " + className + " "; + + if (getAttrib(path[i], 'src') != "") { + var src = tinyMCE.getAttrib(path[i], "mce_src"); + + if (src == "") + src = tinyMCE.getAttrib(path[i], "src"); + + nodeData += "src: " + src + " "; + } + + if (path[i].nodeName == 'A' && getAttrib(path[i], 'href') != "") { + var href = tinyMCE.getAttrib(path[i], "mce_href"); + + if (href == "") + href = tinyMCE.getAttrib(path[i], "href"); + + nodeData += "href: " + href + " "; + } + + className = tinyMCE.getAttrib(path[i], "class"); + if ((nodeName == "img" || nodeName == "span") && className.indexOf('mceItem') != -1) { + nodeName = className.replace(/mceItem([a-z]+)/gi, '$1').toLowerCase(); + nodeData = path[i].getAttribute('title'); + } + + if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") { + nodeName = "a"; + nodeName += "#" + anchor; + nodeData = ""; + } + + if (getAttrib(path[i], 'name').indexOf("mce_") != 0) { + var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); + if (className != "" && className.indexOf('mceItem') == -1) { + nodeName += "." + className; + } + } + + var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');'; + html += '' + nodeName + ''; + + if (i > 0) { + html += " » "; + } + } + + pathElm.innerHTML = '' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' '; + } + + // Reset old states + tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal'); + + if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1) + tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected'); + + // Get link + var anchorLink = tinyMCE.getParentElement(node, "a", "href"); + + if (anchorLink || any_selection) { + tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); + } + + // Handle visual aid + tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal'); + + if (undo_levels != -1) { + tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled'); + } + + // Within li, blockquote + if (tinyMCE.getParentElement(node, "li,blockquote")) + tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal'); + + // Has redo levels + if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) + tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal'); + + // Has undo levels + if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) + tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal'); + + // Select class in select box + var selectElm = document.getElementById(editor_id + "_styleSelect"); + + if (selectElm) { + TinyMCE_AdvancedTheme._setupCSSClasses(editor_id); + + classNode = node; + breakOut = false; + var index = 0; + + do { + if (classNode && classNode.className) { + for (var i=0; i"); + else + selectByValue(selectElm, ""); + } + + // Select fontselect + var selectElm = document.getElementById(editor_id + "_fontNameSelect"); + if (selectElm) { + if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) { + var face = inst.queryCommandValue('FontName'); + + face = face == null || face == "" ? "" : face; + + selectByValue(selectElm, face, face != ""); + } else { + var elm = tinyMCE.getParentElement(node, "font", "face"); + + if (elm) { + var family = tinyMCE.getAttrib(elm, "face"); + + if (family == '') + family = '' + elm.style.fontFamily; + + if (!selectByValue(selectElm, family, family != "")) + selectByValue(selectElm, ""); + } else + selectByValue(selectElm, ""); + } + } + + // Select fontsize + var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); + if (selectElm) { + if (!tinyMCE.isSafari && !tinyMCE.isOpera) { + var size = inst.queryCommandValue('FontSize'); + selectByValue(selectElm, size == null || size == "" ? "0" : size); + } else { + var elm = tinyMCE.getParentElement(node, "font", "size"); + if (elm) { + var size = tinyMCE.getAttrib(elm, "size"); + + if (size == '') { + var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px'); + + size = '' + elm.style.fontSize; + + for (var i=0; i 0) + selectElm.setAttribute('cssImported', 'true'); + } + }, + + _setCookie : function(name, value, expires, path, domain, secure) { + var curCookie = name + "=" + escape(value) + + ((expires) ? "; expires=" + expires.toGMTString() : "") + + ((path) ? "; path=" + escape(path) : "") + + ((domain) ? "; domain=" + domain : "") + + ((secure) ? "; secure" : ""); + + document.cookie = curCookie; + }, + + _getCookie : function(name) { + var dc = document.cookie; + var prefix = name + "="; + var begin = dc.indexOf("; " + prefix); + + if (begin == -1) { + begin = dc.indexOf(prefix); + + if (begin != 0) + return null; + } else + begin += 2; + + var end = document.cookie.indexOf(";", begin); + + if (end == -1) + end = dc.length; + + return unescape(dc.substring(begin + prefix.length, end)); + }, + + _resizeTo : function(inst, w, h, set_w) { + var editorContainer = document.getElementById(inst.editorId + '_parent'); + var tableElm = editorContainer.firstChild; + var iframe = inst.iframeElement; + + if (w == null || w == "null") { + set_w = false; + w = 0; + } + + if (h == null || h == "null") + return; + + w = parseInt(w); + h = parseInt(h); + + if (tinyMCE.isGecko) { + w += 2; + h += 2; + } + + var dx = w - tableElm.clientWidth; + var dy = h - tableElm.clientHeight; + + w = w < 1 ? 30 : w; + h = h < 1 ? 30 : h; + + if (set_w) + tableElm.style.width = w + "px"; + + tableElm.style.height = h + "px"; + + iw = iframe.clientWidth + dx; + ih = iframe.clientHeight + dy; + + iw = iw < 1 ? 30 : iw; + ih = ih < 1 ? 30 : ih; + + if (tinyMCE.isGecko) { + iw -= 2; + ih -= 2; + } + + if (set_w) + iframe.style.width = iw + "px"; + + iframe.style.height = ih + "px"; + + // Is it to small, make it bigger again + if (set_w) { + var tableBodyElm = tableElm.firstChild; + var minIframeWidth = tableBodyElm.scrollWidth; + if (inst.iframeElement.clientWidth < minIframeWidth) { + dx = minIframeWidth - inst.iframeElement.clientWidth; + + inst.iframeElement.style.width = (iw + dx) + "px"; + } + } + + // Remove pesky table controls + inst.useCSS = false; + }, + + /** + * Handles resizing events. + */ + _resizeEventHandler : function(e) { + var resizer = TinyMCE_AdvancedTheme._resizer; + + // Do nothing + if (!resizer.resizing) + return; + + e = typeof(e) == "undefined" ? window.event : e; + + var dx = e.screenX - resizer.downX; + var dy = e.screenY - resizer.downY; + var resizeBox = resizer.resizeBox; + var editorId = resizer.editorId; + + switch (e.type) { + case "mousemove": + var w, h; + + w = resizer.width + dx; + h = resizer.height + dy; + + w = w < 1 ? 1 : w; + h = h < 1 ? 1 : h; + + if (resizer.horizontal) + resizeBox.style.width = w + "px"; + + resizeBox.style.height = h + "px"; + break; + + case "mouseup": + TinyMCE_AdvancedTheme._setResizing(e, editorId, false); + TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal); + + // Expire in a month + if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) { + var expires = new Date(); + expires.setTime(expires.getTime() + 3600000 * 24 * 30); + + // Set the cookies + TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires); + TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires); + } + break; + } + }, + + /** + * Starts/stops the editor resizing. + */ + _setResizing : function(e, editor_id, state) { + e = typeof(e) == "undefined" ? window.event : e; + + var resizer = TinyMCE_AdvancedTheme._resizer; + var editorContainer = document.getElementById(editor_id + '_parent'); + var editorArea = document.getElementById(editor_id + '_parent').firstChild; + var resizeBox = document.getElementById(editor_id + '_resize_box'); + var inst = tinyMCE.getInstanceById(editor_id); + + if (state) { + // Place box over editor area + var width = editorArea.clientWidth; + var height = editorArea.clientHeight; + + resizeBox.style.width = width + "px"; + resizeBox.style.height = height + "px"; + + resizer.iframeWidth = inst.iframeElement.clientWidth; + resizer.iframeHeight = inst.iframeElement.clientHeight; + + // Hide editor and show resize box + editorArea.style.display = "none"; + resizeBox.style.display = "block"; + + // Add event handlers, only once + if (!resizer.eventHandlers) { + if (tinyMCE.isMSIE) + tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler); + else + tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler); + + tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler); + + resizer.eventHandlers = true; + } + + resizer.resizing = true; + resizer.downX = e.screenX; + resizer.downY = e.screenY; + resizer.width = parseInt(resizeBox.style.width); + resizer.height = parseInt(resizeBox.style.height); + resizer.editorId = editor_id; + resizer.resizeBox = resizeBox; + resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true); + } else { + resizer.resizing = false; + resizeBox.style.display = "none"; + editorArea.style.display = tinyMCE.isMSIE && !tinyMCE.isOpera ? "block" : "table"; + tinyMCE.execCommand('mceResetDesignMode'); + } + }, + + _getColorHTML : function(id, n, cm) { + var i, h, cl; + + h = ''; + cl = tinyMCE.getParam(n, TinyMCE_AdvancedTheme._defColors).split(','); + + h += ''; + for (i=0; i'; + + if ((i+1) % 8 == 0) + h += ''; + } + + h += '
    '; + /* + h += 'More colors'; + */ + + return h; + }, + + _insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) { + tinyMCE.execCommand('mceBeginUndoLevel'); + + if (src == "") + return; + + if (!tinyMCE.imgElement && tinyMCE.isSafari) { + var html = ""; + + html += '' + alt + ''; + + tinyMCE.execCommand("mceInsertContent", false, html); + } else { + if (!tinyMCE.imgElement && tinyMCE.selectedInstance) { + if (tinyMCE.isSafari) + tinyMCE.execCommand("mceInsertContent", false, ''); + else + tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL); + + tinyMCE.imgElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL); + } + } + + if (tinyMCE.imgElement) { + var needsRepaint = false; + var msrc = src; + + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);"); + + if (tinyMCE.getParam('convert_urls')) + msrc = src; + + if (onmouseover && onmouseover != "") + onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';"; + + if (onmouseout && onmouseout != "") + onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';"; + + // Use alt as title if it's undefined + if (typeof(title) == "undefined") + title = alt; + + if (width != tinyMCE.imgElement.getAttribute("width") || height != tinyMCE.imgElement.getAttribute("height") || align != tinyMCE.imgElement.getAttribute("align")) + needsRepaint = true; + + tinyMCE.setAttrib(tinyMCE.imgElement, 'src', src); + tinyMCE.setAttrib(tinyMCE.imgElement, 'mce_src', msrc); + tinyMCE.setAttrib(tinyMCE.imgElement, 'alt', alt); + tinyMCE.setAttrib(tinyMCE.imgElement, 'title', title); + tinyMCE.setAttrib(tinyMCE.imgElement, 'align', align); + tinyMCE.setAttrib(tinyMCE.imgElement, 'border', border, true); + tinyMCE.setAttrib(tinyMCE.imgElement, 'hspace', hspace, true); + tinyMCE.setAttrib(tinyMCE.imgElement, 'vspace', vspace, true); + tinyMCE.setAttrib(tinyMCE.imgElement, 'width', width, true); + tinyMCE.setAttrib(tinyMCE.imgElement, 'height', height, true); + tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseover', onmouseover); + tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseout', onmouseout); + + // Fix for bug #989846 - Image resize bug + if (width && width != "") + tinyMCE.imgElement.style.pixelWidth = width; + + if (height && height != "") + tinyMCE.imgElement.style.pixelHeight = height; + + if (needsRepaint) + tinyMCE.selectedInstance.repaint(); + } + + tinyMCE.execCommand('mceEndUndoLevel'); + }, + + _insertLink : function(href, target, title, onclick, style_class) { + tinyMCE.execCommand('mceBeginUndoLevel'); + + if (tinyMCE.selectedInstance && tinyMCE.selectedElement && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") { + var doc = tinyMCE.selectedInstance.getDoc(); + var linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a"); + var newLink = false; + + if (!linkElement) { + linkElement = doc.createElement("a"); + newLink = true; + } + + var mhref = href; + var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);"); + mhref = tinyMCE.getParam('convert_urls') ? href : mhref; + + tinyMCE.setAttrib(linkElement, 'href', thref); + tinyMCE.setAttrib(linkElement, 'mce_href', mhref); + tinyMCE.setAttrib(linkElement, 'target', target); + tinyMCE.setAttrib(linkElement, 'title', title); + tinyMCE.setAttrib(linkElement, 'onclick', onclick); + tinyMCE.setAttrib(linkElement, 'class', style_class); + + if (newLink) { + linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true)); + tinyMCE.selectedElement.parentNode.replaceChild(linkElement, tinyMCE.selectedElement); + } + + return; + } + + if (!tinyMCE.linkElement && tinyMCE.selectedInstance) { + if (tinyMCE.isSafari) { + tinyMCE.execCommand("mceInsertContent", false, '' + tinyMCE.selectedInstance.selection.getSelectedHTML() + ''); + } else + tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL); + + tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL); + + var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL); + + for (var i=0; i + + {$lang_insert_image_title} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + x +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/themes/advanced/images/anchor.gif b/e107_handlers/tiny_mce/themes/advanced/images/anchor.gif new file mode 100644 index 000000000..34ab71534 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/anchor.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/anchor_symbol.gif b/e107_handlers/tiny_mce/themes/advanced/images/anchor_symbol.gif new file mode 100644 index 000000000..2eafd7954 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/anchor_symbol.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/backcolor.gif b/e107_handlers/tiny_mce/themes/advanced/images/backcolor.gif new file mode 100644 index 000000000..d03e206a3 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/backcolor.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/bold.gif b/e107_handlers/tiny_mce/themes/advanced/images/bold.gif new file mode 100644 index 000000000..d6a9cc2cd Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/bold.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/bold_de_se.gif b/e107_handlers/tiny_mce/themes/advanced/images/bold_de_se.gif new file mode 100644 index 000000000..9b129de25 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/bold_de_se.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/bold_es.gif b/e107_handlers/tiny_mce/themes/advanced/images/bold_es.gif new file mode 100644 index 000000000..ea341e608 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/bold_es.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/bold_fr.gif b/e107_handlers/tiny_mce/themes/advanced/images/bold_fr.gif new file mode 100644 index 000000000..281645451 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/bold_fr.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/bold_ru.gif b/e107_handlers/tiny_mce/themes/advanced/images/bold_ru.gif new file mode 100644 index 000000000..e000d461c Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/bold_ru.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/browse.gif b/e107_handlers/tiny_mce/themes/advanced/images/browse.gif new file mode 100644 index 000000000..c786d0b20 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/browse.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/bullist.gif b/e107_handlers/tiny_mce/themes/advanced/images/bullist.gif new file mode 100644 index 000000000..6e19467c7 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/bullist.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/button_menu.gif b/e107_handlers/tiny_mce/themes/advanced/images/button_menu.gif new file mode 100644 index 000000000..c3d8fa231 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/button_menu.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/buttons.gif b/e107_handlers/tiny_mce/themes/advanced/images/buttons.gif new file mode 100644 index 000000000..5ad99a7c4 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/buttons.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/cancel_button_bg.gif b/e107_handlers/tiny_mce/themes/advanced/images/cancel_button_bg.gif new file mode 100644 index 000000000..4b4aeefcb Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/cancel_button_bg.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/center.gif b/e107_handlers/tiny_mce/themes/advanced/images/center.gif new file mode 100644 index 000000000..42d609a99 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/center.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/charmap.gif b/e107_handlers/tiny_mce/themes/advanced/images/charmap.gif new file mode 100644 index 000000000..3cdc4ac91 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/charmap.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/cleanup.gif b/e107_handlers/tiny_mce/themes/advanced/images/cleanup.gif new file mode 100644 index 000000000..16491f6cf Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/cleanup.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/close.gif b/e107_handlers/tiny_mce/themes/advanced/images/close.gif new file mode 100644 index 000000000..679ca2aa4 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/close.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/code.gif b/e107_handlers/tiny_mce/themes/advanced/images/code.gif new file mode 100644 index 000000000..c5d5a6727 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/code.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/color.gif b/e107_handlers/tiny_mce/themes/advanced/images/color.gif new file mode 100644 index 000000000..1ecd5743b Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/color.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/copy.gif b/e107_handlers/tiny_mce/themes/advanced/images/copy.gif new file mode 100644 index 000000000..dc146865c Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/copy.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/custom_1.gif b/e107_handlers/tiny_mce/themes/advanced/images/custom_1.gif new file mode 100644 index 000000000..4cbccdadf Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/custom_1.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/cut.gif b/e107_handlers/tiny_mce/themes/advanced/images/cut.gif new file mode 100644 index 000000000..4e9a70b6e Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/cut.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/ecode.gif b/e107_handlers/tiny_mce/themes/advanced/images/ecode.gif new file mode 100644 index 000000000..f8812b572 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/ecode.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/forecolor.gif b/e107_handlers/tiny_mce/themes/advanced/images/forecolor.gif new file mode 100644 index 000000000..8b7036160 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/forecolor.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/full.gif b/e107_handlers/tiny_mce/themes/advanced/images/full.gif new file mode 100644 index 000000000..c8504f626 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/full.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/help.gif b/e107_handlers/tiny_mce/themes/advanced/images/help.gif new file mode 100644 index 000000000..51a1ee420 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/help.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/hr.gif b/e107_handlers/tiny_mce/themes/advanced/images/hr.gif new file mode 100644 index 000000000..1a1ba2a01 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/hr.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/image.gif b/e107_handlers/tiny_mce/themes/advanced/images/image.gif new file mode 100644 index 000000000..4b88eddc2 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/image.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/indent.gif b/e107_handlers/tiny_mce/themes/advanced/images/indent.gif new file mode 100644 index 000000000..acd315bb1 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/indent.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/insert_button_bg.gif b/e107_handlers/tiny_mce/themes/advanced/images/insert_button_bg.gif new file mode 100644 index 000000000..69c131ce2 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/insert_button_bg.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/italic.gif b/e107_handlers/tiny_mce/themes/advanced/images/italic.gif new file mode 100644 index 000000000..8bb330bd0 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/italic.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/italic_de_se.gif b/e107_handlers/tiny_mce/themes/advanced/images/italic_de_se.gif new file mode 100644 index 000000000..feb0309e7 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/italic_de_se.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/italic_es.gif b/e107_handlers/tiny_mce/themes/advanced/images/italic_es.gif new file mode 100644 index 000000000..4572cdb1d Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/italic_es.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/italic_ru.gif b/e107_handlers/tiny_mce/themes/advanced/images/italic_ru.gif new file mode 100644 index 000000000..a2bb69a72 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/italic_ru.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/justifycenter.gif b/e107_handlers/tiny_mce/themes/advanced/images/justifycenter.gif new file mode 100644 index 000000000..42d609a99 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/justifycenter.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/justifyfull.gif b/e107_handlers/tiny_mce/themes/advanced/images/justifyfull.gif new file mode 100644 index 000000000..c8504f626 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/justifyfull.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/justifyleft.gif b/e107_handlers/tiny_mce/themes/advanced/images/justifyleft.gif new file mode 100644 index 000000000..e8f7e4276 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/justifyleft.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/justifyright.gif b/e107_handlers/tiny_mce/themes/advanced/images/justifyright.gif new file mode 100644 index 000000000..e4cea9714 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/justifyright.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/left.gif b/e107_handlers/tiny_mce/themes/advanced/images/left.gif new file mode 100644 index 000000000..e8f7e4276 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/left.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/link.gif b/e107_handlers/tiny_mce/themes/advanced/images/link.gif new file mode 100644 index 000000000..1accf4262 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/link.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/menu_check.gif b/e107_handlers/tiny_mce/themes/advanced/images/menu_check.gif new file mode 100644 index 000000000..50d6afd50 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/menu_check.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/newdocument.gif b/e107_handlers/tiny_mce/themes/advanced/images/newdocument.gif new file mode 100644 index 000000000..a9d293842 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/newdocument.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/numlist.gif b/e107_handlers/tiny_mce/themes/advanced/images/numlist.gif new file mode 100644 index 000000000..a2683522f Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/numlist.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/opacity.png b/e107_handlers/tiny_mce/themes/advanced/images/opacity.png new file mode 100644 index 000000000..b4217cb21 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/opacity.png differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/outdent.gif b/e107_handlers/tiny_mce/themes/advanced/images/outdent.gif new file mode 100644 index 000000000..23f6aa408 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/outdent.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/paste.gif b/e107_handlers/tiny_mce/themes/advanced/images/paste.gif new file mode 100644 index 000000000..1b45000a0 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/paste.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/quote.gif b/e107_handlers/tiny_mce/themes/advanced/images/quote.gif new file mode 100644 index 000000000..2ef31c97e Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/quote.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/redo.gif b/e107_handlers/tiny_mce/themes/advanced/images/redo.gif new file mode 100644 index 000000000..3af90697f Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/redo.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/removeformat.gif b/e107_handlers/tiny_mce/themes/advanced/images/removeformat.gif new file mode 100644 index 000000000..0fa3cb797 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/removeformat.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/right.gif b/e107_handlers/tiny_mce/themes/advanced/images/right.gif new file mode 100644 index 000000000..e4cea9714 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/right.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/separator.gif b/e107_handlers/tiny_mce/themes/advanced/images/separator.gif new file mode 100644 index 000000000..4f39b809e Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/separator.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/spacer.gif b/e107_handlers/tiny_mce/themes/advanced/images/spacer.gif new file mode 100644 index 000000000..388486517 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/spacer.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/statusbar_resize.gif b/e107_handlers/tiny_mce/themes/advanced/images/statusbar_resize.gif new file mode 100644 index 000000000..af89d803f Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/statusbar_resize.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/strikethrough.gif b/e107_handlers/tiny_mce/themes/advanced/images/strikethrough.gif new file mode 100644 index 000000000..326463591 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/strikethrough.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/sub.gif b/e107_handlers/tiny_mce/themes/advanced/images/sub.gif new file mode 100644 index 000000000..4d7ce30ff Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/sub.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/sup.gif b/e107_handlers/tiny_mce/themes/advanced/images/sup.gif new file mode 100644 index 000000000..a7145e019 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/sup.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table.gif b/e107_handlers/tiny_mce/themes/advanced/images/table.gif new file mode 100644 index 000000000..2911830c3 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table_delete_col.gif b/e107_handlers/tiny_mce/themes/advanced/images/table_delete_col.gif new file mode 100644 index 000000000..91f53af02 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table_delete_col.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table_delete_row.gif b/e107_handlers/tiny_mce/themes/advanced/images/table_delete_row.gif new file mode 100644 index 000000000..7025733fe Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table_delete_row.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_after.gif b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_after.gif new file mode 100644 index 000000000..85058080c Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_after.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_before.gif b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_before.gif new file mode 100644 index 000000000..b669d4fa6 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_before.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_after.gif b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_after.gif new file mode 100644 index 000000000..b9c144661 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_after.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_before.gif b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_before.gif new file mode 100644 index 000000000..157d37365 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_before.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/underline.gif b/e107_handlers/tiny_mce/themes/advanced/images/underline.gif new file mode 100644 index 000000000..1dfeb5f6d Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/underline.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/underline_es.gif b/e107_handlers/tiny_mce/themes/advanced/images/underline_es.gif new file mode 100644 index 000000000..551d9148d Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/underline_es.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/underline_fr.gif b/e107_handlers/tiny_mce/themes/advanced/images/underline_fr.gif new file mode 100644 index 000000000..551d9148d Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/underline_fr.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/underline_ru.gif b/e107_handlers/tiny_mce/themes/advanced/images/underline_ru.gif new file mode 100644 index 000000000..b78e2a498 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/underline_ru.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/undo.gif b/e107_handlers/tiny_mce/themes/advanced/images/undo.gif new file mode 100644 index 000000000..520796d69 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/undo.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/unlink.gif b/e107_handlers/tiny_mce/themes/advanced/images/unlink.gif new file mode 100644 index 000000000..5c8a33db8 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/unlink.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/visualaid.gif b/e107_handlers/tiny_mce/themes/advanced/images/visualaid.gif new file mode 100644 index 000000000..63caf1807 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/visualaid.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_bg.gif b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_bg.gif new file mode 100644 index 000000000..897a01f2b Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_bg.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_end.gif b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_end.gif new file mode 100644 index 000000000..aee442beb Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_end.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif new file mode 100644 index 000000000..9dc8abe1a Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif new file mode 100644 index 000000000..616a889d1 Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/images/xp/tabs_bg.gif b/e107_handlers/tiny_mce/themes/advanced/images/xp/tabs_bg.gif new file mode 100644 index 000000000..c303f66dd Binary files /dev/null and b/e107_handlers/tiny_mce/themes/advanced/images/xp/tabs_bg.gif differ diff --git a/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js b/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js new file mode 100644 index 000000000..f60e6f688 --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js @@ -0,0 +1,75 @@ +function init() { + var inst; + + tinyMCEPopup.resizeToInnerSize(); + inst = tinyMCE.selectedInstance; + + // Give FF some time + window.setTimeout('insertHelpIFrame();', 10); + + var tcont = document.getElementById('plugintablecontainer'); + var plugins = tinyMCE.getParam('plugins', '', true, ','); + if (plugins.length == 0) + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + for (var i=0; i' + info.longname + ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + } + + html += ''; + html += '
    ' + tinyMCE.getLang('lang_plugin') + '' + tinyMCE.getLang('lang_author') + '' + tinyMCE.getLang('lang_version') + '
    ' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; + + tcont.innerHTML = html; +} + +function getPluginInfo(name) { + if (tinyMCE.plugins[name].getInfo) + return tinyMCE.plugins[name].getInfo(); + + return { + longname : name, + authorurl : '', + infourl : '', + author : '--', + version : '--' + }; +} + +function insertHelpIFrame() { + var html = ''; + + document.getElementById('iframecontainer').innerHTML = html; + + html = ''; + html += 'Got Moxie? '; + html += 'Hosted By Sourceforge '; + html += 'Also on freshmeat '; + + document.getElementById('buttoncontainer').innerHTML = html; +} diff --git a/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js b/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js new file mode 100644 index 000000000..f2e5d4829 --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js @@ -0,0 +1,74 @@ +var action, element; + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); + var anchor = tinyMCE.getParentElement(inst.getFocusElement(), "a", "name"); + var img = inst.getFocusElement(); + action = 'insert'; + + if (anchor != null) { + element = anchor; + action = "update"; + } + + if (tinyMCE.getAttrib(img, "class") == "mceItemAnchor") { + element = img; + action = "update"; + } + + if (action == "update") + document.forms[0].anchorName.value = element.nodeName == "IMG" ? element.getAttribute("title") : element.getAttribute("name"); + + document.forms[0].insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); +} + +function insertAnchor() { + var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); + var name = document.forms[0].anchorName.value, e; + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + if (action == "update") { + if (element.nodeName == "IMG") + element.setAttribute("title", name); + else + element.setAttribute("name", name); + } else { + var rng = inst.getRng(); + + if (rng.collapse) + rng.collapse(false); + + name = name.replace(/&/g, '&'); + name = name.replace(/\"/g, '"'); + name = name.replace(//g, '>'); + + // Fix for bug #1447335 + if (tinyMCE.isGecko) + html = ''; + else + html = ''; + + tinyMCEPopup.execCommand("mceInsertContent", false, html); + + // Fix for bug #1447335 force cursor after the anchor element + if (tinyMCE.isGecko) { + e = inst.getDoc().getElementById('mceNewAnchor'); + + if (e) { + inst.selection.selectNode(e, true, false, false); + e.removeAttribute('id'); + } + } + + tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + + tinyMCE.triggerNodeChange(); + tinyMCEPopup.close(); +} diff --git a/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js b/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js new file mode 100644 index 000000000..c4ec3261c --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js @@ -0,0 +1,326 @@ +function init() { + tinyMCEPopup.resizeToInnerSize(); +} + +var charmap = new Array(); + +// for mor details please see w3c.org +// now here is the complete list ;) + +charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true,'lozenge'], + ['♠', '♠', false,'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20; + var html = ''; + var cols=-1; + for (var i=0; i' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + html += '
    '; + document.write(html); +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js b/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js new file mode 100644 index 000000000..aa80714ad --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js @@ -0,0 +1,108 @@ +function init() { + if (tinyMCE.isMSIE) + tinyMCEPopup.resizeToInnerSize(); +} + +function selectColor() { + var color = document.getElementById("selectedColorBox").value; + + tinyMCEPopup.execCommand(tinyMCE.getWindowArg('command'), false, color); + tinyMCEPopup.close(); +} + +function showColor(color) { + document.getElementById("selectedColor").style.backgroundColor = color; + document.getElementById("selectedColorBox").value = color; +} + +var colors = new Array( + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +); + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return "rgb(" + r + "," + g + "," + b + ")"; + } + + return col; +} + +function renderColorMap() { + var html = ""; + var inputColor = convertRGBToHex(tinyMCE.getWindowArg('input_color')); + + html += '' + + ''; + for (var i=0; i' + + '' + + '' + colors[i] +  ''; + if ((i+1) % 18 == 0) + html += ''; + } + html += '' + + '
    ' + + '' + + '' + + '
    ' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + + document.write(html); +} \ No newline at end of file diff --git a/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js b/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js new file mode 100644 index 000000000..950c043ab --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js @@ -0,0 +1,81 @@ +var url = tinyMCE.getParam("external_image_list_url"); +if (url != null) { + // Fix relative + if (url.charAt(0) != '/' && url.indexOf('://') == -1) + url = tinyMCE.documentBasePath + "/" + url; + + document.write(''); +} + +function insertImage() { + var src = document.forms[0].src.value; + var alt = document.forms[0].alt.value; + var border = document.forms[0].border.value; + var vspace = document.forms[0].vspace.value; + var hspace = document.forms[0].hspace.value; + var width = document.forms[0].width.value; + var height = document.forms[0].height.value; + var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value; + + tinyMCEPopup.restoreSelection(); + tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align); + tinyMCEPopup.close(); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + + var formObj = document.forms[0]; + + for (var i=0; i 0) { + for (var i=0; i'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link'); + + // Handle file browser + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + var formObj = document.forms[0]; + + for (var i=0; i 0) { + var formObj = document.forms[0]; + + for (var i=0; i + + {$lang_insert_link_title} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/themes/advanced/source_editor.htm b/e107_handlers/tiny_mce/themes/advanced/source_editor.htm new file mode 100644 index 000000000..84fbb4981 --- /dev/null +++ b/e107_handlers/tiny_mce/themes/advanced/source_editor.htm @@ -0,0 +1,32 @@ + + + + {$lang_theme_code_title} + + + + + +
    +
    {$lang_theme_code_title}
    + +
    + +
    + +
    + + + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/e107_handlers/tiny_mce/tiny_mce.js b/e107_handlers/tiny_mce/tiny_mce.js new file mode 100644 index 000000000..00920a20b --- /dev/null +++ b/e107_handlers/tiny_mce/tiny_mce.js @@ -0,0 +1 @@ +function TinyMCE_Engine(){var ua;this.majorVersion="2";this.minorVersion="0.8";this.releaseDate="2006-10-23";this.instances=new Array();this.switchClassCache=new Array();this.windowArgs=new Array();this.loadedFiles=new Array();this.pendingFiles=new Array();this.loadingIndex=0;this.configs=new Array();this.currentConfig=0;this.eventHandlers=new Array();this.log=new Array();this.undoLevels=[];this.undoIndex=0;this.typingUndoIndex=-1;ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf('MSIE 5.0')!=-1);this.isMSIE7=this.isMSIE&&(ua.indexOf('MSIE 7')!=-1);this.isGecko=ua.indexOf('Gecko')!=-1;this.isSafari=ua.indexOf('Safari')!=-1;this.isOpera=ua.indexOf('Opera')!=-1;this.isMac=ua.indexOf('Mac')!=-1;this.isNS7=ua.indexOf('Netscape/7')!=-1;this.isNS71=ua.indexOf('Netscape/7.1')!=-1;this.dialogCounter=0;this.plugins=new Array();this.themes=new Array();this.menus=new Array();this.loadedPlugins=new Array();this.buttonMap=new Array();this.isLoaded=false;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false}this.isIE=this.isMSIE;this.isRealIE=this.isMSIE&&!this.isOpera;this.idCounter=0};TinyMCE_Engine.prototype={init:function(settings){var theme,nl,baseHREF="",i;if(this.isMSIE5_0)return;this.settings=settings;if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');nl=document.getElementsByTagName('base');for(i=0;i');this._def("font_size_classes",'');this._def("font_size_style_values",'xx-small,x-small,small,medium,large,x-large,xx-large',true);this._def("event_elements",'a,img',true);this._def("convert_urls",true);this._def("table_inline_editing",false);this._def("object_resizing",true);this._def("custom_shortcuts",true);this._def("convert_on_click",false);this._def("content_css",'');this._def("fix_list_elements",false);this._def("fix_table_elements",false);this._def("strict_loading_mode",document.contentType=='application/xhtml+xml');this._def("hidden_tab_class",'');this._def("display_tab_class",'');this._def("gecko_spellcheck",false);if(this.isMSIE&&!this.isOpera)this.settings.strict_loading_mode=false;if(this.isMSIE&&this.settings['browsers'].indexOf('msie')==-1)return;if(this.isGecko&&this.settings['browsers'].indexOf('gecko')==-1)return;if(this.isSafari&&this.settings['browsers'].indexOf('safari')==-1)return;if(this.isOpera&&this.settings['browsers'].indexOf('opera')==-1)return;baseHREF=tinyMCE.settings['document_base_url'];var h=document.location.href;var p=h.indexOf('://');if(p>0&&document.location.protocol!="file:"){p=h.indexOf('/',p+3);h=h.substring(0,p);if(baseHREF.indexOf('://')==-1)baseHREF=h+baseHREF;tinyMCE.settings['document_base_url']=baseHREF;tinyMCE.settings['document_base_prefix']=h}if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings['base_href']=baseHREF.substring(0,baseHREF.lastIndexOf('/'))+"/";theme=this.settings['theme'];this.inlineStrict='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';this.inlineTransitional='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';this.blockElms='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';this.blockRegExp=new RegExp("^("+this.blockElms+")$","i");this.posKeyCodes=new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL='javascript:TINYMCE_UNIQUEURL();';this.uniqueTag='';this.callbacks=new Array('onInit','getInfo','getEditorTemplate','setupContent','onChange','onPageLoad','handleNodeChange','initInstance','execCommand','getControlHTML','handleEvent','cleanup');this.settings['theme_href']=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isIE||tinyMCE.isOpera)this.settings['force_br_newlines']=false;if(tinyMCE.getParam("popups_css",false)){var cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['popups_css']=this.documentBasePath+"/"+cssPath;else this.settings['popups_css']=cssPath}else this.settings['popups_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){var cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['editor_css']=this.documentBasePath+"/"+cssPath;else this.settings['editor_css']=cssPath}else{if(this.settings.editor_css!='')this.settings['editor_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_ui.css"}if(tinyMCE.settings['debug']){var msg="Debug: \n";msg+="baseURL: "+this.baseURL+"\n";msg+="documentBasePath: "+this.documentBasePath+"\n";msg+="content_css: "+this.settings['content_css']+"\n";msg+="popups_css: "+this.settings['popups_css']+"\n";msg+="editor_css: "+this.settings['editor_css']+"\n";alert(msg)}if(this.configs.length==0){if(typeof(TinyMCECompressed)=="undefined"){tinyMCE.addEvent(window,"DOMContentLoaded",TinyMCE_Engine.prototype.onLoad);if(tinyMCE.isRealIE){if(document.body)tinyMCE.addEvent(document.body,"readystatechange",TinyMCE_Engine.prototype.onLoad);else tinyMCE.addEvent(document,"readystatechange",TinyMCE_Engine.prototype.onLoad)}tinyMCE.addEvent(window,"load",TinyMCE_Engine.prototype.onLoad);tinyMCE._addUnloadEvents()}}this.loadScript(tinyMCE.baseURL+'/themes/'+this.settings['theme']+'/editor_template'+tinyMCE.srcMode+'.js');this.loadScript(tinyMCE.baseURL+'/langs/'+this.settings['language']+'.js');this.loadCSS(this.settings['editor_css']);var p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(var i=0;i');this.loadedFiles[this.loadedFiles.length]=url},loadNextScript:function(){var d=document,se;if(!tinyMCE.settings.strict_loading_mode)return;if(this.loadingIndex0){for(i=0,lflen=this.loadedFiles.length;i');this.loadedFiles[this.loadedFiles.length]=ar[x]}}}},importCSS:function(doc,css){var css_ary=css.replace(/\s+/,'').split(',');var csslen,elm,headArr,x,css_file;for(x=0,csslen=css_ary.length;x0){if(css_file.indexOf('://')==-1&&css_file.charAt(0)!='/')css_file=this.documentBasePath+"/"+css_file;if(typeof(doc.createStyleSheet)=="undefined"){elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if((headArr=doc.getElementsByTagName("head"))!=null&&headArr.length>0)headArr[0].appendChild(elm)}else doc.createStyleSheet(css_file)}}},confirmAdd:function(e,settings){var elm=tinyMCE.isIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;tinyMCE.settings=settings;if(tinyMCE.settings['convert_on_click']||(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm'])))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true')},updateContent:function(form_element_name){var formElement=document.getElementById(form_element_name);for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isIE)doc.body.innerHTML=tinyMCE._cleanupHTML(inst,doc,this.settings,doc.body,inst.visualAid)}}},addMCEControl:function(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCE_Control(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst._onAdd(replace_element,form_element_name,target_document)},removeInstance:function(ti){var t=[],n,i;for(n in tinyMCE.instances){i=tinyMCE.instances[n];if(tinyMCE.isInstance(i)&&ti!=i)t[n]=i}tinyMCE.instances=t;n=[];t=tinyMCE.undoLevels;for(i=0;i0){tinyMCE.nextUndoRedoAction='Undo';inst=this.undoLevels[--this.undoIndex];inst.select();if(!tinyMCE.nextUndoRedoInstanceId)inst.execCommand('Undo')}}else inst.execCommand('Undo');return true;case"Redo":if(this.getParam('custom_undo_redo_global')){if(this.undoIndex<=this.undoLevels.length-1){tinyMCE.nextUndoRedoAction='Redo';inst=this.undoLevels[this.undoIndex++];inst.select();if(!tinyMCE.nextUndoRedoInstanceId)inst.execCommand('Redo')}}else inst.execCommand('Redo');return true;case'mceFocus':var inst=tinyMCE.getInstanceById(value);if(inst)inst.getWin().focus();return;case"mceAddControl":case"mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value);return;case"mceAddFrameControl":tinyMCE.addMCEControl(tinyMCE._getElementById(value['element'],value['document']),value['element'],value['document']);return;case"mceRemoveControl":case"mceRemoveEditor":tinyMCE.removeMCEControl(value);return;case"mceResetDesignMode":if(!tinyMCE.isIE){for(var n in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[n]))continue;try{tinyMCE.instances[n].getDoc().designMode="on"}catch(e){}}}return}if(inst){inst.execCommand(command,user_interface,value)}else if(tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert'])},_createIFrame:function(replace_element,doc,win){var iframe,id=replace_element.getAttribute("id");var aw,ah;if(typeof(doc)=="undefined")doc=document;if(typeof(win)=="undefined")win=window;iframe=doc.createElement("iframe");aw=""+tinyMCE.settings['area_width'];ah=""+tinyMCE.settings['area_height'];if(aw.indexOf('%')==-1){aw=parseInt(aw);aw=(isNaN(aw)||aw<0)?300:aw;aw=aw+"px"}if(ah.indexOf('%')==-1){ah=parseInt(ah);ah=(isNaN(ah)||ah<0)?240:ah;ah=ah+"px"}iframe.setAttribute("id",id);iframe.setAttribute("name",id);iframe.setAttribute("class","mceEditorIframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",aw);iframe.setAttribute("height",ah);iframe.setAttribute("allowtransparency","true");iframe.className='mceEditorIframe';if(tinyMCE.settings["auto_resize"])iframe.setAttribute("scrolling","no");if(tinyMCE.isRealIE)iframe.setAttribute("src",this.settings['default_document']);iframe.style.width=aw;iframe.style.height=ah;if(tinyMCE.settings.strict_loading_mode)iframe.style.marginBottom='-5px';if(tinyMCE.isRealIE)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isRealIE)return win.frames[id];else return iframe},setupContent:function(editor_id){var inst=tinyMCE.instances[editor_id],i;var doc=inst.getDoc();var head=doc.getElementsByTagName('head').item(0);var content=inst.startContent;if(tinyMCE.settings.strict_loading_mode){content=content.replace(/</g,'<');content=content.replace(/>/g,'>');content=content.replace(/"/g,'"');content=content.replace(/&/g,'&')}inst.switchSettings();if(!tinyMCE.isIE&&tinyMCE.getParam("setupcontent_reload",false)&&doc.title!="blank_page"){try{doc.location.href=tinyMCE.baseURL+"/blank.htm"}catch(ex){}window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return}if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return}tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/themes/"+inst.settings['theme']+"/css/editor_content.css");tinyMCE.importCSS(inst.getDoc(),inst.settings['content_css']);tinyMCE.dispatchCallback(inst,'init_instance_callback','initInstance',inst);if(tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')){inst.addShortcut('ctrl','z','lang_undo_desc','Undo');inst.addShortcut('ctrl','y','lang_redo_desc','Redo')}for(i=1;i<=6;i++)inst.addShortcut('ctrl',''+i,'','FormatBlock',false,'');inst.addShortcut('ctrl','7','','FormatBlock',false,'

    ');inst.addShortcut('ctrl','8','','FormatBlock',false,'

    ');inst.addShortcut('ctrl','9','','FormatBlock',false,'
    ');if(tinyMCE.isGecko){inst.addShortcut('ctrl','b','lang_bold_desc','Bold');inst.addShortcut('ctrl','i','lang_italic_desc','Italic');inst.addShortcut('ctrl','u','lang_underline_desc','Underline')}if(tinyMCE.getParam("convert_fonts_to_spans"))inst.getBody().setAttribute('id','mceSpanFonts');if(tinyMCE.settings['nowrap'])doc.body.style.whiteSpace="nowrap";doc.body.dir=this.settings['directionality'];doc.editorId=editor_id;if(!tinyMCE.isIE)doc.documentElement.editorId=editor_id;inst.setBaseHREF(tinyMCE.settings['base_href']);if(tinyMCE.settings['convert_newlines_to_brs']){content=tinyMCE.regexpReplace(content,"\r\n","
    ","gi");content=tinyMCE.regexpReplace(content,"\r","
    ","gi");content=tinyMCE.regexpReplace(content,"\n","
    ","gi")}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"insert_to_editor",content);if(tinyMCE.isIE){window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["'+editor_id+'"].getDoc(), "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"])doc.styleSheets[0].addRule("p","margin: 0;");var body=inst.getBody();body.editorId=editor_id}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.isGecko&&tinyMCE.settings['remove_lt_gt'])content=content.replace(new RegExp('<>','g'),"");if(tinyMCE.settings['cleanup_on_startup'])tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement));else tinyMCE.setInnerHTML(inst.getBody(),content);tinyMCE.convertAllRelativeURLs(inst.getBody())}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}')}else tinyMCE._setHTML(inst.getDoc(),content)}var parentElm=inst.targetDoc.getElementById(inst.editorId+'_parent');inst.formElement=tinyMCE.isGecko?parentElm.previousSibling:parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual'],inst);tinyMCE.dispatchCallback(inst,'setupcontent_callback','setupContent',editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isIE)tinyMCE.addEventHandlers(inst);if(tinyMCE.isIE){tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(inst.getBody(),"beforedeactivate",TinyMCE_Engine.prototype._eventPatch);if(!tinyMCE.isOpera){tinyMCE.addEvent(doc.body,"mousemove",TinyMCE_Engine.prototype.onMouseMove);tinyMCE.addEvent(doc.body,"beforepaste",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc.body,"drop",TinyMCE_Engine.prototype._eventPatch)}}inst.select();tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoRedo.add({content:inst.startContent});if(tinyMCE.isGecko){tinyMCE.selectNodes(inst.getBody(),function(n){if(n.nodeType==3||n.nodeType==8)n.nodeValue=n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"','gi'),"");return false})}if(tinyMCE.isGecko)inst.getBody().spellcheck=tinyMCE.getParam("gecko_spellcheck");tinyMCE._removeInternal(inst.getBody());inst.select();tinyMCE.triggerNodeChange(false,true)},storeAwayURLs:function(s){if(!s.match(/(mce_src|mce_href)/gi,s)){s=s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"','gi'),'src="$1" mce_src="$1"');s=s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"','gi'),'href="$1" mce_href="$1"')}return s},_removeInternal:function(n){if(tinyMCE.isGecko){tinyMCE.selectNodes(n,function(n){if(n.nodeType==3||n.nodeType==8)n.nodeValue=n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"','gi'),"");return false})}},handleEvent:function(e){var inst=tinyMCE.selectedInstance;if(typeof(tinyMCE)=="undefined")return true;if(tinyMCE.executeCallback(tinyMCE.selectedInstance,'handle_event_callback','handleEvent',e))return false;switch(e.type){case"beforedeactivate":case"blur":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.execCommand('mceEndTyping');tinyMCE.hideMenus();return;case"drop":case"beforepaste":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.setBaseHREF(null);if(tinyMCE.isRealIE){var ife=tinyMCE.selectedInstance.iframeElement;if(ife.style.height.indexOf('%')!=-1){ife._oldHeight=ife.style.height;ife.style.height=ife.clientHeight}}window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();",1);return;case"submit":tinyMCE.triggerSave();tinyMCE.isNotDirty=true;return;case"reset":var formObj=tinyMCE.isIE?window.event.srcElement:e.target;for(var i=0;i");rng.collapse(false);rng.select();tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return false}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false)}return false;break;case"keyup":case"keydown":tinyMCE.hideMenus();tinyMCE.hasMouseMoved=false;if(inst&&inst.handleShortcut(e))return false;if(e.target.editorId)tinyMCE.instances[e.target.editorId].select();if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();var inst=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");e.preventDefault();return false}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);if(tinyMCE.isIE&&e.type=="keydown"&&e.keyCode==13)tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement();if(tinyMCE.isIE&&e.type=="keyup"&&e.keyCode==13){var elm=tinyMCE.enterKeyElement;if(elm){var re=new RegExp('^HR|IMG|BR$','g');var dre=new RegExp('^H[1-6]$','g');if(!elm.hasChildNodes()&&!re.test(elm.nodeName)){if(dre.test(elm.nodeName))elm.innerHTML="  ";else elm.innerHTML=" "}}}var keys=tinyMCE.posKeyCodes;var posKey=false;for(var i=0;i';h+='';h+=''}else{h+='';h+='';h+=''}return h},getMenuButtonHTML:function(id,lang,img,mcmd,cmd,ui,val){var h='',m,x;mcmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+mcmd+'\');';cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+cmd+'\'';if(typeof(ui)!="undefined"&&ui!=null)cmd+=','+ui;if(typeof(val)!="undefined"&&val!=null)cmd+=",'"+val+"'";cmd+=');';if(tinyMCE.getParam('button_tile_map')&&(!tinyMCE.isIE||tinyMCE.isOpera)&&(m=tinyMCE.buttonMap[id])!=null&&(tinyMCE.getParam("language")=="en"||img.indexOf('$lang')==-1)){x=0-(m*20)==0?'0':0-(m*20);if(tinyMCE.isRealIE)h+='';else h+='';h+='';h+='';h+='';h+=''}else{if(tinyMCE.isRealIE)h+='';else h+='';h+='';h+='';h+='';h+=''}return h},_menuButtonEvent:function(e,o){if(o.className=='mceMenuButtonFocus')return;if(e=='over')o.className=o.className+' mceMenuHover';else o.className=o.className.replace(/\s.*$/,'')},addButtonMap:function(m){var i,a=m.replace(/\s+/,'').split(',');for(i=0;i0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=inst.undoRedo.undoIndex;undoLevels=inst.undoRedo.undoLevels.length}tinyMCE.dispatchCallback(inst,'handle_node_change_callback','handleNodeChange',editorId,elm,undoIndex,undoLevels,inst.visualAid,anySelection,setup_content)}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus()},_customCleanup:function(inst,type,content){var pl,po,i;var customCleanup=tinyMCE.settings['cleanup_callback'];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined")content=eval(customCleanup+"(type, content, inst);");po=tinyMCE.themes[tinyMCE.settings['theme']];if(po&&po.cleanup)content=po.cleanup(type,content,inst);pl=inst.plugins;for(i=0;i0)className+=" ";className+=classNames[i]}return className},handleVisualAid:function(el,deep,state,inst,skip_dispatch){if(!el)return;if(!skip_dispatch)tinyMCE.dispatchCallback(inst,'handle_visual_aid_callback','handleVisualAid',el,deep,state,inst);var tableElement=null;switch(el.nodeName){case"TABLE":var oldW=el.style.width;var oldH=el.style.height;var bo=tinyMCE.getAttrib(el,"border");bo=bo==""||bo=="0"?true:false;tinyMCE.setAttrib(el,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el,"class"),state&&bo));el.style.width=oldW;el.style.height=oldH;for(var y=0;y0){for(var x=0;x0)tinyMCE.cssClasses=output;return output},regexpReplace:function(in_str,reg_exp,replace_str,opts){if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str)},trim:function(s){return s.replace(/^\s*|\s*$/g,"")},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s},getControlHTML:function(c){var i,l,n,o,v;l=tinyMCE.plugins;for(n in l){o=l[n];if(o.getControlHTML&&(v=o.getControlHTML(c))!='')return tinyMCE.replaceVar(v,"pluginurl",o.baseURL)}o=tinyMCE.themes[tinyMCE.settings['theme']];if(o.getControlHTML&&(v=o.getControlHTML(c))!='')return v;return''},evalFunc:function(f,idx,a,o){var s='(',i;for(i=idx;i0)return true;if(ins!=null){for(i=0,l=ins.plugins;i0)return true}}l=tinyMCE.themes;for(on in l){o=l[on];if(o[n]&&(v=tinyMCE.evalFunc(n,3,a,o))==s&&m>0)return true}return false},xmlEncode:function(s){return s?(''+s).replace(new RegExp('[<>&"\']','g'),function(c,b){switch(c){case'&':return'&';case'"':return'"';case'\'':return''';case'<':return'<';case'>':return'>'}return c}):s},extend:function(p,np){var o={};o.parent=p;for(n in p)o[n]=p[n];for(n in np)o[n]=np[n];return o},hideMenus:function(){var e=tinyMCE.lastSelectedMenuBtn;if(tinyMCE.lastMenu){tinyMCE.lastMenu.hide();tinyMCE.lastMenu=null}if(e){tinyMCE.switchClass(e,tinyMCE.lastMenuBtnClass);tinyMCE.lastSelectedMenuBtn=null}}};var TinyMCE=TinyMCE_Engine;var tinyMCE=new TinyMCE_Engine();var tinyMCELang={};function TinyMCE_Control(settings){var t,i,to,fu,p,x,fn,fu,pn,s=settings;this.undoRedoLevel=true;this.isTinyMCE_Control=true;this.settings=s;this.settings['theme']=tinyMCE.getParam("theme","default");this.settings['width']=tinyMCE.getParam("width",-1);this.settings['height']=tinyMCE.getParam("height",-1);this.selection=new TinyMCE_Selection(this);this.undoRedo=new TinyMCE_UndoRedo(this);this.cleanup=new TinyMCE_Cleanup();this.shortcuts=new Array();this.hasMouseMoved=false;this.foreColor=this.backColor="#999999";this.data={};this.cleanup.init({valid_elements:s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,entities:s.entities,entity_encoding:s.entity_encoding,debug:s.cleanup_debug,url_converter:'TinyMCE_Cleanup.prototype._urlConverter',indent:s.apply_source_formatting,invalid_elements:s.invalid_elements,verify_html:s.verify_html,fix_content_duplication:s.fix_content_duplication});t=this.settings['theme'];if(!tinyMCE.hasTheme(t)){fn=tinyMCE.callbacks;to={};for(i=0;i0){for(i=0;i1&&tinyMCE.currentConfig!=this.settings['index']){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings['index']}},select:function(){var oldInst=tinyMCE.selectedInstance;if(oldInst!=this){if(oldInst)oldInst.execCommand('mceEndTyping');tinyMCE.dispatchCallback(this,'select_instance_callback','selectInstance',this,oldInst);tinyMCE.selectedInstance=this}},getBody:function(){return this.contentBody?this.contentBody:this.getDoc().body},getDoc:function(){return this.contentWindow.document},getWin:function(){return this.contentWindow},getContainerWin:function(){return this.containerWindow?this.containerWindow:window},getViewPort:function(){return tinyMCE.getViewPort(this.getWin())},getParentNode:function(n,f){return tinyMCE.getParentNode(n,f,this.getBody())},getParentElement:function(n,na,f){return tinyMCE.getParentElement(n,na,f,this.getBody())},getParentBlockElement:function(n){return tinyMCE.getParentBlockElement(n,this.getBody())},resizeToContent:function(){var d=this.getDoc(),b=d.body,de=d.documentElement;this.iframeElement.style.height=(tinyMCE.isRealIE)?b.scrollHeight:de.offsetHeight+'px'},addShortcut:function(m,k,d,cmd,ui,va){var n=typeof(k)=="number",ie=tinyMCE.isIE,c,sc,i,scl=this.shortcuts;if(!tinyMCE.getParam('custom_shortcuts'))return false;m=m.toLowerCase();k=ie&&!n?k.toUpperCase():k;c=n?null:k.charCodeAt(0);d=d&&d.indexOf('lang_')==0?tinyMCE.getLang(d):d;sc={alt:m.indexOf('alt')!=-1,ctrl:m.indexOf('ctrl')!=-1,shift:m.indexOf('shift')!=-1,charCode:c,keyCode:n?k:(ie?c:null),desc:d,cmd:cmd,ui:ui,val:va};for(i=0;i0)rng.pasteHTML('
    '+rng.htmlText+"
    ");tinyMCE.triggerNodeChange();return}}}switch(command){case"mceRepaint":this.repaint();return true;case"unlink":if(tinyMCE.isGecko&&this.getSel().isCollapsed){focusElm=tinyMCE.getParentElement(focusElm,'A');if(focusElm)this.selection.selectNode(focusElm,false)}this.getDoc().execCommand(command,user_interface,value);tinyMCE.isGecko&&this.getSel().collapseToEnd();tinyMCE.triggerNodeChange();return true;case"FormatBlock":if(!this.cleanup.isValid(value))return true;this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"InsertUnorderedList":case"InsertOrderedList":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"Strikethrough":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"mceSelectNode":this.selection.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case"FormatBlock":if(value==null||value==""){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");if(elm)this.execCommand("mceRemoveNode",false,elm)}else{if(tinyMCE.isGecko&&new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>','gi').test(value))value=value.replace(/[^a-z]/gi,'');if(tinyMCE.isIE&&new RegExp('blockquote|code|samp','gi').test(value)){var b=this.selection.getBookmark();this.getDoc().execCommand("FormatBlock",false,'

    ');tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()),value);this.selection.moveToBookmark(b)}else this.getDoc().execCommand("FormatBlock",false,value)}tinyMCE.triggerNodeChange();break;case"mceRemoveNode":if(!value)value=tinyMCE.getParentElement(this.getFocusElement());if(tinyMCE.isIE){value.outerHTML=value.innerHTML}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML))}tinyMCE.triggerNodeChange();break;case"mceSelectNodeDepth":var parentNode=this.getFocusElement();for(var i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body")break;if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue}if(i==value){this.selection.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return}parentNode=parentNode.parentNode}break;case"SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value['command'];var sname=value['name'];var svalue=value['value']==null?'':value['value'];var wrapper=value['wrapper']?value['wrapper']:"span";var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings['merge_styles_invalid_parents']!=''?new RegExp(tinyMCE.settings['merge_styles_invalid_parents'],"gi"):null;if(tinyMCE.isIE){if(rng.item)parentElm=rng.item(0);else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName))parentElm=pelm}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(new RegExp('td|tr|tbody|table','gi').test(felm.nodeName)&&sel.anchorNode==felm.parentNode))parentElm=felm}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle")tinyMCE.setStyleAttrib(parentElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(parentElm,sname,svalue);if(scmd=="removeformat"){parentElm.style.cssText='';tinyMCE.setAttrib(parentElm,'class','')}var ch=tinyMCE.getNodeTree(parentElm,new Array(),1);for(var z=0;z=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName))this._mergeElements(scmd,elm.parentNode,elm,false)}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.innerHTML.replace(new RegExp('style=""|class=""','gi'),'');if(new RegExp('','gi').test(tmp.innerHTML)){for(var x=0;x0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value)}tinyMCE.triggerNodeChange();break;case"mceSetAttribute":if(typeof(value)=='object'){var targetElms=(typeof(value['targets'])=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value['targets'];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value['name'],value['value']);tinyMCE.triggerNodeChange()}}break;case"mceSetCSSClass":this.execCommand("SetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case"mceInsertRawHTML":var key='tiny_mce_marker';this.execCommand('mceBeginUndoLevel');this.execCommand('mceInsertContent',false,key);var scrollX=this.getBody().scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getBody().scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1)tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length));this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand('mceEndUndoLevel');break;case"mceInsertContent":if(!value)value='';var insertHTMLFailed=false;if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf('<')==-1&&!value.match(/(&| |<|>)/g)){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2)}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}}catch(ex){insertHTMLFailed=true}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return}}if(!tinyMCE.isIE){var isHTML=value.indexOf('<')!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value)}else value=rng.createContextualFragment(value)}else{var el=document.createElement("div");el.innerHTML=value;value=el.firstChild.nodeValue;value=doc.createTextNode(value)}if(tinyMCE.isSafari&&!isHTML){this.execCommand('InsertText',false,value.nodeValue);tinyMCE.triggerNodeChange();return true}else if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node)}else rng.insertNode(value);if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng)}else rng.collapse(false);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}else{var rng=doc.selection.createRange(),tmpRng=null;var c=value.indexOf('"}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i';return h},_serializeAttribute:function(n,r,an){var av='',t,os=this.settings.on_save;if(os&&(an.indexOf('mce_')==0||an.indexOf('_moz')==0))return'';if(os&&this.mceAttribs[an])av=this._getAttrib(n,this.mceAttribs[an]);if(av.length==0)av=this._getAttrib(n,an);if(av.length==0&&r.defaultAttribs&&(t=r.defaultAttribs[an])){av=t;if(av=="mce_empty")return" "+an+'=""'}if(r.forceAttribs&&(t=r.forceAttribs[an]))av=t;if(os&&av.length!=0&&this.settings.url_converter.length!=0&&/^(src|href|longdesc)$/.test(an))av=eval(this.settings.url_converter+'(this, n, av)');if(av.length!=0&&r.validAttribValues&&r.validAttribValues[an]&&!r.validAttribValues[an].test(av))return"";if(av.length!=0&&av=="{$uid}")av="uid_"+(this.idCount++);if(av.length!=0){if(an.indexOf('on')!=0)av=this.xmlEncode(av);return" "+an+"="+'"'+av+'"'}return""},formatHTML:function(h){var s=this.settings,p='',i=0,li=0,o='',l;h=h.replace(/]*)>(.*?)<\/pre>/gi,function(a,b,c){c=c.replace(//gi,'\n');return''+c+''});h=h.replace(/\r/g,'');h='\n'+h;h=h.replace(new RegExp('\\n\\s+','gi'),'\n');h=h.replace(this.nlBeforeRe,'\n<$1$2>');h=h.replace(this.nlAfterRe,'<$1$2>\n');h=h.replace(this.nlBeforeAfterRe,'\n<$1$2$3>\n');h+='\n';while((i=h.indexOf('\n',i+1))!=-1){if((l=h.substring(li+1,i)).length!=0){if(this.ouRe.test(l)&&p.length>=s.indent_levels)p=p.substring(s.indent_levels);o+=p+l+'\n';if(this.inRe.test(l))p+=this.inStr}li=i}return o},xmlEncode:function(s){var cl=this;this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(s);case"named":return s.replace(new RegExp('[\u007F-\uFFFF<>&"\']','g'),function(c,b){b=cl.entities[c.charCodeAt(0)];return b?'&'+b+';':c});case"numeric":return s.replace(new RegExp('[\u007F-\uFFFF<>&"\']','g'),function(c,b){return b?'&#'+c.charCodeAt(0)+';':c})}return s},split:function(re,s){var c=s.split(re);var i,l,o=new Array();for(i=0,l=c.length;i':'>'+h+'';return o};TinyMCE_Engine.prototype.createTag=function(d,tn,a,h){var o=d.createElement(tn);if(a){for(n in a){if(typeof(a[n])!='function'&&a[n]!=null)tinyMCE.setAttrib(o,n,a[n])}}if(h)o.innerHTML=h;return o};TinyMCE_Engine.prototype.getElementByAttributeValue=function(n,e,a,v){return(n=this.getElementsByAttributeValue(n,e,a,v)).length==0?null:n[0]};TinyMCE_Engine.prototype.getElementsByAttributeValue=function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=new Array();for(i=0;i/gi,'');h=h.replace(/<\/em>/gi,'')}if(tinyMCE.isRealIE){h=h.replace(/\s\/>/g,'>');h=h.replace(/]*)>\u00A0?<\/p>/gi,' 

    ');h=h.replace(/]*)>\s* \s*<\/p>/gi,' 

    ');h=h.replace(/]*)>\s+<\/p>/gi,' 

    ');e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);nl=e.getElementsByTagName("p");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.nodeName=='P'&&!n.hasChildNodes()&&!n.mce_keep)n.parentNode.removeChild(n)}}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h)}};TinyMCE_Engine.prototype.getOuterHTML=function(e){if(tinyMCE.isIE)return e.outerHTML;var d=e.ownerDocument.createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML};TinyMCE_Engine.prototype.setOuterHTML=function(e,h,d){var d=typeof(d)=="undefined"?e.ownerDocument:d,i,nl,t;if(tinyMCE.isIE&&e.nodeType==1)e.outerHTML=h;else{t=d.createElement("body");t.innerHTML=h;for(i=0,nl=t.childNodes;i-1;i--){if(ar[i].specified&&ar[i].nodeValue)ne.setAttribute(ar[i].nodeName.toLowerCase(),ar[i].nodeValue)}ar=e.childNodes;for(i=0;i=strTok2.length){for(var i=0;i=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break}}}if(strTok1.length=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";for(var i=breakPoint-1;i=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i]}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue}if(numBack>0){numBack--;continue}newRelURLParts[newRelURLParts.length]=relURLParts[i]}relURLParts=newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return this.serializeURL(relURL)};TinyMCE_Engine.prototype.convertURL=function(url,node,on_save){var prot=document.location.protocol;var host=document.location.hostname;var port=document.location.port;if(prot=="file:")return url;url=tinyMCE.regexpReplace(url,'(http|https):///','/');if(url.indexOf('mailto:')!=-1||url.indexOf('javascript:')!=-1||tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0)=="#")return url;if(!tinyMCE.isIE&&!on_save&&url.indexOf("://")==-1&&url.charAt(0)!='/')return tinyMCE.settings['base_href']+url;if(on_save&&tinyMCE.getParam('relative_urls')){var curl=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(curl.charAt(0)=='/')curl=tinyMCE.settings['document_base_prefix']+curl;var urlParts=tinyMCE.parseURL(curl);var tmpUrlParts=tinyMCE.parseURL(tinyMCE.settings['document_base_url']);if(urlParts['host']==tmpUrlParts['host']&&(urlParts['port']==tmpUrlParts['port']))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'],curl)}if(!tinyMCE.getParam('relative_urls')){var urlParts=tinyMCE.parseURL(url);var baseUrlParts=tinyMCE.parseURL(tinyMCE.settings['base_href']);url=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(urlParts['anchor']&&urlParts['path']==baseUrlParts['path'])return"#"+urlParts['anchor']}if(tinyMCE.getParam('remove_script_host')){var start="",portPart="";if(port!="")portPart=":"+port;start=prot+"//"+host+portPart+"/";if(url.indexOf(start)==0)url=url.substring(start.length-1)}return url};TinyMCE_Engine.prototype.convertAllRelativeURLs=function(body){var i,elms,src,href,mhref,msrc;elms=body.getElementsByTagName("img");for(i=0;ibookmark.index){try{rng.addElement(nl[bookmark.index])}catch(ex){}}}else{try{if(bookmark.start<0)return true;rng=inst.getSel().createRange();rng.moveToElementText(inst.getBody());rng.collapse(true);rng.moveStart('character',bookmark.start);rng.moveEnd('character',bookmark.length)}catch(ex){return true}}rng.select();win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true}if(tinyMCE.isGecko||tinyMCE.isOpera){if(bookmark.rng){sel.removeAllRanges();sel.addRange(bookmark.rng)}if(bookmark.start!=-1&&bookmark.end!=-1){try{sd=this._getTextPos(b,bookmark.start,bookmark.end);rng=doc.createRange();rng.setStart(sd.startNode,sd.startOffset);rng.setEnd(sd.endNode,sd.endOffset);sel.removeAllRanges();sel.addRange(rng);win.focus()}catch(ex){}}win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true}return false},_getPosText:function(r,sn,en){var w=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d}p+=n.nodeValue?n.nodeValue.length:0}return null},_getTextPos:function(r,sp,ep){var w=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){p+=n.nodeValue?n.nodeValue.length:0;if(p>=sp&&!d.startNode){d.startNode=n;d.startOffset=sp-(p-n.nodeValue.length)}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-n.nodeValue.length);return d}}return null},selectNode:function(node,collapse,select_text_node,to_start){var inst=this.instance,sel,rng,nodes;if(!node)return;if(typeof(collapse)=="undefined")collapse=true;if(typeof(select_text_node)=="undefined")select_text_node=false;if(typeof(to_start)=="undefined")to_start=true;if(inst.settings.auto_resize)inst.resizeToContent();if(tinyMCE.isRealIE){rng=inst.getDoc().body.createTextRange();try{rng.moveToElementText(node);if(collapse)rng.collapse(to_start);rng.select()}catch(e){}}else{sel=this.getSel();if(!sel)return;if(tinyMCE.isSafari){sel.setBaseAndExtent(node,0,node,node.innerText.length);if(collapse){if(to_start)sel.collapseToStart();else sel.collapseToEnd()}this.scrollToNode(node);return}rng=inst.getDoc().createRange();if(select_text_node){nodes=tinyMCE.getNodeTree(node,new Array(),3);if(nodes.length>0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node)}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length)}else rng.collapse(to_start)}sel.removeAllRanges();sel.addRange(rng)}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node},scrollToNode:function(node){var inst=this.instance,w=inst.getWin(),vp=inst.getViewPort(),pos=tinyMCE.getAbsPosition(node),cvp,p,cwin;if(pos.absLeftvp.left+vp.width||pos.absTopvp.top+(vp.height-25))w.scrollTo(pos.absLeft,pos.absTop-vp.height+25);if(inst.settings.auto_resize){cwin=inst.getContainerWin();cvp=tinyMCE.getViewPort(cwin);p=this.getAbsPosition(node);if(p.absLeftcvp.left+cvp.width||p.absTopcvp.top+cvp.height)cwin.scrollTo(p.absLeft,p.absTop-cvp.height+25)}},getAbsPosition:function(n){var pos=tinyMCE.getAbsPosition(n),ipos=tinyMCE.getAbsPosition(this.instance.iframeElement);return{absLeft:ipos.absLeft+pos.absLeft,absTop:ipos.absTop+pos.absTop}},getSel:function(){var inst=this.instance;if(tinyMCE.isRealIE)return inst.getDoc().selection;return inst.contentWindow.getSelection()},getRng:function(){var s=this.getSel();if(s==null)return null;if(tinyMCE.isRealIE)return s.createRange();if(tinyMCE.isSafari&&!s.getRangeAt)return''+window.getSelection();return s.getRangeAt(0)},getFocusElement:function(){var inst=this.instance,doc,rng,sel,elm;if(tinyMCE.isRealIE){doc=inst.getDoc();rng=doc.selection.createRange();elm=rng.item?rng.item(0):rng.parentElement()}else{if(!tinyMCE.isSafari&&inst.isHidden())return inst.getBody();sel=this.getSel();rng=this.getRng();if(!sel||!rng)return null;elm=rng.commonAncestorContainer;if(!rng.collapsed){if(rng.startContainer==rng.endContainer){if(rng.startOffset-rng.endOffset<2){if(rng.startContainer.hasChildNodes())elm=rng.startContainer.childNodes[rng.startOffset]}}}elm=tinyMCE.getParentElement(elm);}return elm}};function TinyMCE_UndoRedo(inst){this.instance=inst;this.undoLevels=new Array();this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true};TinyMCE_UndoRedo.prototype={add:function(l){var b,customUndoLevels,newHTML,inst=this.instance,i,ul,ur;if(l){this.undoLevels[this.undoLevels.length]=l;return true}if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;if(tinyMCE.typingUndoIndex!=-1)tinyMCE.undoIndex=tinyMCE.typingUndoIndex}newHTML=tinyMCE.trim(inst.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&newHTML!=this.undoLevels[this.undoIndex].content){tinyMCE.dispatchCallback(inst,'onchange_callback','onChange',inst);customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(i=0;i0){this.undoIndex--;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark)}},redo:function(){var inst=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark)}tinyMCE.triggerNodeChange()}};var TinyMCE_ForceParagraphs={_insertPara:function(inst,e){var doc=inst.getDoc(),sel=inst.getSel(),body=inst.getBody(),win=inst.contentWindow,rng=sel.getRangeAt(0);var rootElm=doc.documentElement,blockName="P",startNode,endNode,startBlock,endBlock;var rngBefore,rngAfter,direct,startNode,startOffset,endNode,endOffset,b=tinyMCE.isOpera?inst.selection.getBookmark():null;var paraBefore,paraAfter,startChop,endChop,contents;function isEmpty(para){function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()==""}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;var nodes=tinyMCE.getNodeTree(para,new Array(),3);for(var i=0;i <"+blockName+"> ";paraAfter=body.childNodes[1]}inst.selection.moveToBookmark(b);inst.selection.selectNode(paraAfter,true,true);return true}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){paraAfter.innerHTML=contents.firstChild.innerHTML}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode)}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset)}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();if(tinyMCE.isOpera){rng.insertNode(paraBefore);rng.insertNode(paraAfter)}else{rng.insertNode(paraAfter);rng.insertNode(paraBefore)}paraAfter.normalize();paraBefore.normalize();inst.selection.moveToBookmark(b);inst.selection.selectNode(paraAfter,true,true);return true},_handleBackSpace:function(inst){var r=inst.getRng(),sn=r.startContainer,nv,s=false;if(sn&&sn.nextSibling&&sn.nextSibling.nodeName=="BR"&&sn.parentNode.nodeName!="BODY"){nv=sn.nodeValue;if(nv!=null&&r.startOffset==nv.length)sn.nextSibling.parentNode.removeChild(sn.nextSibling)}if(inst.settings.auto_resize)inst.resizeToContent();return s}};function TinyMCE_Layer(id,bm){this.id=id;this.blockerElement=null;this.events=false;this.element=null;this.blockMode=typeof(bm)!='undefined'?bm:true;this.doc=document};TinyMCE_Layer.prototype={moveRelativeTo:function(re,p){var rep=this.getAbsPosition(re);var w=parseInt(re.offsetWidth);var h=parseInt(re.offsetHeight);var e=this.getElement();var ew=parseInt(e.offsetWidth);var eh=parseInt(e.offsetHeight);var x,y;switch(p){case"tl":x=rep.absLeft;y=rep.absTop;break;case"tr":x=rep.absLeft+w;y=rep.absTop;break;case"bl":x=rep.absLeft;y=rep.absTop+h;break;case"br":x=rep.absLeft+w;y=rep.absTop+h;break;case"cc":x=rep.absLeft+(w/ 2) - (ew /2);y=rep.absTop+(h/ 2) - (eh /2);break}this.moveTo(x,y)},moveBy:function(x,y){var e=this.getElement();this.moveTo(parseInt(e.style.left)+x,parseInt(e.style.top)+y)},moveTo:function(x,y){var e=this.getElement();e.style.left=x+"px";e.style.top=y+"px";this.updateBlocker()},resizeBy:function(w,h){var e=this.getElement();this.resizeTo(parseInt(e.style.width)+w,parseInt(e.style.height)+h)},resizeTo:function(w,h){var e=this.getElement();if(w!=null)e.style.width=w+"px";if(h!=null)e.style.height=h+"px";this.updateBlocker()},show:function(){this.getElement().style.display='block';this.updateBlocker()},hide:function(){this.getElement().style.display='none';this.updateBlocker()},isVisible:function(){return this.getElement().style.display=='block'},getElement:function(){if(!this.element)this.element=this.doc.getElementById(this.id);return this.element},setBlockMode:function(s){this.blockMode=s},updateBlocker:function(){var e,b,x,y,w,h;b=this.getBlocker();if(b){if(this.blockMode){e=this.getElement();x=this.parseInt(e.style.left);y=this.parseInt(e.style.top);w=this.parseInt(e.offsetWidth);h=this.parseInt(e.offsetHeight);b.style.left=x+'px';b.style.top=y+'px';b.style.width=w+'px';b.style.height=h+'px';b.style.display=e.style.display}else b.style.display='none'}},getBlocker:function(){var d,b;if(!this.blockerElement&&this.blockMode){d=this.doc;b=d.getElementById(this.id+"_blocker");if(!b){b=d.createElement("iframe");b.setAttribute('id',this.id+"_blocker");b.style.cssText='display: none; position: absolute; left: 0; top: 0';b.src='javascript:false;';b.frameBorder='0';b.scrolling='no';d.body.appendChild(b)}this.blockerElement=b}return this.blockerElement},getAbsPosition:function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent}return p},create:function(n,c,p,h){var d=this.doc,e=d.createElement(n);e.setAttribute('id',this.id);if(c)e.className=c;if(!p)p=d.body;if(h)e.innerHTML=h;p.appendChild(e);return this.element=e},exists:function(){return this.doc.getElementById(this.id)!=null},parseInt:function(s){if(s==null||s=='')return 0;return parseInt(s)}};function TinyMCE_Menu(){var id;if(typeof(tinyMCE.menuCounter)=="undefined")tinyMCE.menuCounter=0;id="mc_menu_"+tinyMCE.menuCounter++;TinyMCE_Layer.call(this,id,true);this.id=id;this.items=new Array();this.needsUpdate=true};TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(s){var n;this.settings={separator_class:'mceMenuSeparator',title_class:'mceMenuTitle',disabled_class:'mceMenuDisabled',menu_class:'mceMenu',drop_menu:true};for(n in s)this.settings[n]=s[n];this.create('div',this.settings.menu_class)},clear:function(){this.items=new Array()},addTitle:function(t){this.add({type:'title',text:t})},addDisabled:function(t){this.add({type:'disabled',text:t})},addSeparator:function(){this.add({type:'separator'})},addItem:function(t,js){this.add({text:t,js:js})},add:function(mi){this.items[this.items.length]=mi;this.needsUpdate=true},update:function(){var e=this.getElement(),h='',i,t,m=this.items,s=this.settings;if(this.settings.drop_menu)h+='';h+='';for(i=0;i'}h+='
    ';break;case'title':h+='
    '+t+'';break;case'disabled':h+='
    '+t+'';break;default:h+='
    '+t+''}h+='
    ';e.innerHTML=h;this.needsUpdate=false;this.updateBlocker()},show:function(){var nl,i;if(tinyMCE.lastMenu==this)return;if(this.needsUpdate)this.update();if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this)tinyMCE.lastMenu.hide();TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this}});if(!Function.prototype.call){Function.prototype.call=function(){var a=arguments,s=a[0],i,as='',r,o;for(i=1;i1?',':'')+'a['+i+']';o=s._fu;s._fu=this;r=eval('s._fu('+as+')');s._fu=o;return r}};TinyMCE_Engine.prototype.debug=function(){var m="",a,i,l=tinyMCE.log.length;for(i=0,a=this.debug.arguments;i -1) { + // Write main script and patch some things + if ($index == 0) { + TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js"))); + TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;'); + } else + TinyMCE_echo('tinyMCE = realTinyMCE;'); + + // Do init based on index + TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"); + + // Load theme, language pack and theme language packs + if ($theme) { + TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js"))); + TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js"))); + } + + if ($language) + TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js"))); + + // Load all plugins and their language packs + $plugins = explode(",", $plugins); + foreach ($plugins as $plugin) { + $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js"); + $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js"); + + if ($pluginFile) + TinyMCE_echo(file_get_contents($pluginFile)); + + if ($languageFile) + TinyMCE_echo(file_get_contents($languageFile)); + } + + // Reset tinyMCE compressor engine + TinyMCE_echo("tinyMCE = tinyMCECompressed;"); + + // Write to cache + if ($diskCache) { + // Calculate compression ratio and debug target output path + if ($debug) { + $ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0); + TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');"); + } + + $cacheData = gzencode($cacheData, 9, FORCE_GZIP); + + // Write to file if possible + $fp = @fopen($cacheFile, "wb"); + if ($fp) { + fwrite($fp, $cacheData); + fclose($fp); + } + + // Output + header("Content-Encoding: gzip"); + echo $cacheData; + } + + die; +} +?> + +function TinyMCECompressed() { + this.configs = new Array(); + this.loadedFiles = new Array(); + this.loadAdded = false; + this.isLoaded = false; +} + +TinyMCECompressed.prototype.init = function(settings) { + var elements = document.getElementsByTagName('script'); + var scriptURL = ""; + + for (var i=0; i'); + + if (!this.loadAdded) { + tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad); + tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad); + this.loadAdded = true; + } +} + +TinyMCECompressed.prototype.onLoad = function() { + if (tinyMCE.isLoaded) + return true; + + tinyMCE = realTinyMCE; + TinyMCE_Engine.prototype.onLoad(); + tinyMCE._addUnloadEvents(); + tinyMCE.isLoaded = true; +} + +TinyMCECompressed.prototype.addEvent = function(o, n, h) { + if (o.attachEvent) + o.attachEvent("on" + n, h); + else + o.addEventListener(n, h, false); +} + +TinyMCECompressed.prototype.getOnce = function(str) { + var ar = str.split(','); + + for (var i=0; i'); + + if (tinyMCE.getParam("popups_css_add")) { + c = tinyMCE.getParam("popups_css_add"); + + // Is relative + if (c.indexOf('://') == -1 && c.charAt(0) != '/') + c = tinyMCE.documentBasePath + "/" + c; + + document.write(''); + } + + tinyMCE.addEvent(window, "load", this.onLoad); + }, + + onLoad : function() { + var dir, i, elms, body = document.body; + + if (tinyMCE.getWindowArg('mce_replacevariables', true)) + body.innerHTML = tinyMCE.applyTemplate(body.innerHTML, tinyMCE.windowArgs); + + dir = tinyMCE.selectedInstance.settings['directionality']; + if (dir == "rtl" && document.forms && document.forms.length > 0) { + elms = document.forms[0].elements; + for (i=0; i=0; i--) { + if (wrapper.hasChildNodes()) + wrapper.insertBefore(nodes[i].cloneNode(true), wrapper.firstChild); + else + wrapper.appendChild(nodes[i].cloneNode(true)); + + nodes[i].parentNode.removeChild(nodes[i]); + } + + // Add wrapper + doc.body.appendChild(wrapper); + + // Create iframe + iframe = document.createElement("iframe"); + iframe.id = "mcWinIframe"; + iframe.src = document.location.href.toLowerCase().indexOf('https') == -1 ? "about:blank" : tinyMCE.settings['default_document']; + iframe.width = "100%"; + iframe.height = "100%"; + iframe.style.margin = '0'; + + // Add iframe + doc.body.appendChild(iframe); + + // Measure iframe + iframe = document.getElementById('mcWinIframe'); + dx = tinyMCE.getWindowArg('mce_width') - iframe.clientWidth; + dy = tinyMCE.getWindowArg('mce_height') - iframe.clientHeight; + + // Resize window + // tinyMCE.debug(tinyMCE.getWindowArg('mce_width') + "," + tinyMCE.getWindowArg('mce_height') + " - " + dx + "," + dy); + window.resizeBy(dx, dy); + + // Hide iframe and show wrapper + body.style.margin = oldMargin; + iframe.style.display = 'none'; + wrapper.style.display = 'block'; + } + }, + + resizeToContent : function() { + var isMSIE = (navigator.appName == "Microsoft Internet Explorer"); + var isOpera = (navigator.userAgent.indexOf("Opera") != -1); + + if (isOpera) + return; + + if (isMSIE) { + try { window.resizeTo(10, 10); } catch (e) {} + + var elm = document.body; + var width = elm.offsetWidth; + var height = elm.offsetHeight; + var dx = (elm.scrollWidth - width) + 4; + var dy = elm.scrollHeight - height; + + try { window.resizeBy(dx, dy); } catch (e) {} + } else { + window.scrollBy(1000, 1000); + if (window.scrollX > 0 || window.scrollY > 0) { + window.resizeBy(window.innerWidth * 2, window.innerHeight * 2); + window.sizeToContent(); + window.scrollTo(0, 0); + var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0); + var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0); + window.moveTo(x, y); + } + } + }, + + getWindowArg : function(name, default_value) { + return tinyMCE.getWindowArg(name, default_value); + }, + + restoreSelection : function() { + if (this.storeSelection) { + var inst = tinyMCE.selectedInstance; + + inst.getWin().focus(); + + if (inst.selectionBookmark) + inst.selection.moveToBookmark(inst.selectionBookmark); + } + }, + + execCommand : function(command, user_interface, value) { + var inst = tinyMCE.selectedInstance; + + this.restoreSelection(); + inst.execCommand(command, user_interface, value); + + // Store selection + if (this.storeSelection) + inst.selectionBookmark = inst.selection.getBookmark(true); + }, + + close : function() { + tinyMCE.closeWindow(window); + }, + + pickColor : function(e, element_id) { + tinyMCE.selectedInstance.execCommand('mceColorPicker', true, { + element_id : element_id, + document : document, + window : window, + store_selection : false + }); + }, + + openBrowser : function(element_id, type, option) { + var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback")); + var url = document.getElementById(element_id).value; + + tinyMCE.setWindowArg("window", window); + tinyMCE.setWindowArg("document", document); + + // Call to external callback + if (eval('typeof(tinyMCEPopup.windowOpener.' + cb + ')') == "undefined") + alert("Callback function: " + cb + " could not be found."); + else + eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);"); + }, + + importClass : function(c) { + window[c] = function() {}; + + for (var n in window.opener[c].prototype) + window[c].prototype[n] = window.opener[c].prototype[n]; + + window[c].constructor = window.opener[c].constructor; + } + + }; + +// Setup global instance +var tinyMCEPopup = new TinyMCE_Popup(); + +tinyMCEPopup.init(); diff --git a/e107_handlers/tiny_mce/tiny_mce_src.js b/e107_handlers/tiny_mce/tiny_mce_src.js new file mode 100644 index 000000000..ecd78a231 --- /dev/null +++ b/e107_handlers/tiny_mce/tiny_mce_src.js @@ -0,0 +1,7284 @@ + +/* file:jscripts/tiny_mce/classes/TinyMCE_Engine.class.js */ + +function TinyMCE_Engine() { + var ua; + + this.majorVersion = "2"; + this.minorVersion = "0.8"; + this.releaseDate = "2006-10-23"; + + this.instances = new Array(); + this.switchClassCache = new Array(); + this.windowArgs = new Array(); + this.loadedFiles = new Array(); + this.pendingFiles = new Array(); + this.loadingIndex = 0; + this.configs = new Array(); + this.currentConfig = 0; + this.eventHandlers = new Array(); + this.log = new Array(); + this.undoLevels = []; + this.undoIndex = 0; + this.typingUndoIndex = -1; + + // Browser check + ua = navigator.userAgent; + this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); + this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1); + this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1); + this.isMSIE7 = this.isMSIE && (ua.indexOf('MSIE 7') != -1); + this.isGecko = ua.indexOf('Gecko') != -1; + this.isSafari = ua.indexOf('Safari') != -1; + this.isOpera = ua.indexOf('Opera') != -1; + this.isMac = ua.indexOf('Mac') != -1; + this.isNS7 = ua.indexOf('Netscape/7') != -1; + this.isNS71 = ua.indexOf('Netscape/7.1') != -1; + this.dialogCounter = 0; + this.plugins = new Array(); + this.themes = new Array(); + this.menus = new Array(); + this.loadedPlugins = new Array(); + this.buttonMap = new Array(); + this.isLoaded = false; + + // Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those + if (this.isOpera) { + this.isMSIE = true; + this.isGecko = false; + this.isSafari = false; + } + + this.isIE = this.isMSIE; + this.isRealIE = this.isMSIE && !this.isOpera; + + // TinyMCE editor id instance counter + this.idCounter = 0; +}; + +TinyMCE_Engine.prototype = { + init : function(settings) { + var theme, nl, baseHREF = "", i; + + // IE 5.0x is no longer supported since 5.5, 6.0 and 7.0 now exists. We can't support old browsers forever, sorry. + if (this.isMSIE5_0) + return; + + this.settings = settings; + + // Check if valid browser has execcommand support + if (typeof(document.execCommand) == 'undefined') + return; + + // Get script base path + if (!tinyMCE.baseURL) { + var elements = document.getElementsByTagName('script'); + + // If base element found, add that infront of baseURL + nl = document.getElementsByTagName('base'); + for (i=0; i'); + this._def("font_size_classes", ''); + this._def("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large', true); + this._def("event_elements", 'a,img', true); + this._def("convert_urls", true); + this._def("table_inline_editing", false); + this._def("object_resizing", true); + this._def("custom_shortcuts", true); + this._def("convert_on_click", false); + this._def("content_css", ''); + this._def("fix_list_elements", false); + this._def("fix_table_elements", false); + this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml'); + this._def("hidden_tab_class", ''); + this._def("display_tab_class", ''); + this._def("gecko_spellcheck", false); + + // Force strict loading mode to false on non Gecko browsers + if (this.isMSIE && !this.isOpera) + this.settings.strict_loading_mode = false; + + // Browser check IE + if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1) + return; + + // Browser check Gecko + if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1) + return; + + // Browser check Safari + if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1) + return; + + // Browser check Opera + if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1) + return; + + // If not super absolute make it so + baseHREF = tinyMCE.settings['document_base_url']; + var h = document.location.href; + var p = h.indexOf('://'); + if (p > 0 && document.location.protocol != "file:") { + p = h.indexOf('/', p + 3); + h = h.substring(0, p); + + if (baseHREF.indexOf('://') == -1) + baseHREF = h + baseHREF; + + tinyMCE.settings['document_base_url'] = baseHREF; + tinyMCE.settings['document_base_prefix'] = h; + } + + // Trim away query part + if (baseHREF.indexOf('?') != -1) + baseHREF = baseHREF.substring(0, baseHREF.indexOf('?')); + + this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/"; + + theme = this.settings['theme']; + this.inlineStrict = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment'; + this.inlineTransitional = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment'; + this.blockElms = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP'; + this.blockRegExp = new RegExp("^(" + this.blockElms + ")$", "i"); + this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40); + this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL + this.uniqueTag = ''; + this.callbacks = new Array('onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup'); + + // Theme url + this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme; + + if (!tinyMCE.isIE || tinyMCE.isOpera) + this.settings['force_br_newlines'] = false; + + if (tinyMCE.getParam("popups_css", false)) { + var cssPath = tinyMCE.getParam("popups_css", ""); + + // Is relative + if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') + this.settings['popups_css'] = this.documentBasePath + "/" + cssPath; + else + this.settings['popups_css'] = cssPath; + } else + this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css"; + + if (tinyMCE.getParam("editor_css", false)) { + var cssPath = tinyMCE.getParam("editor_css", ""); + + // Is relative + if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') + this.settings['editor_css'] = this.documentBasePath + "/" + cssPath; + else + this.settings['editor_css'] = cssPath; + } else { + if (this.settings.editor_css != '') + this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css"; + } + + if (tinyMCE.settings['debug']) { + var msg = "Debug: \n"; + + msg += "baseURL: " + this.baseURL + "\n"; + msg += "documentBasePath: " + this.documentBasePath + "\n"; + msg += "content_css: " + this.settings['content_css'] + "\n"; + msg += "popups_css: " + this.settings['popups_css'] + "\n"; + msg += "editor_css: " + this.settings['editor_css'] + "\n"; + + alert(msg); + } + + // Only do this once + if (this.configs.length == 0) { + if (typeof(TinyMCECompressed) == "undefined") { + tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad); + + if (tinyMCE.isRealIE) { + if (document.body) + tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad); + else + tinyMCE.addEvent(document, "readystatechange", TinyMCE_Engine.prototype.onLoad); + } + + tinyMCE.addEvent(window, "load", TinyMCE_Engine.prototype.onLoad); + tinyMCE._addUnloadEvents(); + } + } + + this.loadScript(tinyMCE.baseURL + '/themes/' + this.settings['theme'] + '/editor_template' + tinyMCE.srcMode + '.js'); + this.loadScript(tinyMCE.baseURL + '/langs/' + this.settings['language'] + '.js'); + this.loadCSS(this.settings['editor_css']); + + // Add plugins + var p = tinyMCE.getParam('plugins', '', true, ','); + if (p.length > 0) { + for (var i=0; i'); + + this.loadedFiles[this.loadedFiles.length] = url; + }, + + loadNextScript : function() { + var d = document, se; + + if (!tinyMCE.settings.strict_loading_mode) + return; + + if (this.loadingIndex < this.pendingFiles.length) { + se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script'); + se.setAttribute('language', 'javascript'); + se.setAttribute('type', 'text/javascript'); + se.setAttribute('src', this.pendingFiles[this.loadingIndex++]); + + d.getElementsByTagName("head")[0].appendChild(se); + } else + this.loadingIndex = -1; // Done with loading + }, + + loadCSS : function(url) { + var ar = url.replace(/\s+/, '').split(','); + var lflen = 0, csslen = 0; + var skip = false; + var x = 0, i = 0, nl, le; + + for (x = 0,csslen = ar.length; x 0) { + /* Make sure it doesn't exist. */ + for (i=0, lflen=this.loadedFiles.length; i'); + + this.loadedFiles[this.loadedFiles.length] = ar[x]; + } + } + } + }, + + importCSS : function(doc, css) { + var css_ary = css.replace(/\s+/, '').split(','); + var csslen, elm, headArr, x, css_file; + + for (x = 0, csslen = css_ary.length; x 0) { + // Is relative, make absolute + if (css_file.indexOf('://') == -1 && css_file.charAt(0) != '/') + css_file = this.documentBasePath + "/" + css_file; + + if (typeof(doc.createStyleSheet) == "undefined") { + elm = doc.createElement("link"); + + elm.rel = "stylesheet"; + elm.href = css_file; + + if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0) + headArr[0].appendChild(elm); + } else + doc.createStyleSheet(css_file); + } + } + }, + + confirmAdd : function(e, settings) { + var elm = tinyMCE.isIE ? event.srcElement : e.target; + var elementId = elm.name ? elm.name : elm.id; + + tinyMCE.settings = settings; + + if (tinyMCE.settings['convert_on_click'] || (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm']))) + tinyMCE.addMCEControl(elm, elementId); + + elm.setAttribute('mce_noask', 'true'); + }, + + updateContent : function(form_element_name) { + // Find MCE instance linked to given form element and copy it's value + var formElement = document.getElementById(form_element_name); + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(inst)) + continue; + + inst.switchSettings(); + + if (inst.formElement == formElement) { + var doc = inst.getDoc(); + + tinyMCE._setHTML(doc, inst.formElement.value); + + if (!tinyMCE.isIE) + doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid); + } + } + }, + + addMCEControl : function(replace_element, form_element_name, target_document) { + var id = "mce_editor_" + tinyMCE.idCounter++; + var inst = new TinyMCE_Control(tinyMCE.settings); + + inst.editorId = id; + this.instances[id] = inst; + + inst._onAdd(replace_element, form_element_name, target_document); + }, + + removeInstance : function(ti) { + var t = [], n, i; + + // Remove from instances + for (n in tinyMCE.instances) { + i = tinyMCE.instances[n]; + + if (tinyMCE.isInstance(i) && ti != i) + t[n] = i; + } + + tinyMCE.instances = t; + + // Remove from global undo/redo + n = []; + t = tinyMCE.undoLevels; + + for (i=0; i 0) { + tinyMCE.nextUndoRedoAction = 'Undo'; + inst = this.undoLevels[--this.undoIndex]; + inst.select(); + + if (!tinyMCE.nextUndoRedoInstanceId) + inst.execCommand('Undo'); + } + } else + inst.execCommand('Undo'); + return true; + + case "Redo": + if (this.getParam('custom_undo_redo_global')) { + if (this.undoIndex <= this.undoLevels.length - 1) { + tinyMCE.nextUndoRedoAction = 'Redo'; + inst = this.undoLevels[this.undoIndex++]; + inst.select(); + + if (!tinyMCE.nextUndoRedoInstanceId) + inst.execCommand('Redo'); + } + } else + inst.execCommand('Redo'); + + return true; + + case 'mceFocus': + var inst = tinyMCE.getInstanceById(value); + if (inst) + inst.getWin().focus(); + return; + + case "mceAddControl": + case "mceAddEditor": + tinyMCE.addMCEControl(tinyMCE._getElementById(value), value); + return; + + case "mceAddFrameControl": + tinyMCE.addMCEControl(tinyMCE._getElementById(value['element'], value['document']), value['element'], value['document']); + return; + + case "mceRemoveControl": + case "mceRemoveEditor": + tinyMCE.removeMCEControl(value); + return; + + case "mceResetDesignMode": + // Resets the designmode state of the editors in Gecko + if (!tinyMCE.isIE) { + for (var n in tinyMCE.instances) { + if (!tinyMCE.isInstance(tinyMCE.instances[n])) + continue; + + try { + tinyMCE.instances[n].getDoc().designMode = "on"; + } catch (e) { + // Ignore any errors + } + } + } + + return; + } + + if (inst) { + inst.execCommand(command, user_interface, value); + } else if (tinyMCE.settings['focus_alert']) + alert(tinyMCELang['lang_focus_alert']); + }, + + _createIFrame : function(replace_element, doc, win) { + var iframe, id = replace_element.getAttribute("id"); + var aw, ah; + + if (typeof(doc) == "undefined") + doc = document; + + if (typeof(win) == "undefined") + win = window; + + iframe = doc.createElement("iframe"); + + aw = "" + tinyMCE.settings['area_width']; + ah = "" + tinyMCE.settings['area_height']; + + if (aw.indexOf('%') == -1) { + aw = parseInt(aw); + aw = (isNaN(aw) || aw < 0) ? 300 : aw; + aw = aw + "px"; + } + + if (ah.indexOf('%') == -1) { + ah = parseInt(ah); + ah = (isNaN(ah) || ah < 0) ? 240 : ah; + ah = ah + "px"; + } + + iframe.setAttribute("id", id); + iframe.setAttribute("name", id); + iframe.setAttribute("class", "mceEditorIframe"); + iframe.setAttribute("border", "0"); + iframe.setAttribute("frameBorder", "0"); + iframe.setAttribute("marginWidth", "0"); + iframe.setAttribute("marginHeight", "0"); + iframe.setAttribute("leftMargin", "0"); + iframe.setAttribute("topMargin", "0"); + iframe.setAttribute("width", aw); + iframe.setAttribute("height", ah); + iframe.setAttribute("allowtransparency", "true"); + iframe.className = 'mceEditorIframe'; + + if (tinyMCE.settings["auto_resize"]) + iframe.setAttribute("scrolling", "no"); + + // Must have a src element in MSIE HTTPs breaks aswell as absoute URLs + if (tinyMCE.isRealIE) + iframe.setAttribute("src", this.settings['default_document']); + + iframe.style.width = aw; + iframe.style.height = ah; + + // Ugly hack for Gecko problem in strict mode + if (tinyMCE.settings.strict_loading_mode) + iframe.style.marginBottom = '-5px'; + + // MSIE 5.0 issue + if (tinyMCE.isRealIE) + replace_element.outerHTML = iframe.outerHTML; + else + replace_element.parentNode.replaceChild(iframe, replace_element); + + if (tinyMCE.isRealIE) + return win.frames[id]; + else + return iframe; + }, + + setupContent : function(editor_id) { + var inst = tinyMCE.instances[editor_id], i; + var doc = inst.getDoc(); + var head = doc.getElementsByTagName('head').item(0); + var content = inst.startContent; + + // HTML values get XML encoded in strict mode + if (tinyMCE.settings.strict_loading_mode) { + content = content.replace(/</g, '<'); + content = content.replace(/>/g, '>'); + content = content.replace(/"/g, '"'); + content = content.replace(/&/g, '&'); + } + + inst.switchSettings(); + + // Not loaded correctly hit it again, Mozilla bug #997860 + if (!tinyMCE.isIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { + // This part will remove the designMode status + // Failes first time in Firefox 1.5b2 on Mac + try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} + window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); + return; + } + + if (!head) { + window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); + return; + } + + // Import theme specific content CSS the user specific + tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); + tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); + tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); + + // Setup keyboard shortcuts + if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { + inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); + inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); + } + + // BlockFormat shortcuts keys + for (i=1; i<=6; i++) + inst.addShortcut('ctrl', '' + i, '', 'FormatBlock', false, ''); + + inst.addShortcut('ctrl', '7', '', 'FormatBlock', false, '

    '); + inst.addShortcut('ctrl', '8', '', 'FormatBlock', false, '

    '); + inst.addShortcut('ctrl', '9', '', 'FormatBlock', false, '
    '); + + // Add default shortcuts for gecko + if (tinyMCE.isGecko) { + inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); + inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); + inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); + } + + // Setup span styles + if (tinyMCE.getParam("convert_fonts_to_spans")) + inst.getBody().setAttribute('id', 'mceSpanFonts'); + + if (tinyMCE.settings['nowrap']) + doc.body.style.whiteSpace = "nowrap"; + + doc.body.dir = this.settings['directionality']; + doc.editorId = editor_id; + + // Add on document element in Mozilla + if (!tinyMCE.isIE) + doc.documentElement.editorId = editor_id; + + inst.setBaseHREF(tinyMCE.settings['base_href']); + + // Replace new line characters to BRs + if (tinyMCE.settings['convert_newlines_to_brs']) { + content = tinyMCE.regexpReplace(content, "\r\n", "
    ", "gi"); + content = tinyMCE.regexpReplace(content, "\r", "
    ", "gi"); + content = tinyMCE.regexpReplace(content, "\n", "
    ", "gi"); + } + + // Open closed anchors + // content = content.replace(new RegExp('', 'gi'), ''); + + // Call custom cleanup code + content = tinyMCE.storeAwayURLs(content); + content = tinyMCE._customCleanup(inst, "insert_to_editor", content); + + if (tinyMCE.isIE) { + // Ugly!!! + window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); + + if (tinyMCE.settings["force_br_newlines"]) + doc.styleSheets[0].addRule("p", "margin: 0;"); + + var body = inst.getBody(); + body.editorId = editor_id; + } + + content = tinyMCE.cleanupHTMLCode(content); + + // Fix for bug #958637 + if (!tinyMCE.isIE) { + var contentElement = inst.getDoc().createElement("body"); + var doc = inst.getDoc(); + + contentElement.innerHTML = content; + + // Remove weridness! + if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) + content = content.replace(new RegExp('<>', 'g'), ""); + + if (tinyMCE.settings['cleanup_on_startup']) + tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); + else + tinyMCE.setInnerHTML(inst.getBody(), content); + + tinyMCE.convertAllRelativeURLs(inst.getBody()); + } else { + if (tinyMCE.settings['cleanup_on_startup']) { + tinyMCE._setHTML(inst.getDoc(), content); + + // Produces permission denied error in MSIE 5.5 + eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); + } else + tinyMCE._setHTML(inst.getDoc(), content); + } + + // Fix for bug #957681 + //inst.getDoc().designMode = inst.getDoc().designMode; + + // Setup element references + var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); + inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; + + tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); + tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); + + // Re-add design mode on mozilla + if (!tinyMCE.isIE) + tinyMCE.addEventHandlers(inst); + + // Add blur handler + if (tinyMCE.isIE) { + tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); + tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 + + // Workaround for drag drop/copy paste base href bug + if (!tinyMCE.isOpera) { + tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); + tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); + tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); + } + } + + // Trigger node change, this call locks buttons for tables and so forth + inst.select(); + tinyMCE.selectedElement = inst.contentWindow.document.body; + + // Call custom DOM cleanup + tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); + tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); + tinyMCE._setEventsEnabled(inst.getBody(), false); + tinyMCE.cleanupAnchors(inst.getDoc()); + + if (tinyMCE.getParam("convert_fonts_to_spans")) + tinyMCE.convertSpansToFonts(inst.getDoc()); + + inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); + inst.undoRedo.add({ content : inst.startContent }); + + // Cleanup any mess left from storyAwayURLs + if (tinyMCE.isGecko) { + // Remove mce_src from textnodes and comments + tinyMCE.selectNodes(inst.getBody(), function(n) { + if (n.nodeType == 3 || n.nodeType == 8) + n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), ""); + + return false; + }); + } + + // Remove Gecko spellchecking + if (tinyMCE.isGecko) + inst.getBody().spellcheck = tinyMCE.getParam("gecko_spellcheck"); + + // Cleanup any mess left from storyAwayURLs + tinyMCE._removeInternal(inst.getBody()); + + inst.select(); + tinyMCE.triggerNodeChange(false, true); + }, + + storeAwayURLs : function(s) { + // Remove all mce_src, mce_href and replace them with new ones + // s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), ''); + // s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), ''); + + if (!s.match(/(mce_src|mce_href)/gi, s)) { + s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"'); + s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"'); + } + + return s; + }, + + _removeInternal : function(n) { + if (tinyMCE.isGecko) { + // Remove mce_src from textnodes and comments + tinyMCE.selectNodes(n, function(n) { + if (n.nodeType == 3 || n.nodeType == 8) + n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), ""); + + return false; + }); + } + }, + + handleEvent : function(e) { + var inst = tinyMCE.selectedInstance; + + // Remove odd, error + if (typeof(tinyMCE) == "undefined") + return true; + + //tinyMCE.debug(e.type + " " + e.target.nodeName + " " + (e.relatedTarget ? e.relatedTarget.nodeName : "")); + + if (tinyMCE.executeCallback(tinyMCE.selectedInstance, 'handle_event_callback', 'handleEvent', e)) + return false; + + switch (e.type) { + case "beforedeactivate": // Was added due to bug #1439953 + case "blur": + if (tinyMCE.selectedInstance) + tinyMCE.selectedInstance.execCommand('mceEndTyping'); + + tinyMCE.hideMenus(); + + return; + + // Workaround for drag drop/copy paste base href bug + case "drop": + case "beforepaste": + if (tinyMCE.selectedInstance) + tinyMCE.selectedInstance.setBaseHREF(null); + + // Fixes odd MSIE bug where drag/droping elements in a iframe with height 100% breaks + // This logic forces the width/height to be in pixels while the user is drag/dropping + if (tinyMCE.isRealIE) { + var ife = tinyMCE.selectedInstance.iframeElement; + + /*if (ife.style.width.indexOf('%') != -1) { + ife._oldWidth = ife.width.height; + ife.style.width = ife.clientWidth; + }*/ + + if (ife.style.height.indexOf('%') != -1) { + ife._oldHeight = ife.style.height; + ife.style.height = ife.clientHeight; + } + } + + window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();", 1); + return; + + case "submit": + tinyMCE.triggerSave(); + tinyMCE.isNotDirty = true; + return; + + case "reset": + var formObj = tinyMCE.isIE ? window.event.srcElement : e.target; + + for (var i=0; i"); + rng.collapse(false); + rng.select(); + + tinyMCE.execCommand("mceAddUndoLevel"); + tinyMCE.triggerNodeChange(false); + return false; + } + } + + // Backspace or delete + if (e.keyCode == 8 || e.keyCode == 46) { + tinyMCE.selectedElement = e.target; + tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a"); + tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img"); + tinyMCE.triggerNodeChange(false); + } + + return false; + break; + + case "keyup": + case "keydown": + tinyMCE.hideMenus(); + tinyMCE.hasMouseMoved = false; + + if (inst && inst.handleShortcut(e)) + return false; + + if (e.target.editorId) + tinyMCE.instances[e.target.editorId].select(); + + if (tinyMCE.selectedInstance) + tinyMCE.selectedInstance.switchSettings(); + + var inst = tinyMCE.selectedInstance; + + // Handle backspace + if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) { + // Insert P element instead of BR + if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) { + // Cancel event + tinyMCE.execCommand("mceAddUndoLevel"); + e.preventDefault(); + return false; + } + } + + tinyMCE.selectedElement = null; + tinyMCE.selectedNode = null; + var elm = tinyMCE.selectedInstance.getFocusElement(); + tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a"); + tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img"); + tinyMCE.selectedElement = elm; + + // Update visualaids on tabs + if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9) + tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings['visual'], tinyMCE.selectedInstance); + + // Fix empty elements on return/enter, check where enter occured + if (tinyMCE.isIE && e.type == "keydown" && e.keyCode == 13) + tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement(); + + // Fix empty elements on return/enter + if (tinyMCE.isIE && e.type == "keyup" && e.keyCode == 13) { + var elm = tinyMCE.enterKeyElement; + if (elm) { + var re = new RegExp('^HR|IMG|BR$','g'); // Skip these + var dre = new RegExp('^H[1-6]$','g'); // Add double on these + + if (!elm.hasChildNodes() && !re.test(elm.nodeName)) { + if (dre.test(elm.nodeName)) + elm.innerHTML = "  "; + else + elm.innerHTML = " "; + } + } + } + + // Check if it's a position key + var keys = tinyMCE.posKeyCodes; + var posKey = false; + for (var i=0; i'; + h += ''; + h += ''; + } else { + // Normal button + h += ''; + h += ''; + h += ''; + } + + return h; + }, + + getMenuButtonHTML : function(id, lang, img, mcmd, cmd, ui, val) { + var h = '', m, x; + + mcmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + mcmd + '\');'; + cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\''; + + if (typeof(ui) != "undefined" && ui != null) + cmd += ',' + ui; + + if (typeof(val) != "undefined" && val != null) + cmd += ",'" + val + "'"; + + cmd += ');'; + + // Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled + if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isIE || tinyMCE.isOpera) && (m = tinyMCE.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) { + x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20); + + if (tinyMCE.isRealIE) + h += ''; + else + h += ''; + + h += ''; + h += ''; + h += ''; + h += ''; + } else { + if (tinyMCE.isRealIE) + h += ''; + else + h += ''; + + h += ''; + h += ''; + h += ''; + h += ''; + } + + return h; + }, + + _menuButtonEvent : function(e, o) { + if (o.className == 'mceMenuButtonFocus') + return; + + if (e == 'over') + o.className = o.className + ' mceMenuHover'; + else + o.className = o.className.replace(/\s.*$/, ''); + }, + + addButtonMap : function(m) { + var i, a = m.replace(/\s+/, '').split(','); + + for (i=0; i 0); + + if (tinyMCE.settings['custom_undo_redo']) { + undoIndex = inst.undoRedo.undoIndex; + undoLevels = inst.undoRedo.undoLevels.length; + } + + tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content); + } + + if (this.selectedInstance && (typeof(focus) == "undefined" || focus)) + this.selectedInstance.contentWindow.focus(); + }, + + _customCleanup : function(inst, type, content) { + var pl, po, i; + + // Call custom cleanup + var customCleanup = tinyMCE.settings['cleanup_callback']; + if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined") + content = eval(customCleanup + "(type, content, inst);"); + + // Trigger theme cleanup + po = tinyMCE.themes[tinyMCE.settings['theme']]; + if (po && po.cleanup) + content = po.cleanup(type, content, inst); + + // Trigger plugin cleanups + pl = inst.plugins; + for (i=0; i 0) + className += " "; + + className += classNames[i]; + } + + return className; + }, + + handleVisualAid : function(el, deep, state, inst, skip_dispatch) { + if (!el) + return; + + if (!skip_dispatch) + tinyMCE.dispatchCallback(inst, 'handle_visual_aid_callback', 'handleVisualAid', el, deep, state, inst); + + var tableElement = null; + + switch (el.nodeName) { + case "TABLE": + var oldW = el.style.width; + var oldH = el.style.height; + var bo = tinyMCE.getAttrib(el, "border"); + + bo = bo == "" || bo == "0" ? true : false; + + tinyMCE.setAttrib(el, "class", tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el, "class"), state && bo)); + + el.style.width = oldW; + el.style.height = oldH; + + for (var y=0; y<\/o:p>", "
    "); + html = tinyMCE.regexpReplace(html, " <\/o:p>", ""); + html = tinyMCE.regexpReplace(html, "", ""); + html = tinyMCE.regexpReplace(html, "

    <\/p>", ""); + html = tinyMCE.regexpReplace(html, "

    <\/p>\r\n

    <\/p>", ""); + html = tinyMCE.regexpReplace(html, "

     <\/p>", "
    "); + html = tinyMCE.regexpReplace(html, "

    \s*(

    \s*)?", "

    "); + html = tinyMCE.regexpReplace(html, "<\/p>\s*(<\/p>\s*)?", "

    "); + }*/ + + // Always set the htmlText output + tinyMCE.setInnerHTML(doc.body, html); + } + + tinyMCE.cleanupAnchors(doc); + + if (tinyMCE.getParam("convert_fonts_to_spans")) + tinyMCE.convertSpansToFonts(doc); + }, + + getEditorId : function(form_element) { + var inst = this.getInstanceById(form_element); + if (!inst) + return null; + + return inst.editorId; + }, + + getInstanceById : function(editor_id) { + var inst = this.instances[editor_id]; + if (!inst) { + for (var n in tinyMCE.instances) { + var instance = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(instance)) + continue; + + if (instance.formTargetElementId == editor_id) { + inst = instance; + break; + } + } + } + + return inst; + }, + + queryInstanceCommandValue : function(editor_id, command) { + var inst = tinyMCE.getInstanceById(editor_id); + if (inst) + return inst.queryCommandValue(command); + + return false; + }, + + queryInstanceCommandState : function(editor_id, command) { + var inst = tinyMCE.getInstanceById(editor_id); + if (inst) + return inst.queryCommandState(command); + + return null; + }, + + setWindowArg : function(n, v) { + this.windowArgs[n] = v; + }, + + getWindowArg : function(n, d) { + return (typeof(this.windowArgs[n]) == "undefined") ? d : this.windowArgs[n]; + }, + + getCSSClasses : function(editor_id, doc) { + var output = new Array(); + + // Is cached, use that + if (typeof(tinyMCE.cssClasses) != "undefined") + return tinyMCE.cssClasses; + + if (typeof(editor_id) == "undefined" && typeof(doc) == "undefined") { + var instance; + + for (var instanceName in tinyMCE.instances) { + instance = tinyMCE.instances[instanceName]; + if (!tinyMCE.isInstance(instance)) + continue; + + break; + } + + doc = instance.getDoc(); + } + + if (typeof(doc) == "undefined") { + var instance = tinyMCE.getInstanceById(editor_id); + doc = instance.getDoc(); + } + + if (doc) { + var styles = doc.styleSheets; + + if (styles && styles.length > 0) { + for (var x=0; x 0) + tinyMCE.cssClasses = output; + + return output; + }, + + regexpReplace : function(in_str, reg_exp, replace_str, opts) { + if (in_str == null) + return in_str; + + if (typeof(opts) == "undefined") + opts = 'g'; + + var re = new RegExp(reg_exp, opts); + return in_str.replace(re, replace_str); + }, + + trim : function(s) { + return s.replace(/^\s*|\s*$/g, ""); + }, + + cleanupEventStr : function(s) { + s = "" + s; + s = s.replace('function anonymous()\n{\n', ''); + s = s.replace('\n}', ''); + s = s.replace(/^return true;/gi, ''); // Remove event blocker + + return s; + }, + + getControlHTML : function(c) { + var i, l, n, o, v; + + l = tinyMCE.plugins; + for (n in l) { + o = l[n]; + + if (o.getControlHTML && (v = o.getControlHTML(c)) != '') + return tinyMCE.replaceVar(v, "pluginurl", o.baseURL); + } + + o = tinyMCE.themes[tinyMCE.settings['theme']]; + if (o.getControlHTML && (v = o.getControlHTML(c)) != '') + return v; + + return ''; + }, + + evalFunc : function(f, idx, a, o) { + var s = '(', i; + + for (i=idx; i 0) + return true; + + if (ins != null) { + for (i=0, l = ins.plugins; i 0) + return true; + } + } + + l = tinyMCE.themes; + for (on in l) { + o = l[on]; + + if (o[n] && (v = tinyMCE.evalFunc(n, 3, a, o)) == s && m > 0) + return true; + } + + return false; + }, + + xmlEncode : function(s) { + return s ? ('' + s).replace(new RegExp('[<>&"\']', 'g'), function (c, b) { + switch (c) { + case '&': + return '&'; + + case '"': + return '"'; + + case '\'': + return '''; // ' is not working in MSIE + + case '<': + return '<'; + + case '>': + return '>'; + } + + return c; + }) : s; + }, + + extend : function(p, np) { + var o = {}; + + o.parent = p; + + for (n in p) + o[n] = p[n]; + + for (n in np) + o[n] = np[n]; + + return o; + }, + + hideMenus : function() { + var e = tinyMCE.lastSelectedMenuBtn; + + if (tinyMCE.lastMenu) { + tinyMCE.lastMenu.hide(); + tinyMCE.lastMenu = null; + } + + if (e) { + tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass); + tinyMCE.lastSelectedMenuBtn = null; + } + } + + }; + +// Global instances +var TinyMCE = TinyMCE_Engine; // Compatiblity with gzip compressors +var tinyMCE = new TinyMCE_Engine(); +var tinyMCELang = {}; + +/* file:jscripts/tiny_mce/classes/TinyMCE_Control.class.js */ + +function TinyMCE_Control(settings) { + var t, i, to, fu, p, x, fn, fu, pn, s = settings; + + this.undoRedoLevel = true; + this.isTinyMCE_Control = true; + + // Default settings + this.settings = s; + this.settings['theme'] = tinyMCE.getParam("theme", "default"); + this.settings['width'] = tinyMCE.getParam("width", -1); + this.settings['height'] = tinyMCE.getParam("height", -1); + this.selection = new TinyMCE_Selection(this); + this.undoRedo = new TinyMCE_UndoRedo(this); + this.cleanup = new TinyMCE_Cleanup(); + this.shortcuts = new Array(); + this.hasMouseMoved = false; + this.foreColor = this.backColor = "#999999"; + this.data = {}; + + this.cleanup.init({ + valid_elements : s.valid_elements, + extended_valid_elements : s.extended_valid_elements, + valid_child_elements : s.valid_child_elements, + entities : s.entities, + entity_encoding : s.entity_encoding, + debug : s.cleanup_debug, + url_converter : 'TinyMCE_Cleanup.prototype._urlConverter', + indent : s.apply_source_formatting, + invalid_elements : s.invalid_elements, + verify_html : s.verify_html, + fix_content_duplication : s.fix_content_duplication + }); + + // Wrap old theme + t = this.settings['theme']; + if (!tinyMCE.hasTheme(t)) { + fn = tinyMCE.callbacks; + to = {}; + + for (i=0; i 0) { + for (i=0; i 1 && tinyMCE.currentConfig != this.settings['index']) { + tinyMCE.settings = this.settings; + tinyMCE.currentConfig = this.settings['index']; + } + }, + + select : function() { + var oldInst = tinyMCE.selectedInstance; + + if (oldInst != this) { + if (oldInst) + oldInst.execCommand('mceEndTyping'); + + tinyMCE.dispatchCallback(this, 'select_instance_callback', 'selectInstance', this, oldInst); + tinyMCE.selectedInstance = this; + } + }, + + getBody : function() { + return this.contentBody ? this.contentBody : this.getDoc().body; + }, + + getDoc : function() { +// return this.contentDocument ? this.contentDocument : this.contentWindow.document; // Removed due to IE 5.5 ? + return this.contentWindow.document; + }, + + getWin : function() { + return this.contentWindow; + }, + + getContainerWin : function() { + return this.containerWindow ? this.containerWindow : window; + }, + + getViewPort : function() { + return tinyMCE.getViewPort(this.getWin()); + }, + + getParentNode : function(n, f) { + return tinyMCE.getParentNode(n, f, this.getBody()); + }, + + getParentElement : function(n, na, f) { + return tinyMCE.getParentElement(n, na, f, this.getBody()); + }, + + getParentBlockElement : function(n) { + return tinyMCE.getParentBlockElement(n, this.getBody()); + }, + + resizeToContent : function() { + var d = this.getDoc(), b = d.body, de = d.documentElement; + + this.iframeElement.style.height = (tinyMCE.isRealIE) ? b.scrollHeight : de.offsetHeight + 'px'; + }, + + addShortcut : function(m, k, d, cmd, ui, va) { + var n = typeof(k) == "number", ie = tinyMCE.isIE, c, sc, i, scl = this.shortcuts; + + if (!tinyMCE.getParam('custom_shortcuts')) + return false; + + m = m.toLowerCase(); + k = ie && !n ? k.toUpperCase() : k; + c = n ? null : k.charCodeAt(0); + d = d && d.indexOf('lang_') == 0 ? tinyMCE.getLang(d) : d; + + sc = { + alt : m.indexOf('alt') != -1, + ctrl : m.indexOf('ctrl') != -1, + shift : m.indexOf('shift') != -1, + charCode : c, + keyCode : n ? k : (ie ? c : null), + desc : d, + cmd : cmd, + ui : ui, + val : va + }; + + for (i=0; i 0) + rng.pasteHTML('
    ' + rng.htmlText + "
    "); + + tinyMCE.triggerNodeChange(); + return; + } + } + } + + switch (command) { + case "mceRepaint": + this.repaint(); + return true; + + case "unlink": + // Unlink if caret is inside link + if (tinyMCE.isGecko && this.getSel().isCollapsed) { + focusElm = tinyMCE.getParentElement(focusElm, 'A'); + + if (focusElm) + this.selection.selectNode(focusElm, false); + } + + this.getDoc().execCommand(command, user_interface, value); + + tinyMCE.isGecko && this.getSel().collapseToEnd(); + + tinyMCE.triggerNodeChange(); + + return true; + + case "FormatBlock": + if (!this.cleanup.isValid(value)) + return true; + + this.getDoc().execCommand(command, user_interface, value); + tinyMCE.triggerNodeChange(); + break; + + case "InsertUnorderedList": + case "InsertOrderedList": + this.getDoc().execCommand(command, user_interface, value); + tinyMCE.triggerNodeChange(); + break; + + case "Strikethrough": + this.getDoc().execCommand(command, user_interface, value); + tinyMCE.triggerNodeChange(); + break; + + case "mceSelectNode": + this.selection.selectNode(value); + tinyMCE.triggerNodeChange(); + tinyMCE.selectedNode = value; + break; + + case "FormatBlock": + if (value == null || value == "") { + var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp"); + + if (elm) + this.execCommand("mceRemoveNode", false, elm); + } else { + if (tinyMCE.isGecko && new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>', 'gi').test(value)) + value = value.replace(/[^a-z]/gi, ''); + + if (tinyMCE.isIE && new RegExp('blockquote|code|samp', 'gi').test(value)) { + var b = this.selection.getBookmark(); + this.getDoc().execCommand("FormatBlock", false, '

    '); + tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value); + this.selection.moveToBookmark(b); + } else + this.getDoc().execCommand("FormatBlock", false, value); + } + + tinyMCE.triggerNodeChange(); + + break; + + case "mceRemoveNode": + if (!value) + value = tinyMCE.getParentElement(this.getFocusElement()); + + if (tinyMCE.isIE) { + value.outerHTML = value.innerHTML; + } else { + var rng = value.ownerDocument.createRange(); + rng.setStartBefore(value); + rng.setEndAfter(value); + rng.deleteContents(); + rng.insertNode(rng.createContextualFragment(value.innerHTML)); + } + + tinyMCE.triggerNodeChange(); + + break; + + case "mceSelectNodeDepth": + var parentNode = this.getFocusElement(); + for (var i=0; parentNode; i++) { + if (parentNode.nodeName.toLowerCase() == "body") + break; + + if (parentNode.nodeName.toLowerCase() == "#text") { + i--; + parentNode = parentNode.parentNode; + continue; + } + + if (i == value) { + this.selection.selectNode(parentNode, false); + tinyMCE.triggerNodeChange(); + tinyMCE.selectedNode = parentNode; + return; + } + + parentNode = parentNode.parentNode; + } + + break; + + case "SetStyleInfo": + var rng = this.getRng(); + var sel = this.getSel(); + var scmd = value['command']; + var sname = value['name']; + var svalue = value['value'] == null ? '' : value['value']; + //var svalue = value['value'] == null ? '' : value['value']; + var wrapper = value['wrapper'] ? value['wrapper'] : "span"; + var parentElm = null; + var invalidRe = new RegExp("^BODY|HTML$", "g"); + var invalidParentsRe = tinyMCE.settings['merge_styles_invalid_parents'] != '' ? new RegExp(tinyMCE.settings['merge_styles_invalid_parents'], "gi") : null; + + // Whole element selected check + if (tinyMCE.isIE) { + // Control range + if (rng.item) + parentElm = rng.item(0); + else { + var pelm = rng.parentElement(); + var prng = doc.selection.createRange(); + prng.moveToElementText(pelm); + + if (rng.htmlText == prng.htmlText || rng.boundingWidth == 0) { + if (invalidParentsRe == null || !invalidParentsRe.test(pelm.nodeName)) + parentElm = pelm; + } + } + } else { + var felm = this.getFocusElement(); + if (sel.isCollapsed || (new RegExp('td|tr|tbody|table', 'gi').test(felm.nodeName) && sel.anchorNode == felm.parentNode)) + parentElm = felm; + } + + // Whole element selected + if (parentElm && !invalidRe.test(parentElm.nodeName)) { + if (scmd == "setstyle") + tinyMCE.setStyleAttrib(parentElm, sname, svalue); + + if (scmd == "setattrib") + tinyMCE.setAttrib(parentElm, sname, svalue); + + if (scmd == "removeformat") { + parentElm.style.cssText = ''; + tinyMCE.setAttrib(parentElm, 'class', ''); + } + + // Remove style/attribs from all children + var ch = tinyMCE.getNodeTree(parentElm, new Array(), 1); + for (var z=0; z=0; i--) { + var elm = nodes[i]; + var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true"; + + elm.removeAttribute("mce_new"); + + // Is only child a element + if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) { + //tinyMCE.debug("merge1" + isNew); + this._mergeElements(scmd, elm, elm.childNodes[0], isNew); + continue; + } + + // Is I the only child + if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) { + //tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName); + if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName)) + this._mergeElements(scmd, elm.parentNode, elm, false); + } + } + + // Remove empty wrappers + var nodes = doc.getElementsByTagName(wrapper); + for (var i=nodes.length-1; i>=0; i--) { + var elm = nodes[i]; + var isEmpty = true; + + // Check if it has any attribs + var tmp = doc.createElement("body"); + tmp.appendChild(elm.cloneNode(false)); + + // Is empty span, remove it + tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), ''); + //tinyMCE.debug(tmp.innerHTML); + if (new RegExp('', 'gi').test(tmp.innerHTML)) { + for (var x=0; x 0) { + value = tinyMCE.replaceVar(value, "selection", selectedText); + tinyMCE.execCommand('mceInsertContent', false, value); + } + + tinyMCE.triggerNodeChange(); + break; + + case "mceSetAttribute": + if (typeof(value) == 'object') { + var targetElms = (typeof(value['targets']) == "undefined") ? "p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address" : value['targets']; + var targetNode = tinyMCE.getParentElement(this.getFocusElement(), targetElms); + + if (targetNode) { + targetNode.setAttribute(value['name'], value['value']); + tinyMCE.triggerNodeChange(); + } + } + break; + + case "mceSetCSSClass": + this.execCommand("SetStyleInfo", false, {command : "setattrib", name : "class", value : value}); + break; + + case "mceInsertRawHTML": + var key = 'tiny_mce_marker'; + + this.execCommand('mceBeginUndoLevel'); + + // Insert marker key + this.execCommand('mceInsertContent', false, key); + + // Store away scroll pos + var scrollX = this.getBody().scrollLeft + this.getDoc().documentElement.scrollLeft; + var scrollY = this.getBody().scrollTop + this.getDoc().documentElement.scrollTop; + + // Find marker and replace with RAW HTML + var html = this.getBody().innerHTML; + if ((pos = html.indexOf(key)) != -1) + tinyMCE.setInnerHTML(this.getBody(), html.substring(0, pos) + value + html.substring(pos + key.length)); + + // Restore scoll pos + this.contentWindow.scrollTo(scrollX, scrollY); + + this.execCommand('mceEndUndoLevel'); + + break; + + case "mceInsertContent": + // Force empty string + if (!value) + value = ''; + + var insertHTMLFailed = false; + + // Removed since it produced problems in IE + // this.getWin().focus(); + + if (tinyMCE.isGecko || tinyMCE.isOpera) { + try { + // Is plain text or HTML, &,   etc will be encoded wrong in FF + if (value.indexOf('<') == -1 && !value.match(/(&| |<|>)/g)) { + var r = this.getRng(); + var n = this.getDoc().createTextNode(tinyMCE.entityDecode(value)); + var s = this.getSel(); + var r2 = r.cloneRange(); + + // Insert text at cursor position + s.removeAllRanges(); + r.deleteContents(); + r.insertNode(n); + + // Move the cursor to the end of text + r2.selectNode(n); + r2.collapse(false); + s.removeAllRanges(); + s.addRange(r2); + } else { + value = tinyMCE.fixGeckoBaseHREFBug(1, this.getDoc(), value); + this.getDoc().execCommand('inserthtml', false, value); + tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value); + } + } catch (ex) { + insertHTMLFailed = true; + } + + if (!insertHTMLFailed) { + tinyMCE.triggerNodeChange(); + return; + } + } + + if (!tinyMCE.isIE) { + var isHTML = value.indexOf('<') != -1; + var sel = this.getSel(); + var rng = this.getRng(); + + if (isHTML) { + if (tinyMCE.isSafari) { + var tmpRng = this.getDoc().createRange(); + + tmpRng.setStart(this.getBody(), 0); + tmpRng.setEnd(this.getBody(), 0); + + value = tmpRng.createContextualFragment(value); + } else + value = rng.createContextualFragment(value); + } else { + // Setup text node + var el = document.createElement("div"); + el.innerHTML = value; + value = el.firstChild.nodeValue; + value = doc.createTextNode(value); + } + + // Insert plain text in Safari + if (tinyMCE.isSafari && !isHTML) { + this.execCommand('InsertText', false, value.nodeValue); + tinyMCE.triggerNodeChange(); + return true; + } else if (tinyMCE.isSafari && isHTML) { + rng.deleteContents(); + rng.insertNode(value); + tinyMCE.triggerNodeChange(); + return true; + } + + rng.deleteContents(); + + // If target node is text do special treatment, (Mozilla 1.3 fix) + if (rng.startContainer.nodeType == 3) { + var node = rng.startContainer.splitText(rng.startOffset); + node.parentNode.insertBefore(value, node); + } else + rng.insertNode(value); + + if (!isHTML) { + // Removes weird selection trails + sel.selectAllChildren(doc.body); + sel.removeAllRanges(); + + // Move cursor to end of content + var rng = doc.createRange(); + + rng.selectNode(value); + rng.collapse(false); + + sel.addRange(rng); + } else + rng.collapse(false); + + tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value); + } else { + var rng = doc.selection.createRange(), tmpRng = null; + var c = value.indexOf('"; + } + + if (hc) { + cn = n.childNodes; + + for (i=0, l=cn.length; i'; + + return h; + }, + + _serializeAttribute : function(n, r, an) { + var av = '', t, os = this.settings.on_save; + + if (os && (an.indexOf('mce_') == 0 || an.indexOf('_moz') == 0)) + return ''; + + if (os && this.mceAttribs[an]) + av = this._getAttrib(n, this.mceAttribs[an]); + + if (av.length == 0) + av = this._getAttrib(n, an); + + if (av.length == 0 && r.defaultAttribs && (t = r.defaultAttribs[an])) { + av = t; + + if (av == "mce_empty") + return " " + an + '=""'; + } + + if (r.forceAttribs && (t = r.forceAttribs[an])) + av = t; + + if (os && av.length != 0 && this.settings.url_converter.length != 0 && /^(src|href|longdesc)$/.test(an)) + av = eval(this.settings.url_converter + '(this, n, av)'); + + if (av.length != 0 && r.validAttribValues && r.validAttribValues[an] && !r.validAttribValues[an].test(av)) + return ""; + + if (av.length != 0 && av == "{$uid}") + av = "uid_" + (this.idCount++); + + if (av.length != 0) { + if (an.indexOf('on') != 0) + av = this.xmlEncode(av); + + return " " + an + "=" + '"' + av + '"'; + } + + return ""; + }, + + formatHTML : function(h) { + var s = this.settings, p = '', i = 0, li = 0, o = '', l; + + // Replace BR in pre elements to \n + h = h.replace(/]*)>(.*?)<\/pre>/gi, function (a, b, c) { + c = c.replace(//gi, '\n'); + return '' + c + ''; + }); + + h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :) + h = '\n' + h; + h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting + h = h.replace(this.nlBeforeRe, '\n<$1$2>'); + h = h.replace(this.nlAfterRe, '<$1$2>\n'); + h = h.replace(this.nlBeforeAfterRe, '\n<$1$2$3>\n'); + h += '\n'; + + //tinyMCE.debug(h); + + while ((i = h.indexOf('\n', i + 1)) != -1) { + if ((l = h.substring(li + 1, i)).length != 0) { + if (this.ouRe.test(l) && p.length >= s.indent_levels) + p = p.substring(s.indent_levels); + + o += p + l + '\n'; + + if (this.inRe.test(l)) + p += this.inStr; + } + + li = i; + } + + //tinyMCE.debug(h); + + return o; + }, + + xmlEncode : function(s) { + var cl = this; + + this._setupEntities(); // Will intialize lookup table + + switch (this.settings.entity_encoding) { + case "raw": + return tinyMCE.xmlEncode(s); + + case "named": + return s.replace(new RegExp('[\u007F-\uFFFF<>&"\']', 'g'), function (c, b) { + b = cl.entities[c.charCodeAt(0)]; + + return b ? '&' + b + ';' : c; + }); + + case "numeric": + return s.replace(new RegExp('[\u007F-\uFFFF<>&"\']', 'g'), function (c, b) { + return b ? '&#' + c.charCodeAt(0) + ';' : c; + }); + } + + return s; + }, + + split : function(re, s) { + var c = s.split(re); + var i, l, o = new Array(); + + for (i=0, l=c.length; i' : '>' + h + ''; + + return o; +}; + +TinyMCE_Engine.prototype.createTag = function(d, tn, a, h) { + var o = d.createElement(tn); + + if (a) { + for (n in a) { + if (typeof(a[n]) != 'function' && a[n] != null) + tinyMCE.setAttrib(o, n, a[n]); + } + } + + if (h) + o.innerHTML = h; + + return o; +}; + +TinyMCE_Engine.prototype.getElementByAttributeValue = function(n, e, a, v) { + return (n = this.getElementsByAttributeValue(n, e, a, v)).length == 0 ? null : n[0]; +}; + +TinyMCE_Engine.prototype.getElementsByAttributeValue = function(n, e, a, v) { + var i, nl = n.getElementsByTagName(e), o = new Array(); + + for (i=0; i/gi, ''); + h = h.replace(/<\/em>/gi, ''); + } + + if (tinyMCE.isRealIE) { + // Since MSIE handles invalid HTML better that valid XHTML we + // need to make some things invalid.


    gets converted to
    . + h = h.replace(/\s\/>/g, '>'); + + // Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones + h = h.replace(/]*)>\u00A0?<\/p>/gi, ' 

    '); // Keep empty paragraphs + h = h.replace(/]*)>\s* \s*<\/p>/gi, ' 

    '); // Keep empty paragraphs + h = h.replace(/]*)>\s+<\/p>/gi, ' 

    '); // Keep empty paragraphs + + // Remove first comment + e.innerHTML = tinyMCE.uniqueTag + h; + e.firstChild.removeNode(true); + + // Remove weird auto generated empty paragraphs unless it's supposed to be there + nl = e.getElementsByTagName("p"); + for (i=nl.length-1; i>=0; i--) { + n = nl[i]; + + if (n.nodeName == 'P' && !n.hasChildNodes() && !n.mce_keep) + n.parentNode.removeChild(n); + } + } else { + h = this.fixGeckoBaseHREFBug(1, e, h); + e.innerHTML = h; + this.fixGeckoBaseHREFBug(2, e, h); + } +}; + +TinyMCE_Engine.prototype.getOuterHTML = function(e) { + if (tinyMCE.isIE) + return e.outerHTML; + + var d = e.ownerDocument.createElement("body"); + d.appendChild(e.cloneNode(true)); + return d.innerHTML; +}; + +TinyMCE_Engine.prototype.setOuterHTML = function(e, h, d) { + var d = typeof(d) == "undefined" ? e.ownerDocument : d, i, nl, t; + + if (tinyMCE.isIE && e.nodeType == 1) + e.outerHTML = h; + else { + t = d.createElement("body"); + t.innerHTML = h; + + for (i=0, nl=t.childNodes; i-1; i--) { + if (ar[i].specified && ar[i].nodeValue) + ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue); + } + + ar = e.childNodes; + for (i=0; i= strTok2.length) { + for (var i=0; i= strTok2.length || strTok1[i] != strTok2[i]) { + breakPoint = i + 1; + break; + } + } + } + + if (strTok1.length < strTok2.length) { + for (var i=0; i= strTok1.length || strTok1[i] != strTok2[i]) { + breakPoint = i + 1; + break; + } + } + } + + if (breakPoint == 1) + return targetURL.path; + + for (var i=0; i<(strTok1.length-(breakPoint-1)); i++) + outPath += "../"; + + for (var i=breakPoint-1; i=0; i--) { + if (baseURLParts[i].length == 0) + continue; + + newBaseURLParts[newBaseURLParts.length] = baseURLParts[i]; + } + baseURLParts = newBaseURLParts.reverse(); + + // Merge relURLParts chunks + var newRelURLParts = new Array(); + var numBack = 0; + for (var i=relURLParts.length-1; i>=0; i--) { + if (relURLParts[i].length == 0 || relURLParts[i] == ".") + continue; + + if (relURLParts[i] == '..') { + numBack++; + continue; + } + + if (numBack > 0) { + numBack--; + continue; + } + + newRelURLParts[newRelURLParts.length] = relURLParts[i]; + } + + relURLParts = newRelURLParts.reverse(); + + // Remove end from absolute path + var len = baseURLParts.length-numBack; + var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/'); + var start = "", end = ""; + + // Build output URL + relURL.protocol = baseURL.protocol; + relURL.host = baseURL.host; + relURL.port = baseURL.port; + + // Re-add trailing slash if it's removed + if (relURL.path.charAt(relURL.path.length-1) == "/") + absPath += "/"; + + relURL.path = absPath; + + return this.serializeURL(relURL); +}; + +TinyMCE_Engine.prototype.convertURL = function(url, node, on_save) { + var prot = document.location.protocol; + var host = document.location.hostname; + var port = document.location.port; + + // Pass through file protocol + if (prot == "file:") + return url; + + // Something is wrong, remove weirdness + url = tinyMCE.regexpReplace(url, '(http|https):///', '/'); + + // Mailto link or anchor (Pass through) + if (url.indexOf('mailto:') != -1 || url.indexOf('javascript:') != -1 || tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0) == "#") + return url; + + // Fix relative/Mozilla + if (!tinyMCE.isIE && !on_save && url.indexOf("://") == -1 && url.charAt(0) != '/') + return tinyMCE.settings['base_href'] + url; + + // Handle relative URLs + if (on_save && tinyMCE.getParam('relative_urls')) { + var curl = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url); + if (curl.charAt(0) == '/') + curl = tinyMCE.settings['document_base_prefix'] + curl; + + var urlParts = tinyMCE.parseURL(curl); + var tmpUrlParts = tinyMCE.parseURL(tinyMCE.settings['document_base_url']); + + // Force relative + if (urlParts['host'] == tmpUrlParts['host'] && (urlParts['port'] == tmpUrlParts['port'])) + return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'], curl); + } + + // Handle absolute URLs + if (!tinyMCE.getParam('relative_urls')) { + var urlParts = tinyMCE.parseURL(url); + var baseUrlParts = tinyMCE.parseURL(tinyMCE.settings['base_href']); + + // Force absolute URLs from relative URLs + url = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url); + + // If anchor and path is the same page + if (urlParts['anchor'] && urlParts['path'] == baseUrlParts['path']) + return "#" + urlParts['anchor']; + } + + // Remove current domain + if (tinyMCE.getParam('remove_script_host')) { + var start = "", portPart = ""; + + if (port != "") + portPart = ":" + port; + + start = prot + "//" + host + portPart + "/"; + + if (url.indexOf(start) == 0) + url = url.substring(start.length-1); + } + + return url; +}; + +TinyMCE_Engine.prototype.convertAllRelativeURLs = function(body) { + var i, elms, src, href, mhref, msrc; + + // Convert all image URL:s to absolute URL + elms = body.getElementsByTagName("img"); + for (i=0; i bookmark.index) { + try { + rng.addElement(nl[bookmark.index]); + } catch (ex) { + // Might be thrown if the node no longer exists + } + } + } else { + // Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs + try { + // Incorrect bookmark + if (bookmark.start < 0) + return true; + + rng = inst.getSel().createRange(); + rng.moveToElementText(inst.getBody()); + rng.collapse(true); + rng.moveStart('character', bookmark.start); + rng.moveEnd('character', bookmark.length); + } catch (ex) { + return true; + } + } + + rng.select(); + + win.scrollTo(bookmark.scrollX, bookmark.scrollY); + return true; + } + + if (tinyMCE.isGecko || tinyMCE.isOpera) { + if (bookmark.rng) { + sel.removeAllRanges(); + sel.addRange(bookmark.rng); + } + + if (bookmark.start != -1 && bookmark.end != -1) { + try { + sd = this._getTextPos(b, bookmark.start, bookmark.end); + rng = doc.createRange(); + rng.setStart(sd.startNode, sd.startOffset); + rng.setEnd(sd.endNode, sd.endOffset); + sel.removeAllRanges(); + sel.addRange(rng); + win.focus(); + } catch (ex) { + // Ignore + } + } + + /* + if (typeof(bookmark.index) != 'undefined') { + tinyMCE.selectElements(b, 'IMG', function (n) { + if (bookmark.index-- == 0) { + // Select image in Gecko here + } + + return false; + }); + } + */ + + win.scrollTo(bookmark.scrollX, bookmark.scrollY); + return true; + } + + return false; + }, + + _getPosText : function(r, sn, en) { + var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}; + + while ((n = w.nextNode()) != null) { + if (n == sn) + d.start = p; + + if (n == en) { + d.end = p; + return d; + } + + p += n.nodeValue ? n.nodeValue.length : 0; + } + + return null; + }, + + _getTextPos : function(r, sp, ep) { + var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}; + + while ((n = w.nextNode()) != null) { + p += n.nodeValue ? n.nodeValue.length : 0; + + if (p >= sp && !d.startNode) { + d.startNode = n; + d.startOffset = sp - (p - n.nodeValue.length); + } + + if (p >= ep) { + d.endNode = n; + d.endOffset = ep - (p - n.nodeValue.length); + + return d; + } + } + + return null; + }, + + selectNode : function(node, collapse, select_text_node, to_start) { + var inst = this.instance, sel, rng, nodes; + + if (!node) + return; + + if (typeof(collapse) == "undefined") + collapse = true; + + if (typeof(select_text_node) == "undefined") + select_text_node = false; + + if (typeof(to_start) == "undefined") + to_start = true; + + if (inst.settings.auto_resize) + inst.resizeToContent(); + + if (tinyMCE.isRealIE) { + rng = inst.getDoc().body.createTextRange(); + + try { + rng.moveToElementText(node); + + if (collapse) + rng.collapse(to_start); + + rng.select(); + } catch (e) { + // Throws illigal agrument in MSIE some times + } + } else { + sel = this.getSel(); + + if (!sel) + return; + + if (tinyMCE.isSafari) { + sel.setBaseAndExtent(node, 0, node, node.innerText.length); + + if (collapse) { + if (to_start) + sel.collapseToStart(); + else + sel.collapseToEnd(); + } + + this.scrollToNode(node); + + return; + } + + rng = inst.getDoc().createRange(); + + if (select_text_node) { + // Find first textnode in tree + nodes = tinyMCE.getNodeTree(node, new Array(), 3); + if (nodes.length > 0) + rng.selectNodeContents(nodes[0]); + else + rng.selectNodeContents(node); + } else + rng.selectNode(node); + + if (collapse) { + // Special treatment of textnode collapse + if (!to_start && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + rng.setEnd(node, node.nodeValue.length); + } else + rng.collapse(to_start); + } + + sel.removeAllRanges(); + sel.addRange(rng); + } + + this.scrollToNode(node); + + // Set selected element + tinyMCE.selectedElement = null; + if (node.nodeType == 1) + tinyMCE.selectedElement = node; + }, + + scrollToNode : function(node) { + var inst = this.instance, w = inst.getWin(), vp = inst.getViewPort(), pos = tinyMCE.getAbsPosition(node), cvp, p, cwin; + + // Only scroll if out of visible area + if (pos.absLeft < vp.left || pos.absLeft > vp.left + vp.width || pos.absTop < vp.top || pos.absTop > vp.top + (vp.height-25)) + w.scrollTo(pos.absLeft, pos.absTop - vp.height + 25); + + // Scroll container window + if (inst.settings.auto_resize) { + cwin = inst.getContainerWin(); + cvp = tinyMCE.getViewPort(cwin); + p = this.getAbsPosition(node); + + if (p.absLeft < cvp.left || p.absLeft > cvp.left + cvp.width || p.absTop < cvp.top || p.absTop > cvp.top + cvp.height) + cwin.scrollTo(p.absLeft, p.absTop - cvp.height + 25); + } + }, + + getAbsPosition : function(n) { + var pos = tinyMCE.getAbsPosition(n), ipos = tinyMCE.getAbsPosition(this.instance.iframeElement); + + return { + absLeft : ipos.absLeft + pos.absLeft, + absTop : ipos.absTop + pos.absTop + }; + }, + + getSel : function() { + var inst = this.instance; + + if (tinyMCE.isRealIE) + return inst.getDoc().selection; + + return inst.contentWindow.getSelection(); + }, + + getRng : function() { + var s = this.getSel(); + + if (s == null) + return null; + + if (tinyMCE.isRealIE) + return s.createRange(); + + if (tinyMCE.isSafari && !s.getRangeAt) + return '' + window.getSelection(); + + return s.getRangeAt(0); + }, + + getFocusElement : function() { + var inst = this.instance, doc, rng, sel, elm; + + if (tinyMCE.isRealIE) { + doc = inst.getDoc(); + rng = doc.selection.createRange(); + + // if (rng.collapse) + // rng.collapse(true); + + elm = rng.item ? rng.item(0) : rng.parentElement(); + } else { + if (!tinyMCE.isSafari && inst.isHidden()) + return inst.getBody(); + + sel = this.getSel(); + rng = this.getRng(); + + if (!sel || !rng) + return null; + + elm = rng.commonAncestorContainer; + //elm = (sel && sel.anchorNode) ? sel.anchorNode : null; + + // Handle selection a image or other control like element such as anchors + if (!rng.collapsed) { + // Is selection small + if (rng.startContainer == rng.endContainer) { + if (rng.startOffset - rng.endOffset < 2) { + if (rng.startContainer.hasChildNodes()) + elm = rng.startContainer.childNodes[rng.startOffset]; + } + } + } + + // Get the element parent of the node + elm = tinyMCE.getParentElement(elm); + + //if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") + // elm = tinyMCE.selectedElement; + } + + return elm; + } + + }; + +/* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */ + +function TinyMCE_UndoRedo(inst) { + this.instance = inst; + this.undoLevels = new Array(); + this.undoIndex = 0; + this.typingUndoIndex = -1; + this.undoRedo = true; +}; + +TinyMCE_UndoRedo.prototype = { + add : function(l) { + var b, customUndoLevels, newHTML, inst = this.instance, i, ul, ur; + + if (l) { + this.undoLevels[this.undoLevels.length] = l; + return true; + } + + if (this.typingUndoIndex != -1) { + this.undoIndex = this.typingUndoIndex; + + if (tinyMCE.typingUndoIndex != -1) + tinyMCE.undoIndex = tinyMCE.typingUndoIndex; + } + + newHTML = tinyMCE.trim(inst.getBody().innerHTML); + if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) { + //tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex].content); + + tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst); + + // Time to compress + customUndoLevels = tinyMCE.settings['custom_undo_redo_levels']; + if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) { + for (i=0; i 0) { + this.undoIndex--; + + tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content); + inst.repaint(); + + if (inst.settings.custom_undo_redo_restore_selection) + inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark); + } + }, + + redo : function() { + var inst = this.instance; + + tinyMCE.execCommand("mceEndTyping"); + + if (this.undoIndex < (this.undoLevels.length-1)) { + this.undoIndex++; + + tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content); + inst.repaint(); + + if (inst.settings.custom_undo_redo_restore_selection) + inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark); + } + + tinyMCE.triggerNodeChange(); + } + + }; + +/* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */ + +var TinyMCE_ForceParagraphs = { + _insertPara : function(inst, e) { + var doc = inst.getDoc(), sel = inst.getSel(), body = inst.getBody(), win = inst.contentWindow, rng = sel.getRangeAt(0); + var rootElm = doc.documentElement, blockName = "P", startNode, endNode, startBlock, endBlock; + var rngBefore, rngAfter, direct, startNode, startOffset, endNode, endOffset, b = tinyMCE.isOpera ? inst.selection.getBookmark() : null; + var paraBefore, paraAfter, startChop, endChop, contents; + + function isEmpty(para) { + function isEmptyHTML(html) { + return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == ""; + } + + // Check for images + if (para.getElementsByTagName("img").length > 0) + return false; + + // Check for tables + if (para.getElementsByTagName("table").length > 0) + return false; + + // Check for HRs + if (para.getElementsByTagName("hr").length > 0) + return false; + + // Check all textnodes + var nodes = tinyMCE.getNodeTree(para, new Array(), 3); + for (var i=0; i <" + blockName + "> "; + paraAfter = body.childNodes[1]; + } + + inst.selection.moveToBookmark(b); + inst.selection.selectNode(paraAfter, true, true); + + return true; + } + + // Place first part within new paragraph + if (startChop.nodeName == blockName) + rngBefore.setStart(startChop, 0); + else + rngBefore.setStartBefore(startChop); + + rngBefore.setEnd(startNode, startOffset); + paraBefore.appendChild(rngBefore.cloneContents()); + + // Place secound part within new paragraph + rngAfter.setEndAfter(endChop); + rngAfter.setStart(endNode, endOffset); + contents = rngAfter.cloneContents(); + + if (contents.firstChild && contents.firstChild.nodeName == blockName) { + /* var nodes = contents.firstChild.childNodes; + for (var i=0; i= r.startOffset && nv.charAt(r.startOffset - 1) == ' ') + s = true;*/ + + // Only remove BRs if we are at the end of line #bug 1464152 + if (nv != null && r.startOffset == nv.length) + sn.nextSibling.parentNode.removeChild(sn.nextSibling); + } + + if (inst.settings.auto_resize) + inst.resizeToContent(); + + return s; + } + + }; + +/* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */ + +function TinyMCE_Layer(id, bm) { + this.id = id; + this.blockerElement = null; + this.events = false; + this.element = null; + this.blockMode = typeof(bm) != 'undefined' ? bm : true; + this.doc = document; +}; + +TinyMCE_Layer.prototype = { + moveRelativeTo : function(re, p) { + var rep = this.getAbsPosition(re); + var w = parseInt(re.offsetWidth); + var h = parseInt(re.offsetHeight); + var e = this.getElement(); + var ew = parseInt(e.offsetWidth); + var eh = parseInt(e.offsetHeight); + var x, y; + + switch (p) { + case "tl": + x = rep.absLeft; + y = rep.absTop; + break; + + case "tr": + x = rep.absLeft + w; + y = rep.absTop; + break; + + case "bl": + x = rep.absLeft; + y = rep.absTop + h; + break; + + case "br": + x = rep.absLeft + w; + y = rep.absTop + h; + break; + + case "cc": + x = rep.absLeft + (w / 2) - (ew / 2); + y = rep.absTop + (h / 2) - (eh / 2); + break; + } + + this.moveTo(x, y); + }, + + moveBy : function(x, y) { + var e = this.getElement(); + this.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y); + }, + + moveTo : function(x, y) { + var e = this.getElement(); + + e.style.left = x + "px"; + e.style.top = y + "px"; + + this.updateBlocker(); + }, + + resizeBy : function(w, h) { + var e = this.getElement(); + this.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h); + }, + + resizeTo : function(w, h) { + var e = this.getElement(); + + if (w != null) + e.style.width = w + "px"; + + if (h != null) + e.style.height = h + "px"; + + this.updateBlocker(); + }, + + show : function() { + this.getElement().style.display = 'block'; + this.updateBlocker(); + }, + + hide : function() { + this.getElement().style.display = 'none'; + this.updateBlocker(); + }, + + isVisible : function() { + return this.getElement().style.display == 'block'; + }, + + getElement : function() { + if (!this.element) + this.element = this.doc.getElementById(this.id); + + return this.element; + }, + + setBlockMode : function(s) { + this.blockMode = s; + }, + + updateBlocker : function() { + var e, b, x, y, w, h; + + b = this.getBlocker(); + if (b) { + if (this.blockMode) { + e = this.getElement(); + x = this.parseInt(e.style.left); + y = this.parseInt(e.style.top); + w = this.parseInt(e.offsetWidth); + h = this.parseInt(e.offsetHeight); + + b.style.left = x + 'px'; + b.style.top = y + 'px'; + b.style.width = w + 'px'; + b.style.height = h + 'px'; + b.style.display = e.style.display; + } else + b.style.display = 'none'; + } + }, + + getBlocker : function() { + var d, b; + + if (!this.blockerElement && this.blockMode) { + d = this.doc; + b = d.getElementById(this.id + "_blocker"); + + if (!b) { + b = d.createElement("iframe"); + + b.setAttribute('id', this.id + "_blocker"); + b.style.cssText = 'display: none; position: absolute; left: 0; top: 0'; + b.src = 'javascript:false;'; + b.frameBorder = '0'; + b.scrolling = 'no'; + + d.body.appendChild(b); + } + + this.blockerElement = b; + } + + return this.blockerElement; + }, + + getAbsPosition : function(n) { + var p = {absLeft : 0, absTop : 0}; + + while (n) { + p.absLeft += n.offsetLeft; + p.absTop += n.offsetTop; + n = n.offsetParent; + } + + return p; + }, + + create : function(n, c, p, h) { + var d = this.doc, e = d.createElement(n); + + e.setAttribute('id', this.id); + + if (c) + e.className = c; + + if (!p) + p = d.body; + + if (h) + e.innerHTML = h; + + p.appendChild(e); + + return this.element = e; + }, + + exists : function() { + return this.doc.getElementById(this.id) != null; + }, + + parseInt : function(s) { + if (s == null || s == '') + return 0; + + return parseInt(s); + } + + }; + +/* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */ + +function TinyMCE_Menu() { + var id; + + if (typeof(tinyMCE.menuCounter) == "undefined") + tinyMCE.menuCounter = 0; + + id = "mc_menu_" + tinyMCE.menuCounter++; + + TinyMCE_Layer.call(this, id, true); + + this.id = id; + this.items = new Array(); + this.needsUpdate = true; +}; + +TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, { + init : function(s) { + var n; + + // Default params + this.settings = { + separator_class : 'mceMenuSeparator', + title_class : 'mceMenuTitle', + disabled_class : 'mceMenuDisabled', + menu_class : 'mceMenu', + drop_menu : true + }; + + for (n in s) + this.settings[n] = s[n]; + + this.create('div', this.settings.menu_class); + }, + + clear : function() { + this.items = new Array(); + }, + + addTitle : function(t) { + this.add({type : 'title', text : t}); + }, + + addDisabled : function(t) { + this.add({type : 'disabled', text : t}); + }, + + addSeparator : function() { + this.add({type : 'separator'}); + }, + + addItem : function(t, js) { + this.add({text : t, js : js}); + }, + + add : function(mi) { + this.items[this.items.length] = mi; + this.needsUpdate = true; + }, + + update : function() { + var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings; + + if (this.settings.drop_menu) + h += ''; + + h += ''; + + for (i=0; i'; + } + + h += '
    '; + break; + + case 'title': + h += '
    ' + t + ''; + break; + + case 'disabled': + h += '
    ' + t + ''; + break; + + default: + h += '
    ' + t + ''; + } + + h += '
    '; + + e.innerHTML = h; + + this.needsUpdate = false; + this.updateBlocker(); + }, + + show : function() { + var nl, i; + + if (tinyMCE.lastMenu == this) + return; + + if (this.needsUpdate) + this.update(); + + if (tinyMCE.lastMenu && tinyMCE.lastMenu != this) + tinyMCE.lastMenu.hide(); + + TinyMCE_Layer.prototype.show.call(this); + + if (!tinyMCE.isOpera) { + // Accessibility stuff +/* nl = this.getElement().getElementsByTagName("a"); + if (nl.length > 0) + nl[0].focus();*/ + } + + tinyMCE.lastMenu = this; + } + + }); + +/* file:jscripts/tiny_mce/classes/TinyMCE_Compatibility.class.js */ + +if (!Function.prototype.call) { + Function.prototype.call = function() { + var a = arguments, s = a[0], i, as = '', r, o; + + for (i=1; i 1 ? ',' : '') + 'a[' + i + ']'; + + o = s._fu; + s._fu = this; + r = eval('s._fu(' + as + ')'); + s._fu = o; + + return r; + }; +}; + +/* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */ + +TinyMCE_Engine.prototype.debug = function() { + var m = "", a, i, l = tinyMCE.log.length; + + for (i=0, a = this.debug.arguments; i'; + h += ''; + + return h; +} + +function pickColor(e, target_form_element) { + if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown") + tinyMCEPopup.pickColor(e, target_form_element); +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCE.switchClass(img, 'mceButtonDisabled', true); + } else { + lnk.setAttribute("href", lnk.getAttribute("realhref")); + tinyMCE.switchClass(img, 'mceButtonNormal', false); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback"; + var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback")); + if (cb == null) + return ""; + + var html = ""; + + html += ''; + html += ''; + + return html; +} + +function openBrower(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i x && mx < x + w && my > y && my < y + h)) { + MCLayer.visibleLayer = null; + + if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my)) + return true; + + l.hide(); + } + } + }, + + addCSSClass : function(e, c) { + this.removeCSSClass(e, c); + var a = this.explode(' ', e.className); + a[a.length] = c; + e.className = a.join(' '); + }, + + removeCSSClass : function(e, c) { + var a = this.explode(' ', e.className), i; + + for (i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i "ar", + "Danish" => "da", + "Dutch" => "nl", + "English" => "en", + "Farsi" => "fa", + "French" => "fr", + "German" => "de", + "Greek" => "el", + "Hebrew" => " ", + "Hungarian" => "hu", + "Italian" => "it", + "Japanese" => "ja", + "Korean" => "ko", + "Norwegian" => "nb", + "Polish" => "pl", + "Russian" => "ru", + "Slovak" => "sk", + "Spanish" => "es", + "Swedish" => "sv" +); + +if(!$tinylang[$lang]){ + $tinylang[$lang] = "en"; +} + +$thescript = (strpos($_SERVER['SERVER_SOFTWARE'],"mod_gzip")) ? "tiny_mce_gzip.php" : "tiny_mce.js"; + +$text = "\n"; + +$text .= "\n +"; + +return $text; + +} + + +?> diff --git a/e107_handlers/traffic_class.php b/e107_handlers/traffic_class.php new file mode 100644 index 000000000..7d82a49f0 --- /dev/null +++ b/e107_handlers/traffic_class.php @@ -0,0 +1,208 @@ +Bump('foo',$b,$e); + // ~15 usec err: $eTraffic->Bump('foo',$b,microtime()); + // ~25 usec err: $eTraffic->Bump('foo',$b); + + if (!defined("E107_DBG_TRAFFIC") || !E107_DBG_TRAFFIC) { + return; + } + + if ($tStart) { + $vName = 'aTrafficTimed'; + $bTimed = TRUE; + } else { + $vName = 'aTraffic'; + $bTimed = FALSE; + } + if (!isset($this->{$vName}[$sWhat])) { + $this->{$vName}[$sWhat] = array(); + $t = & $this->{$vName}[$sWhat]; + $t['Count'] = 0; + if ($bTimed) { + $t['Time'] = 0.0; + $t['Min'] = 999999999.0; + $t['Max'] = 0.0; + } + } + + $this->{$vName}[$sWhat]['Count']++; + + if ($bTimed) { + $t = & $this->aTrafficTimed[$sWhat]; + if (!$tFinish) { + $tFinish = $x; + $offset = $this->calPassOne; + } else { + $offset = $this->calPassBoth; + } + $time = $this->TimeDelta($tStart, $tFinish ) - $offset; + $this->calTime += $offset; + $t['Time'] += $time; + if ($time < $t['Min']) $t['Min'] = $time; + if ($time > $t['Max']) $t['Max'] = $time; + } + } + + /** + * @return void + * @param string $sWhat what to count + * @param int $level who to record: default caller. 1-999=N levels up the call tree + * @param time $tStart Start time - unexploded microtime result + * @param time $tStop Finish time - unexploded microtime result + * @desc Count one of anything, optionally with time used. + * @access public + */ + function BumpWho($sWhat, $level = 0, $tStart = 0, $tFinish = 0) { + $x = microtime(); + if (!defined("E107_DBG_TRAFFIC") || !E107_DBG_TRAFFIC) { + return; + } + + $this->Bump($sWhat, $tStart, ($tFinish? $tFinish : $x)); + + if (!isset($this->aTrafficWho[$sWhat])) { + $this->aTrafficWho[$sWhat] = array(); + } + $aTrace = debug_backtrace(); + if ($level >= count($aTrace)) { + $level = count($aTrace)-1; + } + $sFile = $aTrace[$level]['file']; + $sLine = $aTrace[$level]['line']; + + $this->aTrafficWho[$sWhat][] = "$sFile($sLine)"; + } + + function Calibrate($tObject, $count = 10 ) { + if (!defined("E107_DBG_TRAFFIC") || !E107_DBG_TRAFFIC) { + return; + } + if ($tObject != $this) { + message_handler("CRITICAL_ERROR", "Bad traffic object", __LINE__-2, __FILE__); + } + if ($count <= 0) return; // no calibration + + $this->calPassBoth = $this->calPassOne = 0.0; + + for ($i = 0; $i < $count; $i++) { + $b = microtime(); + $e = microtime(); + $tObject->Bump('TRAF_CAL1', $b, $e); // emulate the normal non-insider call + $b = microtime(); + $tObject->Bump('TRAF_CAL2', $b); + } + $t = $tObject->aTrafficTimed['TRAF_CAL1']; + $this->calPassBoth = $t['Time']/$t['Count']; + $t = $tObject->aTrafficTimed['TRAF_CAL2']; + $this->calPassOne = $t['Time']/$t['Count']; + } + + function Display() { + if (!defined("E107_DBG_TRAFFIC") || !E107_DBG_TRAFFIC) { + return ''; + } + + $text = ''; + @include_once(e_HANDLER.'traffic_class_display.php'); + return $text; + } +} + + +// +// This is a set of quick-n-simple tools to measure ONE bit of render time, +// without any need for debug to be working. You can copy to somewhere else if needed +// such as before this class has been loaded + +if (!isset($qTimeOn)) { + $qTimeOn=0; + $qTimeTotal=0; + function eQTimeOn() { + $GLOBALS['qTimeOn']=explode(' ',microtime()); + } + function eQTimeOff() { + $e=explode(' ',microtime()); + $diff=((float)$e[0] + (float)$e[1]) - ((float)$qTimeOn[0] + (float)$qTimeOn[1]); + $GLOBALS['qTimeTotal'] += $diff; + } + function eQTimeElapsed() { + // return elapsed time so far, as text in microseconds, or blank if zero + if ($GLOBALS['qTimeTotal']) { + return number_format($GLOBALS['qTimeTotal']*1000000.0,1); + } else { + return ''; + } + } + +} + +?> diff --git a/e107_handlers/traffic_class_display.php b/e107_handlers/traffic_class_display.php new file mode 100644 index 000000000..1ce990691 --- /dev/null +++ b/e107_handlers/traffic_class_display.php @@ -0,0 +1,121 @@ +aTraffic)) { // Simple counts + $text .= "\n\n"; + $text .= " + + + \n"; + foreach ($this->aTraffic as $key=>$aVals) { + $text .= " + + \n"; + + if (isset($this->aTrafficWho[$key])) { + $text .= " + \n"; + } + + } + $text .="
    ItemCount  
    ". + $key."". + $aVals['Count']."  
    Callers:"; + $bFirst=TRUE; + foreach ($this->aTrafficWho[$key] as $sWho) { + if ($bFirst ) { + $bFirst = FALSE; + } else { + $text .= "
    \n"; + } + $text .= $sWho; + } + $text .= "

    \n"; + } + // + // Fancy timed counts + // + if (count($this->aTrafficTimed)) { + $text .= "\n\n"; + $text .= " + + + + + \n"; + foreach ($this->aTrafficTimed as $key=>$aVals) { + if (substr($key,0,8)=='TRAF_CAL') continue; + $text .= " + + "; + if ($aVals['Count'] && isset($aVals['Time']) && $aVals['Time']) { + $sTot = number_format($aVals['Time']*1000.0,4); + $sAvg = number_format($aVals['Time']*1000000.0/$aVals['Count'],1); + $sMin = number_format($aVals['Min']*1000000.0,1); + $sMax = number_format($aVals['Max']*1000000.0,1); + } else { + $sTot = $sAvg = $sMin = $sMax = ''; + } + $text .= " + + + + \n"; + + if (isset($this->aTrafficWho[$key])) { + $text .= " + \n"; + } + + } + $cal1 = number_format($this->calPassOne*1000000.0,1); + $cal2 = number_format($this->calPassBoth*1000000.0,1); + $cTot = number_format($this->calTime*1000.0,4); + + $text .="\n"; + $text .="
    ItemCount Tot Time (ms) Avg Time (us) Min Time (us) Max Time (us) 
    ". + $key."". + $aVals['Count']." ". + $sTot." ". + $sAvg." ". + $sMin." ". + $sMax." 
    Callers:"; + $bFirst=TRUE; + foreach ($this->aTrafficWho[$key] as $sWho) { + if ($bFirst ) { + $bFirst = FALSE; + } else { + $text .= "
    \n"; + } + $text .= $sWho; + } + $text .= "
    + Note: These times have been decreased by the calibration offset:
    + $cal2 usec per call(start,stop); $cal1 usec per call(start). Total adjustment: $cTot msec.

    \n"; + } +?> \ No newline at end of file diff --git a/e107_handlers/upload_handler.php b/e107_handlers/upload_handler.php new file mode 100644 index 000000000..6818af62e --- /dev/null +++ b/e107_handlers/upload_handler.php @@ -0,0 +1,202 @@ +db_Insert("rbinary", "0, '".$tp -> toDB($file_name, true)."', '".$tp -> toDB($file_userfile['type'][$c], true)."', '$data' "); + $uploaded[$c]['name'] = "Binary ".mysql_insert_id()."/".$file_name; + $uploaded[$c]['type'] = $file_userfile['type'][$c]; + $uploaded[$c]['size'] = $file_userfile['size'][$c]; + } + } + return $uploaded; + } + /* + if (ini_get('open_basedir') != ''){ + require_once(e_HANDLER."message_handler.php"); + message_handler("MESSAGE", "'open_basedir' restriction is in effect, unable to move uploaded file, deleting ...", __LINE__, __FILE__); + return FALSE; + } + */ + + // echo "
    "; print_r($_FILES); echo "
    "; exit; + + $files = $_FILES['file_userfile']; + if (!is_array($files)) + { + return FALSE; + } + + $c = 0; + foreach($files['name'] as $key => $name) + { + + if ($files['size'][$key]) + { + $filesize[] = $files['size'][$key]; + $name = preg_replace("/[^a-z0-9._-]/", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($name)))); + if ($avatar == "attachment") { + $name = time()."_".USERID."_".$fileinfo.$name; + } + + $destination_file = getcwd()."/".$uploaddir."/".$name; + if ($avatar == "unique" && file_exists($destination_file)) + { + $name = time()."_".$name; + $destination_file = getcwd()."/".$uploaddir."/".$name; + } + if (file_exists($destination_file) && !$overwrite) + { + require_once(e_HANDLER."message_handler.php"); + message_handler("MESSAGE", LANUPLOAD_10, __LINE__, __FILE__); // duplicate file + $f_message .= LANUPLOAD_10 . __LINE__ . __FILE__; + $dupe_found = TRUE; + } + else + { + $uploadfile = $files['tmp_name'][$key]; + $fileext1 = substr(strrchr($files['name'][$key], "."), 1); + $fileext2 = substr(strrchr($files['name'][$key], "."), 0); + if (!in_array($fileext1, $allowed_filetypes) && !in_array(strtolower($fileext1), $allowed_filetypes) && !in_array(strtolower($files['type'][$c]), $allowed_filetypes)) + { + if (!in_array($fileext2, $allowed_filetypes) && !in_array(strtolower($fileext2), $allowed_filetypes) && !in_array(strtolower($files['type'][$c]), $allowed_filetypes)) + { + require_once(e_HANDLER."message_handler.php"); + message_handler("MESSAGE", LANUPLOAD_1." ".$files['type'][$key]." ".LANUPLOAD_2.".", __LINE__, __FILE__); + $f_message .= LANUPLOAD_1." ".$files['type'][$key]." ".LANUPLOAD_2."." . __LINE__ . __FILE__; + return FALSE; + require_once(FOOTERF); + exit; + } + } + + $uploaded[$c]['name'] = $name; + $uploaded[$c]['type'] = $files['type'][$key]; + $uploaded[$c]['size'] = 0; + + $method = (OPEN_BASEDIR == FALSE ? "copy" : "move_uploaded_file"); + + if (@$method($uploadfile, $destination_file)) + { + @chmod($destination_file, 0644); + $_tmp = explode('.', $name); + $fext = array_pop($_tmp); + $fname = basename($name, '.'.$fext); + $tmp = pathinfo($name); + $rename = substr($fname, 0, 15).".".time().".".$fext; + if (@rename(e_FILE."public/avatars/".$name, e_FILE."public/avatars/".$rename)) + { + $uploaded[$c]['name'] = $rename; + } + + if ($method == "copy") + { + @unlink($uploadfile); + } + + if(!$dupe_found) + { // don't display 'success message' when duplicate file found. + require_once(e_HANDLER."message_handler.php"); + message_handler("MESSAGE", "".LANUPLOAD_3." '".$files['name'][$key]."'", __LINE__, __FILE__); + $f_message .= "".LANUPLOAD_3." '".$files['name'][$key]."'.
    "; + } + $uploaded[$c]['size'] = $files['size'][$key]; + + } + else + { + $uploaded[$c]['error'] = $files['error'][$key]; + switch ($files['error'][$key]) + { + case 0: + $error = LANUPLOAD_4." [".str_replace("../", "", $uploaddir)."]"; + break; + case 1: + $error = LANUPLOAD_5; + break; + case 2: + $error = LANUPLOAD_6; + break; + case 3: + $error = LANUPLOAD_7; + break; + case 4: + $error = LANUPLOAD_8; + break; + case 5: + $error = LANUPLOAD_9; + break; + } + require_once(e_HANDLER."message_handler.php"); + message_handler("MESSAGE", LANUPLOAD_11." '".$files['name'][$key]."'
    ".LANUPLOAD_12.": ".$error, __LINE__, __FILE__); + $f_message .= LANUPLOAD_11." '".$files['name'][$key]."'
    ".LANUPLOAD_12.": ".$error . __LINE__ . __FILE__; + + } + } + } + $c++; + } + define("F_MESSAGE", "
    ".$f_message); + + return $uploaded; +} +?> \ No newline at end of file diff --git a/e107_handlers/user_extended_class.php b/e107_handlers/user_extended_class.php new file mode 100755 index 000000000..874751336 --- /dev/null +++ b/e107_handlers/user_extended_class.php @@ -0,0 +1,488 @@ +typeArray = array( + 'text' => 1, + 'radio' => 2, + 'dropdown' => 3, + 'db field' => 4, + 'textarea' => 5, + 'integer' => 6, + 'date' => 7, + 'language' => 8 + ); + $this->user_extended_types = array( + 1 => UE_LAN_1, + 2 => UE_LAN_2, + 3 => UE_LAN_3, + 4 => UE_LAN_4, + 5 => UE_LAN_5, + 6 => UE_LAN_6, + 7 => UE_LAN_7, + 8 => UE_LAN_8 + ); + + //load array with field names from main user table, so we can disallow these + $this->reserved_names = array ( + 'id', 'name', 'loginname', 'customtitle', 'password', + 'sess', 'email', 'signature', 'image', 'timezone', 'hideemail', + 'join', 'lastvisit', 'currentvisit', 'lastpost', 'chats', + 'comments', 'forums', 'ip', 'ban', 'prefs', 'new', 'viewed', + 'visits', 'admin', 'login', 'class', 'perms', 'realm', 'pwchange', + 'xup' + ); + + } + + function user_extended_reserved($name) + { + return (in_array($name, $this->reserved_names)); + } + + function user_extended_get_categories($byID = TRUE) + { + global $sql; + if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type = 0 ORDER BY user_extended_struct_order ASC")) + { + + if($byID == TRUE) + { + while($row = $sql->db_Fetch()) + { + $ret[$row['user_extended_struct_id']][] = $row; + } + } + else + { + $ret = $sql->db_getList(); + } + } + return $ret; + } + + function user_extended_get_fields($cat = "") + { + global $sql; + $more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : ""; + if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type > 0 {$more} ORDER BY user_extended_struct_order ASC")) + { + while($row = $sql->db_Fetch()) + { + $ret[$row['user_extended_struct_parent']][] = $row; + } + } + return $ret; + } + + function user_extended_get_fieldList() + { + global $sql; + $more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : ""; + if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type > 0 {$more} ORDER BY user_extended_struct_order ASC")) + { + while($row = $sql->db_Fetch()) + { + $ret[$row['user_extended_struct_id']] = $row; + } + } + return $ret; + } + + function user_extended_type_text($type, $default) + { + global $tp; + switch ($type) + { + + case 6: + // integer, + $db_type = 'INT(11)'; + break; + + case 7: + // date, + $db_type = 'DATE NOT NULL'; + break; + + case 1: + case 2: + case 3: + case 4: + case 8: + //text, dropdown, radio, db_field, language + $db_type = 'VARCHAR(255)'; + break; + + case 5: + //textarea + $db_type = 'TEXT'; + break; + } + if($type != 4 && $default != '') + { + $default_text = " DEFAULT '".$tp -> toDB($default, true)."'"; + } + else + { + $default_text = ''; + } + return $db_type.$default_text; + } + + function user_extended_field_exist($name) + { + global $sql, $tp; + return $sql->db_Count('user_extended_struct','(*)', "WHERE user_extended_struct_name = '".$tp -> toDB($name, true)."'"); + } + + function user_extended_add($name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $order='', $parent) + { + global $sql, $tp; + if(is_array($name)) + { + extract($name); + } + if(!is_numeric($type)) + { + $type = $this->typeArray[$type]; + } + + if (!$this->user_extended_field_exist($name) && !$this->user_extended_reserved($name)) + { + $field_info = $this->user_extended_type_text($type, $default); + if($order === '') + { + if($sql->db_Select("user_extended_struct","MAX(user_extended_struct_order) as maxorder","1")) + { + $row = $sql->db_Fetch(); + if(is_numeric($row['maxorder'])) + { + $order = $row['maxorder']+1; + } + } + } + $sql->db_Select_gen("ALTER TABLE #user_extended ADD user_".$tp -> toDB($name, true)." ".$field_info); + $sql->db_Insert("user_extended_struct","0,'".$tp -> toDB($name, true)."','".$tp -> toDB($text, true)."','".intval($type)."','".$tp -> toDB($parms, true)."','".$tp -> toDB($values, true)."', '".$tp -> toDB($default, true)."', '".intval($read)."', '".intval($write)."', '".intval($required)."', '0', '".intval($applicable)."', '".intval($order)."', '".intval($parent)."'"); + if ($this->user_extended_field_exist($name)) + { + return TRUE; + } + } + return FALSE; + } + + function user_extended_modify($id, $name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $parent) + { + global $sql, $tp; + if ($this->user_extended_field_exist($name)) + { + $field_info = $this->user_extended_type_text($type, $default); + $sql->db_Select_gen("ALTER TABLE #user_extended MODIFY user_".$tp -> toDB($name, true)." ".$field_info); + $newfield_info = " + user_extended_struct_text = '".$tp -> toDB($text, true)."', + user_extended_struct_type = '".intval($type)."', + user_extended_struct_parms = '".$tp -> toDB($parms, true)."', + user_extended_struct_values = '".$tp -> toDB($values, true)."', + user_extended_struct_default = '".$tp -> toDB($default, true)."', + user_extended_struct_required = '".intval($required)."', + user_extended_struct_read = '".intval($read)."', + user_extended_struct_write = '".intval($write)."', + user_extended_struct_applicable = '".intval($applicable)."', + user_extended_struct_parent = '".intval($parent)."' + WHERE user_extended_struct_id = '".intval($id)."' + "; + return $sql->db_Update("user_extended_struct", $newfield_info); + } + } + + function user_extended_remove($id, $name) + { + global $sql, $tp; + if ($this->user_extended_field_exist($name)) + { + $sql->db_Select_gen("ALTER TABLE #user_extended DROP user_".$tp -> toDB($name, true)); + if(is_numeric($id)) + { + $sql->db_Delete("user_extended_struct", "user_extended_struct_id = '".intval($id)."' "); + } + else + { + $sql->db_Delete("user_extended_struct", "user_extended_struct_name = '".$tp -> toDB($id, true)."' "); + } + return !($this->user_extended_field_exist($name)); + } + } + + function user_extended_hide($struct, $curval) + { + $chk = ($curval) ? " checked='checked' " : ""; + $name = "hide[user_".$struct['user_extended_struct_name']."]"; + return " ".UE_LAN_HIDE; + } + + function user_extended_edit($struct, $curval) + { + global $cal, $tp; + $choices = explode(",",$struct['user_extended_struct_values']); + if(trim($curval) == "" && $struct['user_extended_struct_default'] != "") + { + $curval = $struct['user_extended_struct_default']; + } + foreach($choices as $k => $v) + { + $choices[$k] = str_replace("[E_COMMA]", ",", $choices[$k]); + } + $parms = explode("^,^",$struct['user_extended_struct_parms']); + $include = preg_replace("/\n/", " ", $tp->toText($parms[0])); + $regex = $tp->toText($parms[1]); + $regexfail = $tp->toText($parms[2]); + $fname = "ue[user_".$struct['user_extended_struct_name']."]"; + if(strpos($include, 'class') === FALSE) { + $include .= " class='tbox' "; + } + + switch($struct['user_extended_struct_type']) + { + case 1: //textbox + case 6: //integer + $ret = ""; + return $ret; + break; + + case 2: //radio + foreach($choices as $choice) + { + $choice = trim($choice); + $chk = ($curval == $choice)? " checked='checked' " : ""; + $ret .= " {$choice}"; + } + return $ret; + break; + + case 3: //dropdown + $ret = "\n"; + return $ret; + break; + + case 4: //db_field + global $sql; + $order = ($choices[3]) ? "ORDER BY ".$tp -> toDB($choices[3], true) : ""; + + if($sql->db_Select($tp -> toDB($choices[0], true), $tp -> toDB($choices[1], true).",".$tp -> toDB($choices[2], true), "1 $order")){ + $choiceList = $sql->db_getList('ALL',FALSE); + $ret = "\n"; + return $ret; + } else { + return ""; + } + break; + + case 5: //textarea + return ""; + break; + + case 7: //date + return $cal->make_input_field( + array( + 'ifFormat' => '%Y-%m-%d' + ), + array( + 'class' => 'tbox', + 'name' => $fname, + 'value' => $curval + ) + ); + break; + + case 8: // language + require_once(e_HANDLER."file_class.php"); + $fl = new e_file; + $lanlist = $fl->get_dirs(e_LANGUAGEDIR); + sort($lanlist); + $ret = "\n"; + break; + + } + + return $ret; + } + + function user_extended_getStruct($orderby="user_extended_struct_order") + { + if($ueStruct = getcachedvars('ue_struct')) + { + return $ueStruct; + } + global $sql, $tp; + $ret = array(); + $parms = ""; + if($orderby != "") + { + $parms = "1 ORDER BY ".$tp -> toDB($orderby, true); + } + if($sql->db_Select('user_extended_struct','*',$parms)) + { + while($row = $sql->db_Fetch()) + { + $ret['user_'.$row['user_extended_struct_name']] = $row; + } + } + cachevars('ue_struct',$ret); + return $ret; + } + + function parse_extended_xml($contents, $no_cache = FALSE) + { + if($no_cache == FALSE && $this->extended_xml) + { + return $this->extended_xml; + } + + require_once(e_HANDLER."xml_class.php"); + $xml = new CXml; + if("getfile" == $contents) + { + $contents = file_get_contents(e_FILE."cache/user_extended.xml"); + } + $xml->Set_XML_data($contents); + $data = $xml->obj_data->e107_extended_user_fields[0]; + $ret['version'] = $data->version; + unset($info); + foreach($data->item as $item) + { + $info = array( + "name" => $item->name, + "text" => "UE_LAN_".strtoupper($item->name), + "type" => $item->type[0], + "values" => $item->values[0], + "default" => $item->default[0], + "required" => $item->required[0], + "read" => $item->read[0], + "write" => $item->write[0], + "applicable" => $item->applicable[0], + "include_text" => $item->include_text[0], + "parms" => $item->include_text[0], + "regex" => $item->regex[0] + ); + if(is_array($item->default) && $item->default[0] == '') + { + $info['default'] = 0; + } + if($item->regex[0]) + { + $info['parms'] .= $item->include_text[0]."^,^".$item->regex[0]."^,^LAN_UE_FAIL_".strtoupper($item->name); + } + $ret[$item->name] = $info; + } + $this->extended_xml = $ret; + return $this->extended_xml; + } + + function convert_old_fields() + { + global $sql; + $preList = $this->parse_extended_xml('getfile'); + $flist = array('user_aim', 'user_birthday', 'user_homepage', 'user_icq', 'user_msn', 'user_location'); + foreach($flist as $f) + { + $f = substr($f, 5); + $preList[$f]['parms'] = addslashes($preList[$f]['parms']); + $this->user_extended_add($preList[$f]); + } + $sql->db_Select_gen("INSERT IGNORE INTO #user_extended (user_extended_id) SELECT user_id FROM #user "); + $qry = " + UPDATE #user_extended AS ue , #user as u SET + ue.user_aim = u.user_aim, + ue.user_birthday = u.user_birthday, + ue.user_homepage = u.user_homepage, + ue.user_icq = u.user_icq, + ue.user_msn = u.user_msn, + ue.user_location = u.user_location + WHERE ue.user_extended_id = u.user_id + "; + $sql->db_Select_gen($qry); + $dlist = implode(", DROP ", $flist); + $dlist = "DROP ".$dlist; + $qry = "ALTER TABLE #user ".$dlist; + $sql->db_Select_gen($qry); + } +} +?> diff --git a/e107_handlers/user_func.php b/e107_handlers/user_func.php new file mode 100644 index 000000000..d9daa0d93 --- /dev/null +++ b/e107_handlers/user_func.php @@ -0,0 +1,51 @@ +db_Select("user", "user_class, user_admin", "user_id=".intval($user_id))) + { + $row = $uc_sql->db_Fetch(); + $uc = $row['user_class']; + $uc .= ",".e_UC_MEMBER; + if($row['user_admin']) + { + $uc .= ",".e_UC_ADMIN; + } + return $uc; + } + else + { + return ""; + } + } +} +?> \ No newline at end of file diff --git a/e107_handlers/user_select_class.php b/e107_handlers/user_select_class.php new file mode 100644 index 000000000..ff08f61b4 --- /dev/null +++ b/e107_handlers/user_select_class.php @@ -0,0 +1,227 @@ + popup(); +} + +include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php"); + +class user_select { + + function user_list($class, $form_name) { + global $pref, $sql, $tp; + if($class === FALSE) { $class = e_UC_MEMBER;} + switch ($class) + { + case e_UC_ADMIN: + $where = "user_admin = 1"; + break; + + case e_UC_MEMBER: + $where = "1"; + break; + + case e_UC_NOBODY: + return ""; + break; + + default: + $where = "user_class REGEXP '(^|,)(".$tp -> toDB($class, true).")(,|$)'"; + break; + } + + $text = ""; + return $text; + } + + function class_list($class, $form_name) { + global $pref, $sql; + $text = " "; + } + else + { + $text .= " "; + } + $text .= "".US_LAN_4."..."; + } + + if ($class !== false) { + if (($class < e_UC_NOBODY && USERCLASS) || ADMINPERMS == '0') { + $text .= ' '.$this -> class_list($class, 'class'); + } + } + + return $text; + } + + function real_name($_id) { + global $sql; + $sql -> db_Select("user", "user_name", "user_id='".intval($_id)."' "); + if ($row = $sql -> db_Fetch()) { + return $row['user_name']; + } + } + + function popup() { + global $ns, $tp; + list($elementType, $elementID) = explode(".", e_QUERY); + if($elementType == 'textarea') + { + $job = " + curval = parent.opener.document.getElementById('{$elementID}').value; + lastchr = curval.substring(curval.length-1, curval.length); + if(lastchr != '\\n' && curval.length > 0) + { + curval = curval+'\\n'; + } + parent.opener.document.getElementById('{$elementID}').value = curval+d+'\\n';"; + } + else + { + if($elementID == "") + { + $elementID = $elementType; + } + $job = "parent.opener.document.getElementById('{$elementID}').value = d;"; + } + echo " + + "; + + $text = "
    + + + + +
    +
    +
    + "; + + if ($_POST['dosrch']) { + $userlist = $this -> findusers($_POST['srch']); + if($userlist == FALSE) + { + $fcount= 0; + } + else + { + $fcount = count($userlist); + } + $text .= "
    + + + + + + +
    {$fcount} ".US_LAN_5."
    + + +
    +
    + "; + } + + $ns -> tablerender(US_LAN_4, $text); + } + + function findusers($s) { + global $sql, $tp; + if ($sql->db_Select("user", "*", "user_name LIKE '%".$tp -> toDB($s)."%' ")) { + while ($row = $sql -> db_Fetch()) { + $ret[strtolower($row['user_name'])] = $row['user_name']; + } + ksort($ret); + } else { + $ret = FALSE; + } + return $ret; + } + +} + +?> \ No newline at end of file diff --git a/e107_handlers/userclass_class.php b/e107_handlers/userclass_class.php new file mode 100644 index 000000000..a2e40a3ed --- /dev/null +++ b/e107_handlers/userclass_class.php @@ -0,0 +1,323 @@ +\n"; + if (!$optlist || strpos($optlist, "public") !== FALSE) { + $s = ($curval == e_UC_PUBLIC) ? "selected='selected'" : ""; + $text .= "\n"; + } + + if (!$optlist || strpos($optlist, "guest") !== FALSE) { + $s = ($curval == e_UC_GUEST) ? "selected='selected'" : ""; + $text .= "\n"; + } + if (!$optlist || strpos($optlist, "nobody") !== FALSE) { + $s = ($curval == e_UC_NOBODY) ? "selected='selected'" : ""; + $text .= "\n"; + } + if (!$optlist || strpos($optlist, "member") !== FALSE) { + $s = ($curval == e_UC_MEMBER) ? "selected='selected'" : ""; + $text .= "\n"; + } + if ($mode != "off" || strpos($optlist, "admin") !== FALSE) + { + $s = ($curval == e_UC_ADMIN) ? "selected='selected'" : ""; + $text .= "\n"; + } + if ($mode != "off" || strpos($optlist, "main") !== FALSE) + { + $s = ($curval == e_UC_MAINADMIN) ? "selected='selected'" : ""; + $text .= "\n"; + } + if (!$optlist || strpos($optlist, "classes") !== FALSE) + { + $classList = get_userclass_list(); + foreach($classList as $row) + { + extract($row); + if (strpos($optlist, "matchclass") === FALSE || getperms("0") || check_class($userclass_id)) + { + $s = ($userclass_id == $curval) ? "selected='selected'" : ""; + $text .= "\n"; + } + } + } + if (($mode != "off" && $mode != "admin") || strpos($optlist, "readonly") !== FALSE) + { + $s = ($curval == e_UC_READONLY) ? "selected='selected'" : ""; + $text .= "\n"; + } + + if (strpos($optlist, "language") !== FALSE && $pref['multilanguage']) { + $text .= "\n"; + $tmpl = explode(",",e_LANLIST); + foreach($tmpl as $lang){ + $s = ($curval == $lang) ? " selected='selected'" : ""; + $text .= "\n"; + } + } + + + $text .= "\n"; + return $text; +} + +function r_userclass_radio($fieldname, $curval = '') +{ + $sql = new db; + ($curval == e_UC_PUBLIC) ? $c = " checked" : $c = ""; + $text = "".UC_LAN_0."
    "; + ($curval == e_UC_NOBODY) ? $c = " checked" : $c = ""; + $text .= "".UC_LAN_2."
    "; + ($curval == e_UC_GUEST) ? $c = " checked" : $c = ""; + $text .= "".UC_LAN_1."
    "; + ($curval == e_UC_MEMBER) ? $c = " checked" : $c = ""; + $text .= "".UC_LAN_3."
    "; + $classList = get_userclass_list(); + foreach($classList as $row) + { + extract($row); + ($row['userclass_id'] == $curval) ? $c = " checked" : $c = ""; + $text .= "{$row['userclass_name']}
    "; + } + return $text; +} + +function r_userclass_check($fieldname, $curval = '', $optlist = "") +{ + global $pref; + $sql = new db; + $curArray = explode(",", $curval); + $ret = ""; + $ret .= "
    "; + if (!$optlist || strpos($optlist, "public") !== FALSE) + { + $c = (in_array(e_UC_PUBLIC, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + + if (!$optlist || strpos($optlist, "guest") !== FALSE) + { + $c = (in_array(e_UC_GUEST, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + + if (!$optlist || strpos($optlist, "nobody") !== FALSE) + { + $c = (in_array(e_UC_NOBODY, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + + if (!$optlist || strpos($optlist, "member") !== FALSE) + { + $c = (in_array(e_UC_MEMBER, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + + if (!$optlist || strpos($optlist, "admin") !== FALSE) + { + $c = (in_array(e_UC_ADMIN, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + + if (!$optlist || strpos($optlist, "readonly") !== FALSE) + { + $c = (in_array(e_UC_READONLY, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + + if (!$optlist || strpos($optlist, "classes") !== FALSE) + { + $classList = get_userclass_list(); + foreach($classList as $row) + { + if (strpos($optlist, "matchclass") === FALSE || getperms("0") || check_class($row['userclass_id'])) { + $c = (in_array($row['userclass_id'], $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + } + } + + if (strpos($optlist, "language") !== FALSE && $pref['multilanguage']) { + $ret .= "
    \n"; + $tmpl = explode(",",e_LANLIST); + foreach($tmpl as $lang){ + $c = (in_array($lang, $curArray)) ? " checked='checked' " : ""; + $ret .= "
    "; + } + } + + + + $ret .= "
    "; + return $ret; +} + +function get_userclass_list() +{ + global $sql; + if($classList = getcachedvars('uclass_list')) + { + return $classList; + } + else + { + $sql->db_Select('userclass_classes', "*", "ORDER BY userclass_name", "nowhere"); + $classList = $sql->db_getList(); + cachevars('uclass_list', $classList); + return $classList; + } +} + +function r_userclass_name($id) { + $sql = new db; + $class_names = getcachedvars('userclass_names'); + if(!is_array($class_names)) + { + $class_names[e_UC_PUBLIC] = UC_LAN_0; + $class_names[e_UC_GUEST] = UC_LAN_1; + $class_names[e_UC_NOBODY] = UC_LAN_2; + $class_names[e_UC_MEMBER] = UC_LAN_3; + $class_names[e_UC_READONLY] = UC_LAN_4; + $class_names[e_UC_ADMIN] = UC_LAN_5; + if ($sql->db_Select("userclass_classes", "userclass_id, userclass_name", "ORDER BY userclass_name", "nowhere")) + { + while($row = $sql->db_Fetch()) + { + $class_names[$row['userclass_id']] = $row['userclass_name']; + } + } + cachevars('userclass_names', $class_names); + } + return $class_names[$id]; +} + +class e_userclass { + function class_add($cid, $uinfoArray) + { + global $tp; + $sql2 = new db; + foreach($uinfoArray as $uid => $curclass) + { + if ($curclass) + { + $newarray = array_unique(array_merge(explode(',', $curclass), array($cid))); + $new_userclass = implode(',', $newarray); + } + else + { + $new_userclass = $cid; + } + $sql2->db_Update('user', "user_class='".$tp -> toDB($new_userclass, true)."' WHERE user_id=".intval($uid)); + } + } + + function class_remove($cid, $uinfoArray) + { + global $tp; + $sql2 = new db; + foreach($uinfoArray as $uid => $curclass) + { + $newarray = array_diff(explode(',', $curclass), array('', $cid)); + if (count($newarray) > 1) + { + $new_userclass = implode(',', $newarray); + } + else + { + $new_userclass = $newarray[0]; + } + $sql2->db_Update('user', "user_class='".$tp -> toDB($new_userclass, true)."' WHERE user_id=".intval($uid)); + } + } + + function class_create($ulist, $class_prefix = "NEW_CLASS_", $num = 0) + { + global $sql; + $varname = "uc_".$ulist; + if($ret = getcachedvars($varname)) + { + return $ret; + } + $ul = explode(",", $ulist); + array_walk($ul, array($this, 'munge')); + $qry = " + SELECT user_id, user_class from #user AS u + WHERE user_name = ".implode(" OR user_name = ", $ul); + if($sql->db_Select_gen($qry)) + { + while($row = $sql->db_Fetch()) + { + $idList[$row['user_id']] = $row['user_class']; + + } + while($sql->db_Count("userclass_classes","(*)","WHERE userclass_name = '".strtoupper($class_prefix.$num)."'")) + { + $num++; + } + $newname = strtoupper($class_prefix.$num); + $i = 1; + while ($sql->db_Select('userclass_classes', '*', "userclass_id='".intval($i)."' ") && $i < 255) + { + $i++; + } + if ($i < 255) + { + $sql->db_Insert("userclass_classes", "{$i}, '{$newname}', 'Auto_created_class', 254"); + $this->class_add($i, $idList); + cachevars($varname, $i); + return $i; + } + } + + } + + function munge(&$value, &$key) + { + $value = "'".trim($value)."'"; + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/usersession_class.php b/e107_handlers/usersession_class.php new file mode 100644 index 000000000..1e270a1a4 --- /dev/null +++ b/e107_handlers/usersession_class.php @@ -0,0 +1,243 @@ +_SessionName = session_name(); + $this->_UserTrackingType = $pref['user_tracking']; + $this->_CookieName = $pref['cookie_name']; + + global $e107; + $e107->getip; + } + + function UserSessionStart() { + print_r($_POST); + + if ($_POST['username'] && $_POST['userpass']) { + if (ini_get('magic_quotes_gpc' != 1)) { + $_POST['username'] = addslashes($_POST['username']); + $_POST['userpass'] = addslashes($_POST['userpass']); + } + $_POST['autologin'] = intval($_POST['autologin']); + $this->LoginUser(USERLOGIN_TYPE_POST, $_POST['username'], $_POST['userpass'], false, $_POST['autologin']); + } elseif ($this->_UserTrackingType == 'session' && $_COOKIE[$this->$_SessionName]) { + } elseif ($this->_UserTrackingType == 'cookie' && isset($_COOKIE[$this->_CookieName])) { + $Cookie = explode('.', $_COOKIE[$this->_CookieName]); + if (count($Cookie) != 2) { + $this->_LoginResult = LOGINRESULT_INVALIDCOOKIE; + } elseif(preg_match('/^[A-Fa-f0-9]{32}$/', $Cookie[1]) && intval($Cookie[0]) > 0) { + $this->LoginUser(USERLOGIN_TYPE_COOKIE, false, $Cookie[1], $Cookie[0]); + } else { + $this->_LoginResult = LOGINRESULT_INVALIDCOOKIE; + } + } else { + $this->AnonUser(); + $this->_LoginResult = LOGINRESULT_NOTLOGGEDIN; + } + if ($this->_LoginResult != LOGINRESULT_OK) { + $this->AnonUser(); + } + $this->CompatabiltyMode(); + } + + function LoginUser($LoginType = false, $UserName = false, $UserPassword = false, $UserID = false, $AutoLogin = false) { + global $sql, $tp; + switch ($LoginType) { + case USERLOGIN_TYPE_COOKIE: + if (!$sql->db_Select('user', '*', "user_id = '".intval($UserID)."' AND md5(`user_password`) = '".$tp -> toDB($UserPassword)."'")){ + $this->_LoginResult = LOGINRESULT_INVALIDCOOKIE; + } else { + $row = $sql->db_Fetch(); + $this->ExtractDetails($row); + $this->IsUser = true; + $this->_LoginResult = LOGINRESULT_OK; + } + break; + case USERLOGIN_TYPE_SESSION: + echo "Session Handling Not Fully Implemented Yet!"; + break; + case USERLOGIN_TYPE_POST: + $UserPassword = md5($UserPassword); + if (!$sql->db_Select('user', '*', "user_name = '".$tp -> toDB($UserName)."' AND user_password = '".$tp -> toDB($UserPassword)."'", 'default', true)) { + $this->_LoginResult = LOGINRESULT_BADUSERPASS; + } else { + $row = $sql->db_Fetch(); + $this->IsUser = true; + $this->_LoginResult = LOGINRESULT_OK; + $this->ExtractDetails($row); + if ($AutoLogin == true) { + header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); + setcookie($this->_CookieName, $row['user_id'].'.'.md5($UserPassword), (time() + 3600 * 24 * 30)); + $_COOKIE[$this->_CookieName] = $row['user_id'].'.'.md5($UserPassword); + } else { + header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); + setcookie($this->_CookieName, $row['user_id'].'.'.$UserPassword); + $_COOKIE[$this->_CookieName] = $row['user_id'].'.'.md5($UserPassword); + } + if ($this->_UserTrackingType == 'session') { + session_start(); + } + } + break; + if ($this->_LoginResult == LOGINRESULT_INVALIDCOOKIE) { + header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); + setcookie($pref['cookie_name'], '', (time()-2592000)); + unset($_COOKIE[$this->_CookieName]); + } + } + } + + function ExtractDetails($MySQL_Row) { + global $user_pref, $pref; + if ($MySQL_Row['user_ban'] == 1) { + exit(); + } + $this->UserDetails['Name'] = $MySQL_Row['user_name']; + $this->UserDetails['ID'] = $MySQL_Row['user_id']; + $this->UserDetails['Email'] = $MySQL_Row['user_email']; + $this->UserDetails['Class'] = $MySQL_Row['user_class']; + $this->UserDetails['Viewed'] = $MySQL_Row['user_viewed']; + $this->UserDetails['Image'] = $MySQL_Row['user_image']; + $this->UserTimes['PasswordChange'] = $MySQL_Row['user_pwchange']; + $this->UserTimes['LastVisit'] = $MySQL_Row['user_lastvisit']; + $this->UserTimes['CurrentVisit'] = $MySQL_Row['user_currentvisit']; + $this->UserTimes['Join'] = $MySQL_Row['user_join']; + $this->UserTimes['Lastpost'] = $MySQL_Row['user_lastpost']; + $this->UserPrefs = unserialize($MySQL_Row['user_prefs']); + $this->_UserSession = $MySQL_Row['user_sess']; + if ($MySQL_Row['user_admin'] == 1) { + $this->UserIsAdmin = true; + $this->_RawPermissions = $MySQL_Row['user_perms']; + $Perms = explode('.', $MySQL_Row['user_perms']); + $pTotal = count($Perms) - 1; + if ($Perms[$pTotal] == '') { + unset($Perms[$pTotal]); + } + if ($Perms[0] == '0') { + $this->SuperAdmin = true; + } else { + $this->_Permissions = $Perms; + } + } + if ($this->UserTimes['CurrentVisit'] + 3600 < time()) { + $this->UserTimes['LastVisit'] = $this->UserTimes['CurrentVisit']; + $this->UserTimes['CurrentVisit'] = time(); + $sql->db_Update('user', "user_visits = user_visits + 1, user_lastvisit = '{$this->UserTimes['LastVisit']}', user_currentvisit='{$this->UserTimes['CurrentVisit']}', user_viewed='' WHERE user_id='{$this->UserDetails['ID']}'"); + } + if (isset($_POST['settheme'])) { + $this->UserPrefs['sitetheme'] = ($pref['sitetheme'] == $_POST['sitetheme'] ? '' : $_POST['sitetheme']); + $user_pref = $this->UserPrefs; + save_prefs('user', $this->UserDetails['ID']); + } + $user_pref = $this->UserPrefs; + } + + function AnonUser() { + $this->UserDetails['Name'] = 'Anonymous'; + $this->UserDetails['ID'] = 0; + $this->UserDetails['Email'] = ''; + $this->UserTimes['LastVisit'] = time(); + $this->UserTimes['CurrentVisit'] = time(); + $this->UserTimes['Join'] = time(); + $this->UserTimes['Lastpost'] = time(); + $this->UserPrefs = array(); + $this->UserIsAdmin = false; + $this->SuperAdmin = false; + $this->_Permissions = array(); + } + + function CompatabiltyMode() { + if ($this->IsUser == true) { + define("USERID", $this->UserDetails['ID']); + define("USERNAME", $this->UserDetails['Name']); + define("USER", TRUE); + define("USERCLASS", $this->UserDetails['Class']); + define("USERVIEWED", $this->UserDetails['Viewed']); + define("USERIMAGE", $this->UserDetails['Image']); + define("USERSESS", $this->_UserSession); + + define("USERTHEME", ($this->UserPrefs['sitetheme'] && file_exists(e_THEME.$this->UserPrefs['sitetheme'].'/theme.php') ? $this->UserPrefs['sitetheme'] : false)); + + if ($this->UserIsAdmin == true) { + define("ADMIN", TRUE); + define("ADMINID", $this->UserDetails['ID']); + define("ADMINNAME", $this->UserDetails['Name']); + define("ADMINPERMS", $this->_RawPermissions); + define("ADMINEMAIL", $this->UserDetails['Email']); + define("ADMINPWCHANGE", $this->UserTimes['PasswordChange']); + } else { + define("ADMIN", FALSE); + } + } else { + define("USER", FALSE); + define("USERTHEME", FALSE); + define("ADMIN", FALSE); + define("GUEST", TRUE); + } + } +} + +?> \ No newline at end of file diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php new file mode 100644 index 000000000..4a9b91c9d --- /dev/null +++ b/e107_handlers/xml_class.php @@ -0,0 +1,238 @@ + xmlFileContents = curl_exec($cu); + if (curl_error($cu)) + { + $this -> error = "Error: ".curl_errno($cu).", ".curl_error($cu); + return FALSE; + } + curl_close ($cu); + return $this -> xmlFileContents; + } + + if(ini_get("allow_url_fopen")) + { + if(!$remote = @fopen ($address, "r")) + { + $this -> error = "Unable to open remote XML file."; + return FALSE; + } + } + else + { + $tmp = parse_url($address); + if(!$remote = fsockopen ($tmp['host'], 80 ,$errno, $errstr, 10)) + { + $this -> error = "Unable to open remote XML file."; + return FALSE; + } + else + { + socket_set_timeout($remote, 10); + fputs($remote, "GET ".$headline_url." HTTP/1.0\r\n\r\n"); + } + } + + $this -> xmlFileContents = ""; + while (!feof($remote)) + { + $this -> xmlFileContents .= fgets ($remote, 4096); + } + fclose ($remote); + return $this -> xmlFileContents; + } + + + function parseXmlContents () + { + foreach($this -> xmlData as $key => $value) + { + unset($this -> xmlData[$key]); + } + foreach($this -> counterArray as $key => $value) + { + unset($this -> counterArray[$key]); + } + + if(!function_exists('xml_parser_create')) + { + $this->error = "XML library not available."; + return FALSE; + } + + if(!$this -> xmlFileContents) + { + $this->error = "No XML source specified"; + return FALSE; + } + + $this->parser = xml_parser_create(''); + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'startElement', 'endElement'); + xml_set_character_data_handler( $this->parser, 'characterData' ); + + $array = explode("\n", $this -> xmlFileContents); + + foreach($array as $data) + { + + if(strlen($data == 4096)) + { + $this -> error = "The XML cannot be parsed as it is badly formed."; + return FALSE; + } + + if (!xml_parse($this->parser, $data)) + { + $this->error = sprintf('XML error: %s at line %d, column %d', xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser),xml_get_current_column_number($this->parser)); + return FALSE; + } + } + xml_parser_free( $this->parser ); + return $this -> xmlData; + } + + function startElement ($p, $element, &$attrs) + { + $this -> start_tag = $element; + $this -> current_tag = strtolower($element); + if(!array_key_exists($this -> current_tag, $this -> counterArray)) + { + $this -> counterArray[$this -> current_tag] = 0; + $this -> xmlData[$this -> current_tag][$this -> counterArray[$this -> current_tag]] = ""; + } + } + + function endElement ($p, $element) + { + if($this -> start_tag == $element) + { + $this -> counterArray[$this -> current_tag] ++; + } + } + + function characterData ($p, $data) + { + $data = trim ( chop ( $data )); + $data = preg_replace('/&(?!amp;)/', '&', $data); + if(!array_key_exists($this -> current_tag, $this -> xmlData)) + { + $this -> xmlData [$this -> current_tag] = array(); + } + if(array_key_exists($this -> counterArray[$this -> current_tag], $this -> xmlData [$this -> current_tag])) + { + $this -> xmlData [$this -> current_tag] [$this -> counterArray[$this -> current_tag]] .= $data; + } + else + { + $this -> xmlData [$this -> current_tag] [$this -> counterArray[$this -> current_tag]] = $data; + } + } +} + +//CXml class code found on php.net +class CXml +{ + var $xml_data; + var $obj_data; + var $pointer; + + function CXml() { } + + function Set_xml_data( &$xml_data ) + { + $this->index = 0; + $this->pointer[] = &$this->obj_data; + + //strip white space between tags + $this->xml_data = preg_replace("/>[[:space:]]+<", $xml_data); + $this->xml_parser = xml_parser_create( "UTF-8" ); + + xml_parser_set_option( $this->xml_parser, XML_OPTION_CASE_FOLDING, false ); + xml_set_object( $this->xml_parser, &$this ); + xml_set_element_handler( $this->xml_parser, "_startElement", "_endElement"); + xml_set_character_data_handler( $this->xml_parser, "_cData" ); + + xml_parse( $this->xml_parser, $this->xml_data, true ); + xml_parser_free( $this->xml_parser ); + } + + function _startElement( $parser, $tag, $attributeList ) + { + foreach( $attributeList as $name => $value ) + { + $value = $this->_cleanString( $value ); + $object->$name = $value; + } + //replaces the special characters with the underscore (_) in tag name + $tag = preg_replace("/[:\-\. ]/", "_", $tag); + eval( "\$this->pointer[\$this->index]->" . $tag . "[] = \$object;" ); + eval( "\$size = sizeof( \$this->pointer[\$this->index]->" . $tag . " );" ); + eval( "\$this->pointer[] = &\$this->pointer[\$this->index]->" . $tag . "[\$size-1];" ); + + $this->index++; + } + + function _endElement( $parser, $tag ) + { + array_pop( $this->pointer ); + $this->index--; + } + + function _cData( $parser, $data ) + { + if (empty($this->pointer[$this->index])) { + if (rtrim($data, "\n")) + $this->pointer[$this->index] = $data; + } else { + $this->pointer[$this->index] .= $data; + } + } + + function _cleanString( $string ) + { + return utf8_decode( trim( $string ) ); + } +} + +?> \ No newline at end of file diff --git a/e107_images/admin_images/adminlogs_16.png b/e107_images/admin_images/adminlogs_16.png new file mode 100644 index 000000000..4737f57f5 Binary files /dev/null and b/e107_images/admin_images/adminlogs_16.png differ diff --git a/e107_images/admin_images/adminlogs_32.png b/e107_images/admin_images/adminlogs_32.png new file mode 100644 index 000000000..05f31c70d Binary files /dev/null and b/e107_images/admin_images/adminlogs_32.png differ diff --git a/e107_images/admin_images/adminpass_16.png b/e107_images/admin_images/adminpass_16.png new file mode 100644 index 000000000..c0a40f200 Binary files /dev/null and b/e107_images/admin_images/adminpass_16.png differ diff --git a/e107_images/admin_images/adminpass_32.png b/e107_images/admin_images/adminpass_32.png new file mode 100644 index 000000000..7e861173a Binary files /dev/null and b/e107_images/admin_images/adminpass_32.png differ diff --git a/e107_images/admin_images/admins_16.png b/e107_images/admin_images/admins_16.png new file mode 100644 index 000000000..6d1fabb2c Binary files /dev/null and b/e107_images/admin_images/admins_16.png differ diff --git a/e107_images/admin_images/admins_32.png b/e107_images/admin_images/admins_32.png new file mode 100644 index 000000000..ba5d6608b Binary files /dev/null and b/e107_images/admin_images/admins_32.png differ diff --git a/e107_images/admin_images/arrow_16.png b/e107_images/admin_images/arrow_16.png new file mode 100644 index 000000000..064e5f466 Binary files /dev/null and b/e107_images/admin_images/arrow_16.png differ diff --git a/e107_images/admin_images/arrow_32.png b/e107_images/admin_images/arrow_32.png new file mode 100644 index 000000000..ed64335f0 Binary files /dev/null and b/e107_images/admin_images/arrow_32.png differ diff --git a/e107_images/admin_images/arrow_over_16.png b/e107_images/admin_images/arrow_over_16.png new file mode 100644 index 000000000..92dc165ca Binary files /dev/null and b/e107_images/admin_images/arrow_over_16.png differ diff --git a/e107_images/admin_images/arrow_over_32.png b/e107_images/admin_images/arrow_over_32.png new file mode 100644 index 000000000..cfb098539 Binary files /dev/null and b/e107_images/admin_images/arrow_over_32.png differ diff --git a/e107_images/admin_images/articles_16.png b/e107_images/admin_images/articles_16.png new file mode 100644 index 000000000..3a6694cb5 Binary files /dev/null and b/e107_images/admin_images/articles_16.png differ diff --git a/e107_images/admin_images/articles_32.png b/e107_images/admin_images/articles_32.png new file mode 100644 index 000000000..1b24c4de3 Binary files /dev/null and b/e107_images/admin_images/articles_32.png differ diff --git a/e107_images/admin_images/banlist_16.png b/e107_images/admin_images/banlist_16.png new file mode 100644 index 000000000..697e4970d Binary files /dev/null and b/e107_images/admin_images/banlist_16.png differ diff --git a/e107_images/admin_images/banlist_32.png b/e107_images/admin_images/banlist_32.png new file mode 100644 index 000000000..2b861e6a1 Binary files /dev/null and b/e107_images/admin_images/banlist_32.png differ diff --git a/e107_images/admin_images/banners_16.png b/e107_images/admin_images/banners_16.png new file mode 100644 index 000000000..d888eb6ca Binary files /dev/null and b/e107_images/admin_images/banners_16.png differ diff --git a/e107_images/admin_images/banners_32.png b/e107_images/admin_images/banners_32.png new file mode 100644 index 000000000..b81c8dd42 Binary files /dev/null and b/e107_images/admin_images/banners_32.png differ diff --git a/e107_images/admin_images/blocked.png b/e107_images/admin_images/blocked.png new file mode 100644 index 000000000..be6625a68 Binary files /dev/null and b/e107_images/admin_images/blocked.png differ diff --git a/e107_images/admin_images/cache_16.png b/e107_images/admin_images/cache_16.png new file mode 100644 index 000000000..9783afd71 Binary files /dev/null and b/e107_images/admin_images/cache_16.png differ diff --git a/e107_images/admin_images/cache_32.png b/e107_images/admin_images/cache_32.png new file mode 100644 index 000000000..044d155f3 Binary files /dev/null and b/e107_images/admin_images/cache_32.png differ diff --git a/e107_images/admin_images/cat_content_16.png b/e107_images/admin_images/cat_content_16.png new file mode 100644 index 000000000..9eb5a39dc Binary files /dev/null and b/e107_images/admin_images/cat_content_16.png differ diff --git a/e107_images/admin_images/cat_content_32.png b/e107_images/admin_images/cat_content_32.png new file mode 100644 index 000000000..ef9442390 Binary files /dev/null and b/e107_images/admin_images/cat_content_32.png differ diff --git a/e107_images/admin_images/cat_files_16.png b/e107_images/admin_images/cat_files_16.png new file mode 100644 index 000000000..7502e15e4 Binary files /dev/null and b/e107_images/admin_images/cat_files_16.png differ diff --git a/e107_images/admin_images/cat_files_32.png b/e107_images/admin_images/cat_files_32.png new file mode 100644 index 000000000..9b4e4e8a9 Binary files /dev/null and b/e107_images/admin_images/cat_files_32.png differ diff --git a/e107_images/admin_images/cat_plugins_16.png b/e107_images/admin_images/cat_plugins_16.png new file mode 100644 index 000000000..fc6772edd Binary files /dev/null and b/e107_images/admin_images/cat_plugins_16.png differ diff --git a/e107_images/admin_images/cat_plugins_32.png b/e107_images/admin_images/cat_plugins_32.png new file mode 100644 index 000000000..32f71ef54 Binary files /dev/null and b/e107_images/admin_images/cat_plugins_32.png differ diff --git a/e107_images/admin_images/cat_settings_16.png b/e107_images/admin_images/cat_settings_16.png new file mode 100644 index 000000000..e2d3eb81e Binary files /dev/null and b/e107_images/admin_images/cat_settings_16.png differ diff --git a/e107_images/admin_images/cat_settings_32.png b/e107_images/admin_images/cat_settings_32.png new file mode 100644 index 000000000..92b079d63 Binary files /dev/null and b/e107_images/admin_images/cat_settings_32.png differ diff --git a/e107_images/admin_images/cat_tools_16.png b/e107_images/admin_images/cat_tools_16.png new file mode 100644 index 000000000..ee1fa9d21 Binary files /dev/null and b/e107_images/admin_images/cat_tools_16.png differ diff --git a/e107_images/admin_images/cat_tools_32.png b/e107_images/admin_images/cat_tools_32.png new file mode 100644 index 000000000..f50428628 Binary files /dev/null and b/e107_images/admin_images/cat_tools_32.png differ diff --git a/e107_images/admin_images/cat_users_16.png b/e107_images/admin_images/cat_users_16.png new file mode 100644 index 000000000..1938ffefd Binary files /dev/null and b/e107_images/admin_images/cat_users_16.png differ diff --git a/e107_images/admin_images/cat_users_32.png b/e107_images/admin_images/cat_users_32.png new file mode 100644 index 000000000..87328efbd Binary files /dev/null and b/e107_images/admin_images/cat_users_32.png differ diff --git a/e107_images/admin_images/chatbox_16.png b/e107_images/admin_images/chatbox_16.png new file mode 100644 index 000000000..aa3aab597 Binary files /dev/null and b/e107_images/admin_images/chatbox_16.png differ diff --git a/e107_images/admin_images/chatbox_32.png b/e107_images/admin_images/chatbox_32.png new file mode 100644 index 000000000..d1dd53988 Binary files /dev/null and b/e107_images/admin_images/chatbox_32.png differ diff --git a/e107_images/admin_images/comments_16.png b/e107_images/admin_images/comments_16.png new file mode 100644 index 000000000..184b2c310 Binary files /dev/null and b/e107_images/admin_images/comments_16.png differ diff --git a/e107_images/admin_images/comments_32.png b/e107_images/admin_images/comments_32.png new file mode 100644 index 000000000..805bca240 Binary files /dev/null and b/e107_images/admin_images/comments_32.png differ diff --git a/e107_images/admin_images/content_16.png b/e107_images/admin_images/content_16.png new file mode 100644 index 000000000..72157f639 Binary files /dev/null and b/e107_images/admin_images/content_16.png differ diff --git a/e107_images/admin_images/content_32.png b/e107_images/admin_images/content_32.png new file mode 100644 index 000000000..9eeb16973 Binary files /dev/null and b/e107_images/admin_images/content_32.png differ diff --git a/e107_images/admin_images/credits_16.png b/e107_images/admin_images/credits_16.png new file mode 100644 index 000000000..5abe7bbe3 Binary files /dev/null and b/e107_images/admin_images/credits_16.png differ diff --git a/e107_images/admin_images/credits_32.png b/e107_images/admin_images/credits_32.png new file mode 100644 index 000000000..be78bd332 Binary files /dev/null and b/e107_images/admin_images/credits_32.png differ diff --git a/e107_images/admin_images/custom_16.png b/e107_images/admin_images/custom_16.png new file mode 100644 index 000000000..368e8e3cd Binary files /dev/null and b/e107_images/admin_images/custom_16.png differ diff --git a/e107_images/admin_images/custom_32.png b/e107_images/admin_images/custom_32.png new file mode 100644 index 000000000..a362474fc Binary files /dev/null and b/e107_images/admin_images/custom_32.png differ diff --git a/e107_images/admin_images/database_16.png b/e107_images/admin_images/database_16.png new file mode 100644 index 000000000..5d707a97c Binary files /dev/null and b/e107_images/admin_images/database_16.png differ diff --git a/e107_images/admin_images/database_32.png b/e107_images/admin_images/database_32.png new file mode 100644 index 000000000..4904232ff Binary files /dev/null and b/e107_images/admin_images/database_32.png differ diff --git a/e107_images/admin_images/delete_16.png b/e107_images/admin_images/delete_16.png new file mode 100644 index 000000000..d680791ab Binary files /dev/null and b/e107_images/admin_images/delete_16.png differ diff --git a/e107_images/admin_images/delete_32.png b/e107_images/admin_images/delete_32.png new file mode 100644 index 000000000..0eee355c8 Binary files /dev/null and b/e107_images/admin_images/delete_32.png differ diff --git a/e107_images/admin_images/docs_16.png b/e107_images/admin_images/docs_16.png new file mode 100644 index 000000000..63b21b0d5 Binary files /dev/null and b/e107_images/admin_images/docs_16.png differ diff --git a/e107_images/admin_images/docs_32.png b/e107_images/admin_images/docs_32.png new file mode 100644 index 000000000..43372e9bf Binary files /dev/null and b/e107_images/admin_images/docs_32.png differ diff --git a/e107_images/admin_images/down.png b/e107_images/admin_images/down.png new file mode 100644 index 000000000..8108212c0 Binary files /dev/null and b/e107_images/admin_images/down.png differ diff --git a/e107_images/admin_images/downloads_16.png b/e107_images/admin_images/downloads_16.png new file mode 100644 index 000000000..60a03f613 Binary files /dev/null and b/e107_images/admin_images/downloads_16.png differ diff --git a/e107_images/admin_images/downloads_32.png b/e107_images/admin_images/downloads_32.png new file mode 100644 index 000000000..10cfccd52 Binary files /dev/null and b/e107_images/admin_images/downloads_32.png differ diff --git a/e107_images/admin_images/edit_16.png b/e107_images/admin_images/edit_16.png new file mode 100644 index 000000000..1055cae3f Binary files /dev/null and b/e107_images/admin_images/edit_16.png differ diff --git a/e107_images/admin_images/edit_32.png b/e107_images/admin_images/edit_32.png new file mode 100644 index 000000000..f575ef9c8 Binary files /dev/null and b/e107_images/admin_images/edit_32.png differ diff --git a/e107_images/admin_images/emoticons_16.png b/e107_images/admin_images/emoticons_16.png new file mode 100644 index 000000000..d1f945951 Binary files /dev/null and b/e107_images/admin_images/emoticons_16.png differ diff --git a/e107_images/admin_images/emoticons_32.png b/e107_images/admin_images/emoticons_32.png new file mode 100644 index 000000000..0beb7a18f Binary files /dev/null and b/e107_images/admin_images/emoticons_32.png differ diff --git a/e107_images/admin_images/extended_16.png b/e107_images/admin_images/extended_16.png new file mode 100644 index 000000000..ffe37a3e7 Binary files /dev/null and b/e107_images/admin_images/extended_16.png differ diff --git a/e107_images/admin_images/extended_32.png b/e107_images/admin_images/extended_32.png new file mode 100644 index 000000000..aae3470ab Binary files /dev/null and b/e107_images/admin_images/extended_32.png differ diff --git a/e107_images/admin_images/failedlogin_16.png b/e107_images/admin_images/failedlogin_16.png new file mode 100644 index 000000000..98c3e235d Binary files /dev/null and b/e107_images/admin_images/failedlogin_16.png differ diff --git a/e107_images/admin_images/fileinspector_16.png b/e107_images/admin_images/fileinspector_16.png new file mode 100644 index 000000000..cdc463bf2 Binary files /dev/null and b/e107_images/admin_images/fileinspector_16.png differ diff --git a/e107_images/admin_images/fileinspector_32.png b/e107_images/admin_images/fileinspector_32.png new file mode 100644 index 000000000..0b49acbe1 Binary files /dev/null and b/e107_images/admin_images/fileinspector_32.png differ diff --git a/e107_images/admin_images/filemanager_16.png b/e107_images/admin_images/filemanager_16.png new file mode 100644 index 000000000..7502e15e4 Binary files /dev/null and b/e107_images/admin_images/filemanager_16.png differ diff --git a/e107_images/admin_images/filemanager_32.png b/e107_images/admin_images/filemanager_32.png new file mode 100644 index 000000000..9b4e4e8a9 Binary files /dev/null and b/e107_images/admin_images/filemanager_32.png differ diff --git a/e107_images/admin_images/forums_16.png b/e107_images/admin_images/forums_16.png new file mode 100644 index 000000000..8777fd92c Binary files /dev/null and b/e107_images/admin_images/forums_16.png differ diff --git a/e107_images/admin_images/forums_32.png b/e107_images/admin_images/forums_32.png new file mode 100644 index 000000000..01f4b37ad Binary files /dev/null and b/e107_images/admin_images/forums_32.png differ diff --git a/e107_images/admin_images/frontpage_16.png b/e107_images/admin_images/frontpage_16.png new file mode 100644 index 000000000..cb8d02977 Binary files /dev/null and b/e107_images/admin_images/frontpage_16.png differ diff --git a/e107_images/admin_images/frontpage_32.png b/e107_images/admin_images/frontpage_32.png new file mode 100644 index 000000000..c01b078b6 Binary files /dev/null and b/e107_images/admin_images/frontpage_32.png differ diff --git a/e107_images/admin_images/images_16.png b/e107_images/admin_images/images_16.png new file mode 100644 index 000000000..d6cfc4061 Binary files /dev/null and b/e107_images/admin_images/images_16.png differ diff --git a/e107_images/admin_images/images_32.png b/e107_images/admin_images/images_32.png new file mode 100644 index 000000000..dea04363b Binary files /dev/null and b/e107_images/admin_images/images_32.png differ diff --git a/e107_images/admin_images/installed.png b/e107_images/admin_images/installed.png new file mode 100644 index 000000000..a4e49e248 Binary files /dev/null and b/e107_images/admin_images/installed.png differ diff --git a/e107_images/admin_images/language_16.png b/e107_images/admin_images/language_16.png new file mode 100644 index 000000000..982d10b99 Binary files /dev/null and b/e107_images/admin_images/language_16.png differ diff --git a/e107_images/admin_images/language_32.png b/e107_images/admin_images/language_32.png new file mode 100644 index 000000000..bf0badeb0 Binary files /dev/null and b/e107_images/admin_images/language_32.png differ diff --git a/e107_images/admin_images/leave_16.png b/e107_images/admin_images/leave_16.png new file mode 100644 index 000000000..6cc756cdf Binary files /dev/null and b/e107_images/admin_images/leave_16.png differ diff --git a/e107_images/admin_images/leave_32.png b/e107_images/admin_images/leave_32.png new file mode 100644 index 000000000..9b72cd122 Binary files /dev/null and b/e107_images/admin_images/leave_32.png differ diff --git a/e107_images/admin_images/links_16.png b/e107_images/admin_images/links_16.png new file mode 100644 index 000000000..90454faa4 Binary files /dev/null and b/e107_images/admin_images/links_16.png differ diff --git a/e107_images/admin_images/links_32.png b/e107_images/admin_images/links_32.png new file mode 100644 index 000000000..daa7788ac Binary files /dev/null and b/e107_images/admin_images/links_32.png differ diff --git a/e107_images/admin_images/logout_16.png b/e107_images/admin_images/logout_16.png new file mode 100644 index 000000000..6ed913fd3 Binary files /dev/null and b/e107_images/admin_images/logout_16.png differ diff --git a/e107_images/admin_images/logout_32.png b/e107_images/admin_images/logout_32.png new file mode 100644 index 000000000..a437d2af7 Binary files /dev/null and b/e107_images/admin_images/logout_32.png differ diff --git a/e107_images/admin_images/mail_16.png b/e107_images/admin_images/mail_16.png new file mode 100644 index 000000000..a5ad9f598 Binary files /dev/null and b/e107_images/admin_images/mail_16.png differ diff --git a/e107_images/admin_images/mail_32.png b/e107_images/admin_images/mail_32.png new file mode 100644 index 000000000..d45bb2a20 Binary files /dev/null and b/e107_images/admin_images/mail_32.png differ diff --git a/e107_images/admin_images/main_16.png b/e107_images/admin_images/main_16.png new file mode 100644 index 000000000..32f7e086d Binary files /dev/null and b/e107_images/admin_images/main_16.png differ diff --git a/e107_images/admin_images/main_32.png b/e107_images/admin_images/main_32.png new file mode 100644 index 000000000..b195d54bf Binary files /dev/null and b/e107_images/admin_images/main_32.png differ diff --git a/e107_images/admin_images/maintain_16.png b/e107_images/admin_images/maintain_16.png new file mode 100644 index 000000000..7cde7e57f Binary files /dev/null and b/e107_images/admin_images/maintain_16.png differ diff --git a/e107_images/admin_images/maintain_32.png b/e107_images/admin_images/maintain_32.png new file mode 100644 index 000000000..10766f8c9 Binary files /dev/null and b/e107_images/admin_images/maintain_32.png differ diff --git a/e107_images/admin_images/menus_16.png b/e107_images/admin_images/menus_16.png new file mode 100644 index 000000000..aad0f1338 Binary files /dev/null and b/e107_images/admin_images/menus_16.png differ diff --git a/e107_images/admin_images/menus_32.png b/e107_images/admin_images/menus_32.png new file mode 100644 index 000000000..5cc3b0cf3 Binary files /dev/null and b/e107_images/admin_images/menus_32.png differ diff --git a/e107_images/admin_images/meta_16.png b/e107_images/admin_images/meta_16.png new file mode 100644 index 000000000..6c5843414 Binary files /dev/null and b/e107_images/admin_images/meta_16.png differ diff --git a/e107_images/admin_images/meta_32.png b/e107_images/admin_images/meta_32.png new file mode 100644 index 000000000..415e88f76 Binary files /dev/null and b/e107_images/admin_images/meta_32.png differ diff --git a/e107_images/admin_images/news_16.png b/e107_images/admin_images/news_16.png new file mode 100644 index 000000000..cfa279899 Binary files /dev/null and b/e107_images/admin_images/news_16.png differ diff --git a/e107_images/admin_images/news_32.png b/e107_images/admin_images/news_32.png new file mode 100644 index 000000000..21cccc7ac Binary files /dev/null and b/e107_images/admin_images/news_32.png differ diff --git a/e107_images/admin_images/newsfeeds_16.png b/e107_images/admin_images/newsfeeds_16.png new file mode 100644 index 000000000..231d7ef70 Binary files /dev/null and b/e107_images/admin_images/newsfeeds_16.png differ diff --git a/e107_images/admin_images/newsfeeds_32.png b/e107_images/admin_images/newsfeeds_32.png new file mode 100644 index 000000000..3f7b77882 Binary files /dev/null and b/e107_images/admin_images/newsfeeds_32.png differ diff --git a/e107_images/admin_images/noinstall.png b/e107_images/admin_images/noinstall.png new file mode 100644 index 000000000..5b99ae199 Binary files /dev/null and b/e107_images/admin_images/noinstall.png differ diff --git a/e107_images/admin_images/nopreview.png b/e107_images/admin_images/nopreview.png new file mode 100644 index 000000000..4fd23705c Binary files /dev/null and b/e107_images/admin_images/nopreview.png differ diff --git a/e107_images/admin_images/notify_16.png b/e107_images/admin_images/notify_16.png new file mode 100644 index 000000000..89d28ffac Binary files /dev/null and b/e107_images/admin_images/notify_16.png differ diff --git a/e107_images/admin_images/notify_32.png b/e107_images/admin_images/notify_32.png new file mode 100644 index 000000000..9dd5dd18c Binary files /dev/null and b/e107_images/admin_images/notify_32.png differ diff --git a/e107_images/admin_images/phpinfo_16.png b/e107_images/admin_images/phpinfo_16.png new file mode 100644 index 000000000..bbf793fef Binary files /dev/null and b/e107_images/admin_images/phpinfo_16.png differ diff --git a/e107_images/admin_images/phpinfo_32.png b/e107_images/admin_images/phpinfo_32.png new file mode 100644 index 000000000..4b6db72fa Binary files /dev/null and b/e107_images/admin_images/phpinfo_32.png differ diff --git a/e107_images/admin_images/plugins_16.png b/e107_images/admin_images/plugins_16.png new file mode 100644 index 000000000..fc6772edd Binary files /dev/null and b/e107_images/admin_images/plugins_16.png differ diff --git a/e107_images/admin_images/plugins_32.png b/e107_images/admin_images/plugins_32.png new file mode 100644 index 000000000..32f71ef54 Binary files /dev/null and b/e107_images/admin_images/plugins_32.png differ diff --git a/e107_images/admin_images/plugmanager_16.png b/e107_images/admin_images/plugmanager_16.png new file mode 100644 index 000000000..cf94f1fe9 Binary files /dev/null and b/e107_images/admin_images/plugmanager_16.png differ diff --git a/e107_images/admin_images/plugmanager_32.png b/e107_images/admin_images/plugmanager_32.png new file mode 100644 index 000000000..fd72cc1af Binary files /dev/null and b/e107_images/admin_images/plugmanager_32.png differ diff --git a/e107_images/admin_images/polls_16.png b/e107_images/admin_images/polls_16.png new file mode 100644 index 000000000..297342b4f Binary files /dev/null and b/e107_images/admin_images/polls_16.png differ diff --git a/e107_images/admin_images/polls_32.png b/e107_images/admin_images/polls_32.png new file mode 100644 index 000000000..882d46e82 Binary files /dev/null and b/e107_images/admin_images/polls_32.png differ diff --git a/e107_images/admin_images/prefs_16.png b/e107_images/admin_images/prefs_16.png new file mode 100644 index 000000000..b218534e0 Binary files /dev/null and b/e107_images/admin_images/prefs_16.png differ diff --git a/e107_images/admin_images/prefs_32.png b/e107_images/admin_images/prefs_32.png new file mode 100644 index 000000000..52d327f13 Binary files /dev/null and b/e107_images/admin_images/prefs_32.png differ diff --git a/e107_images/admin_images/reviews_16.png b/e107_images/admin_images/reviews_16.png new file mode 100644 index 000000000..2c7e1124c Binary files /dev/null and b/e107_images/admin_images/reviews_16.png differ diff --git a/e107_images/admin_images/reviews_32.png b/e107_images/admin_images/reviews_32.png new file mode 100644 index 000000000..e7807f4ec Binary files /dev/null and b/e107_images/admin_images/reviews_32.png differ diff --git a/e107_images/admin_images/search_16.png b/e107_images/admin_images/search_16.png new file mode 100644 index 000000000..dd353930b Binary files /dev/null and b/e107_images/admin_images/search_16.png differ diff --git a/e107_images/admin_images/search_32.png b/e107_images/admin_images/search_32.png new file mode 100644 index 000000000..328e2d455 Binary files /dev/null and b/e107_images/admin_images/search_32.png differ diff --git a/e107_images/admin_images/stats_16.png b/e107_images/admin_images/stats_16.png new file mode 100644 index 000000000..b3f7d654c Binary files /dev/null and b/e107_images/admin_images/stats_16.png differ diff --git a/e107_images/admin_images/stats_32.png b/e107_images/admin_images/stats_32.png new file mode 100644 index 000000000..2b55aa6ed Binary files /dev/null and b/e107_images/admin_images/stats_32.png differ diff --git a/e107_images/admin_images/sub_forums_16.png b/e107_images/admin_images/sub_forums_16.png new file mode 100644 index 000000000..0c8dc9c5e Binary files /dev/null and b/e107_images/admin_images/sub_forums_16.png differ diff --git a/e107_images/admin_images/sublink.png b/e107_images/admin_images/sublink.png new file mode 100644 index 000000000..b7ee61377 Binary files /dev/null and b/e107_images/admin_images/sublink.png differ diff --git a/e107_images/admin_images/sublink_16.png b/e107_images/admin_images/sublink_16.png new file mode 100644 index 000000000..47190bf52 Binary files /dev/null and b/e107_images/admin_images/sublink_16.png differ diff --git a/e107_images/admin_images/themes_16.png b/e107_images/admin_images/themes_16.png new file mode 100644 index 000000000..0381db929 Binary files /dev/null and b/e107_images/admin_images/themes_16.png differ diff --git a/e107_images/admin_images/themes_32.png b/e107_images/admin_images/themes_32.png new file mode 100644 index 000000000..3fcafe36e Binary files /dev/null and b/e107_images/admin_images/themes_32.png differ diff --git a/e107_images/admin_images/uninstalled.png b/e107_images/admin_images/uninstalled.png new file mode 100644 index 000000000..8963e47fc Binary files /dev/null and b/e107_images/admin_images/uninstalled.png differ diff --git a/e107_images/admin_images/up.png b/e107_images/admin_images/up.png new file mode 100644 index 000000000..51ba0f631 Binary files /dev/null and b/e107_images/admin_images/up.png differ diff --git a/e107_images/admin_images/upgrade.png b/e107_images/admin_images/upgrade.png new file mode 100644 index 000000000..9643adf60 Binary files /dev/null and b/e107_images/admin_images/upgrade.png differ diff --git a/e107_images/admin_images/uploads_16.png b/e107_images/admin_images/uploads_16.png new file mode 100644 index 000000000..0ef31fe27 Binary files /dev/null and b/e107_images/admin_images/uploads_16.png differ diff --git a/e107_images/admin_images/uploads_32.png b/e107_images/admin_images/uploads_32.png new file mode 100644 index 000000000..58f6d5de0 Binary files /dev/null and b/e107_images/admin_images/uploads_32.png differ diff --git a/e107_images/admin_images/userclass_16.png b/e107_images/admin_images/userclass_16.png new file mode 100644 index 000000000..c4950aa7e Binary files /dev/null and b/e107_images/admin_images/userclass_16.png differ diff --git a/e107_images/admin_images/userclass_32.png b/e107_images/admin_images/userclass_32.png new file mode 100644 index 000000000..cd8da8781 Binary files /dev/null and b/e107_images/admin_images/userclass_32.png differ diff --git a/e107_images/admin_images/users_16.png b/e107_images/admin_images/users_16.png new file mode 100644 index 000000000..1938ffefd Binary files /dev/null and b/e107_images/admin_images/users_16.png differ diff --git a/e107_images/admin_images/users_32.png b/e107_images/admin_images/users_32.png new file mode 100644 index 000000000..87328efbd Binary files /dev/null and b/e107_images/admin_images/users_32.png differ diff --git a/e107_images/admin_images/welcome_16.png b/e107_images/admin_images/welcome_16.png new file mode 100644 index 000000000..e0ccc3c55 Binary files /dev/null and b/e107_images/admin_images/welcome_16.png differ diff --git a/e107_images/admin_images/welcome_32.png b/e107_images/admin_images/welcome_32.png new file mode 100644 index 000000000..67449ffae Binary files /dev/null and b/e107_images/admin_images/welcome_32.png differ diff --git a/e107_images/adminlogo.png b/e107_images/adminlogo.png new file mode 100644 index 000000000..359480d71 Binary files /dev/null and b/e107_images/adminlogo.png differ diff --git a/e107_images/advanced.png b/e107_images/advanced.png new file mode 100644 index 000000000..60c08c108 Binary files /dev/null and b/e107_images/advanced.png differ diff --git a/e107_images/avatars/avatar_1.png b/e107_images/avatars/avatar_1.png new file mode 100644 index 000000000..938ef07ef Binary files /dev/null and b/e107_images/avatars/avatar_1.png differ diff --git a/e107_images/avatars/index.html b/e107_images/avatars/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_images/banners/banner1.png b/e107_images/banners/banner1.png new file mode 100644 index 000000000..e7e4943f4 Binary files /dev/null and b/e107_images/banners/banner1.png differ diff --git a/e107_images/banners/banner2.png b/e107_images/banners/banner2.png new file mode 100644 index 000000000..d1c7c4947 Binary files /dev/null and b/e107_images/banners/banner2.png differ diff --git a/e107_images/banners/banner3.png b/e107_images/banners/banner3.png new file mode 100644 index 000000000..0f6e1b373 Binary files /dev/null and b/e107_images/banners/banner3.png differ diff --git a/e107_images/button.png b/e107_images/button.png new file mode 100644 index 000000000..629cd43d3 Binary files /dev/null and b/e107_images/button.png differ diff --git a/e107_images/custom/index.html b/e107_images/custom/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_images/e107_icon_16.png b/e107_images/e107_icon_16.png new file mode 100644 index 000000000..e2b95b2c8 Binary files /dev/null and b/e107_images/e107_icon_16.png differ diff --git a/e107_images/e107_icon_32.png b/e107_images/e107_icon_32.png new file mode 100644 index 000000000..7fdc2d8b3 Binary files /dev/null and b/e107_images/e107_icon_32.png differ diff --git a/e107_images/emotes/default/alien.png b/e107_images/emotes/default/alien.png new file mode 100644 index 000000000..81569ef8f Binary files /dev/null and b/e107_images/emotes/default/alien.png differ diff --git a/e107_images/emotes/default/amazed.png b/e107_images/emotes/default/amazed.png new file mode 100644 index 000000000..90dbedc52 Binary files /dev/null and b/e107_images/emotes/default/amazed.png differ diff --git a/e107_images/emotes/default/angry.png b/e107_images/emotes/default/angry.png new file mode 100644 index 000000000..368c9ad14 Binary files /dev/null and b/e107_images/emotes/default/angry.png differ diff --git a/e107_images/emotes/default/biglaugh.png b/e107_images/emotes/default/biglaugh.png new file mode 100644 index 000000000..51ff29614 Binary files /dev/null and b/e107_images/emotes/default/biglaugh.png differ diff --git a/e107_images/emotes/default/cheesey.png b/e107_images/emotes/default/cheesey.png new file mode 100644 index 000000000..69ce65587 Binary files /dev/null and b/e107_images/emotes/default/cheesey.png differ diff --git a/e107_images/emotes/default/confused.png b/e107_images/emotes/default/confused.png new file mode 100644 index 000000000..72ed2e827 Binary files /dev/null and b/e107_images/emotes/default/confused.png differ diff --git a/e107_images/emotes/default/cry.png b/e107_images/emotes/default/cry.png new file mode 100644 index 000000000..100816902 Binary files /dev/null and b/e107_images/emotes/default/cry.png differ diff --git a/e107_images/emotes/default/dead.png b/e107_images/emotes/default/dead.png new file mode 100644 index 000000000..d1ef23d97 Binary files /dev/null and b/e107_images/emotes/default/dead.png differ diff --git a/e107_images/emotes/default/dodge.png b/e107_images/emotes/default/dodge.png new file mode 100644 index 000000000..fdb30c3f8 Binary files /dev/null and b/e107_images/emotes/default/dodge.png differ diff --git a/e107_images/emotes/default/frown.png b/e107_images/emotes/default/frown.png new file mode 100644 index 000000000..acf7e31b8 Binary files /dev/null and b/e107_images/emotes/default/frown.png differ diff --git a/e107_images/emotes/default/gah.png b/e107_images/emotes/default/gah.png new file mode 100644 index 000000000..d2ac1252f Binary files /dev/null and b/e107_images/emotes/default/gah.png differ diff --git a/e107_images/emotes/default/grin.png b/e107_images/emotes/default/grin.png new file mode 100644 index 000000000..a11f7e0e8 Binary files /dev/null and b/e107_images/emotes/default/grin.png differ diff --git a/e107_images/emotes/default/heart.png b/e107_images/emotes/default/heart.png new file mode 100644 index 000000000..123b8140b Binary files /dev/null and b/e107_images/emotes/default/heart.png differ diff --git a/e107_images/emotes/default/idea.png b/e107_images/emotes/default/idea.png new file mode 100644 index 000000000..236f5c65a Binary files /dev/null and b/e107_images/emotes/default/idea.png differ diff --git a/e107_images/emotes/default/ill.png b/e107_images/emotes/default/ill.png new file mode 100644 index 000000000..fac960f82 Binary files /dev/null and b/e107_images/emotes/default/ill.png differ diff --git a/e107_images/emotes/default/mad.png b/e107_images/emotes/default/mad.png new file mode 100644 index 000000000..390911f06 Binary files /dev/null and b/e107_images/emotes/default/mad.png differ diff --git a/e107_images/emotes/default/mistrust.png b/e107_images/emotes/default/mistrust.png new file mode 100644 index 000000000..2a330b606 Binary files /dev/null and b/e107_images/emotes/default/mistrust.png differ diff --git a/e107_images/emotes/default/neutral.png b/e107_images/emotes/default/neutral.png new file mode 100644 index 000000000..7f8ae23a4 Binary files /dev/null and b/e107_images/emotes/default/neutral.png differ diff --git a/e107_images/emotes/default/question.png b/e107_images/emotes/default/question.png new file mode 100644 index 000000000..7a6cebc25 Binary files /dev/null and b/e107_images/emotes/default/question.png differ diff --git a/e107_images/emotes/default/rolleyes.png b/e107_images/emotes/default/rolleyes.png new file mode 100644 index 000000000..c895b9b5f Binary files /dev/null and b/e107_images/emotes/default/rolleyes.png differ diff --git a/e107_images/emotes/default/sad.png b/e107_images/emotes/default/sad.png new file mode 100644 index 000000000..eae0631bb Binary files /dev/null and b/e107_images/emotes/default/sad.png differ diff --git a/e107_images/emotes/default/shades.png b/e107_images/emotes/default/shades.png new file mode 100644 index 000000000..b6848e4e0 Binary files /dev/null and b/e107_images/emotes/default/shades.png differ diff --git a/e107_images/emotes/default/shy.png b/e107_images/emotes/default/shy.png new file mode 100644 index 000000000..9b2a2065c Binary files /dev/null and b/e107_images/emotes/default/shy.png differ diff --git a/e107_images/emotes/default/smile.png b/e107_images/emotes/default/smile.png new file mode 100644 index 000000000..65806f959 Binary files /dev/null and b/e107_images/emotes/default/smile.png differ diff --git a/e107_images/emotes/default/special.png b/e107_images/emotes/default/special.png new file mode 100644 index 000000000..be3f858b6 Binary files /dev/null and b/e107_images/emotes/default/special.png differ diff --git a/e107_images/emotes/default/suprised.png b/e107_images/emotes/default/suprised.png new file mode 100644 index 000000000..549c376df Binary files /dev/null and b/e107_images/emotes/default/suprised.png differ diff --git a/e107_images/emotes/default/tongue.png b/e107_images/emotes/default/tongue.png new file mode 100644 index 000000000..3820c193b Binary files /dev/null and b/e107_images/emotes/default/tongue.png differ diff --git a/e107_images/emotes/default/wink.png b/e107_images/emotes/default/wink.png new file mode 100644 index 000000000..960d71d3b Binary files /dev/null and b/e107_images/emotes/default/wink.png differ diff --git a/e107_images/fileinspector/blank.png b/e107_images/fileinspector/blank.png new file mode 100644 index 000000000..3e5659f03 Binary files /dev/null and b/e107_images/fileinspector/blank.png differ diff --git a/e107_images/fileinspector/close.png b/e107_images/fileinspector/close.png new file mode 100644 index 000000000..6b06032ec Binary files /dev/null and b/e107_images/fileinspector/close.png differ diff --git a/e107_images/fileinspector/contract.png b/e107_images/fileinspector/contract.png new file mode 100644 index 000000000..66b37a2c6 Binary files /dev/null and b/e107_images/fileinspector/contract.png differ diff --git a/e107_images/fileinspector/expand.png b/e107_images/fileinspector/expand.png new file mode 100644 index 000000000..3463d9cd8 Binary files /dev/null and b/e107_images/fileinspector/expand.png differ diff --git a/e107_images/fileinspector/file.png b/e107_images/fileinspector/file.png new file mode 100644 index 000000000..ed15bd846 Binary files /dev/null and b/e107_images/fileinspector/file.png differ diff --git a/e107_images/fileinspector/file_check.png b/e107_images/fileinspector/file_check.png new file mode 100644 index 000000000..9722a5968 Binary files /dev/null and b/e107_images/fileinspector/file_check.png differ diff --git a/e107_images/fileinspector/file_core.png b/e107_images/fileinspector/file_core.png new file mode 100644 index 000000000..4877d21b1 Binary files /dev/null and b/e107_images/fileinspector/file_core.png differ diff --git a/e107_images/fileinspector/file_fail.png b/e107_images/fileinspector/file_fail.png new file mode 100644 index 000000000..791b96743 Binary files /dev/null and b/e107_images/fileinspector/file_fail.png differ diff --git a/e107_images/fileinspector/file_missing.png b/e107_images/fileinspector/file_missing.png new file mode 100644 index 000000000..22174df01 Binary files /dev/null and b/e107_images/fileinspector/file_missing.png differ diff --git a/e107_images/fileinspector/file_old.png b/e107_images/fileinspector/file_old.png new file mode 100644 index 000000000..e1aa732f3 Binary files /dev/null and b/e107_images/fileinspector/file_old.png differ diff --git a/e107_images/fileinspector/file_uncalc.png b/e107_images/fileinspector/file_uncalc.png new file mode 100644 index 000000000..bd32a5f3e Binary files /dev/null and b/e107_images/fileinspector/file_uncalc.png differ diff --git a/e107_images/fileinspector/file_unknown.png b/e107_images/fileinspector/file_unknown.png new file mode 100644 index 000000000..7621975eb Binary files /dev/null and b/e107_images/fileinspector/file_unknown.png differ diff --git a/e107_images/fileinspector/file_warning.png b/e107_images/fileinspector/file_warning.png new file mode 100644 index 000000000..df3686ee9 Binary files /dev/null and b/e107_images/fileinspector/file_warning.png differ diff --git a/e107_images/fileinspector/fileinspector.png b/e107_images/fileinspector/fileinspector.png new file mode 100644 index 000000000..cdc463bf2 Binary files /dev/null and b/e107_images/fileinspector/fileinspector.png differ diff --git a/e107_images/fileinspector/folder.png b/e107_images/fileinspector/folder.png new file mode 100644 index 000000000..e11cc48bf Binary files /dev/null and b/e107_images/fileinspector/folder.png differ diff --git a/e107_images/fileinspector/folder_check.png b/e107_images/fileinspector/folder_check.png new file mode 100644 index 000000000..357a469f9 Binary files /dev/null and b/e107_images/fileinspector/folder_check.png differ diff --git a/e107_images/fileinspector/folder_core.png b/e107_images/fileinspector/folder_core.png new file mode 100644 index 000000000..e09f201f2 Binary files /dev/null and b/e107_images/fileinspector/folder_core.png differ diff --git a/e107_images/fileinspector/folder_fail.png b/e107_images/fileinspector/folder_fail.png new file mode 100644 index 000000000..f700ee8a8 Binary files /dev/null and b/e107_images/fileinspector/folder_fail.png differ diff --git a/e107_images/fileinspector/folder_missing.png b/e107_images/fileinspector/folder_missing.png new file mode 100644 index 000000000..620f9f856 Binary files /dev/null and b/e107_images/fileinspector/folder_missing.png differ diff --git a/e107_images/fileinspector/folder_old.png b/e107_images/fileinspector/folder_old.png new file mode 100644 index 000000000..873e0f71b Binary files /dev/null and b/e107_images/fileinspector/folder_old.png differ diff --git a/e107_images/fileinspector/folder_old_dir.png b/e107_images/fileinspector/folder_old_dir.png new file mode 100644 index 000000000..d04d224ad Binary files /dev/null and b/e107_images/fileinspector/folder_old_dir.png differ diff --git a/e107_images/fileinspector/folder_root.png b/e107_images/fileinspector/folder_root.png new file mode 100644 index 000000000..073a5a599 Binary files /dev/null and b/e107_images/fileinspector/folder_root.png differ diff --git a/e107_images/fileinspector/folder_unknown.png b/e107_images/fileinspector/folder_unknown.png new file mode 100644 index 000000000..e1712f656 Binary files /dev/null and b/e107_images/fileinspector/folder_unknown.png differ diff --git a/e107_images/fileinspector/folder_up.png b/e107_images/fileinspector/folder_up.png new file mode 100644 index 000000000..963e3cabe Binary files /dev/null and b/e107_images/fileinspector/folder_up.png differ diff --git a/e107_images/fileinspector/folder_warning.png b/e107_images/fileinspector/folder_warning.png new file mode 100644 index 000000000..172b0bbdb Binary files /dev/null and b/e107_images/fileinspector/folder_warning.png differ diff --git a/e107_images/fileinspector/forward.png b/e107_images/fileinspector/forward.png new file mode 100644 index 000000000..f66eeb20e Binary files /dev/null and b/e107_images/fileinspector/forward.png differ diff --git a/e107_images/fileinspector/info.png b/e107_images/fileinspector/info.png new file mode 100644 index 000000000..dae0ff88d Binary files /dev/null and b/e107_images/fileinspector/info.png differ diff --git a/e107_images/fileinspector/integrity_fail.png b/e107_images/fileinspector/integrity_fail.png new file mode 100644 index 000000000..456bea873 Binary files /dev/null and b/e107_images/fileinspector/integrity_fail.png differ diff --git a/e107_images/fileinspector/integrity_pass.png b/e107_images/fileinspector/integrity_pass.png new file mode 100644 index 000000000..6b4136851 Binary files /dev/null and b/e107_images/fileinspector/integrity_pass.png differ diff --git a/e107_images/fileinspector/warning.png b/e107_images/fileinspector/warning.png new file mode 100644 index 000000000..faf2fd503 Binary files /dev/null and b/e107_images/fileinspector/warning.png differ diff --git a/e107_images/filemanager/css.png b/e107_images/filemanager/css.png new file mode 100644 index 000000000..ca8e2a7f1 Binary files /dev/null and b/e107_images/filemanager/css.png differ diff --git a/e107_images/filemanager/def.png b/e107_images/filemanager/def.png new file mode 100644 index 000000000..8973e8b83 Binary files /dev/null and b/e107_images/filemanager/def.png differ diff --git a/e107_images/filemanager/default.png b/e107_images/filemanager/default.png new file mode 100644 index 000000000..354080a52 Binary files /dev/null and b/e107_images/filemanager/default.png differ diff --git a/e107_images/filemanager/del.png b/e107_images/filemanager/del.png new file mode 100644 index 000000000..902c38087 Binary files /dev/null and b/e107_images/filemanager/del.png differ diff --git a/e107_images/filemanager/exe.png b/e107_images/filemanager/exe.png new file mode 100644 index 000000000..37f25fc19 Binary files /dev/null and b/e107_images/filemanager/exe.png differ diff --git a/e107_images/filemanager/folder.png b/e107_images/filemanager/folder.png new file mode 100644 index 000000000..e499532bb Binary files /dev/null and b/e107_images/filemanager/folder.png differ diff --git a/e107_images/filemanager/gif.png b/e107_images/filemanager/gif.png new file mode 100644 index 000000000..1188089ff Binary files /dev/null and b/e107_images/filemanager/gif.png differ diff --git a/e107_images/filemanager/home.png b/e107_images/filemanager/home.png new file mode 100644 index 000000000..84013acb5 Binary files /dev/null and b/e107_images/filemanager/home.png differ diff --git a/e107_images/filemanager/htm.png b/e107_images/filemanager/htm.png new file mode 100644 index 000000000..ef5f018ec Binary files /dev/null and b/e107_images/filemanager/htm.png differ diff --git a/e107_images/filemanager/jpg.png b/e107_images/filemanager/jpg.png new file mode 100644 index 000000000..8e6695bb4 Binary files /dev/null and b/e107_images/filemanager/jpg.png differ diff --git a/e107_images/filemanager/js.png b/e107_images/filemanager/js.png new file mode 100644 index 000000000..d5e25fc04 Binary files /dev/null and b/e107_images/filemanager/js.png differ diff --git a/e107_images/filemanager/link.png b/e107_images/filemanager/link.png new file mode 100644 index 000000000..225031b56 Binary files /dev/null and b/e107_images/filemanager/link.png differ diff --git a/e107_images/filemanager/mp3.png b/e107_images/filemanager/mp3.png new file mode 100644 index 000000000..bebe99926 Binary files /dev/null and b/e107_images/filemanager/mp3.png differ diff --git a/e107_images/filemanager/pdf.png b/e107_images/filemanager/pdf.png new file mode 100644 index 000000000..e61203f03 Binary files /dev/null and b/e107_images/filemanager/pdf.png differ diff --git a/e107_images/filemanager/php.png b/e107_images/filemanager/php.png new file mode 100644 index 000000000..b82a4a704 Binary files /dev/null and b/e107_images/filemanager/php.png differ diff --git a/e107_images/filemanager/png.png b/e107_images/filemanager/png.png new file mode 100644 index 000000000..b174057cc Binary files /dev/null and b/e107_images/filemanager/png.png differ diff --git a/e107_images/filemanager/txt.png b/e107_images/filemanager/txt.png new file mode 100644 index 000000000..857cf769a Binary files /dev/null and b/e107_images/filemanager/txt.png differ diff --git a/e107_images/filemanager/updir.png b/e107_images/filemanager/updir.png new file mode 100644 index 000000000..8bc891042 Binary files /dev/null and b/e107_images/filemanager/updir.png differ diff --git a/e107_images/filemanager/xml.png b/e107_images/filemanager/xml.png new file mode 100644 index 000000000..08aa8dcd6 Binary files /dev/null and b/e107_images/filemanager/xml.png differ diff --git a/e107_images/filemanager/zip.png b/e107_images/filemanager/zip.png new file mode 100644 index 000000000..86d0be456 Binary files /dev/null and b/e107_images/filemanager/zip.png differ diff --git a/e107_images/generic/bar.png b/e107_images/generic/bar.png new file mode 100644 index 000000000..aef87804d Binary files /dev/null and b/e107_images/generic/bar.png differ diff --git a/e107_images/generic/bbcode/blockquote.png b/e107_images/generic/bbcode/blockquote.png new file mode 100644 index 000000000..7234a08f3 Binary files /dev/null and b/e107_images/generic/bbcode/blockquote.png differ diff --git a/e107_images/generic/bbcode/bold.png b/e107_images/generic/bbcode/bold.png new file mode 100644 index 000000000..5e5bd7174 Binary files /dev/null and b/e107_images/generic/bbcode/bold.png differ diff --git a/e107_images/generic/bbcode/center.png b/e107_images/generic/bbcode/center.png new file mode 100644 index 000000000..2cba96709 Binary files /dev/null and b/e107_images/generic/bbcode/center.png differ diff --git a/e107_images/generic/bbcode/code.png b/e107_images/generic/bbcode/code.png new file mode 100644 index 000000000..07313851f Binary files /dev/null and b/e107_images/generic/bbcode/code.png differ diff --git a/e107_images/generic/bbcode/emotes.png b/e107_images/generic/bbcode/emotes.png new file mode 100644 index 000000000..03377bb17 Binary files /dev/null and b/e107_images/generic/bbcode/emotes.png differ diff --git a/e107_images/generic/bbcode/flash.png b/e107_images/generic/bbcode/flash.png new file mode 100644 index 000000000..f3bab2883 Binary files /dev/null and b/e107_images/generic/bbcode/flash.png differ diff --git a/e107_images/generic/bbcode/fontcol.png b/e107_images/generic/bbcode/fontcol.png new file mode 100644 index 000000000..abaf15e77 Binary files /dev/null and b/e107_images/generic/bbcode/fontcol.png differ diff --git a/e107_images/generic/bbcode/fontsize.png b/e107_images/generic/bbcode/fontsize.png new file mode 100644 index 000000000..7b148febf Binary files /dev/null and b/e107_images/generic/bbcode/fontsize.png differ diff --git a/e107_images/generic/bbcode/image.png b/e107_images/generic/bbcode/image.png new file mode 100644 index 000000000..bec8eb21d Binary files /dev/null and b/e107_images/generic/bbcode/image.png differ diff --git a/e107_images/generic/bbcode/italic.png b/e107_images/generic/bbcode/italic.png new file mode 100644 index 000000000..98f065de4 Binary files /dev/null and b/e107_images/generic/bbcode/italic.png differ diff --git a/e107_images/generic/bbcode/left.png b/e107_images/generic/bbcode/left.png new file mode 100644 index 000000000..4786af7eb Binary files /dev/null and b/e107_images/generic/bbcode/left.png differ diff --git a/e107_images/generic/bbcode/link.png b/e107_images/generic/bbcode/link.png new file mode 100644 index 000000000..528868360 Binary files /dev/null and b/e107_images/generic/bbcode/link.png differ diff --git a/e107_images/generic/bbcode/list.png b/e107_images/generic/bbcode/list.png new file mode 100644 index 000000000..832c6fdba Binary files /dev/null and b/e107_images/generic/bbcode/list.png differ diff --git a/e107_images/generic/bbcode/newpage.png b/e107_images/generic/bbcode/newpage.png new file mode 100644 index 000000000..9dd1fc3e4 Binary files /dev/null and b/e107_images/generic/bbcode/newpage.png differ diff --git a/e107_images/generic/bbcode/prefile.png b/e107_images/generic/bbcode/prefile.png new file mode 100644 index 000000000..8576f44b5 Binary files /dev/null and b/e107_images/generic/bbcode/prefile.png differ diff --git a/e107_images/generic/bbcode/preimage.png b/e107_images/generic/bbcode/preimage.png new file mode 100644 index 000000000..9c191c3d1 Binary files /dev/null and b/e107_images/generic/bbcode/preimage.png differ diff --git a/e107_images/generic/bbcode/right.png b/e107_images/generic/bbcode/right.png new file mode 100644 index 000000000..bf939893c Binary files /dev/null and b/e107_images/generic/bbcode/right.png differ diff --git a/e107_images/generic/bbcode/shortcode.png b/e107_images/generic/bbcode/shortcode.png new file mode 100644 index 000000000..459c658a3 Binary files /dev/null and b/e107_images/generic/bbcode/shortcode.png differ diff --git a/e107_images/generic/bbcode/template.png b/e107_images/generic/bbcode/template.png new file mode 100644 index 000000000..ad34dfcb6 Binary files /dev/null and b/e107_images/generic/bbcode/template.png differ diff --git a/e107_images/generic/bbcode/underline.png b/e107_images/generic/bbcode/underline.png new file mode 100644 index 000000000..5b5770faf Binary files /dev/null and b/e107_images/generic/bbcode/underline.png differ diff --git a/e107_images/generic/blank.gif b/e107_images/generic/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_images/generic/blank.gif differ diff --git a/e107_images/generic/code_bg.gif b/e107_images/generic/code_bg.gif new file mode 100644 index 000000000..59323bc68 Binary files /dev/null and b/e107_images/generic/code_bg.gif differ diff --git a/e107_images/generic/code_bg.jpg b/e107_images/generic/code_bg.jpg new file mode 100644 index 000000000..a55af1c63 Binary files /dev/null and b/e107_images/generic/code_bg.jpg differ diff --git a/e107_images/generic/code_bg.png b/e107_images/generic/code_bg.png new file mode 100644 index 000000000..eaa462bef Binary files /dev/null and b/e107_images/generic/code_bg.png differ diff --git a/e107_images/generic/cred.png b/e107_images/generic/cred.png new file mode 100644 index 000000000..1ada1ca0d Binary files /dev/null and b/e107_images/generic/cred.png differ diff --git a/e107_images/generic/dark/answer.png b/e107_images/generic/dark/answer.png new file mode 100644 index 000000000..3d4868190 Binary files /dev/null and b/e107_images/generic/dark/answer.png differ diff --git a/e107_images/generic/dark/arrow.png b/e107_images/generic/dark/arrow.png new file mode 100644 index 000000000..082f440ab Binary files /dev/null and b/e107_images/generic/dark/arrow.png differ diff --git a/e107_images/generic/dark/download.png b/e107_images/generic/dark/download.png new file mode 100644 index 000000000..5f5d59131 Binary files /dev/null and b/e107_images/generic/dark/download.png differ diff --git a/e107_images/generic/dark/edit.png b/e107_images/generic/dark/edit.png new file mode 100644 index 000000000..3e19bfa04 Binary files /dev/null and b/e107_images/generic/dark/edit.png differ diff --git a/e107_images/generic/dark/email.png b/e107_images/generic/dark/email.png new file mode 100644 index 000000000..a4b931c26 Binary files /dev/null and b/e107_images/generic/dark/email.png differ diff --git a/e107_images/generic/dark/file.png b/e107_images/generic/dark/file.png new file mode 100644 index 000000000..f3082cb8e Binary files /dev/null and b/e107_images/generic/dark/file.png differ diff --git a/e107_images/generic/dark/image.png b/e107_images/generic/dark/image.png new file mode 100644 index 000000000..682c56bcb Binary files /dev/null and b/e107_images/generic/dark/image.png differ diff --git a/e107_images/generic/dark/new.png b/e107_images/generic/dark/new.png new file mode 100644 index 000000000..3323cb9b8 Binary files /dev/null and b/e107_images/generic/dark/new.png differ diff --git a/e107_images/generic/dark/new_comments.png b/e107_images/generic/dark/new_comments.png new file mode 100644 index 000000000..bca1eb734 Binary files /dev/null and b/e107_images/generic/dark/new_comments.png differ diff --git a/e107_images/generic/dark/newsedit.png b/e107_images/generic/dark/newsedit.png new file mode 100644 index 000000000..829e8f8fd Binary files /dev/null and b/e107_images/generic/dark/newsedit.png differ diff --git a/e107_images/generic/dark/nonew_comments.png b/e107_images/generic/dark/nonew_comments.png new file mode 100644 index 000000000..7d8823ceb Binary files /dev/null and b/e107_images/generic/dark/nonew_comments.png differ diff --git a/e107_images/generic/dark/password.png b/e107_images/generic/dark/password.png new file mode 100644 index 000000000..1dfa8241e Binary files /dev/null and b/e107_images/generic/dark/password.png differ diff --git a/e107_images/generic/dark/printer.png b/e107_images/generic/dark/printer.png new file mode 100644 index 000000000..becb0f4c8 Binary files /dev/null and b/e107_images/generic/dark/printer.png differ diff --git a/e107_images/generic/dark/question.png b/e107_images/generic/dark/question.png new file mode 100644 index 000000000..0381129ad Binary files /dev/null and b/e107_images/generic/dark/question.png differ diff --git a/e107_images/generic/dark/search_advanced.png b/e107_images/generic/dark/search_advanced.png new file mode 100644 index 000000000..00a3a7b27 Binary files /dev/null and b/e107_images/generic/dark/search_advanced.png differ diff --git a/e107_images/generic/dark/search_basic.png b/e107_images/generic/dark/search_basic.png new file mode 100644 index 000000000..aa76c4957 Binary files /dev/null and b/e107_images/generic/dark/search_basic.png differ diff --git a/e107_images/generic/dark/search_enhanced.png b/e107_images/generic/dark/search_enhanced.png new file mode 100644 index 000000000..1ab4e5f4a Binary files /dev/null and b/e107_images/generic/dark/search_enhanced.png differ diff --git a/e107_images/generic/dark/sticky.png b/e107_images/generic/dark/sticky.png new file mode 100644 index 000000000..215b882ca Binary files /dev/null and b/e107_images/generic/dark/sticky.png differ diff --git a/e107_images/generic/dark/user_select.png b/e107_images/generic/dark/user_select.png new file mode 100644 index 000000000..485273592 Binary files /dev/null and b/e107_images/generic/dark/user_select.png differ diff --git a/e107_images/generic/lite/answer.png b/e107_images/generic/lite/answer.png new file mode 100644 index 000000000..7a7dfaf88 Binary files /dev/null and b/e107_images/generic/lite/answer.png differ diff --git a/e107_images/generic/lite/arrow.png b/e107_images/generic/lite/arrow.png new file mode 100644 index 000000000..26cae0e5a Binary files /dev/null and b/e107_images/generic/lite/arrow.png differ diff --git a/e107_images/generic/lite/download.png b/e107_images/generic/lite/download.png new file mode 100644 index 000000000..df791432d Binary files /dev/null and b/e107_images/generic/lite/download.png differ diff --git a/e107_images/generic/lite/edit.png b/e107_images/generic/lite/edit.png new file mode 100644 index 000000000..79bb78f0a Binary files /dev/null and b/e107_images/generic/lite/edit.png differ diff --git a/e107_images/generic/lite/email.png b/e107_images/generic/lite/email.png new file mode 100644 index 000000000..ee3827ac5 Binary files /dev/null and b/e107_images/generic/lite/email.png differ diff --git a/e107_images/generic/lite/file.png b/e107_images/generic/lite/file.png new file mode 100644 index 000000000..7ea568819 Binary files /dev/null and b/e107_images/generic/lite/file.png differ diff --git a/e107_images/generic/lite/image.png b/e107_images/generic/lite/image.png new file mode 100644 index 000000000..5cc3d7042 Binary files /dev/null and b/e107_images/generic/lite/image.png differ diff --git a/e107_images/generic/lite/new.png b/e107_images/generic/lite/new.png new file mode 100644 index 000000000..71ebd7c0a Binary files /dev/null and b/e107_images/generic/lite/new.png differ diff --git a/e107_images/generic/lite/new_comments.png b/e107_images/generic/lite/new_comments.png new file mode 100644 index 000000000..bca1eb734 Binary files /dev/null and b/e107_images/generic/lite/new_comments.png differ diff --git a/e107_images/generic/lite/newsedit.png b/e107_images/generic/lite/newsedit.png new file mode 100644 index 000000000..980f74683 Binary files /dev/null and b/e107_images/generic/lite/newsedit.png differ diff --git a/e107_images/generic/lite/nonew_comments.png b/e107_images/generic/lite/nonew_comments.png new file mode 100644 index 000000000..7d8823ceb Binary files /dev/null and b/e107_images/generic/lite/nonew_comments.png differ diff --git a/e107_images/generic/lite/password.png b/e107_images/generic/lite/password.png new file mode 100644 index 000000000..91d06135e Binary files /dev/null and b/e107_images/generic/lite/password.png differ diff --git a/e107_images/generic/lite/printer.png b/e107_images/generic/lite/printer.png new file mode 100644 index 000000000..23242ffe4 Binary files /dev/null and b/e107_images/generic/lite/printer.png differ diff --git a/e107_images/generic/lite/question.png b/e107_images/generic/lite/question.png new file mode 100644 index 000000000..28dbe1224 Binary files /dev/null and b/e107_images/generic/lite/question.png differ diff --git a/e107_images/generic/lite/search_advanced.png b/e107_images/generic/lite/search_advanced.png new file mode 100644 index 000000000..738d35744 Binary files /dev/null and b/e107_images/generic/lite/search_advanced.png differ diff --git a/e107_images/generic/lite/search_basic.png b/e107_images/generic/lite/search_basic.png new file mode 100644 index 000000000..d8d8181e6 Binary files /dev/null and b/e107_images/generic/lite/search_basic.png differ diff --git a/e107_images/generic/lite/search_enhanced.png b/e107_images/generic/lite/search_enhanced.png new file mode 100644 index 000000000..0bd5156e2 Binary files /dev/null and b/e107_images/generic/lite/search_enhanced.png differ diff --git a/e107_images/generic/lite/sticky.png b/e107_images/generic/lite/sticky.png new file mode 100644 index 000000000..601ff976b Binary files /dev/null and b/e107_images/generic/lite/sticky.png differ diff --git a/e107_images/generic/lite/user_select.png b/e107_images/generic/lite/user_select.png new file mode 100644 index 000000000..68a2bdfd8 Binary files /dev/null and b/e107_images/generic/lite/user_select.png differ diff --git a/e107_images/generic/php-small-trans-light.gif b/e107_images/generic/php-small-trans-light.gif new file mode 100644 index 000000000..1ad08ae9b Binary files /dev/null and b/e107_images/generic/php-small-trans-light.gif differ diff --git a/e107_images/generic/poweredbymysql-88.png b/e107_images/generic/poweredbymysql-88.png new file mode 100644 index 000000000..1acff483b Binary files /dev/null and b/e107_images/generic/poweredbymysql-88.png differ diff --git a/e107_images/generic/valid-xhtml11.png b/e107_images/generic/valid-xhtml11.png new file mode 100644 index 000000000..d3cbba1ad Binary files /dev/null and b/e107_images/generic/valid-xhtml11.png differ diff --git a/e107_images/generic/valid-xhtml11_small.png b/e107_images/generic/valid-xhtml11_small.png new file mode 100644 index 000000000..dcf2c1dd5 Binary files /dev/null and b/e107_images/generic/valid-xhtml11_small.png differ diff --git a/e107_images/generic/vcss.png b/e107_images/generic/vcss.png new file mode 100644 index 000000000..fd8b8867f Binary files /dev/null and b/e107_images/generic/vcss.png differ diff --git a/e107_images/generic/vcss_small.png b/e107_images/generic/vcss_small.png new file mode 100644 index 000000000..85ce17e70 Binary files /dev/null and b/e107_images/generic/vcss_small.png differ diff --git a/e107_images/icons/download_32.png b/e107_images/icons/download_32.png new file mode 100644 index 000000000..09a67f8df Binary files /dev/null and b/e107_images/icons/download_32.png differ diff --git a/e107_images/icons/folder.png b/e107_images/icons/folder.png new file mode 100644 index 000000000..af07095a8 Binary files /dev/null and b/e107_images/icons/folder.png differ diff --git a/e107_images/icons/folder_32.png b/e107_images/icons/folder_32.png new file mode 100644 index 000000000..420b712ea Binary files /dev/null and b/e107_images/icons/folder_32.png differ diff --git a/e107_images/icons/folderx.png b/e107_images/icons/folderx.png new file mode 100644 index 000000000..6376568a5 Binary files /dev/null and b/e107_images/icons/folderx.png differ diff --git a/e107_images/icons/folderx_32.png b/e107_images/icons/folderx_32.png new file mode 100644 index 000000000..f4e180874 Binary files /dev/null and b/e107_images/icons/folderx_32.png differ diff --git a/e107_images/icons/html.png b/e107_images/icons/html.png new file mode 100644 index 000000000..173274770 Binary files /dev/null and b/e107_images/icons/html.png differ diff --git a/e107_images/icons/icon1.png b/e107_images/icons/icon1.png new file mode 100644 index 000000000..fd278f3e8 Binary files /dev/null and b/e107_images/icons/icon1.png differ diff --git a/e107_images/icons/icon10.png b/e107_images/icons/icon10.png new file mode 100644 index 000000000..40eac238a Binary files /dev/null and b/e107_images/icons/icon10.png differ diff --git a/e107_images/icons/icon11.png b/e107_images/icons/icon11.png new file mode 100644 index 000000000..882526a84 Binary files /dev/null and b/e107_images/icons/icon11.png differ diff --git a/e107_images/icons/icon12.png b/e107_images/icons/icon12.png new file mode 100644 index 000000000..4b616e24c Binary files /dev/null and b/e107_images/icons/icon12.png differ diff --git a/e107_images/icons/icon13.png b/e107_images/icons/icon13.png new file mode 100644 index 000000000..5a6f570e1 Binary files /dev/null and b/e107_images/icons/icon13.png differ diff --git a/e107_images/icons/icon14.png b/e107_images/icons/icon14.png new file mode 100644 index 000000000..59d5cde93 Binary files /dev/null and b/e107_images/icons/icon14.png differ diff --git a/e107_images/icons/icon15.png b/e107_images/icons/icon15.png new file mode 100644 index 000000000..8bb4e068a Binary files /dev/null and b/e107_images/icons/icon15.png differ diff --git a/e107_images/icons/icon16.png b/e107_images/icons/icon16.png new file mode 100644 index 000000000..5476b78bb Binary files /dev/null and b/e107_images/icons/icon16.png differ diff --git a/e107_images/icons/icon17.png b/e107_images/icons/icon17.png new file mode 100644 index 000000000..870fc32bb Binary files /dev/null and b/e107_images/icons/icon17.png differ diff --git a/e107_images/icons/icon18.png b/e107_images/icons/icon18.png new file mode 100644 index 000000000..b986da39d Binary files /dev/null and b/e107_images/icons/icon18.png differ diff --git a/e107_images/icons/icon19.png b/e107_images/icons/icon19.png new file mode 100644 index 000000000..c821f1fa3 Binary files /dev/null and b/e107_images/icons/icon19.png differ diff --git a/e107_images/icons/icon2.png b/e107_images/icons/icon2.png new file mode 100644 index 000000000..7a74a9c5a Binary files /dev/null and b/e107_images/icons/icon2.png differ diff --git a/e107_images/icons/icon20.png b/e107_images/icons/icon20.png new file mode 100644 index 000000000..cbff11255 Binary files /dev/null and b/e107_images/icons/icon20.png differ diff --git a/e107_images/icons/icon21.png b/e107_images/icons/icon21.png new file mode 100644 index 000000000..7544cb957 Binary files /dev/null and b/e107_images/icons/icon21.png differ diff --git a/e107_images/icons/icon22.png b/e107_images/icons/icon22.png new file mode 100644 index 000000000..1e5f944eb Binary files /dev/null and b/e107_images/icons/icon22.png differ diff --git a/e107_images/icons/icon23.png b/e107_images/icons/icon23.png new file mode 100644 index 000000000..5cd43b743 Binary files /dev/null and b/e107_images/icons/icon23.png differ diff --git a/e107_images/icons/icon24.png b/e107_images/icons/icon24.png new file mode 100644 index 000000000..ab02795f0 Binary files /dev/null and b/e107_images/icons/icon24.png differ diff --git a/e107_images/icons/icon25.png b/e107_images/icons/icon25.png new file mode 100644 index 000000000..ed73992ac Binary files /dev/null and b/e107_images/icons/icon25.png differ diff --git a/e107_images/icons/icon26.png b/e107_images/icons/icon26.png new file mode 100644 index 000000000..cfa279899 Binary files /dev/null and b/e107_images/icons/icon26.png differ diff --git a/e107_images/icons/icon3.png b/e107_images/icons/icon3.png new file mode 100644 index 000000000..68a6ef5e2 Binary files /dev/null and b/e107_images/icons/icon3.png differ diff --git a/e107_images/icons/icon4.png b/e107_images/icons/icon4.png new file mode 100644 index 000000000..fb997a7c6 Binary files /dev/null and b/e107_images/icons/icon4.png differ diff --git a/e107_images/icons/icon5.png b/e107_images/icons/icon5.png new file mode 100644 index 000000000..a786dc0e7 Binary files /dev/null and b/e107_images/icons/icon5.png differ diff --git a/e107_images/icons/icon6.png b/e107_images/icons/icon6.png new file mode 100644 index 000000000..f45e0a0e5 Binary files /dev/null and b/e107_images/icons/icon6.png differ diff --git a/e107_images/icons/icon7.png b/e107_images/icons/icon7.png new file mode 100644 index 000000000..8bcd95c4b Binary files /dev/null and b/e107_images/icons/icon7.png differ diff --git a/e107_images/icons/icon8.png b/e107_images/icons/icon8.png new file mode 100644 index 000000000..9bd2feed5 Binary files /dev/null and b/e107_images/icons/icon8.png differ diff --git a/e107_images/icons/icon9.png b/e107_images/icons/icon9.png new file mode 100644 index 000000000..8431229a0 Binary files /dev/null and b/e107_images/icons/icon9.png differ diff --git a/e107_images/index.html b/e107_images/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_images/logo.png b/e107_images/logo.png new file mode 100644 index 000000000..ef92a6e98 Binary files /dev/null and b/e107_images/logo.png differ diff --git a/e107_images/logo_template.png b/e107_images/logo_template.png new file mode 100644 index 000000000..68d8cbe47 Binary files /dev/null and b/e107_images/logo_template.png differ diff --git a/e107_images/logo_template_large.png b/e107_images/logo_template_large.png new file mode 100644 index 000000000..8b573f74f Binary files /dev/null and b/e107_images/logo_template_large.png differ diff --git a/e107_images/newspost_images/index.html b/e107_images/newspost_images/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_images/newspost_images/welcome.png b/e107_images/newspost_images/welcome.png new file mode 100644 index 000000000..f32c74e42 Binary files /dev/null and b/e107_images/newspost_images/welcome.png differ diff --git a/e107_images/pcmag.png b/e107_images/pcmag.png new file mode 100644 index 000000000..1dbb9cf4e Binary files /dev/null and b/e107_images/pcmag.png differ diff --git a/e107_images/rate/box.png b/e107_images/rate/box.png new file mode 100644 index 000000000..d7f28a88f Binary files /dev/null and b/e107_images/rate/box.png differ diff --git a/e107_images/rate/box/box1.png b/e107_images/rate/box/box1.png new file mode 100644 index 000000000..822d65ca8 Binary files /dev/null and b/e107_images/rate/box/box1.png differ diff --git a/e107_images/rate/box/box10.png b/e107_images/rate/box/box10.png new file mode 100644 index 000000000..81a9c681b Binary files /dev/null and b/e107_images/rate/box/box10.png differ diff --git a/e107_images/rate/box/box2.png b/e107_images/rate/box/box2.png new file mode 100644 index 000000000..503cd4c1b Binary files /dev/null and b/e107_images/rate/box/box2.png differ diff --git a/e107_images/rate/box/box3.png b/e107_images/rate/box/box3.png new file mode 100644 index 000000000..9ebdf1d8c Binary files /dev/null and b/e107_images/rate/box/box3.png differ diff --git a/e107_images/rate/box/box4.png b/e107_images/rate/box/box4.png new file mode 100644 index 000000000..cbaa79634 Binary files /dev/null and b/e107_images/rate/box/box4.png differ diff --git a/e107_images/rate/box/box5.png b/e107_images/rate/box/box5.png new file mode 100644 index 000000000..f0152df58 Binary files /dev/null and b/e107_images/rate/box/box5.png differ diff --git a/e107_images/rate/box/box6.png b/e107_images/rate/box/box6.png new file mode 100644 index 000000000..2ddc1d156 Binary files /dev/null and b/e107_images/rate/box/box6.png differ diff --git a/e107_images/rate/box/box7.png b/e107_images/rate/box/box7.png new file mode 100644 index 000000000..3fff1ec62 Binary files /dev/null and b/e107_images/rate/box/box7.png differ diff --git a/e107_images/rate/box/box8.png b/e107_images/rate/box/box8.png new file mode 100644 index 000000000..741c2e9c4 Binary files /dev/null and b/e107_images/rate/box/box8.png differ diff --git a/e107_images/rate/box/box9.png b/e107_images/rate/box/box9.png new file mode 100644 index 000000000..1428706e7 Binary files /dev/null and b/e107_images/rate/box/box9.png differ diff --git a/e107_images/rate/boxend.png b/e107_images/rate/boxend.png new file mode 100644 index 000000000..3ae4d0607 Binary files /dev/null and b/e107_images/rate/boxend.png differ diff --git a/e107_images/rate/dark/1.png b/e107_images/rate/dark/1.png new file mode 100644 index 000000000..878cd4273 Binary files /dev/null and b/e107_images/rate/dark/1.png differ diff --git a/e107_images/rate/dark/2.png b/e107_images/rate/dark/2.png new file mode 100644 index 000000000..a437a6bc1 Binary files /dev/null and b/e107_images/rate/dark/2.png differ diff --git a/e107_images/rate/dark/3.png b/e107_images/rate/dark/3.png new file mode 100644 index 000000000..6b6f383fd Binary files /dev/null and b/e107_images/rate/dark/3.png differ diff --git a/e107_images/rate/dark/4.png b/e107_images/rate/dark/4.png new file mode 100644 index 000000000..e1cf7882f Binary files /dev/null and b/e107_images/rate/dark/4.png differ diff --git a/e107_images/rate/dark/5.png b/e107_images/rate/dark/5.png new file mode 100644 index 000000000..986707cd7 Binary files /dev/null and b/e107_images/rate/dark/5.png differ diff --git a/e107_images/rate/dark/6.png b/e107_images/rate/dark/6.png new file mode 100644 index 000000000..84ba3b75d Binary files /dev/null and b/e107_images/rate/dark/6.png differ diff --git a/e107_images/rate/dark/7.png b/e107_images/rate/dark/7.png new file mode 100644 index 000000000..25f421f18 Binary files /dev/null and b/e107_images/rate/dark/7.png differ diff --git a/e107_images/rate/dark/8.png b/e107_images/rate/dark/8.png new file mode 100644 index 000000000..f092d4d83 Binary files /dev/null and b/e107_images/rate/dark/8.png differ diff --git a/e107_images/rate/dark/9.png b/e107_images/rate/dark/9.png new file mode 100644 index 000000000..d359ffe66 Binary files /dev/null and b/e107_images/rate/dark/9.png differ diff --git a/e107_images/rate/dark/lev1.png b/e107_images/rate/dark/lev1.png new file mode 100644 index 000000000..050a5732d Binary files /dev/null and b/e107_images/rate/dark/lev1.png differ diff --git a/e107_images/rate/dark/lev10.png b/e107_images/rate/dark/lev10.png new file mode 100644 index 000000000..606f214af Binary files /dev/null and b/e107_images/rate/dark/lev10.png differ diff --git a/e107_images/rate/dark/lev2.png b/e107_images/rate/dark/lev2.png new file mode 100644 index 000000000..f0ff12e7c Binary files /dev/null and b/e107_images/rate/dark/lev2.png differ diff --git a/e107_images/rate/dark/lev3.png b/e107_images/rate/dark/lev3.png new file mode 100644 index 000000000..c1ae649aa Binary files /dev/null and b/e107_images/rate/dark/lev3.png differ diff --git a/e107_images/rate/dark/lev4.png b/e107_images/rate/dark/lev4.png new file mode 100644 index 000000000..6b76caeda Binary files /dev/null and b/e107_images/rate/dark/lev4.png differ diff --git a/e107_images/rate/dark/lev5.png b/e107_images/rate/dark/lev5.png new file mode 100644 index 000000000..fcbae98dd Binary files /dev/null and b/e107_images/rate/dark/lev5.png differ diff --git a/e107_images/rate/dark/lev6.png b/e107_images/rate/dark/lev6.png new file mode 100644 index 000000000..3870a1a48 Binary files /dev/null and b/e107_images/rate/dark/lev6.png differ diff --git a/e107_images/rate/dark/lev7.png b/e107_images/rate/dark/lev7.png new file mode 100644 index 000000000..76788b92e Binary files /dev/null and b/e107_images/rate/dark/lev7.png differ diff --git a/e107_images/rate/dark/lev8.png b/e107_images/rate/dark/lev8.png new file mode 100644 index 000000000..d85743df2 Binary files /dev/null and b/e107_images/rate/dark/lev8.png differ diff --git a/e107_images/rate/dark/lev9.png b/e107_images/rate/dark/lev9.png new file mode 100644 index 000000000..5488d97fd Binary files /dev/null and b/e107_images/rate/dark/lev9.png differ diff --git a/e107_images/rate/dark/star.png b/e107_images/rate/dark/star.png new file mode 100644 index 000000000..d351e6074 Binary files /dev/null and b/e107_images/rate/dark/star.png differ diff --git a/e107_images/rate/lite/1.png b/e107_images/rate/lite/1.png new file mode 100644 index 000000000..257de3a2e Binary files /dev/null and b/e107_images/rate/lite/1.png differ diff --git a/e107_images/rate/lite/2.png b/e107_images/rate/lite/2.png new file mode 100644 index 000000000..df9eb7b71 Binary files /dev/null and b/e107_images/rate/lite/2.png differ diff --git a/e107_images/rate/lite/3.png b/e107_images/rate/lite/3.png new file mode 100644 index 000000000..654a48639 Binary files /dev/null and b/e107_images/rate/lite/3.png differ diff --git a/e107_images/rate/lite/4.png b/e107_images/rate/lite/4.png new file mode 100644 index 000000000..95fc0f19a Binary files /dev/null and b/e107_images/rate/lite/4.png differ diff --git a/e107_images/rate/lite/5.png b/e107_images/rate/lite/5.png new file mode 100644 index 000000000..47bafcd99 Binary files /dev/null and b/e107_images/rate/lite/5.png differ diff --git a/e107_images/rate/lite/6.png b/e107_images/rate/lite/6.png new file mode 100644 index 000000000..0b7be10a6 Binary files /dev/null and b/e107_images/rate/lite/6.png differ diff --git a/e107_images/rate/lite/7.png b/e107_images/rate/lite/7.png new file mode 100644 index 000000000..8a08de777 Binary files /dev/null and b/e107_images/rate/lite/7.png differ diff --git a/e107_images/rate/lite/8.png b/e107_images/rate/lite/8.png new file mode 100644 index 000000000..16f784961 Binary files /dev/null and b/e107_images/rate/lite/8.png differ diff --git a/e107_images/rate/lite/9.png b/e107_images/rate/lite/9.png new file mode 100644 index 000000000..9a3fbda76 Binary files /dev/null and b/e107_images/rate/lite/9.png differ diff --git a/e107_images/rate/lite/lev1.png b/e107_images/rate/lite/lev1.png new file mode 100644 index 000000000..70baaa915 Binary files /dev/null and b/e107_images/rate/lite/lev1.png differ diff --git a/e107_images/rate/lite/lev10.png b/e107_images/rate/lite/lev10.png new file mode 100644 index 000000000..8392ca931 Binary files /dev/null and b/e107_images/rate/lite/lev10.png differ diff --git a/e107_images/rate/lite/lev2.png b/e107_images/rate/lite/lev2.png new file mode 100644 index 000000000..d05b5b337 Binary files /dev/null and b/e107_images/rate/lite/lev2.png differ diff --git a/e107_images/rate/lite/lev3.png b/e107_images/rate/lite/lev3.png new file mode 100644 index 000000000..a5489f9f3 Binary files /dev/null and b/e107_images/rate/lite/lev3.png differ diff --git a/e107_images/rate/lite/lev4.png b/e107_images/rate/lite/lev4.png new file mode 100644 index 000000000..17e844e74 Binary files /dev/null and b/e107_images/rate/lite/lev4.png differ diff --git a/e107_images/rate/lite/lev5.png b/e107_images/rate/lite/lev5.png new file mode 100644 index 000000000..76647a94f Binary files /dev/null and b/e107_images/rate/lite/lev5.png differ diff --git a/e107_images/rate/lite/lev6.png b/e107_images/rate/lite/lev6.png new file mode 100644 index 000000000..3890c0441 Binary files /dev/null and b/e107_images/rate/lite/lev6.png differ diff --git a/e107_images/rate/lite/lev7.png b/e107_images/rate/lite/lev7.png new file mode 100644 index 000000000..36321bda5 Binary files /dev/null and b/e107_images/rate/lite/lev7.png differ diff --git a/e107_images/rate/lite/lev8.png b/e107_images/rate/lite/lev8.png new file mode 100644 index 000000000..159124d00 Binary files /dev/null and b/e107_images/rate/lite/lev8.png differ diff --git a/e107_images/rate/lite/lev9.png b/e107_images/rate/lite/lev9.png new file mode 100644 index 000000000..e53165f10 Binary files /dev/null and b/e107_images/rate/lite/lev9.png differ diff --git a/e107_images/rate/lite/star.png b/e107_images/rate/lite/star.png new file mode 100644 index 000000000..fcdf16359 Binary files /dev/null and b/e107_images/rate/lite/star.png differ diff --git a/e107_images/rate/star.png b/e107_images/rate/star.png new file mode 100644 index 000000000..b7b90dbf8 Binary files /dev/null and b/e107_images/rate/star.png differ diff --git a/e107_images/splash.jpg b/e107_images/splash.jpg new file mode 100644 index 000000000..11f019872 Binary files /dev/null and b/e107_images/splash.jpg differ diff --git a/e107_images/thumb.php b/e107_images/thumb.php new file mode 100644 index 000000000..a7a10aced --- /dev/null +++ b/e107_images/thumb.php @@ -0,0 +1,63 @@ + + or + + eg + +*/ + +require_once("../class2.php"); +require_once(e_HANDLER."resize_handler.php"); + +// var 3. +// 1= newspost images/preview +// 2= + + if (e_QUERY){ + $tmp = explode("+",rawurldecode(e_QUERY)); + if(strpos($tmp[0], "/") === 0 || strpos($tmp[0], ":") >= 1){ + $source = $tmp[0]; + }else{ + $source = "../".str_replace("../","",$tmp[0]); + } + + + + + $newsize = $tmp[1]; + if(!file_exists(e_IMAGE."newspost_images/preview/preview_".basename($source))){ + + if(!resize_image($source, e_IMAGE."newspost_images/preview/preview_".basename($source), $newsize)){ + echo "Couldn't find: ".$source; + } + } + + + header("Content-type: image/jpg"); + $imagedata = file_get_contents(e_IMAGE."newspost_images/preview/preview_".basename($source)); + echo $imagedata; + exit; + + + } +?> \ No newline at end of file diff --git a/e107_images/user_icons/realname_dark.png b/e107_images/user_icons/realname_dark.png new file mode 100644 index 000000000..51e68070b Binary files /dev/null and b/e107_images/user_icons/realname_dark.png differ diff --git a/e107_images/user_icons/realname_lite.png b/e107_images/user_icons/realname_lite.png new file mode 100644 index 000000000..fb041abf9 Binary files /dev/null and b/e107_images/user_icons/realname_lite.png differ diff --git a/e107_images/user_icons/user_aim.png b/e107_images/user_icons/user_aim.png new file mode 100644 index 000000000..4c26f336d Binary files /dev/null and b/e107_images/user_icons/user_aim.png differ diff --git a/e107_images/user_icons/user_birthday_dark.png b/e107_images/user_icons/user_birthday_dark.png new file mode 100644 index 000000000..5d4d87747 Binary files /dev/null and b/e107_images/user_icons/user_birthday_dark.png differ diff --git a/e107_images/user_icons/user_birthday_lite.png b/e107_images/user_icons/user_birthday_lite.png new file mode 100644 index 000000000..fcb3ab2b8 Binary files /dev/null and b/e107_images/user_icons/user_birthday_lite.png differ diff --git a/e107_images/user_icons/user_dark.png b/e107_images/user_icons/user_dark.png new file mode 100644 index 000000000..bebe7f331 Binary files /dev/null and b/e107_images/user_icons/user_dark.png differ diff --git a/e107_images/user_icons/user_homepage.png b/e107_images/user_icons/user_homepage.png new file mode 100644 index 000000000..a77dee7b7 Binary files /dev/null and b/e107_images/user_icons/user_homepage.png differ diff --git a/e107_images/user_icons/user_icq.png b/e107_images/user_icons/user_icq.png new file mode 100644 index 000000000..f94097cb3 Binary files /dev/null and b/e107_images/user_icons/user_icq.png differ diff --git a/e107_images/user_icons/user_lite.png b/e107_images/user_icons/user_lite.png new file mode 100644 index 000000000..4ab7ada02 Binary files /dev/null and b/e107_images/user_icons/user_lite.png differ diff --git a/e107_images/user_icons/user_location.png b/e107_images/user_icons/user_location.png new file mode 100644 index 000000000..3f9394dae Binary files /dev/null and b/e107_images/user_icons/user_location.png differ diff --git a/e107_images/user_icons/user_msn.png b/e107_images/user_icons/user_msn.png new file mode 100644 index 000000000..1e690e8c7 Binary files /dev/null and b/e107_images/user_icons/user_msn.png differ diff --git a/e107_images/user_icons/user_realname_dark.png b/e107_images/user_icons/user_realname_dark.png new file mode 100644 index 000000000..51e68070b Binary files /dev/null and b/e107_images/user_icons/user_realname_dark.png differ diff --git a/e107_images/user_icons/user_realname_lite.png b/e107_images/user_icons/user_realname_lite.png new file mode 100644 index 000000000..fb041abf9 Binary files /dev/null and b/e107_images/user_icons/user_realname_lite.png differ diff --git a/e107_images/user_icons/user_star_dark.png b/e107_images/user_icons/user_star_dark.png new file mode 100644 index 000000000..3ca85fa2c Binary files /dev/null and b/e107_images/user_icons/user_star_dark.png differ diff --git a/e107_images/user_icons/user_star_lite.png b/e107_images/user_icons/user_star_lite.png new file mode 100644 index 000000000..05d497f96 Binary files /dev/null and b/e107_images/user_icons/user_star_lite.png differ diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php new file mode 100644 index 000000000..e2632aabc --- /dev/null +++ b/e107_languages/English/English.php @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/help/administrator.php b/e107_languages/English/admin/help/administrator.php new file mode 100644 index 000000000..27c5d044e --- /dev/null +++ b/e107_languages/English/admin/help/administrator.php @@ -0,0 +1,26 @@ +
    +To create a new admin go to the user config page and update an existing user to admin status."; +$ns -> tablerender($caption, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/article.php b/e107_languages/English/admin/help/article.php new file mode 100644 index 000000000..d8d54546a --- /dev/null +++ b/e107_languages/English/admin/help/article.php @@ -0,0 +1,27 @@ + + For a multi-page article separate each page with the text [newpage], i.e.
    Test1 [newpage] Test2
    would create a two page article with 'Test1' on page 1 and 'Test2' on page 2. +

    +If your article contains HTML tags that you wish to preserve, enclose the code with [html] [/html]. For example, if you entered the text '<table><tr><td>Hello </td></tr></table>' in your article, a table would be shown containing the word hello. If you entered '[html]<table><tr><td>Hello </td></tr></table>[/html]' the code as you entered it would be shown and not the table that the code generates."; +$ns -> tablerender("Article Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/banlist.php b/e107_languages/English/admin/help/banlist.php new file mode 100644 index 000000000..3f2282e8c --- /dev/null +++ b/e107_languages/English/admin/help/banlist.php @@ -0,0 +1,32 @@ + +Either enter their full IP address or use a wildcard to ban a range of IP addresses. You can also enter an email address to stop a user registering as a member on your site.

    +Banning by IP address:
    +Entering the IP address 123.123.123.123 will stop the user with that address visiting your site.
    +Entering the IP address 123.123.123.* will stop anyone in that IP range from visiting your site.

    +Banning by email address
    +Entering the email address foo@bar.com will stop anyone using that email address from registering as a member on your site.
    +Entering the email address *@bar.com will stop anyone using that email domain from registering as a member on your site."; +$ns -> tablerender($caption, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/cache.php b/e107_languages/English/admin/help/cache.php new file mode 100644 index 000000000..fb692a7ea --- /dev/null +++ b/e107_languages/English/admin/help/cache.php @@ -0,0 +1,25 @@ +
    IMPORTANT! If you are making your own theme turn caching off as any changes you make will not be reflected."; +$ns -> tablerender($caption, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/chatbox.php b/e107_languages/English/admin/help/chatbox.php new file mode 100644 index 000000000..7be652163 --- /dev/null +++ b/e107_languages/English/admin/help/chatbox.php @@ -0,0 +1,25 @@ +If the replace link box is ticked, any links entered will be replaced by the text you enter in the textbox, this stops long links causing display problems. Wordwrap will auto wrap text that is longer than the length specified here."; + +$ns -> tablerender("Chatbox", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/content.php b/e107_languages/English/admin/help/content.php new file mode 100644 index 000000000..f3abef982 --- /dev/null +++ b/e107_languages/English/admin/help/content.php @@ -0,0 +1,25 @@ + +If you want your content page to have a caption, enter it in the Page Heading box."; +$ns -> tablerender("Content Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/cpage.php b/e107_languages/English/admin/help/cpage.php new file mode 100644 index 000000000..f42a40b52 --- /dev/null +++ b/e107_languages/English/admin/help/cpage.php @@ -0,0 +1,26 @@ +
    "; +// $text .= "Please see http://docs.e107.org/Using Custom Pages and Custom Menus for an explanation of all the features."; + +$ns -> tablerender(CUSLAN_18, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/custommenu.php b/e107_languages/English/admin/help/custommenu.php new file mode 100644 index 000000000..83bbe3e6c --- /dev/null +++ b/e107_languages/English/admin/help/custommenu.php @@ -0,0 +1,26 @@ +
    +Please see http://docs.e107.org?Custom Pages"; + +$ns -> tablerender(CUSLAN_18, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/db.php b/e107_languages/English/admin/help/db.php new file mode 100644 index 000000000..1b53b1fc5 --- /dev/null +++ b/e107_languages/English/admin/help/db.php @@ -0,0 +1,24 @@ + tablerender("Database Tools", $text); +?> diff --git a/e107_languages/English/admin/help/download.php b/e107_languages/English/admin/help/download.php new file mode 100644 index 000000000..639daa091 --- /dev/null +++ b/e107_languages/English/admin/help/download.php @@ -0,0 +1,26 @@ +
    +To submit a download, first create a parent, then create a category under that parent, you will then be able to make the download available."; +$ns -> tablerender("Download Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/emoticon.php b/e107_languages/English/admin/help/emoticon.php new file mode 100644 index 000000000..a09a49c5e --- /dev/null +++ b/e107_languages/English/admin/help/emoticon.php @@ -0,0 +1,26 @@ + tablerender("Emoticon Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/fileinspector.php b/e107_languages/English/admin/help/fileinspector.php new file mode 100644 index 000000000..1a018a4a5 --- /dev/null +++ b/e107_languages/English/admin/help/fileinspector.php @@ -0,0 +1,51 @@ + +".$dir." Core File
    +
    +".$dir." Known Insecurity
    +
    +".$dir." Core File (Integrity Pass)
    +
    +".$dir." Core File (Integrity Fail)
    +
    +".$dir." Core File (Incalculable)
    +
    +".$dir." Missing Core File
    +
    +".$dir." Old Core File
    +
    +".$dir." Non Core File
    "; +$ns -> tablerender("File Key", $text); + +$text = "The file inspector scans and analyses the files on your sites server. When the inspector encounters +an e107 core file, it checks it for file consistency to make sure it isn't corrupted."; + +if ($pref['developer']) { +$text .= "

    +The additional string matching tool (developer mode only) enables you to scan the files on your server for text strings +using regular expressions. The regex engine in use is PHP's PCRE +(the preg_* functions), so enter your query as #pattern#modifiers in the fields provided."; +} + +$ns -> tablerender("File Inspector Help", $text); +?> diff --git a/e107_languages/English/admin/help/filemanager.php b/e107_languages/English/admin/help/filemanager.php new file mode 100644 index 000000000..279f33674 --- /dev/null +++ b/e107_languages/English/admin/help/filemanager.php @@ -0,0 +1,24 @@ + tablerender("File Manager Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/forum.php b/e107_languages/English/admin/help/forum.php new file mode 100644 index 000000000..d88cd4e04 --- /dev/null +++ b/e107_languages/English/admin/help/forum.php @@ -0,0 +1,43 @@ +General
    +Use this screen to create or edit your forums
    +
    +Parents/Forums
    +A parent is a heading that other forums are displayed under, this makes layout simpler and makes navigating around your forums much simpler for visitors. +

    +Accessibility +
    +You can set your forums to only be accessible to certain visitors. Once you have set the 'class' of the visitors you can tick the +class to only allow those visitors access to the forum. You can set parents or individual forums up in this way. +

    +Moderators +
    +Tick the names of the listed administrators to give them moderator status on the forum. The administrator must have forum moderation permissions to be listed here. +

    +Ranks +
    +Set your user ranks from here. If the image fields are filled in, images will be used, to use rank names enter the names and make sure the corresponding rank image field is blank.
    The threshold is the number of points the user needs to gain before his level changes."; +$ns -> tablerender($caption, $text); +unset($text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/frontpage.php b/e107_languages/English/admin/help/frontpage.php new file mode 100644 index 000000000..1e8c03a41 --- /dev/null +++ b/e107_languages/English/admin/help/frontpage.php @@ -0,0 +1,25 @@ + tablerender($caption, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/image.php b/e107_languages/English/admin/help/image.php new file mode 100644 index 000000000..a70f2850b --- /dev/null +++ b/e107_languages/English/admin/help/image.php @@ -0,0 +1,24 @@ + tablerender("Images Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/index.html b/e107_languages/English/admin/help/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_languages/English/admin/help/language.php b/e107_languages/English/admin/help/language.php new file mode 100644 index 000000000..ce024f746 --- /dev/null +++ b/e107_languages/English/admin/help/language.php @@ -0,0 +1,24 @@ + tablerender("Language Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/link_category.php b/e107_languages/English/admin/help/link_category.php new file mode 100644 index 000000000..8775de69d --- /dev/null +++ b/e107_languages/English/admin/help/link_category.php @@ -0,0 +1,24 @@ +
    Any link entered under the Main category will be displayed in your main navigation menu."; +$ns -> tablerender("Link Category Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/links.php b/e107_languages/English/admin/help/links.php new file mode 100644 index 000000000..5a2c79895 --- /dev/null +++ b/e107_languages/English/admin/help/links.php @@ -0,0 +1,26 @@ + +"; +$ns -> tablerender("Links Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/list_menu_conf.php b/e107_languages/English/admin/help/list_menu_conf.php new file mode 100644 index 000000000..dbcc066b5 --- /dev/null +++ b/e107_languages/English/admin/help/list_menu_conf.php @@ -0,0 +1,30 @@ + + New Articles Menu
    +Enter a number for example '5' in the first field to show the first 5 articles, leave empty to see all, You configure what the title of the link should be to the rest of the articles in the second field, when you leave this last option empty it won't create a link, for example: 'All articles'
    + Comments/Forum Menu
    +The number of comments default to 5, the number of characters default to 10000. The postfix is for if a line is too long it will cut it off and append this postfix to the end, a good choice for this is '...', check original topics if you want to see those in the overview.
    + +"; +$ns -> tablerender("Menu Configuration Help", $text); +?> diff --git a/e107_languages/English/admin/help/mailout.php b/e107_languages/English/admin/help/mailout.php new file mode 100644 index 000000000..c070b9868 --- /dev/null +++ b/e107_languages/English/admin/help/mailout.php @@ -0,0 +1,24 @@ + tablerender("Mail Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/menus.php b/e107_languages/English/admin/help/menus.php new file mode 100644 index 000000000..ed83b3553 --- /dev/null +++ b/e107_languages/English/admin/help/menus.php @@ -0,0 +1,56 @@ + db_Select("menus","*", "menu_location='".$mc."' ORDER BY menu_order"); + $count = 1; + $sql2 = new db; + while(list($menu_id, $menu_name, $menu_location, $menu_order) = $sql-> db_Fetch()){ + $sql2 -> db_Update("menus", "menu_order='$count' WHERE menu_id='$menu_id' "); + $count++; + } + $text = "Menus reset in database

    "; + } +}else{ + unset($text); +} + +$text .= " +You can arrange where and in which order your menu items are from here. +Use the dropdown menu to move the menus up and down until you are satisfied with their positioning. +
    +
    +If you find the menus are not updating properly click on the refresh button. +
    + +
    +
    * indicates menu visibility has been modified
    +"; + +$ns -> tablerender("Menus Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/menus2.php b/e107_languages/English/admin/help/menus2.php new file mode 100644 index 000000000..05d4bec66 --- /dev/null +++ b/e107_languages/English/admin/help/menus2.php @@ -0,0 +1,28 @@ + +The menu items in the middle of the screen are de-activated; you can activate these by choosing a location to put them in. +"; + +$ns -> tablerender("Menus Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/meta.php b/e107_languages/English/admin/help/meta.php new file mode 100644 index 000000000..8e45bb3c5 --- /dev/null +++ b/e107_languages/English/admin/help/meta.php @@ -0,0 +1,25 @@ + tablerender("Meta Tags", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/news_category.php b/e107_languages/English/admin/help/news_category.php new file mode 100644 index 000000000..f1f81f875 --- /dev/null +++ b/e107_languages/English/admin/help/news_category.php @@ -0,0 +1,24 @@ +
    Upload your news icon images either ".e_THEME."-yourtheme-/images/ or themes/shared/newsicons/."; +$ns -> tablerender("News Category Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/newsfeed.php b/e107_languages/English/admin/help/newsfeed.php new file mode 100644 index 000000000..147adec4a --- /dev/null +++ b/e107_languages/English/admin/help/newsfeed.php @@ -0,0 +1,25 @@ +Enter the full path URL to the backend (ie http://e107.org/news.xml). You can add a path to an image if you don't like the default one, or it isn't defined. You can activate and de-activate the backend if the site goes down for instance.

    To see the headlines on your site, make sure the headlines_menu is activated from your menus page."; + +$ns -> tablerender("Headlines", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/newspost.php b/e107_languages/English/admin/help/newspost.php new file mode 100644 index 000000000..1f01a115a --- /dev/null +++ b/e107_languages/English/admin/help/newspost.php @@ -0,0 +1,36 @@ +General
    +Body will be displayed on the main page; extended will be readable by clicking a 'Read More' link. +
    +
    +Show title only +
    +Enable this to show the news title only on front page, with clickable link to full story. +

    +Activation +
    +If you set a start and/or end date your news item will only be displayed between these dates. +"; +$ns -> tablerender($caption, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/notify.php b/e107_languages/English/admin/help/notify.php new file mode 100644 index 000000000..27994d935 --- /dev/null +++ b/e107_languages/English/admin/help/notify.php @@ -0,0 +1,31 @@ +
    +For example, set 'IP banned for flooding site' to user class 'Admin' and all admins will be sent an email when your +site is being flooded.

    +You can also, as another example, set 'News item posted by admin' to user class 'Members' and all your users will be +sent news items you post to the site in an email.

    +If you would like the email notifications to be sent to an alternative email address - select the 'Email' option and +enter in the email address in the field provided."; + +$ns -> tablerender("Notify Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/phpinfo.php b/e107_languages/English/admin/help/phpinfo.php new file mode 100644 index 000000000..85ed0b0c6 --- /dev/null +++ b/e107_languages/English/admin/help/phpinfo.php @@ -0,0 +1,24 @@ + tablerender("PHP Info Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/poll.php b/e107_languages/English/admin/help/poll.php new file mode 100644 index 000000000..e8c0b4ff7 --- /dev/null +++ b/e107_languages/English/admin/help/poll.php @@ -0,0 +1,26 @@ +
    +To see the poll, go to your menus page and make sure poll_menu is activated."; + +$ns -> tablerender("Polls", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/prefs.php b/e107_languages/English/admin/help/prefs.php new file mode 100644 index 000000000..a9c058b92 --- /dev/null +++ b/e107_languages/English/admin/help/prefs.php @@ -0,0 +1,24 @@ + tablerender("Preferences Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/review.php b/e107_languages/English/admin/help/review.php new file mode 100644 index 000000000..a60a01517 --- /dev/null +++ b/e107_languages/English/admin/help/review.php @@ -0,0 +1,25 @@ + + For a multi-page review separate each page with the text [newpage], i.e.
    Test1 [newpage] Test2
    would create a two page review with 'Test1' on page 1 and 'Test2' on page 2."; +$ns -> tablerender("Review Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/search.php b/e107_languages/English/admin/help/search.php new file mode 100644 index 000000000..475341439 --- /dev/null +++ b/e107_languages/English/admin/help/search.php @@ -0,0 +1,27 @@ +
    +If your site includes Ideographic languages such as Chinese and Japanese you must +use the PHP sort method and switch whole word matching off."; +$ns -> tablerender("Search Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/theme.php b/e107_languages/English/admin/help/theme.php new file mode 100644 index 000000000..4c63e0602 --- /dev/null +++ b/e107_languages/English/admin/help/theme.php @@ -0,0 +1,24 @@ + tablerender("Theme Manager Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/ugflag.php b/e107_languages/English/admin/help/ugflag.php new file mode 100644 index 000000000..1cb1e03b7 --- /dev/null +++ b/e107_languages/English/admin/help/ugflag.php @@ -0,0 +1,25 @@ + tablerender("Maintenance", $text); +?> diff --git a/e107_languages/English/admin/help/updateadmin.php b/e107_languages/English/admin/help/updateadmin.php new file mode 100644 index 000000000..9bf576cd7 --- /dev/null +++ b/e107_languages/English/admin/help/updateadmin.php @@ -0,0 +1,24 @@ + tablerender("Update Settings Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/upload.php b/e107_languages/English/admin/help/upload.php new file mode 100644 index 000000000..0ec0ab8f0 --- /dev/null +++ b/e107_languages/English/admin/help/upload.php @@ -0,0 +1,24 @@ + tablerender("Public Uploads Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/userclass2.php b/e107_languages/English/admin/help/userclass2.php new file mode 100644 index 000000000..08a30bd1b --- /dev/null +++ b/e107_languages/English/admin/help/userclass2.php @@ -0,0 +1,25 @@ +This is useful for restricting users to certain parts of your site. For example, you could create a class called TEST, then create a forum which only allowed users in the TEST class to access it."; +$ns -> tablerender($caption, $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/users.php b/e107_languages/English/admin/help/users.php new file mode 100644 index 000000000..5e3914813 --- /dev/null +++ b/e107_languages/English/admin/help/users.php @@ -0,0 +1,25 @@ + tablerender("Users Help", $text); +unset($text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/users_extended.php b/e107_languages/English/admin/help/users_extended.php new file mode 100644 index 000000000..750b0eca7 --- /dev/null +++ b/e107_languages/English/admin/help/users_extended.php @@ -0,0 +1,24 @@ + tablerender(" Extended User Fields Help", $text); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/help/wmessage.php b/e107_languages/English/admin/help/wmessage.php new file mode 100644 index 000000000..9621837ba --- /dev/null +++ b/e107_languages/English/admin/help/wmessage.php @@ -0,0 +1,24 @@ + tablerender("WMessage Help", $text); +?> diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php new file mode 100644 index 000000000..0b3b527e3 --- /dev/null +++ b/e107_languages/English/admin/lan_admin.php @@ -0,0 +1,272 @@ +immediately. The files are related to the older 0.6xx branch of e107. Please delete the following directories and all their contents:"); +define("ADLAN_ERR_3", "There are one or more files in your public upload directories that are not in your allowed upload filetypes list. These may have been placed here by an attacker and if so should be removed immediately. You should not open these files as this may execute any malicious code the file might contain; i.e. do not open them with your browser.

    If you recognise these files as being legitimate, it is likely that due to the recent allowed filetypes changes, the filetype you allowed is no longer in the allowed filetypes list and you will need to re-add it (see admin => uploads). You should not allow the upload of .html, .txt, etc as an attacker may upload a file of this type which includes malicious javascript. You should also, of course, not allow the upload of .php files or any other type of executable script.

    Below is the list of files that could potentially be malicious:"); +define("ADLAN_ERR_4", "Deprecated plugin file(s) found"); +define("ADLAN_ERR_5", "The following files need to be renamed to"); +define("ADLAN_ERR_6", "Then, click here to re-scan your plugin folders."); + + +// Common Terms +define("LAN_EDIT","Edit"); +define("LAN_DELETE","Delete"); +define("LAN_CREATE","Create"); +define("LAN_UPDATE","Update"); +define("LAN_SAVE","Save"); +define("LAN_SAVED","Saved"); +define("LAN_SETSAVED","Your settings have been saved"); +define("LAN_CONFIRMDEL","Please confirm you wish to delete"); +define("LAN_OPTIONS","Options"); +define("LAN_PREFS","Preferences"); +define("LAN_DELETED","Successfully deleted"); +define("LAN_UPDATED","Successfully updated"); +define("LAN_CREATED","Successfully created"); +define("LAN_CREATED_FAILED","Creation Unsuccessful"); +define("LAN_DELETED_FAILED","Deletion Unsuccessful"); +define("LAN_UPDATED_FAILED","Update Unsuccessful"); +define("LAN_NO_CHANGE","Update unsuccessful as no changes were made."); +define("LAN_TRY_AGAIN","Please try again."); + +define("LAN_RESET","Reset"); +define("LAN_CLEAR","Clear"); +define("LAN_OK","OK"); + +define("LAN_PRESET","Preset"); +define("LAN_PRESET_SAVED","Preset saved successfully"); + +define("LAN_PRESET_DELETED","Preset successfully deleted"); +define("LAN_PRESET_CONFIRMDEL","Are you sure you want to delete this preset?"); +define("LAN_NOTWRITABLE"," is not writable, you need to CHMOD 777 the file or folder first."); +define("LAN_DATE","Date"); +define("LAN_TIME","Time"); +define("LAN_YES","Yes"); +define("LAN_NO","No"); +define("LAN_EMPTY","There are no entries in the database yet"); +define("LAN_EXISTING","Existing Entries"); + +define("LAN_CANCEL","Cancel"); +define("LAN_CONFDELETE","Confirm Delete"); +define("LAN_PLUGIN","Plugin"); +define("LAN_ORDER","Order"); + +define("LAN_SELECT","Select ..."); +define("LAN_ADMIN","Admin"); +define("LAN_DISPLAYOPT", "Edit Display Options"); +define("LAN_GOPAGE", "Go to page:"); +define("LAN_DATESTAMP","Date stamp"); +define("LAN_OPTIONAL", "optional"); +define("LAN_INACTIVE","Inactive"); + +define("LAN_BAN","Ban"); +define("LAN_RATING", "Rating"); + +define("LAN_UPLOAD_IMAGES","Upload Images"); +define("LAN_UPLOAD_FILES","Upload Files"); +define("LAN_UPLOAD_ADDFILE","Add Another File"); +define("LAN_UPLOAD_CONFIRM","Any unsaved changes to this page will be lost. Continue?"); +define("LAN_UPLOAD_777","Folder is missing or not writable, you need to CHMOD 777 the following folder before uploading:"); +define("LAN_UPLOAD_SERVEROFF", "This option is disabled as file uploading is not enabled on your server"); + +define("LAN_DISABLED","Disabled"); +define("LAN_ENABLED", "Enabled"); + +define("LAN_PRESET_CONFIRMSAVE","Save current form values as the default for this page?"); +define("LAN_CONFIGURE", "Configure"); + +define("LAN_BACK","Back"); + +define("LAN_CREDITS","Credits"); + +?> diff --git a/e107_languages/English/admin/lan_admin_log.php b/e107_languages/English/admin/lan_admin_log.php new file mode 100644 index 000000000..0ed7cb9c9 --- /dev/null +++ b/e107_languages/English/admin/lan_admin_log.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_administrator.php b/e107_languages/English/admin/lan_administrator.php new file mode 100644 index 000000000..fbf57b169 --- /dev/null +++ b/e107_languages/English/admin/lan_administrator.php @@ -0,0 +1,83 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_banlist.php b/e107_languages/English/admin/lan_banlist.php new file mode 100644 index 000000000..efe7b0885 --- /dev/null +++ b/e107_languages/English/admin/lan_banlist.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_banner.php b/e107_languages/English/admin/lan_banner.php new file mode 100644 index 000000000..f2a71ad82 --- /dev/null +++ b/e107_languages/English/admin/lan_banner.php @@ -0,0 +1,73 @@ +this is only used when multiple campaigns are selected"); + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_cache.php b/e107_languages/English/admin/lan_cache.php new file mode 100644 index 000000000..3e6bc8286 --- /dev/null +++ b/e107_languages/English/admin/lan_cache.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_cpage.php b/e107_languages/English/admin/lan_cpage.php new file mode 100644 index 000000000..591aab03b --- /dev/null +++ b/e107_languages/English/admin/lan_cpage.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_credits.php b/e107_languages/English/admin/lan_credits.php new file mode 100644 index 000000000..935263889 --- /dev/null +++ b/e107_languages/English/admin/lan_credits.php @@ -0,0 +1,54 @@ +5ODM2NDU3YWI0ZjM1NGILJT
    yarrrrrr! wtf matey!\""); // jalist +define("CRELAN_23", ""); // lisa +define("CRELAN_24", ""); // McFly +define("CRELAN_25", ""); // que +define("CRELAN_26", ""); // streaky +define("CRELAN_27", "\"Wot? No tea?? 0_0\""); // SweetAs +define("CRELAN_28", ""); // MrPete + +// end dev team + +?> diff --git a/e107_languages/English/admin/lan_db.php b/e107_languages/English/admin/lan_db.php new file mode 100644 index 000000000..42bc275b7 --- /dev/null +++ b/e107_languages/English/admin/lan_db.php @@ -0,0 +1,45 @@ + diff --git a/e107_languages/English/admin/lan_db_verify.php b/e107_languages/English/admin/lan_db_verify.php new file mode 100644 index 000000000..f858e3bf2 --- /dev/null +++ b/e107_languages/English/admin/lan_db_verify.php @@ -0,0 +1,33 @@ +
    Please ensure the file core_sql.php exists in the /admin/sql directory."); +define("DBLAN_2", "Verifying all"); + +define("DBLAN_4", "Table"); +define("DBLAN_5", "Field"); +define("DBLAN_6", "Status"); +define("DBLAN_7", "Notes"); +define("DBLAN_8", "Mismatch"); +define("DBLAN_9", "Currently"); +define("DBLAN_10", "should be"); +define("DBLAN_11", "Field missing"); +define("DBLAN_12", "Extra Field!"); +define("DBLAN_13", "Table missing!"); +define("DBLAN_14", "Choose table(s) to validate"); +define("DBLAN_15", "Start Verify"); +define("DBLAN_16", "SQL Verification"); +define("DBLAN_17", "Back"); +define("DBLAN_18", "tables"); +define("DBLAN_19", "Attempt to Fix"); +define("DBLAN_20", "Attempting to fix tables"); +define("DBLAN_21", "Fix Selected Items"); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_docs.php b/e107_languages/English/admin/lan_docs.php new file mode 100644 index 000000000..15c5adc7f --- /dev/null +++ b/e107_languages/English/admin/lan_docs.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_download.php b/e107_languages/English/admin/lan_download.php new file mode 100644 index 000000000..7876097b9 --- /dev/null +++ b/e107_languages/English/admin/lan_download.php @@ -0,0 +1,143 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_e107_update.php b/e107_languages/English/admin/lan_e107_update.php new file mode 100644 index 000000000..d7bfb3ba6 --- /dev/null +++ b/e107_languages/English/admin/lan_e107_update.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_emoticon.php b/e107_languages/English/admin/lan_emoticon.php new file mode 100644 index 000000000..eb546e324 --- /dev/null +++ b/e107_languages/English/admin/lan_emoticon.php @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_fileinspector.php b/e107_languages/English/admin/lan_fileinspector.php new file mode 100644 index 000000000..6178be7c2 --- /dev/null +++ b/e107_languages/English/admin/lan_fileinspector.php @@ -0,0 +1,73 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_filemanager.php b/e107_languages/English/admin/lan_filemanager.php new file mode 100644 index 000000000..fcdde2747 --- /dev/null +++ b/e107_languages/English/admin/lan_filemanager.php @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_fla.php b/e107_languages/English/admin/lan_fla.php new file mode 100644 index 000000000..7883b46c3 --- /dev/null +++ b/e107_languages/English/admin/lan_fla.php @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_footer.php b/e107_languages/English/admin/lan_footer.php new file mode 100644 index 000000000..4952516fd --- /dev/null +++ b/e107_languages/English/admin/lan_footer.php @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_frontpage.php b/e107_languages/English/admin/lan_frontpage.php new file mode 100644 index 000000000..0115f865d --- /dev/null +++ b/e107_languages/English/admin/lan_frontpage.php @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_header.php b/e107_languages/English/admin/lan_header.php new file mode 100644 index 000000000..0113b85d7 --- /dev/null +++ b/e107_languages/English/admin/lan_header.php @@ -0,0 +1,21 @@ + diff --git a/e107_languages/English/admin/lan_image.php b/e107_languages/English/admin/lan_image.php new file mode 100644 index 000000000..d290c5092 --- /dev/null +++ b/e107_languages/English/admin/lan_image.php @@ -0,0 +1,65 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_lancheck.php b/e107_languages/English/admin/lan_lancheck.php new file mode 100644 index 000000000..71956b706 --- /dev/null +++ b/e107_languages/English/admin/lan_lancheck.php @@ -0,0 +1,35 @@ + diff --git a/e107_languages/English/admin/lan_language.php b/e107_languages/English/admin/lan_language.php new file mode 100644 index 000000000..c3c3aa6cc --- /dev/null +++ b/e107_languages/English/admin/lan_language.php @@ -0,0 +1,38 @@ + diff --git a/e107_languages/English/admin/lan_links.php b/e107_languages/English/admin/lan_links.php new file mode 100644 index 000000000..c6ff190d6 --- /dev/null +++ b/e107_languages/English/admin/lan_links.php @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_mailout.php b/e107_languages/English/admin/lan_mailout.php new file mode 100644 index 000000000..04ea1574a --- /dev/null +++ b/e107_languages/English/admin/lan_mailout.php @@ -0,0 +1,103 @@ +e107.htaccess to .htaccess in"); +define("MAILAN_41", "before sending mail from this page."); +define("MAILAN_42", "Warning"); +define("MAILAN_43", "Username"); +define("MAILAN_44", "User Login"); +define("MAILAN_45", "User Email"); +define("MAILAN_46", "User-Match"); +define("MAILAN_47", "contains"); +define("MAILAN_48", "equals"); +define("MAILAN_49", "Id"); +define("MAILAN_50", "Author"); +define("MAILAN_51", "Subject"); +define("MAILAN_52", "Lastmod"); +define("MAILAN_53", "Admins"); +define("MAILAN_54", "Self"); +define("MAILAN_55", "Userclass"); +define("MAILAN_56", "Send Mail"); +define("MAILAN_57", "Keep SMTP session alive"); +define("MAILAN_58", "There is a problem with the attachment:"); +define("MAILAN_59", "Mailing Progress"); +define("MAILAN_60", "Sending..."); +define("MAILAN_61", "There are no remaining emails to be sent."); +define("MAILAN_62", "Emails sent:"); +define("MAILAN_63", "Emails failed:"); +define("MAILAN_64", "Total time elapsed:"); +define("MAILAN_65", "seconds"); +define("MAILAN_66", "Cancelled Successfully"); +define("MAILAN_67", "Use 'POP before SMTP' authentication"); + + + + + + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_menus.php b/e107_languages/English/admin/lan_menus.php new file mode 100644 index 000000000..6c385a305 --- /dev/null +++ b/e107_languages/English/admin/lan_menus.php @@ -0,0 +1,56 @@ +SHOWN on the following pages"); +define("MENLAN_27", "This menu will only be HIDDEN on the following pages"); +define("MENLAN_28", "Enter one page per line, enter enough of the url to distinguish it properly. If you need the ending of the url to match exactly, use a ! at the end of the page name
    For example: page.php?1!"); + +define("MENLAN_29", "Select Layout"); +define("MENLAN_30", "To see the menu areas and their positions for custom layouts, select the custom layout here:"); +define("MENLAN_31", "Default Layout"); +define("MENLAN_32", "Newsheader Layout"); +define("MENLAN_33", "Custom Layout"); +define("MENLAN_34", "Embedded"); +define("MENLAN_35", "Configure Menus"); +define("MENLAN_36", "Choose the menu(s) to activate"); +define("MENLAN_37", "and where to activate them."); +define("MENLAN_38", "Hold down CTRL to select multiple menus."); + + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_message.php b/e107_languages/English/admin/lan_message.php new file mode 100644 index 000000000..3adb69460 --- /dev/null +++ b/e107_languages/English/admin/lan_message.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_meta.php b/e107_languages/English/admin/lan_meta.php new file mode 100644 index 000000000..465f8a8bc --- /dev/null +++ b/e107_languages/English/admin/lan_meta.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_modcomment.php b/e107_languages/English/admin/lan_modcomment.php new file mode 100644 index 000000000..74a3f7ab5 --- /dev/null +++ b/e107_languages/English/admin/lan_modcomment.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_newspost.php b/e107_languages/English/admin/lan_newspost.php new file mode 100644 index 000000000..76dcb7782 --- /dev/null +++ b/e107_languages/English/admin/lan_newspost.php @@ -0,0 +1,173 @@ + or leave blank to disable."); +define("NWSLAN_103", "re-post"); +define("NWSLAN_104", "by"); +define("NWSLAN_105", "Check box to update date stamp of news item to current time"); +define("NWSLAN_106", "Submit-News maybe accessed by:"); +define("NWSLAN_107", "Enable WYSIWYG editor on Submit-News page."); +define("NWSLAN_108", "on"); + +define("NWSLAN_111", "Show new date header"); +define("NWSLAN_112", "If this box is ticked, a box containing the date will be displayed above news items posted on a new day, useful for distinguishing posts on different days"); + +define("NWSLAN_113", "Use non-standard template for news layout"); +define("NWSLAN_114", "if the theme you're using has a news layout template, use this instead of the generic layout"); + +define("NWSLAN_115", "News posts to display in archive ?"); +define("NWSLAN_116", "First update the preferences with the changed display per page setting, then update again after setting the news archive preference. (0 is un-activated)"); +define("NWSLAN_117", "set the title for the news archive"); +// define("NWSLAN_118", "View Images"); already defined above. +define("NWSLAN_119", "Settings Saved"); +define("NWSLAN_120", "Text to show at the top of Submit News"); + +define("LAN_NEWS_5", "Error! - Was unable to update news item into database!"); +define("LAN_NEWS_6", "News entered into database."); +define("LAN_NEWS_7", "Error! - Was unable to enter news item into database!"); +define("LAN_NEWS_9", "Title only is set - only the news title will be shown"); +define("LAN_NEWS_10", "This news post is inactive (It will be not shown on front page). "); +define("LAN_NEWS_11", "This news post is active (it will be shown on front page). "); +define("LAN_NEWS_12", "Comments are turned on."); +define("LAN_NEWS_13", "Comments are turned off."); +define("LAN_NEWS_14", "
    Activation period: "); +define("LAN_NEWS_15", "Body length: "); +define("LAN_NEWS_16", "b. Extended length: "); +define("LAN_NEWS_17", "b."); +define("LAN_NEWS_18", "Info"); +define("LAN_NEWS_19", "Now"); +define("LAN_NEWS_21", "News updated in database."); + +define("LAN_NEWS_22", "Thumbnail"); +define("LAN_NEWS_23", "Choose an image for this news item"); +define("LAN_NEWS_24", "Image + Auto-Thumbnail"); +define("LAN_NEWS_25", "Auto-Thumbnail size"); +define("LAN_NEWS_26", "add new upload"); +define("LAN_NEWS_27", "Summary"); + +define("LAN_NEWS_28", "Sticky"); +define("LAN_NEWS_29", "Select if news item will be sticky"); +define("LAN_NEWS_30", "If selected, news item will appear above all others"); +define("LAN_NEWS_31", "This news post is sticky (it will be shown above all other items). "); +define("LAN_NEWS_32", "Date stamp"); +define("LAN_NEWS_33", "Set the date stamp for the current news item"); + +define("LAN_NEWS_34", "Trackback"); +define("LAN_NEWS_35", "Add trackback URLs"); +define("LAN_NEWS_36", "Pingback (send a pingback to all URLs in this post)"); +define("LAN_NEWS_37", "Trackback URLs: (one URL per line)"); +define("LAN_NEWS_38", "Insert images"); + +define("LAN_NEWS_39", "click on file to insert at cursor position"); +define("LAN_NEWS_40", "Insert download links"); + +define("LAN_NEWS_42", "Files"); +// define("LAN_NEWS_43", "(no images in /e107_images/newspost_images)"); // deprecated see lan_admin.php +define("LAN_NEWS_44", "Trackback not enabled."); + +define("LAN_NEWS_45", "ID"); + +define("LAN_NEWS_46", "News item not updated as no changes were made."); +// define("LAN_NEWS_47", "Image"); // already defined above. +define("LAN_NEWS_48", "No Image"); + +define("LAN_NEWS_49", "Render-type"); + +?> diff --git a/e107_languages/English/admin/lan_notify.php b/e107_languages/English/admin/lan_notify.php new file mode 100644 index 000000000..532b8104c --- /dev/null +++ b/e107_languages/English/admin/lan_notify.php @@ -0,0 +1,38 @@ + diff --git a/e107_languages/English/admin/lan_plugin.php b/e107_languages/English/admin/lan_plugin.php new file mode 100644 index 000000000..e33c931f8 --- /dev/null +++ b/e107_languages/English/admin/lan_plugin.php @@ -0,0 +1,88 @@ +your menus page."); + +// define("EPL_CANCEL", "Cancel"); use LAN_CANCEL instead !! +// define("EPL_EMAIL", "email"); +define("EPL_WEBSITE", "Website"); +// define("EPL_OPTIONS", "Options"); use LAN_OPTIONS instead! +define("EPL_NOINSTALL", "No install required, just activate from your menus screen. To uninstall, delete the "); +define("EPL_DIRECTORY", "directory."); +define("EPL_NOINSTALL_1", "No install required, to remove delete the "); +define("EPL_UPGRADE", "Upgrade"); + +define("EPL_ADLAN_50", "Comments successfully deleted"); + +define("EPL_ADLAN_53", "Directory not writable"); +define("EPL_ADLAN_54", "Please select the option for uninstalling the plugin:"); +define("EPL_ADLAN_55", "Uninstall plugin"); + +define("EPL_ADLAN_57", "Delete plugin tables"); +define("EPL_ADLAN_58", "If the tables are not removed, the plugin can be reinstalled with no data loss. The creation of tables during the reinstall will fail. Tables will have to be manually deleted to remove."); +define("EPL_ADLAN_59", "Delete plugin files"); +define("EPL_ADLAN_60", "e107 will attempt to remove all plugin related files."); +// define("EPL_ADLAN_61", "Confirm uninstall"); // duplicated. can be deleted. +define("EPL_ADLAN_62", "Cancel uninstall"); +define("EPL_ADLAN_63", "Uninstall:"); + +define("LAN_UPGRADE_SUCCESSFUL", "Upgrade Successful"); +define("LAN_INSTALL_SUCCESSFUL", "Installation Successful"); + + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php new file mode 100644 index 000000000..6e6d62924 --- /dev/null +++ b/e107_languages/English/admin/lan_prefs.php @@ -0,0 +1,190 @@ +you are sure you know what you are doing!"); +define("PRFLAN_76", "Enable Image-code verification during signup."); +define("PRFLAN_77", "Admin Display Options "); +define("PRFLAN_78", "Leave blank to disable"); +define("PRFLAN_80", "Click here to view"); +define("PRFLAN_81", "Enable Image-code verification during login."); +define("PRFLAN_83", "example"); +define("PRFLAN_87", "Comments"); +define("PRFLAN_88", "Turn on nested comments"); +define("PRFLAN_89", "Display new comment icon"); +define("PRFLAN_90", "Allow posters to edit their comments"); + +define("CUSTSIG_1", "Settings Saved!"); +define("CUSTSIG_2", "Real Name:"); +define("CUSTSIG_3", "Website:"); +define("CUSTSIG_4", "Birthday:"); +define("CUSTSIG_5", "Location:"); +define("CUSTSIG_6", "Signature:"); +define("CUSTSIG_7", "Avatar:"); +define("CUSTSIG_8", "Time-Zone:"); +define("CUSTSIG_12", "Hide"); +define("CUSTSIG_13", "Fields"); +define("CUSTSIG_14", "Display"); +define("CUSTSIG_15", "Required"); +define("CUSTSIG_16", "Minimum Length for Passwords"); +define("CUSTSIG_17", "Subscribe to content/mailouts"); +define("CUSTSIG_18", "Disallow usernames"); +define("CUSTSIG_19", "usernames containing the following text will be rejected, separate entries by commas"); + +define("PRFLAN_91", "If someone is attacking your site by multiple requests to your server, his IP will be automatically banned ! Don't replace a correct server config !!!"); +define("PRFLAN_92", "Secure signup verification -- hide password in email?"); +define("PRFLAN_93", "strftime function page at php.net"); +define("PRFLAN_94", "here"); +define("PRFLAN_95", "Display plugins info:"); +define("PRFLAN_96", "Will display info on all admin pages for each plugin supporting this type of feature"); +define("PRFLAN_97", "Unique 'Plugins info' menu:"); +define("PRFLAN_98", "If unchecked, each plugin will display its own info in an individual menu. If checked all info will be displayed in one menu."); +define("PRFLAN_101", "Text rendering"); +define("PRFLAN_102", "Replace clickable URLs"); +define("PRFLAN_103", "If ticked, and 'Make Clickable' (above) is also ticked, posted URLs are displayed as a hyperlink using text from the textbox below. This keeps very long URLs from breaking layout."); +define("PRFLAN_104", "URL replacement text"); +define("PRFLAN_105", "Replacement visible text for clickable URLs. Image can be used by using <img> tag, with full path to image"); +define("PRFLAN_106", "Core preferences saved to database."); +define("PRFLAN_107", "Email link replace text"); +define("PRFLAN_108", "text to replace email links with, image can be used by using <img> tag, with full path to image"); +define("PRFLAN_109", "Wrap long words in main text"); +define("PRFLAN_110", "words longer than the length entered will be wrapped onto a new line"); +define("PRFLAN_111", "Wrap long words in menu text"); +define("PRFLAN_112", "On"); +define("PRFLAN_113", "Off"); +define("PRFLAN_116", "Allow HTML posting"); +define("PRFLAN_117", "This will allow users to post HTML code anywhere on the site, select the userclass to allow this."); +define("PRFLAN_118", "Use Geshi for syntax highlighting"); +define("PRFLAN_119", "Geshi is an open source multi-language syntax highlighter, see http://qbnz.com/highlighter/ for more information"); +define("PRFLAN_120", "Default Geshi syntax language"); +define("PRFLAN_121", "if no language is specified in the code bbtag, this language will be used for highlighting"); +define("PRFLAN_122", "Enable WYSIWYG textareas"); +define("PRFLAN_123", "Will display a what-you-see-is-what-you-get editor in textareas when available. Applies only to Admins and Users that are allowed to post HTML."); +define("PRFLAN_124", "Use 'classic' nextprev look"); +define("PRFLAN_125", "Turning this on will show the nextprev pages as 1 2 3 ... 21 22 23, instead of the new look with the dropdown."); +define("PRFLAN_126", "Text to display on signup page"); +define("PRFLAN_127", "Make URLs clickable"); +define("PRFLAN_128", "Turning this on will convert posted URLs to hyperlinks"); +define("PRFLAN_129", "Disallow multiple logins"); +define("PRFLAN_130", "Activating this will prevent more than one person logging in with the same username/password (login detail sharing)"); +define("PRFLAN_131", "Activate use of [php] bbcode"); +define("PRFLAN_132", "Activating this will allow authorized users to post [php] code in certain areas"); +define("PRFLAN_133", "GD extension required, not found"); +define("PRFLAN_134", "Redirect all requests to site URL"); +define("PRFLAN_135", "for example, if your site URL above is set http://foo.com, anyone requesting http://www.foo.com will be redirected to http://foo.com"); +define("PRFLAN_136", "Maximum Signups permitted from the same IP address."); +define("PRFLAN_137", "Display Memory Usage"); +define("PRFLAN_138", "Enable Image-code verification during forgotten password."); +define("PRFLAN_139", "Display warning when main administrator password hasn't changed for at least 30 days"); +define("PRFLAN_140", "Text to display after signup form has been submitted."); +define("PRFLAN_141", "Allow registration using XML User Profiles"); +define("PRFLAN_142", "Flood Only"); +define("PRFLAN_143", "Failed Login Only"); +define("PRFLAN_144", "Flood & Failed Login"); +define("PRFLAN_145", "Links in new window"); +define("PRFLAN_146", "Tick here to make all links open in a new window (this will apply sitewide). "); +define("PRFLAN_147", "Developer Mode"); +define("PRFLAN_148", "Activate developer functions. This is for developers only. Do not use on production sites for security reasons."); +define("PRFLAN_149", "Advanced Features"); +define("PRFLAN_150", "Select e107 authentication method"); +define("PRFLAN_151", "e107 - No alternate authentication methods installed"); + +define("PRFLAN_31", "Email Verification"); +define("PRFLAN_152", "No Verification"); +define("PRFLAN_153", "Admin Approval"); +define("PRFLAN_154", "New user verification method
    If 'Admin Approval' is selected, it is recommended that you enable email notification on user signup here."); + +define("PRFLAN_155", "Display Name available to"); +define("PRFLAN_156", "Reset ALL Display Names"); +define("PRFLAN_157", "All Display Names have been reset to the Login Name"); +define("PRFLAN_158", "Display Name maximum length"); +define("PRFLAN_159", "viewing this page with"); + +define("PRFLAN_160", "Check remote servers when validating email addresses."); +define("PRFLAN_161", "Disable all comments on the site"); + +define("PRFLAN_162", "Site Contact Information"); +define("PRFLAN_163", "e.g. Company Name, Address, Phone, etc."); + +define("PRFLAN_164", "Allow users to email copy of contact email to self"); +define("PRFLAN_165", "Possible opening for allowing spam, use with caution"); +define("PRFLAN_166", "Show emoticon images on comment form?"); + +define("PRFLAN_167", "Make entering an email addresses optional"); // subject to change. +define("PRFLAN_168", "Site Contact Person(s)"); +define("PRFLAN_169", "If the chosen group contains more than one person, the user will be asked to select a person from the group."); + +define("PRFLAN_170", "Use reverse DNS to allow host banning"); +define("PRFLAN_171", "Turning this option on will allow you to ban users by hostname, rather then just IP or email address.
    NOTE: This may affect pageload times on some hosts"); + + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_search.php b/e107_languages/English/admin/lan_search.php new file mode 100644 index 000000000..c5a33feaa --- /dev/null +++ b/e107_languages/English/admin/lan_search.php @@ -0,0 +1,63 @@ + diff --git a/e107_languages/English/admin/lan_theme.php b/e107_languages/English/admin/lan_theme.php new file mode 100644 index 000000000..5eb5f3e36 --- /dev/null +++ b/e107_languages/English/admin/lan_theme.php @@ -0,0 +1,62 @@ +'".PREVIEWTHEMENAME."' theme. It has not been set as the main theme for your site, it has been activated to provide a preview of how the theme looks.
    To set this theme as your site theme, return to your theme manager and select 'Set As Site Theme'.
    To preview more themes please click here"); +define("TPVLAN_2", "Theme Preview"); +define("TPVLAN_3", "Main site theme set to"); +define("TPVLAN_4", "Author"); +define("TPVLAN_5", "Website"); +define("TPVLAN_6", "Release date"); +define("TPVLAN_7", "Information"); +define("TPVLAN_8", "Options"); +define("TPVLAN_9", "Preview Theme"); +define("TPVLAN_10", "Set As Site Theme"); +define("TPVLAN_11", "Version"); +define("TPVLAN_12", "No preview available"); + +define("TPVLAN_13", "Upload theme (.zip or .tar.gz format)"); +define("TPVLAN_14", "Upload Theme"); +define("TPVLAN_15", "The file could not be uploaded as the ".e_THEME." folder does not have the correct permissions - please CHMOD to 777 and re-upload the file."); +define("TPVLAN_16", "Admin Message"); +define("TPVLAN_17", "That file does not appear to be a valid .zip or .tar archive."); +define("TPVLAN_18", "An error has occurred, unable to un-archive the file"); +define("TPVLAN_19", "Your theme has been uploaded and unzipped, please scroll down to see your theme in the list."); +define("TPVLAN_20", "Auto theme upload and extraction is disabled as your themes folder does not have the correct permissions - please CHMOD your e107_themes folder to 777."); + +define("TPVLAN_21", "This is the currently selected site theme"); + +define("TPVLAN_22", "This theme has multiple stylesheets"); +define("TPVLAN_23", "default stylesheet"); +define("TPVLAN_24", "no information"); +define("TPVLAN_25", "To choose which stylesheet to use, please go to preferences and click on 'Theme'."); + +define("TPVLAN_26", "Theme Manager"); +define("TPVLAN_27", "Please select stylesheet to use"); +define("TPVLAN_28", "on"); +define("TPVLAN_29", "off"); +define("TPVLAN_30", "Preload Theme Images:"); + +define("TPVLAN_31", "This is the currently selected admin theme"); +define("TPVLAN_32", "Set As Admin Theme"); + +define("TPVLAN_33", "Current Site Theme"); +define("TPVLAN_34", "Current Admin Theme"); +define("TPVLAN_35", "Save options"); +define("TPVLAN_36", "Admin Message"); +define("TPVLAN_37", "Theme options saved"); +define("TPVLAN_38", "Upload Theme"); +define("TPVLAN_39", "Available Themes"); +define("TPVLAN_40", "Admin theme set to"); + +define("TPVLAN_41", "Please select admin layout style to use"); +define("TPVLAN_42", "Save admin options"); +define("TPVLAN_43", "Admin options saved"); +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_ugflag.php b/e107_languages/English/admin/lan_ugflag.php new file mode 100644 index 000000000..6341b1b4b --- /dev/null +++ b/e107_languages/English/admin/lan_ugflag.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_updateadmin.php b/e107_languages/English/admin/lan_updateadmin.php new file mode 100644 index 000000000..2d850d15f --- /dev/null +++ b/e107_languages/English/admin/lan_updateadmin.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_upload.php b/e107_languages/English/admin/lan_upload.php new file mode 100644 index 000000000..ac9462007 --- /dev/null +++ b/e107_languages/English/admin/lan_upload.php @@ -0,0 +1,72 @@ +Note binary is only suitable for smaller files under approximately 500kb"); +define("UPLLAN_31", "Flatfile"); +define("UPLLAN_32", "Binary"); +define("UPLLAN_33", "Maximum file size"); +define("UPLLAN_34", "Maximum upload size in bytes - leave blank to conform to php.ini setting ( php.ini setting is"); +define("UPLLAN_35", "Allowed file types"); +define("UPLLAN_36", "Please enter one type per line"); +define("UPLLAN_37", "Permission"); +define("UPLLAN_38", "Select to allow only certain users to upload"); +define("UPLLAN_39", "Submit"); + +define("UPLLAN_41", "Please note - file uploads are disabled from your php.ini, it will not be possible to upload files until you set it to On."); + +define("UPLLAN_42", "Actions"); +define("UPLLAN_43", "Uploads"); +define("UPLLAN_44", "Upload"); + +define("UPLLAN_45", "Are you sure you want to delete the following file..."); + +define("UPLAN_COPYTODLM", "copy to download manager"); +define("UPLAN_IS", "is "); +define("UPLAN_ARE", "are "); +define("UPLAN_COPYTODLS", "Copy to Downloads"); + +define("UPLLAN_48", "For security reasons allowed file types has been moved out of the database into a +flatfile located in your admin directory. To use, rename the file e107_admin/filetypes_.php to e107_admin/filetypes.php +and add a comma delimited list of file type extensions to it. You should not allow the upload of .html, .txt, etc., as an attacker may upload a file of this type which includes malicious javascript. You should also, of course, not allow +the upload of .php files or any other type of executable script."); + + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_userclass.php b/e107_languages/English/admin/lan_userclass.php new file mode 100644 index 000000000..275ff849d --- /dev/null +++ b/e107_languages/English/admin/lan_userclass.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_userclass2.php b/e107_languages/English/admin/lan_userclass2.php new file mode 100644 index 000000000..b0ddffbc4 --- /dev/null +++ b/e107_languages/English/admin/lan_userclass2.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_userinfo.php b/e107_languages/English/admin/lan_userinfo.php new file mode 100644 index 000000000..a95172381 --- /dev/null +++ b/e107_languages/English/admin/lan_userinfo.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/e107_languages/English/admin/lan_users.php b/e107_languages/English/admin/lan_users.php new file mode 100644 index 000000000..47e6ba449 --- /dev/null +++ b/e107_languages/English/admin/lan_users.php @@ -0,0 +1,192 @@ +This option is ignored if user signups are admin moderated"); +define("USRLAN_95", "minutes"); + + +define("USRLAN_112", "Resend Email"); +define("USRLAN_113", "Registration details for"); +define("USRLAN_114", "Dear"); +define("USRLAN_115", "Thanks for your registration."); +define("USRLAN_116", "Please confirm that you wish to resend a confirmation email to:"); +define("USRLAN_117", "Click the button below to test the following email:"); +define("USRLAN_118", "Test Email"); + +define("USRLAN_120", "Set Classes"); +define("USRLAN_121", "Mailing"); +define("USRLAN_122", "Welcome to"); +define("USRLAN_123", "Your registration has been received and created."); +define("USRLAN_124", "Your account is currently marked as being inactive, to activate your account please go to the following link"); +define("USRLAN_125", "From"); + +define("USRLAN_126", "Allow users to rate users"); +define("USRLAN_127", "Allow comments in user profile"); + +define("USRLAN_128", "Login name"); + +define("USRLAN_130", "Enable online user tracking"); +define("USRLAN_131", "You must enable this option to use online user tracking options, like online.php, forum online info and online menus"); +define("USRLAN_132", "Enable"); + +define("USRLAN_133", "Force user to update settings"); +define("USRLAN_134", "Enabling this option will automatically send the user to their user-settings if a required user field is not filled."); + +define("USRLAN_135", "No IP address found in user's info; IP not banned"); +define("USRLAN_136", "Multiple users found with IP address of {IP}; IP not banned."); +define("USRLAN_137", "Users IP address of {IP} banned."); + +define("LAN_MAINADMIN","Main Admin"); +define("LAN_ADMIN","Admin"); +define("LAN_NOTVERIFIED","Not Verified"); +define("LAN_BANNED","Banned"); + +define("DUSRLAN_1", "ID"); +define("DUSRLAN_2", "Display Name"); +define("DUSRLAN_3", "Username"); +define("DUSRLAN_4", "Custom Title"); +define("DUSRLAN_5", "Password"); +define("DUSRLAN_6", "Session"); +define("DUSRLAN_7", "Email"); +define("DUSRLAN_8", "Website"); +define("DUSRLAN_9", "ICQ"); +define("DUSRLAN_10", "AIM"); +define("DUSRLAN_11", "MSN"); +define("DUSRLAN_12", "Location"); +define("DUSRLAN_13", "Birthday"); +define("DUSRLAN_14", "Signature"); +define("DUSRLAN_15", "Image"); +define("DUSRLAN_16", "Timezone"); +define("DUSRLAN_17", "Hide Email"); +define("DUSRLAN_18", "Join Date"); +define("DUSRLAN_19", "Last Visit"); +define("DUSRLAN_20", "Current Visit"); +define("DUSRLAN_21", "Last Post"); +define("DUSRLAN_22", "Chatbox Posts"); +define("DUSRLAN_23", "Comments"); +define("DUSRLAN_24", "Forum Posts"); +define("DUSRLAN_25", "IP"); +define("DUSRLAN_26", "Ban"); +define("DUSRLAN_27", "Prefs"); +define("DUSRLAN_28", "New"); +define("DUSRLAN_29", "Viewed"); +define("DUSRLAN_30", "Visits"); +define("DUSRLAN_31", "Admin"); +define("DUSRLAN_32", "Real Name"); +define("DUSRLAN_33", "User Class"); +define("DUSRLAN_34", "Perms"); +define("DUSRLAN_35", "Picture"); +define("DUSRLAN_36", "Password Change"); +define("DUSRLAN_37", "XUP"); + +define("USRLAN_138", "Unverified users"); +define("USRLAN_139", "Your account has been activated.\n\nYou can visit {SITEURL} and log into the site using the login information you provided."); + +define("USRLAN_140", "Email Re-sent to"); +define("USRLAN_141", "Failed to Re-send email to"); +define("USRLAN_142", "with the following activation link"); + +define("LAN_BOUNCED","Bounced"); +define("USRLAN_143", "Check For Bounces"); +define("USRLAN_144", "Resend Confirmation Email to All"); +define("USRLAN_145", "Bounced users"); +define("USRLAN_146", "Member information is available to"); + +?> diff --git a/e107_languages/English/admin/lan_users_extended.php b/e107_languages/English/admin/lan_users_extended.php new file mode 100755 index 000000000..e73c9c0dc --- /dev/null +++ b/e107_languages/English/admin/lan_users_extended.php @@ -0,0 +1,107 @@ + For DB table see help."); +define("EXTLAN_18", "Required"); +define("EXTLAN_19", "Users will be required to enter a value in this field when updating their settings."); +define("EXTLAN_20", "Determines which users this field will apply to."); +define("EXTLAN_21", "This will determine who will see this field in their usersettings."); +define("EXTLAN_22", "This will determine who can see the value in the user page
    NOTE: Setting this to 'Read Only' will make it visible to Admin and the member only."); +define("EXTLAN_23", "Add Extended Field"); +define("EXTLAN_24", "Update Extended Field"); +define("EXTLAN_25", "move down"); +define("EXTLAN_26", "move up"); +define("EXTLAN_27", "Confirm Delete"); +define("EXTLAN_28", "No extended fields defined"); +define("EXTLAN_29", "Extended user fields saved."); +define("EXTLAN_30", "Extended field deleted"); +// define("EXTLAN_31", "Extended Field Menu"); +// define("EXTLAN_32", "Extended front page"); +define("EXTLAN_33", "Cancel Edit"); +define("EXTLAN_34", "Extended Fields"); +define("EXTLAN_35", "Categories"); +define("EXTLAN_36", "No assigned Category"); +define("EXTLAN_37", "No categories defined"); +define("EXTLAN_38", "Category name"); +define("EXTLAN_39", "Add category"); +define("EXTLAN_40", "Category created"); +define("EXTLAN_41", "Category deleted"); +define("EXTLAN_42", "Update Category"); +define("EXTLAN_43", "Category Updated"); +define("EXTLAN_44", "Category"); +define("EXTLAN_45", "Add New Field"); +define("EXTLAN_46", "Help"); +define("EXTLAN_47", "Add new parameter"); +define("EXTLAN_48", "Add new value"); +define("EXTLAN_49", "Allow user to hide"); +define("EXTLAN_50", "Setting this to yes will allow the user to hide this value from non-admins"); +define("EXTLAN_51", "Any valid w3c parameter may be entered here
    ie class='tbox' size='40' maxlength='80'"); +define("EXTLAN_52", "regex validation code"); +define("EXTLAN_53", "Enter the regex code that will need to be matched to make it a valid entry
    **regex delimiters are required**"); +define("EXTLAN_54", "regex failure text"); +define("EXTLAN_55", "Enter the error message that will be shown if the regex validation fails."); +define("EXTLAN_56", "Predefined Fields"); +define("EXTLAN_57", "Activated"); +define("EXTLAN_58", "Not Activated"); +define("EXTLAN_59", "Activate"); +define("EXTLAN_60", "Deactivate"); +define("EXTLAN_61", "None"); + +define("EXTLAN_62", "Table"); +define("EXTLAN_63", "Field Id"); +define("EXTLAN_64", "Display Value"); + +define("EXTLAN_65", "No - Will not show on signup page"); +define("EXTLAN_66", "Yes - Will show on signup page"); +define("EXTLAN_67", "No - Show on signup page"); + +define("EXTLAN_68", "Field:"); +define("EXTLAN_69", "has been activated"); +define("EXTLAN_70", "ERROR!! Field:"); +define("EXTLAN_71", "was not activated!"); +define("EXTLAN_72", "has been deactivated"); +define("EXTLAN_73", "was not deactivated!"); +define("EXTLAN_74", "is a reserved field name and can not be used."); + + +//textbox +define("EXTLAN_HELP_1", "Parameters:
    size - size of field
    maxlength - max length of field

    class - css class of field
    style - css style string

    regex - regex validation code
    regexfail - validation fail text"); +//radio buttons +define("EXTLAN_HELP_2", "This will be the radio buttons help text"); +//dropdown +define("EXTLAN_HELP_3", "This will be the dropdown help text"); +//db field +define("EXTLAN_HELP_4", "Values:
    There should be three values given ALWAYS:
    1. dbtable
    2. field containing id
    3. field containing value

    "); +//textarea +define("EXTLAN_HELP_5", "This will be the Textarea help text"); +//integer +define("EXTLAN_HELP_6", "This will be the Integer help text"); +//date +define("EXTLAN_HELP_7", "This will be the date help text"); + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_wmessage.php b/e107_languages/English/admin/lan_wmessage.php new file mode 100644 index 000000000..613fbf6f6 --- /dev/null +++ b/e107_languages/English/admin/lan_wmessage.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_banner.php b/e107_languages/English/lan_banner.php new file mode 100644 index 000000000..9f6ecd465 --- /dev/null +++ b/e107_languages/English/lan_banner.php @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_comment.php b/e107_languages/English/lan_comment.php new file mode 100644 index 000000000..242913733 --- /dev/null +++ b/e107_languages/English/lan_comment.php @@ -0,0 +1,77 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_contact.php b/e107_languages/English/lan_contact.php new file mode 100644 index 000000000..9b66acd76 --- /dev/null +++ b/e107_languages/English/lan_contact.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_date.php b/e107_languages/English/lan_date.php new file mode 100644 index 000000000..455a8acaf --- /dev/null +++ b/e107_languages/English/lan_date.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_download.php b/e107_languages/English/lan_download.php new file mode 100644 index 000000000..962d9fa6f --- /dev/null +++ b/e107_languages/English/lan_download.php @@ -0,0 +1,100 @@ +Thank you."); +define("LAN_dl_49", "Click here to return to download"); +define("LAN_dl_50", "Report broken download to an administrator"); +define("LAN_dl_51", "Reporting download: "); +define("LAN_dl_52", "Guest"); +define("LAN_dl_53", "Click to view download"); +define("LAN_dl_54", "An administrator will be made aware of this download, please leave a message if you feel it necessary."); +define("LAN_dl_55", "Do not use this form to contact the admin for any other reason."); +// define("LAN_dl_56", "Report broken download"); already defined above. +define("LAN_dl_57", "reported by"); +define("LAN_dl_58", "The following download has been reported as broken from site"); +define("LAN_dl_59", "Reported by: "); +define("LAN_dl_60", "Broken download report from"); + +define("LAN_dl_61", "Download Error"); +define("LAN_dl_62", "You have been prevented from downloading this file; you have exceeded your download quota"); +define("LAN_dl_63", "You do not have the correct permissions to download this file."); +define("LAN_dl_64", "Back"); +define("LAN_dl_65", "File Not Found"); + +define("LAN_dl_66", "Select download mirror"); + +define("LAN_dl_67", "Please select mirror to use ..."); +define("LAN_dl_68", "Mirror Host"); +// define("LAN_dl_69", "Download"); // duplicate +define("LAN_dl_70", "Location"); +define("LAN_dl_71", "About"); + +define("LAN_dl_72", "Requesting file: "); +define("LAN_dl_73", "Downloads from this mirror: "); +define("LAN_dl_74", "Total downloads from this mirror: "); + +define("LAN_dl_75", "no image available "); +define("LAN_dl_76", "Go to page"); + +?> diff --git a/e107_languages/English/lan_email.php b/e107_languages/English/lan_email.php new file mode 100644 index 000000000..205626c73 --- /dev/null +++ b/e107_languages/English/lan_email.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_equery_secure.php b/e107_languages/English/lan_equery_secure.php new file mode 100644 index 000000000..21c1dfc16 --- /dev/null +++ b/e107_languages/English/lan_equery_secure.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_error.php b/e107_languages/English/lan_error.php new file mode 100644 index 000000000..621a87c5f --- /dev/null +++ b/e107_languages/English/lan_error.php @@ -0,0 +1,49 @@ +Reset_Core utility to rebuild your core settings.
    After rebuilding your core please save a backup from the admin/sql screen."); +define("LAN_ERROR_29", "[5]: Field(s) have been left blank. Please resubmit the form and fill in the required fields."); +define("LAN_ERROR_30", "[6]: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information."); +define("LAN_ERROR_31", "[7]: mySQL is running but database ({$mySQLdefaultdb}) couldn't be connected to.
    Please check it exists and that your e107_config.php contains the correct information."); +define("LAN_ERROR_32", "To complete the upgrade, copy the following text into your e107_config.php file:"); + + +?> diff --git a/e107_languages/English/lan_fpw.php b/e107_languages/English/lan_fpw.php new file mode 100644 index 000000000..04ede40b2 --- /dev/null +++ b/e107_languages/English/lan_fpw.php @@ -0,0 +1,48 @@ +Please contact the site administrator for more details."); +define("LAN_FPW8","The password for username"); +define("LAN_FPW9","has been successfully changed.

    The new password is:"); +define("LAN_FPW10","Please"); +define("LAN_FPW11","log in now"); +define("LAN_FPW12","and immediately change your password, for security purposes."); + +define("LAN_FPW13", "please follow the instructions in the email to validate your password."); +define("LAN_FPW14", "has been submitted by someone with the IP of"); +define("LAN_FPW15", "This does not mean your password has yet been reset. You must navigate to the link shown below to complete the reset process."); +define("LAN_FPW16", "If you did not request to have your password reset and you do NOT want it reset, you may simply ignore this email"); +define("LAN_FPW17", "The link below will be valid for 48 hours."); + +?> \ No newline at end of file diff --git a/e107_languages/English/lan_installer.php b/e107_languages/English/lan_installer.php new file mode 100644 index 000000000..486367834 --- /dev/null +++ b/e107_languages/English/lan_installer.php @@ -0,0 +1,124 @@ += 3.23 to function correctly."); +define("LANINS_014", "File Permissions"); +define("LANINS_015", "PHP Version"); +define("LANINS_016", "MySQL"); +define("LANINS_017", "PASS"); +define("LANINS_018", "Ensure all the listed files exist and are writable by the server. This normally involves CHMODing them 777, but environments vary - contact your host if you have any problems."); +define("LANINS_019", "The version of PHP installed on your server isn't capable of running e107. e107 requires a PHP version of at least 4.3.0 to run correctly. Either upgrade your PHP version, or contact your host for an upgrade."); +define("LANINS_020", "Continue Installation"); +define("LANINS_021", "2"); +define("LANINS_022", "MySQL Server Details"); +define("LANINS_023", "Please enter your MySQL settings here. + +If you have root permissions you can create a new database by ticking the box, if not you must create a database or use a pre-existing one. + +If you have only one database use a prefix so that other scripts can share the same database. +If you do not know your MySQL details contact your web host."); +define("LANINS_024", "MySQL Server:"); +define("LANINS_025", "MySQL Username:"); +define("LANINS_026", "MySQL Password:"); +define("LANINS_027", "MySQL Database:"); +define("LANINS_028", "Create Database?"); +define("LANINS_029", "Table prefix:"); +define("LANINS_030", "The MySQL server you would like e107 to use. It can also include a port number. e.g. \"hostname:port\" or a path to a local socket e.g. \":/path/to/socket\" for the localhost."); +define("LANINS_031", "The username you wish e107 to use for connecting to your MySQL server"); +define("LANINS_032", "The Password for the user you just entered"); +define("LANINS_033", "The MySQL database you wish e107 to reside in, sometimes referred to as a schema. If the user has database create permissions you can opt to create the database automatically if it doesn't already exist."); +define("LANINS_034", "The prefix you wish e107 to use when creating the e107 tables. Useful for multiple installs of e107 in one database schema."); +define("LANINS_035", "Continue"); +define("LANINS_036", "3"); +define("LANINS_037", "MySQL Connection Verification"); +define("LANINS_038", " and Database Creation"); +define("LANINS_039", "Please make sure you fill in all fields, most importantly, MySQL Server, MySQL Username and MySQL Database (These are always required by the MySQL Server)"); +define("LANINS_040", "Errors"); +define("LANINS_041", "e107 was unable to establish a connection to the MySQL server using the information you entered. Please return to the last page and ensure the information is correct."); +define("LANINS_042", "Connection to the MySQL server established and verified."); +define("LANINS_043", "Unable to create database, please ensure you have the correct permissions to create databases on your server."); +define("LANINS_044", "Successfully created database."); +define("LANINS_045", "Please click on the button to proceed to next stage."); +define("LANINS_046", "5"); +define("LANINS_047", "Administrator Details"); +define("LANINS_048", "Go Back To Last Step"); +define("LANINS_049", "The two passwords you entered are not the same. Please go back and try again."); +define("LANINS_050", "XML Extension"); +define("LANINS_051", "Installed"); +define("LANINS_052", "Not Installed"); +define("LANINS_053", "e107 .700 requires the PHP XML Extension to be installed. Please contact your host or read the information at "); +define("LANINS_054", " before continuing"); +define("LANINS_055", "Install Confirmation"); +define("LANINS_056", "6"); +define("LANINS_057", " e107 now has all the information it needs to complete the installation. + +Please click the button to create the database tables and save all your settings. + +"); +define("LANINS_058", "7"); +define("LANINS_060", "Unable to read the sql datafile + +Please ensure the file core_sql.php exists in the /e107_admin/sql directory."); +define("LANINS_061", "e107 was unable to create all of the required database tables. +Please clear the database and rectify any problems before trying again."); + +define("LANINS_062", "[b]Welcome to your new website![/b] +e107 has installed successfully and is now ready to accept content.
    Your administration section is [link=e107_admin/admin.php]located here[/link], click to go there now. You will have to login using the name and password you entered during the installation process. + +[b]Support[/b] +e107 Homepage: [link=http://e107.org]http://e107.org[/link], you will find the FAQ and documentation here. +Forums: [link=http://e107.org/e107_plugins/forum/forum.php]http://e107.org/e107_plugins/forum/forum.php[/link] + +[b]Downloads[/b] +Plugins: [link=http://e107coders.org]http://e107coders.org[/link] +Themes: [link=http://e107themes.org]http://e107themes.org[/link] + +Thank you for trying e107, we hope it fulfils your website needs. +(You can delete this message from your admin section.)"); + +define("LANINS_063", "Welcome to e107"); + +define("LANINS_069", "e107 has been successfully installed! + +For security reasons you should now set the file permissions on the e107_config.php file back to 644. + +Also please delete install.php from your server after you have clicked the button below. +"); +define("LANINS_070", "e107 was unable to save the main config file to your server. + +Please ensure the e107_config.php file has the correct permissions"); +define("LANINS_071", "Finalising Installation"); + +define("LANINS_072", "Admin Username"); +define("LANINS_073", "This is the name you will use to login into the site. If you wish to use this as your display name also"); +define("LANINS_074", "Admin Display Name"); +define("LANINS_075", "This is the name that you wish your users to see displayed in your profile, forums and other areas. If you wish to use the same as your login name then leave this blank."); +define("LANINS_076", "Admin Password"); +define("LANINS_077", "Please type the admin password you wish to use here"); +define("LANINS_078", "Admin Password Confirmation"); +define("LANINS_079", "Please type the admin password again for confirmation"); +define("LANINS_080", "Admin Email"); +define("LANINS_081", "Enter your email address"); + +define("LANINS_082", "user@yoursite.com"); + +// Better table creation error reporting +define("LANINS_083", "MySQL Reported Error:"); +define("LANINS_084", "The installer could not establish a connection to the database"); +define("LANINS_085", "The installer could not select database:"); + +define("LANINS_086", "Admin Username, Admin Password and Admin Email are required fields. Please return to the last page and ensure the information is correctly entered."); diff --git a/e107_languages/English/lan_links.php b/e107_languages/English/lan_links.php new file mode 100644 index 000000000..abb2aed5b --- /dev/null +++ b/e107_languages/English/lan_links.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_login.php b/e107_languages/English/lan_login.php new file mode 100644 index 000000000..31e6c4123 --- /dev/null +++ b/e107_languages/English/lan_login.php @@ -0,0 +1,38 @@ +here."); +define("LAN_303", "Incorrect code entered."); +define("LAN_304", "That username/password combination is already in use."); +define("LAN_LOGIN_1", "User name"); +define("LAN_LOGIN_2", "User password"); +define("LAN_LOGIN_3", "Protected server"); +define("LAN_LOGIN_4", "Please enter your details to gain access."); +define("LAN_LOGIN_5", "Click here to Sign-Up"); +define("LAN_LOGIN_6", "Not accepting new members at this time"); +define("LAN_LOGIN_7", "Enter visible code"); +define("LAN_LOGIN_8", "Remember Me"); +define("LAN_LOGIN_9", "Log In"); +define("LAN_LOGIN_10", "Click to login"); +define("LAN_LOGIN_11", "Register as a New User"); +define("LAN_LOGIN_12", "Forgot Password"); +define("LAN_LOGIN_13", "Please enter text in image"); + +define("LAN_LOGIN_14", "User attempted to login with unrecognised user name"); +define("LAN_LOGIN_15", "User attempted to login with incorrect password"); +define("LAN_LOGIN_16", "User attempted to login with username/password combination that was already in use"); +define("LAN_LOGIN_17", "User password (hashed)"); +define("LAN_LOGIN_18", "Auto-ban: More than 10 failed login attempts"); +define("LAN_LOGIN_19", "> 10 failed login attempts"); + +?> \ No newline at end of file diff --git a/e107_languages/English/lan_mail_handler.php b/e107_languages/English/lan_mail_handler.php new file mode 100644 index 000000000..44184d9de --- /dev/null +++ b/e107_languages/English/lan_mail_handler.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_membersonly.php b/e107_languages/English/lan_membersonly.php new file mode 100644 index 000000000..aa9f13290 --- /dev/null +++ b/e107_languages/English/lan_membersonly.php @@ -0,0 +1,21 @@ +log in"); +define("LAN_MEMBERS_3","or register as a member"); +define("LAN_MEMBERS_4","Click here to return to front page"); + + +?> \ No newline at end of file diff --git a/e107_languages/English/lan_news.php b/e107_languages/English/lan_news.php new file mode 100644 index 000000000..6c41f8ab6 --- /dev/null +++ b/e107_languages/English/lan_news.php @@ -0,0 +1,48 @@ +only the news title will be shown
    "); +define("LAN_NEWS_10", "This news post is inactive (It will be not shown on front page). "); +define("LAN_NEWS_11", "This news post is active (it will be shown on front page). "); +define("LAN_NEWS_12", "Comments are turned on. "); +define("LAN_NEWS_13", "Comments are turned off. "); +define("LAN_NEWS_14", "
    Activation period: "); +define("LAN_NEWS_15", "Body length: "); +define("LAN_NEWS_16", "b. Extended length: "); +define("LAN_NEWS_17", "b."); +define("LAN_NEWS_18", "Info:"); +define("LAN_NEWS_19", "Now"); +define("LAN_NEWS_20", "News updated in database for the following language: "); +define("LAN_NEWS_21", "News updated in database."); +// define("LAN_NEWS_22", "Go to page: "); +define("LAN_NEWS_23", "News Categories"); +define("LAN_NEWS_24", "create pdf of this news item"); + +define("LAN_NEWS_82", "News - Category"); +define("LAN_NEWS_83", "No news items at the moment - please check back soon."); +define("LAN_NEWS_84", "News Items"); +define("LAN_NEWS_99", "Comments"); +define("LAN_NEWS_100", "On"); +define("LAN_NEWS_307", "Total posts in this category: "); +define("LAN_NEWS_462", "No news items for specified month"); + +?> \ No newline at end of file diff --git a/e107_languages/English/lan_newspost.php b/e107_languages/English/lan_newspost.php new file mode 100644 index 000000000..1c6b64545 --- /dev/null +++ b/e107_languages/English/lan_newspost.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_notify.php b/e107_languages/English/lan_notify.php new file mode 100644 index 000000000..0d1d412bd --- /dev/null +++ b/e107_languages/English/lan_notify.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_np.php b/e107_languages/English/lan_np.php new file mode 100644 index 000000000..9ac7e50d4 --- /dev/null +++ b/e107_languages/English/lan_np.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_online.php b/e107_languages/English/lan_online.php new file mode 100644 index 000000000..194455a99 --- /dev/null +++ b/e107_languages/English/lan_online.php @@ -0,0 +1,64 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_page.php b/e107_languages/English/lan_page.php new file mode 100644 index 000000000..8fbff5e3b --- /dev/null +++ b/e107_languages/English/lan_page.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_parser_functions.php b/e107_languages/English/lan_parser_functions.php new file mode 100644 index 000000000..5e8502b43 --- /dev/null +++ b/e107_languages/English/lan_parser_functions.php @@ -0,0 +1,16 @@ + diff --git a/e107_languages/English/lan_prefs.php b/e107_languages/English/lan_prefs.php new file mode 100644 index 000000000..a5bcf24f1 --- /dev/null +++ b/e107_languages/English/lan_prefs.php @@ -0,0 +1,19 @@ +e107, which is released under the terms of the GNU GPL License."); +define("LAN_PREF_4", "censored"); +define("LAN_PREF_5", "Forums"); + +?> \ No newline at end of file diff --git a/e107_languages/English/lan_print.php b/e107_languages/English/lan_print.php new file mode 100644 index 000000000..2523fd626 --- /dev/null +++ b/e107_languages/English/lan_print.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_rate.php b/e107_languages/English/lan_rate.php new file mode 100644 index 000000000..e503293e4 --- /dev/null +++ b/e107_languages/English/lan_rate.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_ren_help.php b/e107_languages/English/lan_ren_help.php new file mode 100644 index 000000000..03e185ac9 --- /dev/null +++ b/e107_languages/English/lan_ren_help.php @@ -0,0 +1,66 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_search.php b/e107_languages/English/lan_search.php new file mode 100644 index 000000000..43c6ca61f --- /dev/null +++ b/e107_languages/English/lan_search.php @@ -0,0 +1,119 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_signup.php b/e107_languages/English/lan_signup.php new file mode 100644 index 000000000..1c169e385 --- /dev/null +++ b/e107_languages/English/lan_signup.php @@ -0,0 +1,119 @@ +case-sensitive."); +define("LAN_401", "Your account has now been activated, please"); +define("LAN_402", "Registration activated"); +define("LAN_403", "Welcome to"); +define("LAN_404", "Registration details for"); +define("LAN_405", "This stage of registration is complete. You will receive a confirmation email containing your login details. Please follow the link in the email to complete the signup process and activate your account."); +define("LAN_406", "Thank you!"); +define("LAN_407", "Please keep this email for your own information. Your password has been encrypted and cannot be retrieved if you misplace or forget it. You can however request a new password if this happens.\n\nThanks for your registration.\n\nFrom"); +define("LAN_408", "A user with that email address already exists. Please use the 'forgot password' screen to retrieve your password."); +define("LAN_SIGNUP_1", "Min."); +define("LAN_SIGNUP_2", "chars."); +define("LAN_SIGNUP_3", "Code verification failed."); +define("LAN_SIGNUP_4", "Your password must be at least "); +define("LAN_SIGNUP_5", " characters long."); +define("LAN_SIGNUP_6", "Your "); +define("LAN_SIGNUP_7", " is required"); +define("LAN_SIGNUP_8", "Thank you!"); +define("LAN_SIGNUP_9", "Unable to proceed."); +define("LAN_SIGNUP_10", "Yes"); +define("LAN_SIGNUP_11", "."); + +define("LAN_409", "Invalid characters in username"); +define("LAN_410", "Enter code visible in the image"); +define("LAN_411", "That display name already exists in the database, please choose a different display name"); + + +define("LAN_SIGNUP_12", "please keep your username and password written down in a safe place as if lost they cannot be retrieved."); +define("LAN_SIGNUP_13", "You can now log in from the Login box, or from here."); +define("LAN_SIGNUP_14", "here"); +define("LAN_SIGNUP_15", "Please contact the main site admin"); +define("LAN_SIGNUP_16", "if you require assistance."); +define("LAN_SIGNUP_17", "Please certify you are 13 or over the age of 13."); +define("LAN_SIGNUP_18", "Your registration has been received and created with the following login information ..."); +define("LAN_SIGNUP_19", "Username:"); +define("LAN_SIGNUP_20", "Password:"); +define("LAN_SIGNUP_21", "Your account is currently marked as being inactive, to activate your account please go to the following link ..."); +define("LAN_SIGNUP_22", "click here"); +define("LAN_SIGNUP_23", "to login."); +define("LAN_SIGNUP_24", "Thank you for registering at"); +define("LAN_SIGNUP_25", "Upload your avatar"); +define("LAN_SIGNUP_26", "Upload your photograph"); +define("LAN_SIGNUP_27", "Show"); +define("LAN_SIGNUP_28", "choice of Content/Mail-lists"); +define("LAN_SIGNUP_29", "A verification email will be sent to the email address you enter here so it must be valid."); +define("LAN_SIGNUP_30", "If you do not wish to display your email address on this site, please tick the 'hide email address' box."); + +define("LAN_SIGNUP_31", "URL to your XUP file"); +define("LAN_SIGNUP_32", "What's an XUP file?"); +define("LAN_SIGNUP_33", "Type path or choose avatar"); +define("LAN_SIGNUP_34", "Please note: Any image uploaded to this server that is deemed inappropriate by the administrators will be deleted immediately."); +define("LAN_SIGNUP_35", "Click here to register using an XUP file"); +define("LAN_SIGNUP_36", "An error has occurred creating your user information, please contact the site admin"); + +define("LAN_LOGINNAME", "Login Name"); +define("LAN_PASSWORD", "Password"); +define("LAN_USERNAME", "Display Name"); +define("LAN_EMAIL_01", "Dear"); +define("LAN_EMAIL_04", "Please keep this email for your own information."); +define("LAN_EMAIL_05", "Your password has been encrypted and cannot be retrieved if you misplace or forget it. You can however request a new password if this happens."); +define("LAN_EMAIL_06", "Thanks for your registration."); + +define("LAN_SIGNUP_37", "This stage of registration is complete. The site admin will need to approve your membership. Once this has been done you will receive a confirmation email alerting you that your membership has been approved."); +define("LAN_SIGNUP_38", "You entered two different email addresses. Please enter a valid email address in the two fields provided"); +define("LAN_SIGNUP_39", "Re-type Email Address:"); + +// 0.7.6 +define("LAN_SIGNUP_40", "Activation not necessary"); +define("LAN_SIGNUP_41", "Your account is already activated."); +define("LAN_SIGNUP_42", "There was a problem, the registration mail was not sent, please contact the website administrator."); +define("LAN_SIGNUP_43", "Email Sent"); +define("LAN_SIGNUP_44", "Activation email sent to:"); +define("LAN_SIGNUP_45", "Please check your inbox."); +define("LAN_SIGNUP_47", "Resend Activation Email"); +define("LAN_SIGNUP_48", "Username or Email"); +define("LAN_SIGNUP_49", "If you registered with the wrong email address, type a new one and your password here:"); +define("LAN_SIGNUP_50", "New Email"); +define("LAN_SIGNUP_51", "Old Password"); +define("LAN_SIGNUP_52", "Incorrect Password"); +define("LAN_SIGNUP_53", "field failed validation test"); + + + +?> diff --git a/e107_languages/English/lan_sitedown.php b/e107_languages/English/lan_sitedown.php new file mode 100644 index 000000000..ff0ea3daa --- /dev/null +++ b/e107_languages/English/lan_sitedown.php @@ -0,0 +1,15 @@ + diff --git a/e107_languages/English/lan_sitelinks.php b/e107_languages/English/lan_sitelinks.php new file mode 100644 index 000000000..bfe5bbfec --- /dev/null +++ b/e107_languages/English/lan_sitelinks.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_submitnews.php b/e107_languages/English/lan_submitnews.php new file mode 100644 index 000000000..ffed21f25 --- /dev/null +++ b/e107_languages/English/lan_submitnews.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_top.php b/e107_languages/English/lan_top.php new file mode 100644 index 000000000..d07584415 --- /dev/null +++ b/e107_languages/English/lan_top.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_upload.php b/e107_languages/English/lan_upload.php new file mode 100644 index 000000000..74cbd2f34 --- /dev/null +++ b/e107_languages/English/lan_upload.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_upload_handler.php b/e107_languages/English/lan_upload_handler.php new file mode 100644 index 000000000..9d4801bbf --- /dev/null +++ b/e107_languages/English/lan_upload_handler.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_user.php b/e107_languages/English/lan_user.php new file mode 100644 index 000000000..cad87c5d3 --- /dev/null +++ b/e107_languages/English/lan_user.php @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_user_extended.php b/e107_languages/English/lan_user_extended.php new file mode 100644 index 000000000..2a2393180 --- /dev/null +++ b/e107_languages/English/lan_user_extended.php @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_user_select.php b/e107_languages/English/lan_user_select.php new file mode 100644 index 000000000..5d2d5005e --- /dev/null +++ b/e107_languages/English/lan_user_select.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_userclass.php b/e107_languages/English/lan_userclass.php new file mode 100644 index 000000000..5f5bf6cee --- /dev/null +++ b/e107_languages/English/lan_userclass.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_userposts.php b/e107_languages/English/lan_userposts.php new file mode 100644 index 000000000..b5f7423c4 --- /dev/null +++ b/e107_languages/English/lan_userposts.php @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_usersettings.php b/e107_languages/English/lan_usersettings.php new file mode 100644 index 000000000..5216dd57e --- /dev/null +++ b/e107_languages/English/lan_usersettings.php @@ -0,0 +1,110 @@ + \ No newline at end of file diff --git a/e107_languages/index.html b/e107_languages/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/admin_menu/admin_menu.php b/e107_plugins/admin_menu/admin_menu.php new file mode 100644 index 000000000..2b9b2d70c --- /dev/null +++ b/e107_plugins/admin_menu/admin_menu.php @@ -0,0 +1,61 @@ +db_Select("plugin", "*", "plugin_installflag=1")) { + while ($row = $sql->db_Fetch()) { + include(e_PLUGIN.$row['plugin_path']."/plugin.php"); + if ($eplug_conffile) { + $array_functions[] = array(e_PLUGIN.$row['plugin_path']."/".$eplug_conffile, $tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), "P".$row['plugin_id']); + } + unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small); + } + } + + $array_functions = asortbyindex($array_functions, 1); + + $amtext = "
    + +
    "; + $ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu'); +} + +function render_admin_links($link, $title, $perms) { + if (getperms($perms)) { + return ""; + } +} +?> diff --git a/e107_plugins/alt_auth/alt_auth_adminmenu.php b/e107_plugins/alt_auth/alt_auth_adminmenu.php new file mode 100755 index 000000000..5773cdcd9 --- /dev/null +++ b/e107_plugins/alt_auth/alt_auth_adminmenu.php @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/e107_plugins/alt_auth/alt_auth_conf.php b/e107_plugins/alt_auth/alt_auth_conf.php new file mode 100755 index 000000000..a1c563fdf --- /dev/null +++ b/e107_plugins/alt_auth/alt_auth_conf.php @@ -0,0 +1,115 @@ +\n"; +foreach($authlist as $a) +{ + $s = ($pref['auth_method'] == $a) ? "selected='selected'" : ""; + $auth_dropdown .= "\n"; +} +$auth_dropdown .= "\n"; + +if(isset($message)) +{ + $ns -> tablerender("", "
    ".$message."
    "); +} + +$text = " +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    ".LAN_ALT_1.": ". +$auth_dropdown." +
    ".LAN_ALT_6.":
    +
    ".LAN_ALT_7."
    +
    + +
    ".LAN_ALT_8.":
    +
    ".LAN_ALT_9."
    +
    + +
    +
    + +
    +
    +
    "; + +$ns -> tablerender("
    ".LAN_ALT_3."
    ", $text); + + +require_once(e_ADMIN."footer.php"); + +function alt_auth_conf_adminmenu() +{ + alt_auth_adminmenu(); +} + + +?> \ No newline at end of file diff --git a/e107_plugins/alt_auth/alt_auth_login_class.php b/e107_plugins/alt_auth/alt_auth_login_class.php new file mode 100755 index 000000000..36a7bb8d3 --- /dev/null +++ b/e107_plugins/alt_auth/alt_auth_login_class.php @@ -0,0 +1,80 @@ +Available === FALSE) + { + return false; + } + + $login_result = $_login -> login($username, $userpass, $newvals); + + if($login_result === AUTH_SUCCESS ) + { + $sql = new db; + if(!$sql -> db_Select("user","*","user_loginname='{$username}' ")) + { + // User not found in e107 database - add it now. + $qry = "INSERT INTO #user (user_id, user_loginname, user_name, user_join) VALUES ('0','{$username}','{$username}',".time().")"; + $sql -> db_Select_gen($qry); + } + // Set password and any other applicable fields + $qry="user_password='".md5($userpass)."'"; + foreach($newvals as $key => $val) + { + $qry .= " ,user_{$key}='{$val}' "; + } + $qry.=" WHERE user_loginname='{$username}' "; + $sql -> db_Update("user", $qry); + } + else + { + switch($login_result) + { + case AUTH_NOUSER: + if(!isset($pref['auth_nouser']) || !$pref['auth_nouser']) + { + $username=md5("xx_nouser_xx"); + } + break; + case AUTH_NOCONNECT: + if(!isset($pref['auth_noconn']) || !$pref['auth_noconn']) + { + $username=md5("xx_noconn_xx"); + } + break; + case AUTH_BADPASSWORD: + $userpass=md5("xx_badpassword_xx"); + break; + } + } + } +} +?> \ No newline at end of file diff --git a/e107_plugins/alt_auth/alt_auth_readme.txt b/e107_plugins/alt_auth/alt_auth_readme.txt new file mode 100755 index 000000000..810d1fde2 --- /dev/null +++ b/e107_plugins/alt_auth/alt_auth_readme.txt @@ -0,0 +1,52 @@ +/* +| Copyright (C) 2003 Thom Michelbrink +| +| Author: Thom Michelbrink mcfly@e107.org +| +*/ + +Purpose: + + This is a plugin for the E107 CMS system (e107.org). + This plugin will enable Alternate authorization functionality to your site. + +Requirements: + + This plugin requires e107 Verion 0.600+ + +############## INSTALLATION ####################### + +1) Upload all files to your e107_plugins directory on your server, retaining directory structure. +2) Go to the admin section of the website, go the to plugin manager and install the Alt auth. +3) Go to the admin section of the website and configure the Alternate Authorization setting. + +Until this is integrated into the e107 core. the following lines need to be added to the e107_handlers\login.php file. They need to be inserted into the userlogin() function, just after the 'global $pref;' line: + + if($pref['auth_method'] && $pref['auth_method'] != "e107"){ + $auth_file=e_PLUGIN."alt_auth/".$pref['auth_method']."_auth.php"; + if(file_exists($auth_file)){ + require_once(e_PLUGIN."alt_auth/alt_auth_login_class.php"); + $result = new alt_login($pref['auth_method'],$username, $userpass); + } + } + + +--- AUTHORIZATION TYPES -- +This version currently supports Active Directory and LDAP authorization types. Others could easily +be added though. + +The requirements to add a new auth type are: + +xxx_auth.php - Actual file the performs the authorization based on user input of uname / passwd. +xxx_conf.php - The file used to edit any configuration option for your auth type. + +The xxx_auth.php must contain a class named auth_login(), the class must contain a function named login($uname,$passwd). The login() function must return values of: +AUTH_SUCCESS - valid login +AUTH_NOUSER - User not found +AUTH_BADPASSWORD - Password is incorrect +----------------------------------------------------------------------------- + +Version history: + +11/11/2003 - Initial beta release + diff --git a/e107_plugins/alt_auth/alt_login_class.php b/e107_plugins/alt_auth/alt_login_class.php new file mode 100644 index 000000000..9fc06249d --- /dev/null +++ b/e107_plugins/alt_auth/alt_login_class.php @@ -0,0 +1,56 @@ + login($username,$userpass,$newvals); + + if($login_result === AUTH_SUCCESS ){ + $sql = new db; + if(!$sql -> db_Select("user","*","user_loginname='{$username}' ")){ + // User not found in e107 database - add it now. + $qry = "INSERT INTO ".MPREFIX."user (user_id, user_loginname, user_name, user_join) VALUES ('0', '{$username}', '{$username}', ".time().")"; + $sql -> db_Select_gen($qry); + } + // Set password and any other applicable fields + $qry="user_password='".md5($userpass)."'"; + foreach($newvals as $key => $val){ + $qry .= " ,user_{$key}='{$val}' "; + } + $qry.=" WHERE user_loginname='{$username}' "; + $sql -> db_Update("user",$qry); + } else { + switch($login_result){ + case AUTH_NOUSER: + $username=md5("xx_nouser_xx"); + break; + case AUTH_BADPASSWORD: + $userpass=md5("xx_badpassword_xx"); + break; + } + } + } +} +?> \ No newline at end of file diff --git a/e107_plugins/alt_auth/images/icon_ldap.png b/e107_plugins/alt_auth/images/icon_ldap.png new file mode 100755 index 000000000..b3781e45c Binary files /dev/null and b/e107_plugins/alt_auth/images/icon_ldap.png differ diff --git a/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php b/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php new file mode 100755 index 000000000..a38a6fbcf --- /dev/null +++ b/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php @@ -0,0 +1,15 @@ + diff --git a/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php b/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php new file mode 100755 index 000000000..89b96b931 --- /dev/null +++ b/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php @@ -0,0 +1,15 @@ +If LDAP - Enter BaseDN
    If AD - Enter domain"); +define("LDAPLAN_3", "LDAP Browsing user
    Full context of the user who is able to search the directory."); +define("LDAPLAN_4", "LDAP Browsing password
    Password for the LDAP Browsing user."); +define("LDAPLAN_5", "LDAP Version"); +define("LDAPLAN_6", "Configure LDAP auth"); +define("LDAPLAN_7", "eDirectory search filter:"); +define("LDAPLAN_8", "This will be used to ensure the username is in the correct tree,
    ie '(objectclass=inetOrgPerson)'"); +define("LDAPLAN_9", "Current search filter will be:"); +define("LDAPLAN_10", "Settings Updated"); +define("LDAPLAN_11", "WARNING: It appears as if the ldap module is not currently available, setting your auth method to LDAP will probably not work!"); +define("LDAPLAN_12", "Server Type"); +define("LDAPLAN_13", "Update settings"); +?> diff --git a/e107_plugins/alt_auth/languages/English/lan_otherdb_auth.php b/e107_plugins/alt_auth/languages/English/lan_otherdb_auth.php new file mode 100644 index 000000000..8a381ed3a --- /dev/null +++ b/e107_plugins/alt_auth/languages/English/lan_otherdb_auth.php @@ -0,0 +1,14 @@ + diff --git a/e107_plugins/alt_auth/ldap_auth.php b/e107_plugins/alt_auth/ldap_auth.php new file mode 100755 index 000000000..649631219 --- /dev/null +++ b/e107_plugins/alt_auth/ldap_auth.php @@ -0,0 +1,186 @@ + db_Select("alt_auth", "*", "auth_type = 'ldap' "); + while($row = $sql -> db_Fetch()) + { + $ldap[$row['auth_parmname']]=$row['auth_parmval']; + } + + $this->server = explode(",", $ldap['ldap_server']); + $this->serverType = $ldap['ldap_servertype']; + $this->dn = $ldap['ldap_basedn']; + $this->usr = $ldap['ldap_user']; + $this->pwd = $ldap['ldap_passwd']; + $this->ldapVersion = $ldap['ldap_version']; + $this->filter = (isset($ldap['ldap_edirfilter']) ? $ldap['ldap_edirfilter'] : ""); + + if(!function_exists('ldap_connect')) + { + $this->Available = FALSE; + return false; + } + + if(!$this -> connect()) + { + return AUTH_NOCONNECT; + } + } + + function connect() + { + foreach ($this->server as $key => $host) + { + $this->connection = ldap_connect($host); + if ( $this->connection) { + if($this -> ldapVersion == 3 || $this->serverType == "ActiveDirectory") + { + @ldap_set_option( $this -> connection, LDAP_OPT_PROTOCOL_VERSION, 3 ); + } + return true; + } + } + + $this->ldapErrorCode = -1; + $this->ldapErrorText = "Unable to connect to any server"; + return false; + } + + function close() + { + if ( !@ldap_close( $this->connection)) + { + $this->ldapErrorCode = ldap_errno( $this->connection); + $this->ldapErrorText = ldap_error( $this->connection); + return false; + } + else + { + return true; + } + } + + function login($uname, $pass) + { + /* Construct the full DN, eg:- + ** "uid=username, ou=People, dc=orgname,dc=com" + */ + if ($this->serverType == "ActiveDirectory") + { + $checkDn = "$uname@$this->dn"; + } + else + { + if ($this -> usr != '' && $this -> pwd != '') + { + $this -> result = ldap_bind($this -> connection, $this -> usr, $this -> pwd); + } + else + { + $this -> result = ldap_bind($this -> connection); + } + +// In ldap_auth.php, should look like this instead for eDirectory +// $query = ldap_search($this -> connection, $this -> dn, "cn=".$uname); + + if($this->serverType == "eDirectory") + { + $_filter = (isset($ldap['ldap_edirfilter']) ? $ldap['ldap_edirfilter'] : ""); + $current_filter = "(&(cn={$uname})".$this->filter.")"; + $query = ldap_search($this->connection, $this->dn, $current_filter); + } + else + { + $query = ldap_search($this->connection, $this->dn, "uid=".$uname); + } + + if ($query == false) + { +// Could not perform query to LDAP directory + return AUTH_NOCONNECT; + } + else + { + $query_result = ldap_get_entries($this -> connection, $query); + + if ($query_result["count"] != 1) + { + return AUTH_NOUSER; + } + else + { + $checkDn = $query_result[0]["dn"]; + $this -> close(); + $this -> connect(); + } + } + } + // Try and connect... + $this->result = ldap_bind($this -> connection, $checkDn, $pass); + if ( $this->result) + { + // Connected OK - login credentials are fine! + return AUTH_SUCCESS; + } + else + { + /* Login failed. Return false, together with the error code and text from + ** the LDAP server. The common error codes and reasons are listed below : + ** (for iPlanet, other servers may differ) + ** 19 - Account locked out (too many invalid login attempts) + ** 32 - User does not exist + ** 49 - Wrong password + ** 53 - Account inactive (manually locked out by administrator) + */ + $this->ldapErrorCode = ldap_errno( $this->connection); + $this->ldapErrorText = ldap_error( $this->connection); + + if($this -> ldapErrorCode == 32) + { + return AUTH_NOUSER; + } + if($this -> ldapErrorCode == 49) + { + return AUTH_BADPASSWORD; + } + // return error code as if it never connected, maybe change that in the future + return AUTH_NOCONNECT; + } + } +} +?> diff --git a/e107_plugins/alt_auth/ldap_conf.php b/e107_plugins/alt_auth/ldap_conf.php new file mode 100755 index 000000000..ab98ea0d5 --- /dev/null +++ b/e107_plugins/alt_auth/ldap_conf.php @@ -0,0 +1,133 @@ + $v) + { + if(preg_match("/ldap_/", $k)) + { + if($sql -> db_Select("alt_auth", "*", "auth_type='ldap' AND auth_parmname='{$k}' ")) + { + $sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='ldap' AND auth_parmname='{$k}' "); + } + else + { + $sql -> db_Insert("alt_auth", "'ldap','{$k}','{$v}' "); + } + } + } + $message = LDAPLAN_10; +} + +if(!function_exists('ldap_connect')) +{ + $message = "
    ".LDAPLAN_11."
    "; +} + +if($message) +{ + $ns->tablerender("","
    ".$message."
    "); +} + +$ldap['ldap_edirfilter'] == ""; +$sql -> db_Select("alt_auth", "*", "auth_type = 'ldap' "); +while($row = $sql->db_Fetch()) +{ + $ldap[$row['auth_parmname']] = $row['auth_parmval']; +} + +$current_filter = "(&(cn=[USERNAME]){$ldap['ldap_edirfilter']})"; + +$frm = new form; +$text = $frm -> form_open("POST",e_SELF); +$text .= ""; +$text .= ""; + +$text .= ""; + +$text .= ""; + +$text .= ""; + +$text .= ""; + +$text .= ""; + +$text .= ""; + +$text .= ""; + +$text .= "
    ".LDAPLAN_12.""; +$text .= $frm -> form_select_open("ldap_servertype"); +foreach($server_types as $v) +{ + $sel = ($ldap['ldap_servertype'] == $v) ? " Selected" : ""; + $text .= $frm -> form_option($v, $sel, $v); +} +$text .= $frm -> form_select_close(); +$text .= "
    ".LDAPLAN_1.""; +$text .= $frm -> form_text("ldap_server", 35, $ldap['ldap_server'], 120); +$text .= "
    ".LDAPLAN_2.""; +$text .= $frm -> form_text("ldap_basedn", 35, $ldap['ldap_basedn'], 120); +$text .= "
    ".LDAPLAN_3.""; +$text .= $frm -> form_text("ldap_user", 35, $ldap['ldap_user'], 120); +$text .= "
    ".LDAPLAN_4.""; +$text .= $frm -> form_text("ldap_passwd", 35, $ldap['ldap_passwd'], 120); +$text .= "
    ".LDAPLAN_5.""; +$text .= $frm -> form_select_open("ldap_version"); + +foreach($ldap_ver as $v) +{ + $sel = ($ldap['ldap_version'] == $v) ? " Selected" : ""; + $text .= $frm -> form_option($v, $sel, $v); +} + +$text .= $frm -> form_select_close(); +$text .= "
    ".LDAPLAN_7."
    ".LDAPLAN_8."
    "; +$text .= $frm -> form_text("ldap_edirfilter", 35, $ldap['ldap_edirfilter'], 120); +$text .= "
    ".LDAPLAN_9."
    {$current_filter}
    "; +$text .= $frm -> form_button("submit", "update", LDAPLAN_13); +$text .= "
    "; +$text .= $frm -> form_close(); + +$ns -> tablerender(LDAPLAN_6,$text); +require_once(e_ADMIN."footer.php"); + +function ldap_conf_adminmenu() +{ + alt_auth_adminmenu(); +} + +?> diff --git a/e107_plugins/alt_auth/otherdb_auth.php b/e107_plugins/alt_auth/otherdb_auth.php new file mode 100644 index 000000000..8ba070507 --- /dev/null +++ b/e107_plugins/alt_auth/otherdb_auth.php @@ -0,0 +1,147 @@ + db_Select("alt_auth", "*", "auth_type = 'otherdb' "); + while($row = $sql -> db_Fetch()) + { + $otherdb_conf[$row['auth_parmname']] = base64_decode(base64_decode($row['auth_parmval'])); + } + $class_name = "otherdb_".$otherdb_conf['otherdb_dbtype']."_class"; + + if($otherdb_conf['otherdb_dbtype'] == 'e107') + { + $class_name = "otherdb_mysql_class"; + } + + if(class_exists($class_name)) + { + $this->od = new $class_name; + } + else + { + return AUTH_NOCONNECT; + } + } + + function login($uname, $pword, &$newvals) + { + global $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $sql; + $ret = $this->od->login($uname, $pword, $newvals); + $sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb); + return $ret; + } + +} + +class otherdb_mysql_class +{ + + var $conf; + + function otherdb_mysql_class() + { + global $otherdb_conf; + $this->conf = $otherdb_conf; + } + + function login($uname, $pword, &$newvals) + { + + //Attempt to open connection to sql database + if(!$res = mysql_connect($this->conf['otherdb_server'], $this->conf['otherdb_username'], $this->conf['otherdb_password'])) + { + return AUTH_NOCONNECT; + } + + //Select correct db + if(!mysql_select_db($this->conf['otherdb_database'], $res)) + { + mysql_close($res); + return AUTH_NOCONNECT; + } + + if($this->conf['otherdb_dbtype'] == 'mysql') + { + $sel_fields = $this->conf['otherdb_password_field']; + $user_field = $this->conf['otherdb_user_field']; + } + else + { + $sel_fields = 'user_password, user_email, user_join'; + $user_field = "user_loginname"; + } + + + //Get record containing supplied login name + $qry = "SELECT {$sel_fields} FROM {$this->conf['otherdb_table']} WHERE {$user_field} = '{$uname}'"; + if(!$r1 = mysql_query($qry)) + { + mysql_close($res); + return AUTH_NOCONNECT; + } + if(!$row = mysql_fetch_array($r1)) + { + mysql_close($res); + return AUTH_NOUSER; + } + + //Compare password in db to supplied password + if($this->conf['otherdb_password_method'] == 'md5' || $this->conf['otherdb_dbtype'] == 'e107') + { + $goodpw = md5($pword) == $row[0]; + } + else + { + $goodpw = $pword == $row[0]; + } + if($goodpw) + { + //Close newly opened mysql connection + mysql_close($res); + if($this->conf['otherdb_dbtype'] == 'e107') + { + $newvals['email'] = $row[1]; + $newvals['join'] = $row[2]; + } + return AUTH_SUCCESS; + } + + mysql_close($res); + return AUTH_BADPASSWORD; + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/alt_auth/otherdb_conf.php b/e107_plugins/alt_auth/otherdb_conf.php new file mode 100644 index 000000000..b1ea52094 --- /dev/null +++ b/e107_plugins/alt_auth/otherdb_conf.php @@ -0,0 +1,143 @@ +tablerender("","
    ".$message."
    "); +} + + +show_otherdb_form(); + +function show_otherdb_form() +{ + global $sql, $tp, $ns; + + $password_methods = array("md5", "plaintext"); + $db_types = array("e107" => "mysql - e107 database", "mysql" => "mysql - generic database"); + + $sql -> db_Select("alt_auth", "*", "auth_type = 'otherdb' "); + $parm = array(); + while($row = $sql->db_Fetch()) + { + $parm[$row['auth_parmname']] = base64_decode(base64_decode($row['auth_parmval'])); + } + + $frm = new form; + $text = $frm -> form_open("POST", e_SELF); + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= ""; + + $text .= "
    ".OTHERDB_LAN_1.""; + $text .= $frm -> form_select_open("otherdb_dbtype"); + foreach($db_types as $k => $v) + { + $sel = ($parm['otherdb_dbtype'] == $k) ? " Selected" : ""; + $text .= $frm -> form_option($v, $sel, $k); + } + $text .= $frm -> form_select_close(); + $text .= "
    ".OTHERDB_LAN_2.""; + $text .= $frm -> form_text("otherdb_server", 35, $parm['otherdb_server'], 120); + $text .= "
    ".OTHERDB_LAN_3.""; + $text .= $frm -> form_text("otherdb_username", 35, $parm['otherdb_username'], 120); + $text .= "
    ".OTHERDB_LAN_4.""; + $text .= $frm -> form_text("otherdb_password", 35, $parm['otherdb_password'], 120); + $text .= "
    ".OTHERDB_LAN_5.""; + $text .= $frm -> form_text("otherdb_database", 35, $parm['otherdb_database'], 120); + $text .= "
    ".OTHERDB_LAN_6.""; + $text .= $frm -> form_text("otherdb_table", 35, $parm['otherdb_table'], 120); + $text .= "
    ".OTHERDB_LAN_11."
    ".OTHERDB_LAN_7.""; + $text .= $frm -> form_text("otherdb_user_field", 35, $parm['otherdb_user_field'], 120); + $text .= "
    ".OTHERDB_LAN_8.""; + $text .= $frm -> form_text("otherdb_password_field", 35, $parm['otherdb_password_field'], 120); + $text .= "
    ".OTHERDB_LAN_9.""; + $text .= $frm -> form_select_open("otherdb_password_method"); + foreach($password_methods as $v) + { + $sel = ($parm['otherdb_password_method'] == $v) ? " Selected" : ""; + $text .= $frm -> form_option($v, $sel, $v); + } + $text .= $frm -> form_select_close(); + $text .= "
    "; + $text .= $frm -> form_button("submit", "update", "Update settings"); + $text .= "
    "; + $text .= $frm -> form_close(); + + $ns -> tablerender(OTHERDB_LAN_10, $text); +} + +require_once(e_ADMIN."footer.php"); + + +function update_otherdb_prefs() +{ + global $sql; + foreach($_POST as $k => $v) + { + $v = base64_encode(base64_encode($v)); + + if(preg_match("/otherdb_/", $k)) + { + if($sql -> db_Select("alt_auth", "*", "auth_type='otherdb' AND auth_parmname='{$k}' ")) + { + $sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='otherdb' AND auth_parmname='{$k}' "); + } + else + { + $sql -> db_Insert("alt_auth", "'otherdb','{$k}','{$v}' "); + } + } + } + return "Settings Updated"; +} + +function otherdb_conf_adminmenu() +{ + alt_auth_adminmenu(); +} + +?> diff --git a/e107_plugins/alt_auth/plugin.php b/e107_plugins/alt_auth/plugin.php new file mode 100755 index 000000000..baae5399a --- /dev/null +++ b/e107_plugins/alt_auth/plugin.php @@ -0,0 +1,74 @@ + diff --git a/e107_plugins/alt_news/alt_news.php b/e107_plugins/alt_news/alt_news.php new file mode 100644 index 000000000..44399b77f --- /dev/null +++ b/e107_plugins/alt_news/alt_news.php @@ -0,0 +1,118 @@ +db_Select("news_category", "*", "category_id='".intval($category)."'"); + list($category_id, $category_name, $category_icon) = $sql->db_Fetch(); + $category_name = $aj->tpa($category_name); + if (strstr($category_icon, "../")) { + $category_icon = str_replace("../", "", e_BASE.$category_icon); + } else { + $category_icon = THEME.$category_icon; + } + + if ($count = $sql->db_Select("news", "*", "news_category='".intval($category)."' ORDER BY news_datestamp DESC")) { + while ($row = $sql->db_Fetch()) { + extract($row); + if ($news_title == "") { + $news_title = "Untitled"; + } + $datestamp = $gen->convert_date($news_datestamp, "short"); + $news_body = strip_tags(substr($news_body, 0, 100))." ..."; + $comment_total = $sql2->db_Count("comments", "(*)", "WHERE comment_item_id='".intval($news_id)."' AND comment_type='0' "); + $text .= "
    + bullet "; + + if ($news_allow_comments) { + $text .= "".$news_title.""; + } else { + $text .= "".$news_title.""; + } + $text .= "
    + ".LAN_NEWS_100." ".$datestamp." (".LAN_NEWS_99.": "; + if ($news_allow_comments) { + $text .= COMMENTOFFSTRING.")"; + } else { + $text .= $comment_total.")"; + } + $text .= "
    + ".$news_body." +

    \n"; + } + $text = "
    ". LAN_NEWS_307.$count." +

    ".$text; + $ns->tablerender(LAN_NEWS_82." '".$category_name."'", $text, 'alt_news'); + } + } + return TRUE; + } + + if ($sql->db_Select("news", "*", "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_category='".intval($news_category)."' ORDER BY news_datestamp DESC LIMIT 0,".ITEMVIEW)) { + $sql2 = new db; + while (list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'], $news['news_start'], $news['news_end'], $news['news_class']) = $sql->db_Fetch()) { + + if (check_class($news['news_class']) || !$news['news_class']) { + + if ($news['admin_id'] == 1 && $pref['siteadmin']) { + $news['admin_name'] = $pref['siteadmin']; + } + else if(!$news['admin_name'] = getcachedvars($news['admin_id'])) { + $sql2->db_Select("user", "user_name", "user_id='".intval($news['admin_id'])."' "); + list($news['admin_name']) = $sql2->db_Fetch(); + cachevars($news['admin_id'], $news['admin_name']); + } + + $sql2->db_Select("news_category", "*", "category_id='".intval($news_category)."' "); + + list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2->db_Fetch(); + $news['comment_total'] = $sql2->db_Count("comments", "(*)", "WHERE comment_item_id='".intval($news['news_id'])."' AND comment_type='0' "); + $ix->render_newsitem($news); + } else { + if ($pref['subnews_hide_news'] == 1) { + if ($news['admin_id'] == 1 && $pref['siteadmin']) { + $news['admin_name'] = $pref['siteadmin']; + } + else if(!$news['admin_name'] = getcachedvars($news['admin_id'])) { + $sql2->db_Select("user", "user_name", "user_id='".intval($news['admin_id'])."' "); + list($news['admin_name']) = $sql2->db_Fetch(); + cachevars($news['admin_id'], $news['admin_name']); + } + + $sql2->db_Select("news_category", "*", "category_id='".intval($news_category)."' "); + + list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2->db_Fetch(); + $ix->render_newsitem($news, "", "userclass"); + } + } + } + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/banner_menu/banner_menu.php b/e107_plugins/banner_menu/banner_menu.php new file mode 100644 index 000000000..5f016ddf0 --- /dev/null +++ b/e107_plugins/banner_menu/banner_menu.php @@ -0,0 +1,89 @@ + banners and create a campaign, then add your banner to it +2. Add this line to this file ... + + $campaign = NAME_OF_YOUR_CAMPAIGN + +3. Save file +*/ + + +global $THEMES_DIRECTORY; +if (file_exists(THEME."banner_template.php")) { + require_once(THEME."banner_template.php"); +} else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); +} + +if(isset($campaign)){ + $parm = (isset($campaign) ? $campaign : ""); + $bannersccode = file_get_contents(e_FILE."shortcode/banner.sc"); + $BANNER = eval($bannersccode); + $txt = $BANNER_MENU_START; + $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU); + $txt .= $BANNER_MENU_END; + +}else{ + if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign']) + { + if(strstr($menu_pref['banner_campaign'], "|")) + { + $campaignlist = explode("|", $menu_pref['banner_campaign']); + $amount = ($menu_pref['banner_amount']<1 ? '1' : $menu_pref['banner_amount']); + $amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount); + $keys = array_rand($campaignlist, $amount); + $parms = array(); + foreach($keys as $k=>$v){ + $parms[] = $campaignlist[$v]; + } + } + else + { + $parms[] = $menu_pref['banner_campaign']; + } + } + + $txt = $BANNER_MENU_START; + foreach($parms as $parm){ + $bannersccode = file_get_contents(e_FILE."shortcode/banner.sc"); + $BANNER = eval($bannersccode); + $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU); + } + $txt .= $BANNER_MENU_END; +} + +$text = $txt; + +if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2) +{ + $ns->tablerender($menu_pref['banner_caption'], $text); +} +else +{ + echo $text; +} + +?> \ No newline at end of file diff --git a/e107_plugins/banner_menu/config.php b/e107_plugins/banner_menu/config.php new file mode 100644 index 000000000..0dbcd7d22 --- /dev/null +++ b/e107_plugins/banner_menu/config.php @@ -0,0 +1,259 @@ + $v) { + if (strpos($k, "banner_") === 0) { + $menu_pref[$k] = $v; + } + } + + if (isset($_POST['catid'])) { + $array_cat = explode("-", $_POST['catid']); + for($i = 0; $i < count($array_cat); $i++) { + $cat .= $array_cat[$i]."|"; + } + $cat = substr($cat, 0, -1); + $menu_pref['banner_campaign'] = $cat; + } + + $sysprefs->setArray('menu_pref'); + $ns->tablerender("", "
    ".BANNER_MENU_L2."
    "); +} + +if (!$menu_pref['banner_caption']) { + $menu_pref['banner2_caption'] = BANNER_MENU_L1; +} + +$text = "
    +
    + + + + + + "; + +$array_cat_in = explode("|", $menu_pref['banner_campaign']); + +$c = 0; + $d = 0; +$sql2 = new db; +$category_total = $sql2->db_Select("banner", "DISTINCT(SUBSTRING_INDEX(banner_campaign, '^', 1)) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where"); +while ($row = $sql2->db_Fetch()) { + extract($row); + if (in_array($banner_campaign, $array_cat_in)) { + $in_catname[$c] = $banner_campaign; + $c++; + } else { + $out_catname[$d] = $banner_campaign; + $d++; + } +} + +$text .= " + + + + + + + + + + + + + + + + + + + +
    ".BANNER_MENU_L3.": + +
    ".BANNER_MENU_L6." + + + + + + +
    ".BANNER_MENU_L7."
    + +
    ".BANNER_MENU_L8."
    +

    + + +
    + +
    ".BANNER_MENU_L10." +
    ".BANNER_MENU_L15."
    ".BANNER_MENU_L16."
    +
    +
    +
    "; + +$ns->tablerender(BANNER_MENU_L5, $text); + + +require_once(e_ADMIN."footer.php"); + +function headerjs() { + + $script_js = "\n"; + return $script_js; +} + +?> \ No newline at end of file diff --git a/e107_plugins/banner_menu/languages/English.php b/e107_plugins/banner_menu/languages/English.php new file mode 100644 index 000000000..ed82f1fb8 --- /dev/null +++ b/e107_plugins/banner_menu/languages/English.php @@ -0,0 +1,34 @@ +if less banners are present the maximum available amount will be used."); +define("BANNER_MENU_L17", "set amount ..."); +define("BANNER_MENU_L18", "Update Menu Settings"); + +?> \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/archive.php b/e107_plugins/blogcalendar_menu/archive.php new file mode 100644 index 000000000..45242e4e0 --- /dev/null +++ b/e107_plugins/blogcalendar_menu/archive.php @@ -0,0 +1,134 @@ +db_Select_gen("SELECT news_id, news_datestamp from ".MPREFIX."news ORDER BY news_datestamp LIMIT 0,1"); +$first_post = $sql->db_Fetch(); +$start_year = date("Y", $first_post['news_datestamp']); +$end_year = $cur_year; + + +// ---------------------- +// build the yearselector +// ---------------------- +$year_selector = "
    "; +$year_selector .= "".BLOGCAL_ARCHIV1.": "; + + +// -------------------------- +// create the archive display +// -------------------------- +$newline = 0; +$archive = "
    "; +$archive .= ""; +for($i = 1; $i <= 12; $i++) { + if (++$newline == $months_per_row+1) { + $archive .= ""; + $newline = 1; + } + $archive .= "\n"; +} +$archive .= "
    $year_selector
    "; + $archive .= "
    "; + + // href the current month regardless of newsposts or any month with news + if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i]) { + $archive .= "".$marray[$i-1].""; + } else { + $archive .= $marray[$i-1]; + } + + $archive .= "
    "; + if (($req_year == $cur_year) && ($i == $cur_month)) { + $req_day = $cur_day; + } else { + $req_day = ""; + } + $archive .= "
    ".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."
    "; +$ns->tablerender(BLOGCAL_L2 ." $req_year", $archive); + +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php new file mode 100644 index 000000000..69e51752e --- /dev/null +++ b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php @@ -0,0 +1,131 @@ +"; +$month_selector .= "
    "; + + +// ------------------------ +// create and show calendar +// ------------------------ +$menu = "
    "; +$menu .= ""; +$menu .= "
    $month_selector"; +$menu .= "
    ".calendar($req_day, $req_month, $req_year, $day_links, $pref['blogcal_ws'])."
    "; +$menu .= "
    "; +$ns->tablerender(BLOGCAL_L1." ".$req_year, $menu, 'blog_calender'); +?> \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/calendar.php b/e107_plugins/blogcalendar_menu/calendar.php new file mode 100644 index 000000000..11f4a0e87 --- /dev/null +++ b/e107_plugins/blogcalendar_menu/calendar.php @@ -0,0 +1,102 @@ +"; + $calendar .= ''; + foreach($darray as $dheader) { + $calendar .= "$dheader"; + } + $calendar .= ""; + $calendar .= ''; + + $day_of_month = 1; + $tablerow = 1; + + // take care of the first "empty" days of the month + if ($day_of_week-$ws > 0) { + $calendar .= " "; + } + + // print the days of the month (take the $ws into account) + while ($day_of_month <= $last_day) { + if ($day_of_week-$ws == 7) { + #start a new week + $calendar .= ""; + $day_of_week = 0+$ws; + $tablerow++; + } + if ($day_of_month == $req_day) { + $day_style = isset($links[$day_of_month]) ? "indent" : "forumheader3"; + } else { + $day_style = isset($links[$day_of_month]) ? "indent" : "forumheader3"; + } + $calendar .= ""; + $calendar .= isset($links[$day_of_month]) ? "":""; + $calendar .= $day_of_month; + $calendar .= isset($links[$day_of_month]) ? "" : ""; + $calendar .= ""; + $day_of_month++; + $day_of_week++; + } + if ($day_of_week-$ws != 7) { + $calendar .= ' '; + } + $calendar .= ""; + if ($tablerow != 6) { + $calendar .= " "; + } + + $calendar .= ""; + return $calendar; +} +?> \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/config.php b/e107_plugins/blogcalendar_menu/config.php new file mode 100644 index 000000000..2b005c56c --- /dev/null +++ b/e107_plugins/blogcalendar_menu/config.php @@ -0,0 +1,91 @@ +tablerender("", "
    ".BLOGCAL_CONF5."
    "); +} + +$text = "
    +
    + + + + + + +
    ".BLOGCAL_CONF1.": + + +
    +
    +
    "; +$ns->tablerender(BLOGCAL_CONF4, $text); + +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/functions.php b/e107_plugins/blogcalendar_menu/functions.php new file mode 100644 index 000000000..670e883dd --- /dev/null +++ b/e107_plugins/blogcalendar_menu/functions.php @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/languages/English.php b/e107_plugins/blogcalendar_menu/languages/English.php new file mode 100644 index 000000000..4c6f4324e --- /dev/null +++ b/e107_plugins/blogcalendar_menu/languages/English.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/e107_plugins/blogcalendar_menu/styles.php b/e107_plugins/blogcalendar_menu/styles.php new file mode 100644 index 000000000..c9f5632bd --- /dev/null +++ b/e107_plugins/blogcalendar_menu/styles.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/e107_plugins/calendar_menu/admin_config.php b/e107_plugins/calendar_menu/admin_config.php new file mode 100644 index 000000000..fa8040fd8 --- /dev/null +++ b/e107_plugins/calendar_menu/admin_config.php @@ -0,0 +1,830 @@ +clear('nq_event_cal'); // Clear cache as well, in case displays changed + $message = EC_LAN_75; // "Calendar settings updated."; +} + +// ****************** FORTHCOMING EVENTS ****************** +if (isset($_POST['updateforthcoming'])) +{ + $pref['eventpost_menuheading'] = $_POST['eventpost_fe_menuheading']; + $pref['eventpost_daysforward'] = $_POST['eventpost_fe_daysforward']; + $pref['eventpost_numevents'] = $_POST['eventpost_fe_numevents']; + $pref['eventpost_checkrecur'] = $_POST['eventpost_fe_checkrecur']; + $pref['eventpost_linkheader'] = $_POST['eventpost_fe_linkheader']; + $pref['eventpost_fe_set'] = implode(",", $_POST['fe_eventclass']); + $pref['eventpost_showcaticon'] = $_POST['eventpost_showcaticon']; + $pref['eventpost_namelink'] = $_POST['eventpost_namelink']; + save_prefs(); + $e107cache->clear('nq_event_cal'); // Clear cache as well, in case displays changed + $message = EC_ADLAN_A109; // "Forthcoming Events settings updated."; +} + +if (e_QUERY) +{ + $qs = explode(".", e_QUERY); +} + +require_once('ecal_class.php'); +$ecal_class = new ecal_class; + + +// ****************** MAINTENANCE ****************** +if (isset($_POST['deleteold']) && isset($_POST['eventpost_deleteoldmonths'])) +{ + $back_count = $_POST['eventpost_deleteoldmonths']; + if (($back_count >= 1) && ($back_count <= 12)) + { + $old_date = intval(mktime(0,0,0,$ecal_class->now_date['mon']-$back_count,1,$ecal_class->now_date['year'])); + $old_string = strftime("%d %B %Y",$old_date); +// $message = "Back delete {$back_count} months. Oldest date = {$old_string}"; + $qs[0] = "confdel"; + $qs[1] = $old_date; + } + else + $message = EC_ADLAN_A148; +} + + +if (isset($_POST['cache_clear'])) +{ + $qs[0] = "confcache"; +} + +require_once(e_ADMIN."auth.php"); + + + + +// Actually delete back events +if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel")) +{ + $old_date = $qs[1]; + $old_string = strftime("%d %B %Y",$old_date); + // Check both start and end dates to avoid problems with events originally entered under 0.617 + $qry = "event_start < {$old_date} AND event_end < {$old_date} AND event_recurring = 0"; +// $message = "Back delete {$back_count} months. Oldest date = {$old_string} Query = {$qry}"; + if ($sql -> db_Delete("event",$qry)) + { + // Add in a log event + $ecal_class->cal_log(4,'db_Delete - earlier than {$old_string} (past {$back_count} months)',$qry); + $message = EC_ADLAN_A146.$old_string.EC_ADLAN_A147; + } + else + { + $message = EC_ADLAN_A149." : ".$sql->mySQLresult; + } + + $qs[0] = "maint"; +} + + +// Actually empty cache +if (isset($_POST['confirmdelcache']) && isset($qs[0]) &&($qs[0] == "cachedel")) +{ + $e107cache->clear('nq_event_cal'); + $message = EC_ADLAN_A163; + $qs[0] = "maint"; // Re-display maintenance menu +} + + +// Prompt to delete back events +if(isset($qs[0]) && ($qs[0] == "confdel")) +{ + $old_string = strftime("%d %B %Y",$qs[1]); + $text = "
    +
    + + + + + +
    ".EC_ADLAN_A150.$old_string."
    "; + + $ns->tablerender("
    ".EC_LAN_50."
    ", $text); +} + + +// Prompt to clear cache +if (isset($qs[0]) && ($qs[0] == "confcache")) +{ + $text = "
    +
    + + + + + +
    ".EC_ADLAN_A162."
    "; + + $ns->tablerender("
    ".EC_LAN_50."
    ", $text); +} + + +if (isset($message)) +{ + $ns->tablerender("", "
    $message
    "); +} + + + +//category +if(isset($qs[0]) && $qs[0] == "cat") +{ + $calendarmenu_db = new DB; + $calendarmenu_action = ''; + if (isset($_POST['calendarmenu_action'])) $calendarmenu_action = $_POST['calendarmenu_action']; + $calendarmenu_edit = FALSE; + // * If we are updating then update or insert the record + if ($calendarmenu_action == 'update') + { + $calendarmenu_id = $_POST['calendarmenu_id']; + if ($calendarmenu_id == 0) + { + // New record so add it + // Enumerate fields so it doesn't matter if they're in the wrong order. + // db_Insert can take an array of key => value pairs + $calendarmenu_args = array ( + 'event_cat_id' => 0, + 'event_cat_name' => $_POST['event_cat_name'], + 'event_cat_description' => $_POST['event_cat_description'], + 'event_cat_icon' => $_POST['ne_new_category_icon'], + 'event_cat_class' => intval($_POST['event_cat_class']), + 'event_cat_subs' => intval($_POST['event_cat_subs']), + 'event_cat_force_class' => intval($_POST['event_cat_force_class']), + 'event_cat_ahead' => intval($_POST['event_cat_ahead']), + 'event_cat_msg1' => $_POST['event_cat_msg1'], + 'event_cat_msg2' => $_POST['event_cat_msg2'], + 'event_cat_notify' => intval($_POST['event_cat_notify']), + 'event_cat_lastupdate' => intval(time()), + 'event_cat_addclass' => intval($_POST['event_cat_addclass']) + ); + + if ($calendarmenu_db->db_Insert("event_cat", $calendarmenu_args)) + { + $calendarmenu_msg .= "".EC_ADLAN_A26.""; + } + else + { + $calendarmenu_msg .= "".EC_ADLAN_A27.""; + } + } + else + { + // Update existing + $calendarmenu_args = " + event_cat_name='".$_POST['event_cat_name']."', + event_cat_description='".$_POST['event_cat_description']."', + event_cat_class='".intval($_POST['event_cat_class'])."', + event_cat_icon='".$_POST['ne_new_category_icon']."', + event_cat_subs='".intval($_POST['event_cat_subs'])."', + event_cat_force_class='".intval($_POST['event_cat_force_class'])."', + event_cat_ahead='".intval($_POST['event_cat_ahead'])."', + event_cat_msg1='".$_POST['event_cat_msg1']."', + event_cat_msg2='".$_POST['event_cat_msg2']."', + event_cat_notify='".intval($_POST['event_cat_notify'])."', + event_cat_addclass='".intval($_POST['event_cat_addclass'])."', + event_cat_lastupdate='".time()."' + where event_cat_id='$calendarmenu_id'"; + if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)){ + // Changes saved + $calendarmenu_msg .= "".EC_ADLAN_A28.""; + }else{ + $calendarmenu_msg .= "".EC_ADLAN_A29.""; + } + } + } + // We are creating, editing or deleting a record + if ($calendarmenu_action == 'dothings') + { + $calendarmenu_id = $_POST['calendarmenu_selcat']; + $calendarmenu_do = $_POST['calendarmenu_recdel']; + $calendarmenu_dodel = false; + + switch ($calendarmenu_do) + { + case '1': // Edit existing record + { + // We edit the record + $calendarmenu_db->db_Select("event_cat", "*", "event_cat_id='$calendarmenu_id'"); + $calendarmenu_row = $calendarmenu_db->db_Fetch() ; + extract($calendarmenu_row); + $calendarmenu_cap1 = EC_ADLAN_A24; + $calendarmenu_edit = TRUE; + break; + } + case '2': // New category + { + // Create new record + $calendarmenu_id = 0; + // set all fields to zero/blank + $calendar_category_name = ""; + $calendar_category_description = ""; + $calendarmenu_cap1 = EC_ADLAN_A23; + $calendarmenu_edit = TRUE; + break; + } + case '3': + { + // delete the record + if ($_POST['calendarmenu_okdel'] == '1'){ + if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='$calendarmenu_id'", "nowhere")){ + $calendarmenu_msg .= "".EC_ADLAN_A59.""; + }else{ + if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='$calendarmenu_id'")){ + $calendarmenu_msg .= "".EC_ADLAN_A30.""; + }else{ + $calendarmenu_msg .= "".EC_ADLAN_A32.""; + } + } + }else{ + $calendarmenu_msg .= "".EC_ADLAN_A31.""; + } + $calendarmenu_dodel = TRUE; + $calendarmenu_edit = FALSE; + } + } + + if (!$calendarmenu_dodel) + { + require_once(e_HANDLER."file_class.php"); + + + $calendarmenu_text .= " +
    + + + + + {$calendarmenu_msg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$calendarmenu_cap1} + + +
    ".EC_ADLAN_A21."
    ".EC_ADLAN_A121."
    ".EC_ADLAN_A80."".r_userclass("event_cat_class", $event_cat_class, "off", 'public, nobody, member, admin, classes')."
    ".EC_ADLAN_A94."".r_userclass("event_cat_addclass", $event_cat_addclass, "off", 'public, nobody, member, admin, classes')."
    ".EC_LAN_55." + + + +
    ".EC_ADLAN_A81." 0?"checked='checked'":"")." />
    ".EC_ADLAN_A86." +
    ".EC_ADLAN_A82."".r_userclass("event_cat_force_class", $event_cat_force_class, "off", 'nobody, member, admin, classes')."
    ".EC_ADLAN_A83."
    ".EC_ADLAN_A84."
    ".EC_ADLAN_A117."
    +
    "; + } + } + if (!$calendarmenu_edit) + { + // Get the category names to display in combo box then display actions available + $calendarmenu2_db = new DB; + $calendarmenu_catopt = ''; + if (!isset($calendarmenu_id)) $calendarmenu_id = -1; + if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere")) + { + while ($row = $calendarmenu2_db->db_Fetch()){ + //extract($calendarmenu_row); + $calendarmenu_catopt .= ""; + } + } + else + { + $calendarmenu_catopt .= ""; + } + + $calendarmenu_text .= " +
    + + + + + + {$calendarmenu_msg} + + + + + + + + + + + +
    ".EC_ADLAN_A11."
    ".EC_ADLAN_A11."
    ".EC_ADLAN_A18." + ".EC_ADLAN_A13."
    + ".EC_ADLAN_A14."
    + ".EC_ADLAN_A15." + ".EC_ADLAN_A16." +
    +
    "; + } + if(isset($calendarmenu_text)) + { + $ns->tablerender(EC_ADLAN_A19, $calendarmenu_text); + } +} + +// ==================================================== +// FORTHCOMING EVENTS OPTIONS +// ==================================================== + +if((isset($qs[0]) && $qs[0] == "forthcoming")) +{ + +if (!isset($pref['eventpost_menuheading'])) $pref['eventpost_menuheading'] = EC_ADLAN_A100; +if (!isset($pref['eventpost_daysforward'])) $pref['eventpost_daysforward'] = 30; +if (!isset($pref['eventpost_numevents'])) $pref['eventpost_numevents'] = 3; +if (!isset($pref['eventpost_checkrecur'])) $pref['eventpost_checkrecur'] = '1'; +if (!isset($pref['eventpost_linkheader'])) $pref['eventpost_linkheader'] = '0'; +if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1'; + + $text = "
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".EC_ADLAN_A100."
    ".EC_ADLAN_A108." +
    ".EC_ADLAN_A101." +
    ".EC_ADLAN_A102." +
    ".EC_ADLAN_A103."
    ".EC_ADLAN_A107."
    ".EC_ADLAN_A130."
    + +
    ".EC_ADLAN_A104." +
    ".EC_ADLAN_A120." +
    ".EC_ADLAN_A118.""; + +// Now display all the current categories as checkboxes + $cal_fe_prefs = array(); + if (isset($pref['eventpost_fe_set'])) $cal_fe_prefs = array_flip(explode(",",$pref['eventpost_fe_set'])); + if (!is_object($calendarmenu2_db)) $calendarmenu2_db = new DB; // Possible notice here + if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere")) + { + while ($row = $calendarmenu2_db->db_Fetch()) + { + $selected = isset($cal_fe_prefs[$row['event_cat_id']]); + $text .= "".$row['event_cat_name']."
    "; + } + } + else + { + $text .= EC_ADLAN_A119; // No categories, or error + } + + $text .= "
    +
    +
    "; + + $ns->tablerender("
    ".EC_ADLAN_A100."
    ", $text); +} // End of Forthcoming Events Menu Options + + +// ==================================================== +// MAINTENANCE OPTIONS +// ==================================================== + +if((isset($qs[0]) && $qs[0] == "maint")) +{ + $text = "
    +
    + + + + + + + +
    ".EC_ADLAN_A144."
    ".EC_ADLAN_A142." + + ".EC_ADLAN_A143." +


    "; + + $ns->tablerender("
    ".EC_ADLAN_A144."
    ", $text); + + $text = "
    +
    + + + +
    ".EC_ADLAN_A160."
    "; + + $ns->tablerender("
    ".EC_ADLAN_A159."
    ", $text); + +} + +// ======================================================== +// MAIN OPTIONS MENU +// ======================================================== + + +if(!isset($qs[0]) || (isset($qs[0]) && $qs[0] == "config")){ + $text = "
    +
    + + + + + + + "; +$text .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".EC_LAN_78."
    ".EC_LAN_76." ". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')." +
    ".EC_LAN_104." ". r_userclass("eventpost_super", $pref['eventpost_super'], "off", 'public, nobody, member, admin, classes')." +
    ".EC_ADLAN_A134." + + ".EC_ADLAN_A137." +
    ".EC_ADLAN_A165." + +
    ".EC_ADLAN_A140."
    ".EC_LAN_102."
    ".EC_ADLAN_A171." + ".EC_ADLAN_A172." +
    ".EC_LAN_114." + +
    ".EC_LAN_117."
    + +
    ".EC_LAN_118."
    + +
    ".EC_ADLAN_A133."
    + +
    ".EC_ADLAN_A138."  ".EC_ADLAN_A139." +
    ".EC_ADLAN_A122."
    + ".EC_ADLAN_A124."".$ecal_class->time_string($ecal_class->time_now)."
    + ".EC_ADLAN_A125."".$ecal_class->time_string($ecal_class->site_timedate)."
    + ".EC_ADLAN_A126."".$ecal_class->time_string($ecal_class->user_timedate)." +
    +
    ".EC_ADLAN_A129." +
    ".EC_ADLAN_A123."
    + ".EC_ADLAN_A127." +
    + + +
    ".EC_ADLAN_A128." +
    ".EC_ADLAN_A166."
    + ".EC_ADLAN_A169." +
    + + +
    ".EC_ADLAN_A168." +
    ".EC_ADLAN_A167."
    + ".EC_ADLAN_A170." +
    + + +
    ".EC_ADLAN_A168." +
    ".EC_ADLAN_A95."  ".EC_ADLAN_A96." +
    ".EC_ADLAN_A92." +
    ".EC_ADLAN_A91." +
    ".EC_ADLAN_A93." +
    ".EC_ADLAN_A114."
    + +
    +
    +
    "; + + $ns->tablerender("
    ".EC_LAN_78."
    ", $text); +} + + +function admin_config_adminmenu() +{ + if (e_QUERY) { + $tmp = explode(".", e_QUERY); + $action = $tmp[0]; + } + if (!isset($action) || ($action == "")) + { + $action = "config"; + } + $var['config']['text'] = EC_ADLAN_A10; + $var['config']['link'] = "admin_config.php"; + + $var['cat']['text'] = EC_ADLAN_A11; + $var['cat']['link'] ="admin_config.php?cat"; + + $var['forthcoming']['text'] = EC_ADLAN_A100; + $var['forthcoming']['link'] ="admin_config.php?forthcoming"; + + $var['maint']['text'] = EC_ADLAN_A141; + $var['maint']['link'] ="admin_config.php?maint"; + + show_admin_menu(EC_ADLAN_A12, $action, $var); +} + + +require_once(e_ADMIN."footer.php"); + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/calendar.php b/e107_plugins/calendar_menu/calendar.php new file mode 100644 index 000000000..d2d006e4a --- /dev/null +++ b/e107_plugins/calendar_menu/calendar.php @@ -0,0 +1,319 @@ +cal_date; +} +else +{ // Get date from query + $datearray = getdate($qs[0]); +} + $month = $datearray['mon']; + $year = $datearray['year']; + + +// set up arrays for calender display ------------------------------------------------------------------ +if($pref['eventpost_weekstart'] == 'sun') { + $week = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24); + } else { + $week = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25); +} +$months = Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11); +$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC); + +$days = array(EC_LAN_DAY_1, EC_LAN_DAY_2, EC_LAN_DAY_3, EC_LAN_DAY_4, EC_LAN_DAY_5, EC_LAN_DAY_6, EC_LAN_DAY_7, EC_LAN_DAY_8, EC_LAN_DAY_9, EC_LAN_DAY_10, EC_LAN_DAY_11, EC_LAN_DAY_12, EC_LAN_DAY_13, EC_LAN_DAY_14, EC_LAN_DAY_15, EC_LAN_DAY_16, EC_LAN_DAY_17, EC_LAN_DAY_18, EC_LAN_DAY_19, EC_LAN_DAY_20, EC_LAN_DAY_21, EC_LAN_DAY_22, EC_LAN_DAY_23, EC_LAN_DAY_24, EC_LAN_DAY_25, EC_LAN_DAY_26, EC_LAN_DAY_27, EC_LAN_DAY_28, EC_LAN_DAY_29, EC_LAN_DAY_30, EC_LAN_DAY_31); + +// show events------------------------------------------------------------------------------------------- +$monthstart = mktime(0, 0, 0, $month, 1, $year); // Start of month to be shown +$firstdayarray = getdate($monthstart); +$monthend = mktime(0, 0, 0, $month + 1, 1, $year) - 1; // End of month to be shown + +$prevmonth = ($month-1); +$prevyear = $year; +if ($prevmonth == 0) +{ + $prevmonth = 12; + $prevyear = ($year-1); +} +$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); // Used by nav + +$nextmonth = ($month + 1); +$nextyear = $year; +if ($nextmonth == 13) +{ + $nextmonth = 1; + $nextyear = ($year + 1); +} +$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear); +$py = $year-1; +$prevlink = mktime(0, 0, 0, $month, 1, $py); +$ny = $year + 1; +$nextlink = mktime(0, 0, 0, $month, 1, $ny); + +$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry +$nowmonth = $ecal_class->cal_date['mon']; +$nowyear = $ecal_class->cal_date['year']; +$nowday = $ecal_class->cal_date['mday']; + +// time switch buttons +$cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes); + +// navigation buttons +$nav_text = $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes); + +// get events from selected + $qry = "SELECT e.*, ec.* + FROM #event as e + LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id + WHERE e.event_id != '' + AND ((e.event_start >= ".intval($monthstart)." AND e.event_start <= ".intval($monthend).") + OR (e.event_end >= ".intval($monthstart)." AND e.event_end <= ".intval($monthend).") + OR (e.event_start <= ".intval($monthstart)." AND e.event_end >= ".intval($monthend).") + OR (e.event_recurring = '1' AND e.event_rec_y = ".intval($month).")) {$category_filter} + {$ecal_class->extra_query} + ORDER BY e.event_start"; + +if ($sql->db_Select_gen($qry)) +{ + while ($row = $sql->db_Fetch()) + { + // check for recurring events in this month + if($row['event_recurring']=='1') + { + if ($month == $row['event_rec_y']) + { // Change it into an event that happens today + $row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year); + $row['event_end'] = $row['event_start']; + } + else + { // Effectively create a null event + $row['event_start'] = 0; + $row['event_end'] = 0; + } + } + + $evf = getdate($row['event_start']); + $tmp = $evf['mday']; // Day of month for start + $eve = getdate($row['event_end']); + $tmp2 = $eve['mday']; // Day of month for end + $tmp3 = date("t", $monthstart); // number of days in this month + if ((($ecal_class->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $ecal_class->max_recent_show)) $row['is_recent'] = TRUE; + + //1) start in month, end in month + if(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']<=$monthend) + { + $events[$tmp][] = $row; + for ($c=($tmp+1); $c<($tmp2+1); $c++) + { + $row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2); + $events[$c][] = $row; + } + + //2) start in month, end after month + } + elseif(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']>=$monthend) + { + $events[$tmp][] = $row; + for ($c=($tmp+1); $c<=$tmp3; $c++) + { + $row['event_true_end'][$c] = 1; + $events[$c][] = $row; + } + + //3) start before month, end in month + } + elseif($row['event_start']<=$monthstart && ($row['event_end']>=$monthstart && $row['event_end']<=$monthend)) + { + for ($c=1; $c<=$tmp2; $c++) + { + $row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2); + $events[$c][] = $row; + } + + //4) start before month, end after month + } + elseif($row['event_start']<=$monthstart && $row['event_end']>=$monthend) + { + for ($c=1; $c<=$tmp3; $c++){ + $row['event_true_end'][$c] = 1; + $events[$c][] = $row; + } + } + } +} + + +// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference! + +$start = $monthstart; +$numberdays = date("t", $start); // number of days in this month + +$text = ""; +$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_START, FALSE, $calendar_shortcodes); +$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_START, FALSE, $calendar_shortcodes); +foreach($week as $day) +{ + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER, FALSE, $calendar_shortcodes); +} +$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_END, FALSE, $calendar_shortcodes); + +$calmonth = $datearray['mon']; +$calday = $datearray['mday']; +$calyear = $datearray['year']; + +if ($pref['eventpost_weekstart'] == 'mon') +{ + $firstdayoffset = ($firstdayarray['wday'] == 0 ? $firstdayarray['wday']+6 : $firstdayarray['wday']-1); +} +else +{ + $firstdayoffset = $firstdayarray['wday'] ; +} +for ($c=0; $c<$firstdayoffset; $c++) +{ + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes); +} +$loop = $firstdayoffset; + +for ($c = 1; $c <= $numberdays; $c++) +{ + $dayarray = getdate($start + (($c-1) * 86400)); + $stopp = mktime(24, 0, 0, $calmonth, $c, $calyear); + $startt = mktime(0, 0, 0, $calmonth, $c, $calyear); + // Highlight the current day. + if ($dayarray['mon'] == $calmonth) + { + if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear) + { + //today + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_TODAY, FALSE, $calendar_shortcodes); + } + elseif(isset($events[$c]) && is_array($events[$c]) && !empty($events[$c]) && count($events[$c]) > 0) + { + //day has events + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EVENT, FALSE, $calendar_shortcodes); + } + else + { + // no events and not today + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EMPTY, FALSE, $calendar_shortcodes); + } + // if there are events then list them + if (array_key_exists($c, $events)) + { + foreach($events[$c] as $ev) + { + //if ($event_true_end[$c][$a]){ + if(isset($ev['event_true_end']) && $ev['event_true_end']) + { + //$ev['indicat'] = ($ev['event_true_end']==1 ? "->" : "|"); + $ev['indicat'] = ""; + $ev['imagesize'] = "4"; + $ev['fulltopic'] = FALSE; + $ev['startofevent'] = FALSE; + } + else + { + $ev['indicat'] = ""; + $ev['imagesize'] = "8"; + $ev['fulltopic'] = TRUE; + $ev['startofevent'] = TRUE; + } + $text .= $tp -> parseTemplate($CALENDAR_SHOWEVENT, FALSE, $calendar_shortcodes); + } + } + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_END, FALSE, $calendar_shortcodes); + } + $loop++; + if ($loop == 7) + { + $loop = 0; + if($c != $numberdays) + { + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_WEEKSWITCH, FALSE, $calendar_shortcodes); + } + } +} +//remainder cells to end the row properly with empty cells +if($loop!=0) +{ + $remainder = 7-$loop; + for ($c=0; $c<$remainder; $c++) + { + $text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes); + } +} +$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_END, FALSE, $calendar_shortcodes); + +$caption = EC_LAN_79; // "Calendar View"; +$nav = $cal_text . $nav_text . $text; +$ns->tablerender($caption, $nav); + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/calendar_menu.php b/e107_plugins/calendar_menu/calendar_menu.php new file mode 100644 index 000000000..ab47572cb --- /dev/null +++ b/e107_plugins/calendar_menu/calendar_menu.php @@ -0,0 +1,257 @@ +retrieve($cache_tag, $ecal_class->max_cache_time)) + { + echo $cacheData; + return; + } + +include_lan($ecal_dir."languages/".e_LANGUAGE.".php"); + +global $ecal_dir, $tp; + + +if (is_readable(THEME."calendar_template.php")) +{ + require(THEME."calendar_template.php"); +} +else +{ // Needs to be require - otherwise not loaded if two menus use it + require($ecal_dir."calendar_template.php"); +} + +$cal_datearray = $ecal_class->cal_date; +$cal_current_month = $cal_datearray['mon']; +$cal_current_year = $cal_datearray['year']; +$numberdays = date("t", $ecal_class->cal_date); // number of days in this month + + +$cal_monthstart = mktime(0, 0, 0, $cal_current_month, 1, $cal_current_year); // Time stamp for first day of month +$cal_firstdayarray = getdate($cal_monthstart); +$cal_monthend = mktime(0, 0, 0, $cal_current_month + 1, 1, $cal_current_year) -1; // Time stamp for last day of month + + + $cal_qry = "SELECT e.event_rec_m, e.event_rec_y, e.event_start, e.event_end, e.event_datestamp, ec.* + FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id + WHERE ((e.event_start >= {$cal_monthstart} AND e.event_start <= {$cal_monthend}) OR (e.event_rec_y = {$cal_current_month})) + {$ecal_class->extra_query} order by e.event_start"; + + +$cal_events = array(); +$cal_totev = 0; +if ($cal_totev = $sql->db_Select_gen($cal_qry)) +{ + while ($cal_row = $sql->db_Fetch()) + { + if ($cal_row['event_rec_y'] == $cal_current_month) + { // Recurring events + $cal_start_day = $cal_row['event_rec_m']; + } + else + { // 'normal' events + $cal_tmp = getdate($cal_row['event_start']); + if ($cal_tmp['mon'] == $cal_current_month) + { + $cal_start_day = $cal_tmp['mday']; + } + else + { + $cal_start_day = 1; + } + } + // Mark start day of each event + $cal_events[$cal_start_day][] = $cal_row['event_cat_icon']; // Will be overwritten if several events on same day + if ((($ecal_class->max_recent_show != 0) && (time() - $cal_row['event_datestamp']) <= $ecal_class->max_recent_show)) $cal_events[$cal_start_day]['is_recent'] = TRUE; + } +} + + +if ($pref['eventpost_weekstart'] == 'sun') +{ + $cal_week = array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24); +} +else +{ + $cal_week = array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25); +} + +$cal_months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11); + + +$calendar_title = ""; +} +else +{ + $calendar_title .= $cal_current_year ." ". $cal_months[$cal_datearray['mon']-1] . ""; +} + + +$cal_text = $CALENDAR_MENU_START; + + +if ($pref['eventpost_showeventcount']=='1') +{ + if ($cal_totev) + { + $cal_text .= EC_LAN_26 . ": " . $cal_totev; + } + else + { + $cal_text .= EC_LAN_27; + } + $cal_text .= "

    "; +} + +$cal_start = $cal_monthstart; // First day of month as time stamp + + +// Start the table +$cal_text .= $CALENDAR_MENU_TABLE_START; +// Open header row +$cal_text .= $CALENDAR_MENU_HEADER_START; +// Now do the headings + +foreach($cal_week as $cal_day) +{ + $cal_text .= $CALENDAR_MENU_HEADER_FRONT; + $cal_text .= substr($cal_day, 0, $pref['eventpost_lenday']); + $cal_text .= $CALENDAR_MENU_HEADER_BACK; +} +$cal_text .= $CALENDAR_MENU_HEADER_END; // Close off header row, open first date row + + +$cal_thismonth = $cal_datearray['mon']; +$cal_thisday = $cal_datearray['mday']; // Today + + +if ($pref['eventpost_weekstart'] == 'mon') +{ + $firstdayoffset = ($cal_firstdayarray['wday'] == 0 ? $cal_firstdayarray['wday'] + 6 : $cal_firstdayarray['wday']-1); +} +else +{ + $firstdayoffset = $cal_firstdayarray['wday']; +} + + +for ($cal_c = 0; $cal_c < $firstdayoffset; $cal_c++) +{ + $cal_text .= $CALENDAR_MENU_DAY_NON; +} +$cal_loop = $firstdayoffset; + +// Now do the days of the month +for($cal_c = 1; $cal_c <= 31; $cal_c++) +{ // Four cases to decode: + // 1 - Today, no events + // 2 - Some other day, no events (or no icon defined) + // 3 - Today with events (and icon defined) + // 4 - Some other day with events (and icon defined) + $cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400)); + $cal_css = 2; // The default - not today, no events + if ($cal_dayarray['mon'] == $cal_thismonth) + { // Dates match for this month + $cal_img = $cal_c; // Default 'image' is the day of the month + $cal_event_count = 0; + $title = ""; + if ($cal_thisday == $cal_c) $cal_css = 1; + $cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_c, $cal_datearray['year']).".one"; // ALways need "one" + if (array_key_exists($cal_c, $cal_events)) + { + $cal_event_icon = e_PLUGIN . "calendar_menu/images/" . $cal_events[$cal_c]['0']; + $cal_event_count = count($cal_events[$cal_c]); // See how many events today + if (!empty($cal_events[$cal_c]) && is_file($cal_event_icon)) + { // Show icon if it exists + $cal_css += 2; // Gives 3 for today, 4 for other day + if ($cal_event_count == 1) + { + $title = " title='1 ".EC_LAN_135."' "; + } + else + { + $title = " title='{$cal_event_count} " . EC_LAN_106 . "' "; + } + $cal_img = ""; + //height='10' width='10' + if (isset($cal_events[$cal_c]['is_recent']) && $cal_events[$cal_c]['is_recent']) + { + $cal_css += 2; + } + } + } + $cal_text .= $CALENDAR_MENU_DAY_START[$cal_css]."{$cal_img}"; + $cal_text .= $CALENDAR_MENU_DAY_END[$cal_css]; + $cal_loop++; + if ($cal_loop == 7) + { // Start next row + $cal_loop = 0; + if ($cal_c != $numberdays) + { + $cal_text .= $CALENDAR_MENU_WEEKSWITCH; + } + } + } +} + +if ($cal_loop != 0) +{ +for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++) +{ + $cal_text .= $CALENDAR_MENU_DAY_NON; +} +} +// Close table +$cal_text .= $CALENDAR_MENU_END; + +// Now handle the data, cache as well +ob_start(); // Set up a new output buffer +$ns->tablerender($calendar_title, $cal_text, 'calendar_menu'); +$cache_data = ob_get_flush(); // Get the page content, and display it +$e107cache->set($cache_tag, $cache_data); // Save to cache + + +?> diff --git a/e107_plugins/calendar_menu/calendar_shortcodes.php b/e107_plugins/calendar_menu/calendar_shortcodes.php new file mode 100644 index 000000000..55704ac19 --- /dev/null +++ b/e107_plugins/calendar_menu/calendar_shortcodes.php @@ -0,0 +1,477 @@ + e_sc -> parse_scbatch(__FILE__); +/* +// TIME SWITCH BUTTONS ------------------------------------------------ +SC_BEGIN PREV_MONTH + global $PREV_MONTH, $previous, $months, $prevmonth; + return "<< ".$months[($prevmonth-1)].""; +SC_END + +SC_BEGIN NEXT_MONTH + global $NEXT_MONTH, $next, $months, $nextmonth; + return " ".$months[($nextmonth-1)]." >>"; +SC_END + +SC_BEGIN CURRENT_MONTH + global $CURRENT_MONTH, $pref, $months, $month, $year; + if($pref['eventpost_dateformat'] == 'my') { + $CURRENT_MONTH = $months[($month-1)]." ".$year; + } else { + $CURRENT_MONTH = $year." ".$months[($month-1)]; + } + return $CURRENT_MONTH; +SC_END + +SC_BEGIN PREV_YEAR + global $PREV_YEAR, $prevlink, $py; + return "<< ".$py.""; +SC_END + +SC_BEGIN NEXT_YEAR + global $NEXT_YEAR, $nextlink, $ny; + return "".$ny." >>"; +SC_END + +SC_BEGIN MONTH_LIST + global $MONTH_LIST, $year, $monthjump, $monthabb; + $MONTH_LIST = ""; + for ($ii = 0; $ii < 12; $ii++) + { + $m = $ii + 1; + $monthjump = mktime(0, 0, 0, $m, 1, $year); + $MONTH_LIST .= "".$monthabb[$ii]."  "; + } + return $MONTH_LIST; +SC_END + + + +// NAVIGATION BUTTONS ------------------------------------------------ +SC_BEGIN NAV_BUT_ALLEVENTS + global $NAV_BUT_ALLEVENTS; + $allevents = (e_PAGE == "event.php" ? EC_LAN_96 : EC_LAN_93); + return ""; +SC_END + +SC_BEGIN NAV_BUT_VIEWCAT + global $NAV_BUT_VIEWCAT; + //return ""; + return ""; +SC_END + +SC_BEGIN NAV_BUT_SUBSCRIPTION + global $NAV_BUT_SUBSCRIPTION, $pref; + if (($pref['eventpost_asubs']>0) && USER) + { + $NAV_BUT_SUBSCRIPTION = ""; + } + return $NAV_BUT_SUBSCRIPTION; +SC_END + +SC_BEGIN NAV_BUT_ENTEREVENT + global $NAV_BUT_ENTEREVENT, $pref, $prop; + $NAV_BUT_ENTEREVENT = ""; + if (check_class($pref['eventpost_admin']) || getperms('0')){ + // start no admin preference + $NAV_BUT_ENTEREVENT .= ""; + } + return $NAV_BUT_ENTEREVENT; +SC_END + +SC_BEGIN NAV_LINKCURRENTMONTH + global $NAV_LINKCURRENTMONTH, $month, $nowmonth, $year, $nowyear, $current, $ds; + $NAV_LINKCURRENTMONTH = ""; + if ($month != $nowmonth || $year != $nowyear || $ds == 'one'){ + $NAV_LINKCURRENTMONTH = ""; + } + return $NAV_LINKCURRENTMONTH; +SC_END + +SC_BEGIN NAV_CATEGORIES + global $NAV_CATEGORIES, $sql, $pref, $_POST, $cal_super; + $NAV_CATEGORIES = ""; + return $NAV_CATEGORIES; +SC_END + + + +// CALENDAR SHOWEVENT ------------------------------------------------------------ +SC_BEGIN SHOWEVENT_IMAGE + global $SHOWEVENT_IMAGE, $ev; + if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon'])){ + $img = ""; + }else{ + $img = ""; + } + return $img; + //return ""; +SC_END + +SC_BEGIN SHOWEVENT_INDICAT + global $SHOWEVENT_INDICAT, $ev; + return $ev['indicat']; +SC_END + +SC_BEGIN SHOWEVENT_HEADING + global $SHOWEVENT_HEADING, $ev, $datearray, $c; + $linkut = mktime(0 , 0 , 0 , $datearray['mon'], $c, $datearray['year']); + if(isset($ev['fulltopic']) && $ev['fulltopic']) + { // Used on first day + $show_title = $ev['event_title']; + } + else + { + if (strlen($ev['event_title']) > 10) + { + $show_title = substr($ev['event_title'], 0, 10) . "..."; + } + else + { + $show_title = $ev['event_title']; + } + } + if($ev['startofevent']) + { + if (isset($ev['is_recent'])) + { + return "".$show_title.""; + } + else + { + return "".$show_title.""; + } + } + else + { + return "".$show_title.""; + } +SC_END + +SC_BEGIN CALENDAR_CALENDAR_RECENT_ICON + global $ev; + if (!isset($ev['is_recent'])) return ""; +// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png"; + $recent_icon = e_IMAGE."generic/".IMODE."/new.png"; + if (file_exists($recent_icon)) + { + return " "; + } + return "R"; +SC_END + + + +// CALENDAR CALENDAR ------------------------------------------------------------ +SC_BEGIN CALENDAR_CALENDAR_HEADER_DAY + global $CALENDAR_CALENDAR_HEADER_DAY, $day, $pref, $week; + if(isset($pref['eventpost_lenday']) && $pref['eventpost_lenday']) + { + return "".substr($day,0,$pref['eventpost_lenday']).""; + } + else + { + return "".$day.""; + } +SC_END + +SC_BEGIN CALENDAR_CALENDAR_DAY_TODAY_HEADING + global $CALENDAR_CALENDAR_DAY_TODAY_HEADING, $startt, $c, $days; + return "".$days[($c-1)]." [".EC_LAN_TODAY."]"; +SC_END + +SC_BEGIN CALENDAR_CALENDAR_DAY_EVENT_HEADING + global $CALENDAR_CALENDAR_DAY_EVENT_HEADING, $startt, $c, $days; + return "".$days[($c-1)].""; +SC_END + +SC_BEGIN CALENDAR_CALENDAR_DAY_EMPTY_HEADING + global $CALENDAR_CALENDAR_DAY_EMPTY_HEADING, $startt, $c, $days; + return "".$days[($c-1)].""; +SC_END + + +// EVENT LIST ------------------------------------------------ +SC_BEGIN EVENTLIST_CAPTION + global $EVENTLIST_CAPTION, $ds, $months, $selected_mon, $dayslo, $selected_day, $monthstart; + if ($ds == 'one') + { + $EVENTLIST_CAPTION = EC_LAN_111.$months[$selected_mon-1]." ".$selected_day; + } + elseif ($ds != 'event') + { + $EVENTLIST_CAPTION = EC_LAN_112.$months[date("m", $monthstart)-1]; + } + return $EVENTLIST_CAPTION; +SC_END + + + +// EVENT ARCHIVE ------------------------------------------------------------ +SC_BEGIN EVENTARCHIVE_CAPTION + global $EVENTARCHIVE_CAPTION, $num; + if ($num == 0) + { + $EVENTARCHIVE_CAPTION = EC_LAN_137; + } + else + { + $EVENTARCHIVE_CAPTION = str_replace("-NUM-", $num, EC_LAN_62); + } + return $EVENTARCHIVE_CAPTION; +SC_END + +SC_BEGIN EVENTARCHIVE_DATE + global $EVENTARCHIVE_DATE, $thisevent, $ecal_class; + $startds = $ecal_class->event_date_string($thisevent['event_start']); + $EVENTARCHIVE_DATE = "".$startds.""; + return $EVENTARCHIVE_DATE; +SC_END + +SC_BEGIN EVENTARCHIVE_DETAILS + global $EVENTARCHIVE_DETAILS, $thisevent, $tp; + $number = 40; + $rowtext = $tp->toHTML($thisevent['event_details'], TRUE, "nobreak"); + $rowtext = strip_tags($rowtext); + $words = explode(" ", $rowtext); + $EVENTARCHIVE_DETAILS = implode(" ", array_slice($words, 0, $number)); + if(count($words) > $number){ + $EVENTARCHIVE_DETAILS .= " ".EC_LAN_133." "; + } + return $EVENTARCHIVE_DETAILS; +SC_END + +SC_BEGIN EVENTARCHIVE_EMPTY + global $EVENTARCHIVE_EMPTY; + return EC_LAN_37; +SC_END + +SC_BEGIN EVENTARCHIVE_HEADING + global $EVENTARCHIVE_HEADING, $thisevent; + $EVENTARCHIVE_HEADING = $thisevent['event_title']; + return $EVENTARCHIVE_HEADING; +SC_END + + + + +// EVENT SHOWEVENT ------------------------------------------------------------ + +SC_BEGIN EVENT_RECENT_ICON + global $thisevent, $ecal_class; + if (($ecal_class->max_recent_show == 0) || (time() - $thisevent['event_datestamp']) > $ecal_class->max_recent_show) return ""; +// Can use the generic icon, or a calendar-specific one + $recent_icon = e_IMAGE."generic/".IMODE."/new.png"; +// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png"; + if (file_exists($recent_icon)) + { + return " "; + } + return ""; +SC_END + +SC_BEGIN EVENT_HEADING_DATE + global $thisevent, $ecal_class; + $startds = $ecal_class->event_date_string($thisevent['event_start']); + return $startds; +SC_END + +SC_BEGIN EVENT_DATE_START + global $thisevent, $ecal_class; + $startds = $ecal_class->event_date_string($thisevent['event_start']); + return $startds; +SC_END + +SC_BEGIN EVENT_TIME_START + global $thisevent, $ecal_class; + if ($thisevent['event_allday'] == 1) return ""; + $startds = $ecal_class->time_string($thisevent['event_start']); + return $startds; +SC_END + +SC_BEGIN EVENT_DATE_END + global $thisevent, $ecal_class; + if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return ""; + $endds = $ecal_class->event_date_string($thisevent['event_end']); + return $endds; +SC_END + +SC_BEGIN EVENT_TIME_END + global $thisevent, $ecal_class; + if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return ""; + $endds = $ecal_class->time_string($thisevent['event_end']); + return $endds; +SC_END + +SC_BEGIN EVENT_TITLE + global $thisevent; + return $thisevent['event_title']; +SC_END + +SC_BEGIN EVENT_CAT_ICON + global $thisevent; + if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon'])) + { + return " "; + } + else + { + return ""; + } +SC_END + +SC_BEGIN EVENT_ID + global $thisevent; + return "calevent".$thisevent['event_id']; +SC_END + +SC_BEGIN EVENT_DISPLAYSTYLE + global $EVENT_DISPLAYSTYLE, $ds; + if (($ds=="event") || ($ds=="one")){ + $EVENT_DISPLAYSTYLE = "show"; + }else{ + $EVENT_DISPLAYSTYLE = "none"; + } + return $EVENT_DISPLAYSTYLE; +SC_END + +SC_BEGIN EVENT_DETAILS + global $EVENT_DETAILS, $thisevent, $tp; + return $tp->toHTML($thisevent['event_details'], TRUE); +SC_END + +SC_BEGIN EVENT_CATEGORY + global $EVENT_CATEGORY, $thisevent; + $EVENT_CATEGORY = $thisevent['event_cat_name']; + return $EVENT_CATEGORY; +SC_END + +SC_BEGIN EVENT_LOCATION + global $EVENT_LOCATION, $thisevent; + if ($thisevent['event_location'] == ""){ + $EVENT_LOCATION = ""; + }else{ + $EVENT_LOCATION = $thisevent['event_location']; + } + return $EVENT_LOCATION; +SC_END + +SC_BEGIN EVENT_AUTHOR + global $EVENT_AUTHOR, $event_author_id, $event_author_name; + if(USER){ + $EVENT_AUTHOR = "".$event_author_name.""; + }else{ + $EVENT_AUTHOR = $event_author_name; + } + return $EVENT_AUTHOR; +SC_END + +SC_BEGIN EVENT_CONTACT + global $EVENT_CONTACT, $thisevent,$tp; + if ($thisevent['event_contact'] == ""){ + //$EVENT_CONTACT = EC_LAN_38; // Not Specified ; + $EVENT_CONTACT = ""; + }else{ + $EVENT_CONTACT = $tp->toHTML($thisevent['event_contact'],TRUE); + } + return $EVENT_CONTACT; +SC_END + +SC_BEGIN EVENT_THREAD + global $EVENT_THREAD, $thisevent; + return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? " ".EC_LAN_39."" : ""; +SC_END + +SC_BEGIN EVENT_OPTIONS + global $EVENT_OPTIONS, $thisevent, $event_author_name, $cal_super; + if (USERNAME == $event_author_name || $cal_super){ + $EVENT_OPTIONS = "".EC_LAN_35 . "  ".EC_LAN_36.""; + } + return $EVENT_OPTIONS; +SC_END + + + + +SC_BEGIN NEXT_EVENT_TIME + global $cal_row, $ecal_class; + if ($cal_row['event_allday'] != 1) return $ecal_class->time_string($cal_row['event_start']); else return ''; +SC_END + +SC_BEGIN NEXT_EVENT_DATE + global $cal_row, $ecal_class; + return $ecal_class->next_date_string($cal_row['event_start']); +SC_END + +SC_BEGIN NEXT_EVENT_TITLE + global $pref, $cal_row; + if (isset($pref['eventpost_namelink']) && ($pref['eventpost_namelink'] == '2') && (isset($cal_row['event_thread']) && ($cal_row['event_thread'] != ""))) + { + $fe_event_title = ""; + } + else + { + $fe_event_title = ""; + } + $fe_event_title .= $cal_row['event_title'].""; + return $fe_event_title; +SC_END + +SC_BEGIN NEXT_EVENT_ICON + global $pref, $cal_row, $ecal_dir; + $fe_icon_file = ""; + if ($pref['eventpost_showcaticon'] == 1) + { + if($cal_row['event_cat_icon'] && file_exists($ecal_dir."images/".$cal_row['event_cat_icon'])) + { + $fe_icon_file = $ecal_dir."images/".$cal_row['event_cat_icon']; + } + else + { + $fe_icon_file = THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif"); + } + } + return $fe_icon_file; +SC_END + +SC_BEGIN NEXT_EVENT_GAP + global $cal_totev; + if ($cal_totev) return "

    "; else return ""; +SC_END + + +*/ +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/calendar_sql.php b/e107_plugins/calendar_menu/calendar_sql.php new file mode 100644 index 000000000..8a965266f --- /dev/null +++ b/e107_plugins/calendar_menu/calendar_sql.php @@ -0,0 +1,42 @@ +CREATE TABLE event ( + event_id int(11) unsigned NOT NULL auto_increment, + event_start int(10) NOT NULL default '0', + event_end int(10) NOT NULL default '0', + event_allday tinyint(1) unsigned NOT NULL default '0', + event_recurring tinyint(1) unsigned NOT NULL default '0', + event_datestamp int(10) unsigned NOT NULL default '0', + event_title varchar(200) NOT NULL default '', + event_location text NOT NULL, + event_details text NOT NULL, + event_author varchar(100) NOT NULL default '', + event_contact varchar(200) NOT NULL default '', + event_category smallint(5) unsigned NOT NULL default '0', + event_thread varchar(100) NOT NULL default '', + event_rec_m tinyint(2) unsigned NOT NULL default '0', + event_rec_y tinyint(2) unsigned NOT NULL default '0', + PRIMARY KEY (event_id) + ) TYPE=MyISAM;, + CREATE TABLE event_cat ( + event_cat_id smallint(5) unsigned NOT NULL auto_increment, + event_cat_name varchar(100) NOT NULL default '', + event_cat_icon varchar(100) NOT NULL default '', + event_cat_class int(10) unsigned NOT NULL default '0', + event_cat_subs tinyint(3) unsigned NOT NULL default '0', + event_cat_ahead tinyint(3) unsigned NOT NULL default '0', + event_cat_msg1 text, + event_cat_msg2 text, + event_cat_notify tinyint(3) unsigned NOT NULL default '0', + event_cat_last int(10) unsigned NOT NULL default '0', + event_cat_today int(10) unsigned NOT NULL default '0', + event_cat_lastupdate int(10) unsigned NOT NULL default '0', + event_cat_addclass int(10) unsigned NOT NULL default '0', + event_cat_description text, + event_cat_force_class int(10) unsigned NOT NULL default '0', + PRIMARY KEY (event_cat_id) + ) TYPE=MyISAM;, + CREATE TABLE event_subs ( + event_subid int(10) unsigned NOT NULL auto_increment, + event_userid int(10) unsigned NOT NULL default '0', + event_cat int(10) unsigned NOT NULL default '0', + PRIMARY KEY (event_subid) + ) TYPE=MyISAM; diff --git a/e107_plugins/calendar_menu/calendar_template.php b/e107_plugins/calendar_menu/calendar_template.php new file mode 100644 index 000000000..2d41d9011 --- /dev/null +++ b/e107_plugins/calendar_menu/calendar_template.php @@ -0,0 +1,269 @@ +"; +$sc_style['PREV_MONTH']['post'] = "
    "; + +$sc_style['CURRENT_MONTH']['pre'] = ""; +$sc_style['CURRENT_MONTH']['post'] = ""; + +$sc_style['NEXT_MONTH']['pre'] = ""; +$sc_style['NEXT_MONTH']['post'] = ""; + +$sc_style['PREV_YEAR']['pre'] = ""; +$sc_style['PREV_YEAR']['post'] = ""; + +$sc_style['MONTH_LIST']['pre'] = ""; +$sc_style['MONTH_LIST']['post'] = ""; + +$sc_style['NEXT_YEAR']['pre'] = ""; +$sc_style['NEXT_YEAR']['post'] = ""; + +// + +$CALENDAR_TIME_TABLE = " +
    + + + + +\n + + + + +\n +
    {PREV_MONTH}{CURRENT_MONTH}{NEXT_MONTH}
    {PREV_YEAR}{MONTH_LIST}{NEXT_YEAR}
    "; + + + +// NAVIGATION BUTTONS ------------------------------------------------------------ +//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = ""; +//$sc_style['NAV_LINKCURRENTMONTH']['post'] = ""; +$sc_style['NAV_LINKCURRENTMONTH']['pre'] = ""; +$sc_style['NAV_LINKCURRENTMONTH']['post'] = ""; + +$CALENDAR_NAVIGATION_TABLE = " +
    +
    + + + +\n +
    {NAV_CATEGORIES} {NAV_BUT_ALLEVENTS} {NAV_BUT_VIEWCAT} {NAV_BUT_ENTEREVENT} {NAV_BUT_SUBSCRIPTION} {NAV_LINKCURRENTMONTH}
    +
    +
    "; + + + +// EVENT LIST ------------------------------------------------------------ +$sc_style['EVENTLIST_CAPTION']['pre'] = ""; +$sc_style['EVENTLIST_CAPTION']['post'] = ":

    \n"; + +$EVENT_EVENTLIST_TABLE_START = "{EVENTLIST_CAPTION}"; +$EVENT_EVENTLIST_TABLE_END = "
    "; + + + +// EVENT ARCHIVE ------------------------------------------------------------ +$sc_style['EVENTARCHIVE_CAPTION']['pre'] = ""; +$sc_style['EVENTARCHIVE_CAPTION']['post'] = "\n"; + +$EVENT_ARCHIVE_TABLE_START = "
    {EVENTARCHIVE_CAPTION}"; +$EVENT_ARCHIVE_TABLE = " + + + +\n"; +//
    {EVENTARCHIVE_DETAILS} +$EVENT_ARCHIVE_TABLE_EMPTY = "\n"; +$EVENT_ARCHIVE_TABLE_END = "
    {EVENT_RECENT_ICON}{EVENTARCHIVE_DATE}{EVENTARCHIVE_HEADING}
    {EVENTARCHIVE_EMPTY}
    "; + + + +// EVENT SHOW EVENT ------------------------------------------------------------ +$EVENT_EVENT_TABLE_START = ""; +$EVENT_EVENT_TABLE_END = "
    "; + +$sc_style['EVENT_HEADING_DATE']['pre'] = ""; +$sc_style['EVENT_HEADING_DATE']['post'] = ""; + +$sc_style['EVENT_DETAILS']['pre'] = ""; +$sc_style['EVENT_DETAILS']['post'] = "\n"; + +$sc_style['EVENT_LOCATION']['pre'] = "".EC_LAN_32." "; +$sc_style['EVENT_LOCATION']['post'] = ""; + +$sc_style['EVENT_AUTHOR']['pre'] = "".EC_LAN_31." "; +$sc_style['EVENT_AUTHOR']['post'] = " "; + +$sc_style['EVENT_CONTACT']['pre'] = "".EC_LAN_33." "; +$sc_style['EVENT_CONTACT']['post'] = " "; + +$sc_style['EVENT_THREAD']['pre'] = ""; +$sc_style['EVENT_THREAD']['post'] = "\n"; + +$sc_style['EVENT_CATEGORY']['pre'] = "".EC_LAN_30." "; +$sc_style['EVENT_CATEGORY']['post'] = " "; + +$sc_style['EVENT_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? "".EC_LAN_68." " : "".EC_LAN_29." "; +$sc_style['EVENT_DATE_START']['post'] = ""; + +$sc_style['EVENT_TIME_START']['pre'] = EC_LAN_144; +$sc_style['EVENT_TIME_START']['post'] = ""; + +$sc_style['EVENT_DATE_END']['pre'] = "".EC_LAN_69." "; +$sc_style['EVENT_DATE_END']['post'] = ""; + +$sc_style['EVENT_TIME_END']['pre'] = EC_LAN_144; +$sc_style['EVENT_TIME_END']['post'] = ""; + +$EVENT_EVENT_TABLE = " + + +
    {EVENT_RECENT_ICON}{EVENT_CAT_ICON}{EVENT_HEADING_DATE}{EVENT_TIME_START} - {EVENT_TITLE}
    +
    + + + \n + + {EVENT_DETAILS} + {EVENT_THREAD} +
    {EVENT_AUTHOR} {EVENT_CAT_ICON} {EVENT_CATEGORY} {EVENT_CONTACT} {EVENT_OPTIONS}
    {EVENT_DATE_START}{EVENT_TIME_START} {EVENT_DATE_END}{EVENT_TIME_END}
    {EVENT_LOCATION}
    +
    + +\n +"; + + +// CALENDAR SHOW EVENT ------------------------------------------------------------ +$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['pre'] = ""; +$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['post'] = ""; +$CALENDAR_SHOWEVENT = "{CALENDAR_CALENDAR_RECENT_ICON}\n
    {SHOWEVENT_IMAGE}{SHOWEVENT_INDICAT}{SHOWEVENT_HEADING}
    "; + + + +// CALENDAR CALENDAR ------------------------------------------------------------ +$CALENDAR_CALENDAR_START = " +
    +"; + +$CALENDAR_CALENDAR_END = " +\n
    "; + +$CALENDAR_CALENDAR_DAY_NON = ""; + +//header row +$CALENDAR_CALENDAR_HEADER_START = ""; +$CALENDAR_CALENDAR_HEADER = "{CALENDAR_CALENDAR_HEADER_DAY}"; +$CALENDAR_CALENDAR_HEADER_END = "\n"; + + +$CALENDAR_CALENDAR_WEEKSWITCH = "\n"; + +//today +$CALENDAR_CALENDAR_DAY_TODAY = " + +{CALENDAR_CALENDAR_DAY_TODAY_HEADING}"; + +//day has events +$CALENDAR_CALENDAR_DAY_EVENT = " + +{CALENDAR_CALENDAR_DAY_EVENT_HEADING}"; + +// no events and not today +$CALENDAR_CALENDAR_DAY_EMPTY = " + +{CALENDAR_CALENDAR_DAY_EMPTY_HEADING}"; + +$CALENDAR_CALENDAR_DAY_END = ""; + +//==================================================================== +// Calendar menu templates +$CALENDAR_MENU_START = "
    "; +$CALENDAR_MENU_TABLE_START = ""; + +$CALENDAR_MENU_END = "
    "; + +// Blank cells at beginning and end +$CALENDAR_MENU_DAY_NON = "
    "; + +//header row +$CALENDAR_MENU_HEADER_START = "\n"; +$CALENDAR_MENU_HEADER_FRONT = ""; +$CALENDAR_MENU_HEADER_BACK = ""; +$CALENDAR_MENU_HEADER_END = "\n"; + + +$CALENDAR_MENU_WEEKSWITCH = "\n"; + +// Start and end CSS for date cells - six cases to decode, determined by array index: +// 1 - Today, no events +// 2 - Some other day, no events (or no icon defined) +// 3 - Today with events (and icon defined) +// 4 - Some other day with events (and icon defined) +// 5 - today with events, one or more of which has recently been added/updated (and icon defined) +// 6 - Some other day with events, one or more of which has recently been added/updated (and icon defined) + +//today, no events +$CALENDAR_MENU_DAY_START['1'] = ""; + +// no events and not today +$CALENDAR_MENU_DAY_START['2'] = ""; + +//day has events - same whether its today or not +$CALENDAR_MENU_DAY_START['3'] = ""; +$CALENDAR_MENU_DAY_START['4'] = ""; +// day has events, one which is recently added/updated +$CALENDAR_MENU_DAY_START['5'] = ""; +$CALENDAR_MENU_DAY_START['6'] = ""; +// Example highlight using background colour: +//$CALENDAR_MENU_DAY_START['5'] = ""; +//$CALENDAR_MENU_DAY_START['6'] = ""; + +$CALENDAR_MENU_DAY_END['1'] = ""; +$CALENDAR_MENU_DAY_END['2'] = ""; +$CALENDAR_MENU_DAY_END['3'] = ""; +$CALENDAR_MENU_DAY_END['4'] = ""; +$CALENDAR_MENU_DAY_END['5'] = ""; +$CALENDAR_MENU_DAY_END['6'] = ""; + +//============================================================================ +// Next event menu template +$sc_style['NEXT_EVENT_TIME']['pre'] = EC_LAN_144; +$sc_style['NEXT_EVENT_TIME']['post'] = ""; +// Following are original styles +//$sc_style['NEXT_EVENT_ICON']['pre'] = " \ No newline at end of file diff --git a/e107_plugins/calendar_menu/e_list.php b/e107_plugins/calendar_menu/e_list.php new file mode 100644 index 000000000..9bb93cb7d --- /dev/null +++ b/e107_plugins/calendar_menu/e_list.php @@ -0,0 +1,62 @@ + db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' ")) + { + return; + } + + $LIST_CAPTION = $arr[0]; + $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); + +require_once('ecal_class.php'); +$ecal_class = new ecal_class; + +$current_day = $ecal_class->cal_date['mday']; +$current_month = $ecal_class->cal_date['mon']; +$current_year = $ecal_class->cal_date['year']; + + $current = mktime(0,0,0,$current_month, $current_day, $current_year); + + if($mode == "new_page" || $mode == "new_menu" ){ + $lvisit = $this -> getlvisit(); + $qry = " event_datestamp>".intval($lvisit)." AND "; + }else{ + $qry = ""; + } + + $bullet = $this -> getBullet($arr[6], $mode); + + $qry = " + SELECT e.*, c.event_cat_name + FROM #event AS e + LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category + WHERE ".$qry." e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."' + ORDER BY e.event_start ASC LIMIT 0,".intval($arr[7]); + + if(!$event_items = $sql->db_Select_gen($qry)){ + $LIST_DATA = LIST_CALENDAR_2; + }else{ + while($row = $sql -> db_Fetch()){ + + $tmp = explode(".", $row['event_author']); + if($tmp[0] == "0"){ + $AUTHOR = $tmp[1]; + }elseif(is_numeric($tmp[0]) && $tmp[0] != "0"){ + $AUTHOR = (USER ? "".$tmp[1]."" : $tmp[1]); + }else{ + $AUTHOR = ""; + } + + $rowheading = $this -> parse_heading($row['event_title'], $mode); + $ICON = $bullet; + $HEADING = "".$rowheading.""; + $CATEGORY = $row['event_cat_name']; + $DATE = ($arr[5] ? ($row['event_start'] ? $this -> getListDate($row['event_start'], $mode) : "") : ""); + $INFO = ""; + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/e_notify.php b/e107_plugins/calendar_menu/e_notify.php new file mode 100644 index 000000000..e098c7682 --- /dev/null +++ b/e107_plugins/calendar_menu/e_notify.php @@ -0,0 +1,53 @@ + NT_LAN_EC_7, 'ecaledit' => NT_LAN_EC_2); +} + +if (!function_exists('notify_ecalnew')) +{ + function notify_ecalnew($data) { + global $nt; + include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); + $message = NT_LAN_EC_3.': '.USERNAME.' ('.NT_LAN_EC_4.': '.$data['ip'].' )
    '; + $message .= NT_LAN_EC_5.':
    '.$data['cmessage'].'

    '; + $nt -> send('ecaledit', NT_LAN_EC_6, $message); + } +} + +if (!function_exists('notify_ecaledit')) { + function notify_ecaledit($data) { + global $nt; + include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); + $message = NT_LAN_EC_3.': '.USERNAME.' ('.NT_LAN_EC_4.': '.$data['ip'].' )
    '; + $message .= NT_LAN_EC_5.':
    '.$data['cmessage'].'

    '; + $nt -> send('ecaledit', NT_LAN_EC_8, $message); + } +} + + + + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/e_rss.php b/e107_plugins/calendar_menu/e_rss.php new file mode 100644 index 000000000..7d3559875 --- /dev/null +++ b/e107_plugins/calendar_menu/e_rss.php @@ -0,0 +1,59 @@ +cal_date['mday']; +$current_month = $ecal_class->cal_date['mon']; +$current_year = $ecal_class->cal_date['year']; +$current = mktime(0,0,0,$current_month, $current_day, $current_year); + +$qry = " +SELECT e.*, c.event_cat_name +FROM #event AS e +LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category +WHERE e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."' +ORDER BY e.event_start ASC LIMIT 0,".$this->limit; + +$rss = array(); +$sqlrss = new db; +if($items = $sqlrss->db_Select_gen($qry)){ + $i=0; + while($rowrss = $sqlrss -> db_Fetch()){ + $tmp = explode(".", $rowrss['event_author']); + $rss[$i]['author'] = $tmp[1]; + $rss[$i]['author_email'] = ''; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."calendar_menu/event.php?".$rowrss['event_start'].".event.".$rowrss['event_id']; + $rss[$i]['linkid'] = $rowrss['event_id']; + $rss[$i]['title'] = $rowrss['event_title']; + $rss[$i]['description'] = ''; + $rss[$i]['category_name'] = $rowrss['event_cat_name']; + $rss[$i]['category_link'] = ''; + $rss[$i]['datestamp'] = $rowrss['event_start']; + $rss[$i]['enc_url'] = ""; + $rss[$i]['enc_leng'] = ""; + $rss[$i]['enc_type'] = ""; + $i++; + } +} +//##### ------------------------------------------------------------------------------------ + +$eplug_rss_feed[] = $feed; +$eplug_rss_data[] = $rss; + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/e_search.php b/e107_plugins/calendar_menu/e_search.php new file mode 100644 index 000000000..0e3212c80 --- /dev/null +++ b/e107_plugins/calendar_menu/e_search.php @@ -0,0 +1,11 @@ + e_PLUGIN.'calendar_menu/search/search_parser.php', 'qtype' => CM_SCH_LAN_1, 'refpage' => 'calendar.php'); + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/ecal_class.php b/e107_plugins/calendar_menu/ecal_class.php new file mode 100644 index 000000000..b7023c61d --- /dev/null +++ b/e107_plugins/calendar_menu/ecal_class.php @@ -0,0 +1,245 @@ +time_now = time(); + $this->site_timedate = $this->time_now + ($pref['time_offset'] * 3600); // Check sign of offset + $this->user_timedate = $this->time_now + TIMEOFFSET; + switch ($pref['eventpost_caltime']) + { + case 1 : + $this->cal_timedate = $this->site_timedate; // Site time + break; + case 2 : + $this->cal_timedate = $this->user_timedate; // User + break; + default : + $this->cal_timedate = $this->time_now; // Server time - default + } + $this->now_date = getdate($this->time_now); + $this->site_date = getdate($this->site_timedate); // Array with h,m,s, day, month year etc + $this->cal_date = getdate($this->cal_timedate); + + $this->max_cache_time = $this->site_date['minutes'] + 60*$this->site_date['hours']; + + $this->cal_super = check_class($pref['eventpost_super']); + if ($this->cal_super) $this->extra_query = ""; else $this->extra_query = " AND find_in_set(event_cat_class,'".USERCLASS_LIST."')"; + + if (isset($pref['eventpost_recentshow']) && ($pref['eventpost_recentshow'] != 0)) + { + $this->max_recent_show = 3600 * $pref['eventpost_recentshow']; + } + else + { + $this->max_recent_show = 0; + } + switch ($pref['eventpost_timedisplay']) + { + case 2 : + $this->time_format_string = "%I:%M %p"; // 12-hour display + break; + case 3 : + $this->time_format_string = $pref['eventpost_timecustom']; // custom display + if (isset($this->time_format_string)) break; + default : + $this->time_format_string = "%H%M"; // default to 24-hour display + } + + switch ($pref['eventpost_datedisplay']) + { // Event entry calendar + case 2 : + $this->cal_format_string = "d-m-Y"; + $this->dcal_format_string = "%d-%m-%Y"; + $this->java_format_code = 2; + break; + case 3 : + $this->cal_format_string = "m-d-Y"; + $this->dcal_format_string = "%m-%d-%Y"; + $this->java_format_code = 3; + break; + default : // 'original' defaults + $this->cal_format_string = "Y-m-d"; + $this->dcal_format_string = "%Y-%m-%d"; + $this->java_format_code = 1; + } + + switch ($pref['eventpost_dateevent']) + { // Event list date display + case 0 : + $this->event_date_format_string = $pref['eventpost_eventdatecustom']; + break; + case 2 : + $this->event_date_format_string = "%a %d %b %Y"; + break; + case 3 : + $this->event_date_format_string = "%a %d-%m-%y"; + break; + default : + $this->event_date_format_string = "%A %d %B %Y"; + } + + switch ($pref['eventpost_datenext']) + { // Forthcoming event date display + case 0 : + $this->next_date_format_string = $pref['eventpost_nextdatecustom']; + break; + case 2 : + $this->next_date_format_string = "%d %b"; + break; + case 3 : + $this->next_date_format_string = "%B %d"; + break; + case 4 : + $this->next_date_format_string = "%b %d"; + break; + default : + $this->next_date_format_string = "%d %B"; + } + } + + function time_string($convtime) + { // Returns a time string from a time stamp, formatted as 24-hour, 12-hour or custom as set in prefs + return strftime($this->time_format_string, $convtime); + } + + function event_date_string($convdate) + { // Returns a date string from a date stamp, formatted for display in event list + return strftime($this->event_date_format_string,$convdate); + } + + + function next_date_string($convdate) + { // Returns a date string from a date stamp, formatted for display in forthcoming event menu + return strftime($this->next_date_format_string,$convdate); + } + + + function full_date($convdate) + { // Returns a date as dd-mm-yyyy or yyyy-mm-dd according to prefs (for event entry) + return date($this->cal_format_string, $convdate); + } + + function make_date($new_hour, $new_minute, $date_string) + { // Turns a date as entered in the calendar into a time stamp (for event entry) + global $pref; + $tmp = explode("-", $date_string); + switch ($pref['eventpost_datedisplay']) + { + case 2 : + return mktime($new_hour, $new_minute, 0, $tmp[1], $tmp[0], $tmp[2]); // dd-mm-yyyy + case 3 : + return mktime($new_hour, $new_minute, 0, $tmp[0], $tmp[1], $tmp[2]); // mm-dd-yyyy + default : + return mktime($new_hour, $new_minute, 0, $tmp[1], $tmp[2], $tmp[0]); // yyyy-mm-dd + } + } + + function cal_log($event_type, $event_title = '', $event_string='', $event_start=0) + { // All calendar-related logging intentionally passed through a single point to maintain control + // (so we could also add other info if we wanted) + // Event types: + // 1 - add event + // 2 - edit event + // 3 - delete event + // 4 - Bulk delete + global $pref, $admin_log, $e_event; + + $log_titles = array( '1' => 'Event Calendar - add event', + '2' => 'Event Calendar - edit event', + '3' => 'Event Calendar - delete event', + '4' => 'Event Calendar - Bulk Delete' + ); +// Do the notifies first + $cmessage = $log_titles[$event_type]."
    "; + if ($event_start > 0) + $cmessage .= "Event Start: ".strftime("%d-%B-%Y",$event_start)."
    "; + else + $cmessage .= "Event Start unknown
    "; + $edata_ec = array("cmessage" => $cmessage, "ip" => getip()); + switch ($event_type) + { + case 1 : $e_event -> trigger("ecalnew", $edata_ec); + break; + case 2 : + case 3 : + case 4 : $e_event -> trigger("ecaledit", $edata_ec); + break; + } + + switch ($pref['eventpost_adminlog']) + { + case 1 : if ($event_type == '1') return; + case 2 : break; // Continue + default : return; // Invalid or undefined option + } + $log_titles = array( '1' => 'Event Calendar - add event', + '2' => 'Event Calendar - edit event', + '3' => 'Event Calendar - delete event', + '4' => 'Event Calendar - Bulk Delete' + ); + $admin_log->log_event($log_titles[$event_type],$event_title." \n".$event_string,4); + } + } + +?> diff --git a/e107_plugins/calendar_menu/event.php b/e107_plugins/calendar_menu/event.php new file mode 100644 index 000000000..3b027faab --- /dev/null +++ b/e107_plugins/calendar_menu/event.php @@ -0,0 +1,854 @@ +cal_super; + +require_once(e_HANDLER."calendar/calendar_class.php"); +$cal = new DHTML_Calendar(true); + +$category_filter = ""; +if ((isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] != "all")) +{ + $category_filter = " AND (e.event_category = '".$_POST['event_cat_ids']."') "; +} + +/* +// enter new category into db +if (isset($_POST['ne_cat_create'])) +{ + if ($_POST['ne_new_category'] != "") + { + $sql->db_Insert("event_cat", "0, '".$tp->toDB($_POST['ne_new_category'])."', '".$tp->toDB($_POST['ne_new_category_icon'])."', '0', '0', '0', '0', '', '', '0', '0', '0', '".time()."', '0' "); + header("location:event.php?".$_POST['qs'].".m1"); + } + else + { + header("location:event.php?".$_POST['qs'].".m3"); + } +} +*/ +// Event to add or update +if ((isset($_POST['ne_insert']) || isset($_POST['ne_update'])) && USER == true) +{ + if (($_POST['ne_event'] == "") || !isset($_POST['qs'])) + { // Problem - tell user to go away + header("location:event.php?".$ev_start.".m3"); + } + else + { + $ev_start = $ecal_class->make_date($_POST['ne_hour'], $_POST['ne_minute'],$_POST['start_date']); + $ev_end = $ecal_class->make_date($_POST['end_hour'], $_POST['end_minute'],$_POST['end_date']); + $ev_title = $tp->toDB($_POST['ne_title']); + $ev_location = $tp->toDB($_POST['ne_location']); + $ev_event = $tp->toDB($_POST['ne_event']); + $temp_date = getdate($ecal_class->make_date(0,0,$_POST['start_date'])); + if ($_POST['recurring'] == 1) + { + $rec_m = $temp_date['mday']; // Day of month + $rec_y = $temp_date['mon']; // Month number + } + else + { + $rec_m = ""; + $rec_y = ""; + } + + $report_msg = '.m3'; + if (isset($_POST['ne_insert'])) + { // Bits specific to inserting a new event + $qry = " 0, '".intval($ev_start)."', '".intval($ev_end)."', '".intval($_POST['allday'])."', '".intval($_POST['recurring'])."', '".time()."', '$ev_title', '$ev_location', '$ev_event', '".USERID.".".USERNAME."', '".$tp -> toDB($_POST['ne_email'])."', '".intval($_POST['ne_category'])."', '".$tp -> toDB($_POST['ne_thread'])."', '".intval($rec_m)."', '".intval($rec_y)."' "; + $sql->db_Insert("event", $qry); + $ecal_class->cal_log(1,'db_Insert',$qry, $ev_start); + $qs = preg_replace("/ne./i", "", $_POST['qs']); + $report_msg = '.m4'; + } + + if (isset($_POST['ne_update'])) + { // Bits specific to updating an existing event + $qry = "event_start='".intval($ev_start)."', event_end='".intval($ev_end)."', event_allday='".intval($_POST['allday'])."', event_recurring='".intval($_POST['recurring'])."', event_datestamp= '".time()."', event_title= '$ev_title', event_location='$ev_location', event_details='$ev_event', event_contact='".$tp -> toDB($_POST['ne_email'])."', event_category='".intval($_POST['ne_category'])."', event_thread='".$tp -> toDB($_POST['ne_thread'])."', event_rec_m='".intval($rec_m)."', event_rec_y='".intval($rec_y)."' WHERE event_id='".intval($_POST['id'])."' "; + $sql->db_Update("event", $qry); + $ecal_class->cal_log(2,'db_Update',$qry, $ev_start); + $qs = preg_replace("/ed./i", "", $_POST['qs']); + $report_msg = '.m5'; + } + // Now clear cache - just do the lot for now - get clever later + $e107cache->clear('nq_event_cal'); + header("location:event.php?".$ev_start.".".$qs.$report_msg); + } +} + +$action = ""; // Remove notice + +require_once(HEADERF); + +if (isset($_POST['jump'])) +{ + $smarray = getdate(mktime(0, 0, 0, $_POST['jumpmonth'], 1, $_POST['jumpyear'])); + $month = $smarray['mon']; + $year = $smarray['year']; +} +else +{ + if(e_QUERY) + { + $qs = explode(".", e_QUERY); + $action = $qs[0]; // Often a date if just viewing + $ds = (isset($qs[1]) ? $qs[1] : ""); + $eveid = (isset($qs[2]) ? $qs[2] : ""); + } + + if ($action == "") + { + $month = $ecal_class->cal_date['mon']; + $year = $ecal_class->cal_date['year']; + } + else + { + $smarray = getdate($action); + $month = $smarray['mon']; + $year = $smarray['year']; + } +} + + +if (isset($_POST['confirm'])) +{ + $qry = "event_id='".intval($_POST['existing'])."' "; + if ($sql->db_Delete("event", $qry)) + { + $message = EC_LAN_51; //Event Deleted + $ecal_class->cal_log(3,'db_Delete',$qry,$ev_start); + } + else + { + $message = EC_LAN_109; //Unable to Delete event for some mysterious reason + } +} + + +if ($action == "de") +{ // Delete event - show confirmation form + $text = "
    + ".EC_LAN_48." +

    +
    + + + + +
    +
    "; + $ns->tablerender(EC_LAN_46, $text); // Confirm Delete Event + require_once(FOOTERF); + exit; +} + + + +if (isset($_POST['cancel'])) +{ // Delete Cancelled + $message = EC_LAN_47; +} + + +// set up data arrays ---------------------------------------------------------------------------------- +// (some of these are only used in the shortcodes) +if ($pref['eventpost_weekstart'] == 'sun') +{ + $days = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24); +} +else +{ + $days = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25); +} +$dayslo = array('1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.', '13.', '14.', '15.', '16.', '17.', '18.', '19.', '20.', '21.', '22.', '23.', '24.', '25.', '26.', '27.', '28.', '29.', '30.', '31.'); +$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC); +$months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11); +// ---------------------------------------------------------------------------------------------------------- + +// Messages acknowledging actions +$poss_message = array('m1' => EC_LAN_41, 'm2' => EC_LAN_42, 'm3' => EC_LAN_43, 'm4' => EC_LAN_44, 'm5' => EC_LAN_45); +if (isset($qs[2])) if (isset($poss_message[$qs[2]])) $message = $poss_message[$qs[2]]; + +if (isset($message)) +{ + $ns->tablerender("", "
    ".$message."
    "); +} + + +// enter new event form +if ($action == "ne" || $action == "ed") +{ + if ($ecal_class->cal_super || check_class($pref['eventpost_admin'])) + { +function make_calendar($boxname, $boxvalue) +{ + global $ecal_class, $cal; + + unset($cal_options); + unset($cal_attrib); + $cal_options['firstDay'] = 0; + $cal_options['showsTime'] = false; + $cal_options['showOthers'] = true; + $cal_options['weekNumbers'] = false; + $cal_options['ifFormat'] = $ecal_class->dcal_format_string; + $cal_attrib['class'] = "tbox"; + $cal_attrib['size'] = "12"; + $cal_attrib['name'] = $boxname; + $cal_attrib['value'] = $boxvalue; + return $cal->make_input_field($cal_options, $cal_attrib); +} + + +function make_hourmin($boxname,$cur_hour,$cur_minute) +{ + global $pref; + if (isset($pref['eventpost_fivemins'])) $incval = 5; else $incval = 1; + $retval = " \n + \n"; + return $retval; +} + + + if ($action == "ed") + { // Editing existing event - read from database + $sql->db_Select("event", "*", "event_id='".intval($qs[1])."' "); + list($null, $ne_start, $ne_end, $allday, $recurring, $ne_datestamp, $ne_title, $ne_location, $ne_event, $ne_author, $ne_email, $ne_category, $ne_thread) = $sql->db_Fetch(); + + $smarray = getdate($ne_start); + $ne_hour = $smarray['hours']; + $ne_minute = $smarray['minutes']; + $ne_startdate = $ecal_class->full_date($ne_start); + + $smarray = getdate($ne_end); + $end_hour = $smarray['hours']; + $end_minute = $smarray['minutes']; + $ne_enddate = $ecal_class->full_date($ne_end); + } + else + { // New event - initialise everything + $smarray = getdate($qs[1]); + $month = $smarray['mon']; + $year = $smarray['year']; + $ne_startdate = $ecal_class->full_date($qs[1]); + + $ne_hour = $smarray['hours']; + $ne_minute = $smarray['minutes']; + + $end_hour = $smarray['hours']; + $end_minute = $smarray['minutes']; + $ne_enddate = $ecal_class->full_date($qs[1]); + } + + $text = " + "; + + $text .= " +
    + "; + + if ($action == "ed") + { + $caption = EC_LAN_66; // edit Event + + } elseif ($action == "ne") + { + $caption = EC_LAN_28; // Enter New Event + } + else + { + $caption = EC_LAN_83; + } + + $text .= " + + + + + + + + + + + + + + + + + + + + "; + // * *BK* Check if the add class is appropriate for adding new categories + // * *BK* It will default to everybody class when created. Need to go in to admin categories if + // * *BK* you want to change read class. + if (FALSE && check_class($pref['eventpost_addcat']) && $action != "ed") + { + require_once(e_HANDLER."file_class.php"); + $fi = new e_file; + $imagelist = $fi->get_files(e_PLUGIN."calendar_menu/images", "\.\w{3}$"); + $text .= " + + + + "; + } + + $text .= " + + + + + + + + + "; + // * *BK* + // * *BK* Only display for forum thread if it is required. No point in being in if not wanted + // * *BK* or if forums are inactive + // * *BK* + if (isset($pref['eventpost_forum']) && $pref['eventpost_forum'] == 1) + { + $text .= " + + + + "; + } + // * *BK* + // * *BK* If the user is logged in and has their email set plus the field is empty then put in + // * *BK* their email address. They can always take it out if they want, its not a required field + if (empty($ne_email) && ($action == "ne") && defined('USEREMAIL')) + { + $ne_email = USEREMAIL; + } + $text .= " + + + + + + + + + + +
    ".EC_LAN_72." ".EC_LAN_67." "; + + + $text .= make_calendar("start_date",$ne_startdate)."   ".EC_LAN_73." ".make_calendar("end_date",$ne_enddate); + $text .= " +
    ".EC_LAN_71." + ".EC_LAN_67; + + + $text .= make_hourmin("ne_",$ne_hour,$ne_minute)."  ".EC_LAN_73.make_hourmin('end_',$end_hour,$end_minute); + $text .= "
    "; + $text .= EC_LAN_64." +
    ".EC_LAN_65.""; + $text .= ""; + $text .= EC_LAN_63." +
    ".EC_LAN_70." * + +
    ".EC_LAN_52." + +
    ".EC_LAN_53." ".EC_LAN_54." + "; + $text .= "
    ".EC_LAN_55; + $text .= " "; + $text .= " "; + $text .= ""; + $text .= "
    +
    +
    ".EC_LAN_32." + +
    ".EC_LAN_57." * + +
    ".EC_LAN_58." + +
    ".EC_LAN_59." + +
    ".EC_LAN_105."
    "; + if ($action == "ed") + { + $text .= " + "; + } + else + { + $text .= ""; + } + $text .= "
    +
    "; + + $ns->tablerender($caption, $text); + require_once(FOOTERF); + exit; + } + else + { + header("location:".e_PLUGIN."calendar_menu/event.php"); + exit; + } +} // End of "Enter New Event + +//----------------------------------------------- +// show events +// $month, $year have the month required +//----------------------------------------------- +$monthstart = mktime(0, 0, 0, $month, 1, $year); +$firstdayarray = getdate($monthstart); +$monthend = mktime(0, 0, 0, $month + 1, 1, $year) -1 ; +$lastdayarray = getdate($monthend); + +$prevmonth = ($month-1); +$prevyear = $year; +if ($prevmonth == 0) +{ + $prevmonth = 12; + $prevyear = ($year-1); +} +$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); + +$nextmonth = ($month + 1); +$nextyear = $year; +if ($nextmonth == 13) +{ + $nextmonth = 1; + $nextyear = ($year + 1); +} + +$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry +$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear); // Used by nav buttons +$nowmonth = $ecal_class->cal_date['mon']; +$nowyear = $ecal_class->cal_date['year']; + + +$py = $year-1; +$prevlink = mktime(0, 0, 0, $month, 1, $py); +$ny = $year + 1; +$nextlink = mktime(0, 0, 0, $month, 1, $ny); + +if (is_readable(THEME."calendar_template.php")) +{ // Has to be require + require(THEME."calendar_template.php"); +} +else +{ + require(e_PLUGIN."calendar_menu/calendar_template.php"); +} + +$text2 = ""; +// time switch buttons +$text2 .= $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes); + +// navigation buttons +$text2 .= $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes); + + +// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference! + +$event = array(); +$extra = ''; + +if ($ds == "event") +{ // Show single event + $qry = " + SELECT e.*, ec.* + FROM #event as e + LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id + WHERE e.event_id='".intval($eveid)."' + {$ecal_class->extra_query} + "; + $sql2->db_Select_gen($qry); + $row = $sql2->db_Fetch(); + if ($row['event_recurring']=='1') // Single event, selected by ID. So day/month must match + { + $row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year); + $row['event_end'] = $row['event_start']; + } + $event[] = $row; + $next10_start = $event[0]['event_start']; + $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_START, FALSE, $calendar_shortcodes); + $text2 .= show_event($event); + $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_END, FALSE, $calendar_shortcodes); + +} +else +{ + if ($ds == 'one') + { // Show events from one day + $tmp = getdate($action); + $selected_day = $tmp['mday']; + $selected_mon = $tmp['mon']; + $start_time = $action; + $end_time = $action + 86399; + $next10_start = $end_time + 1; + $cap_title = " - ".$months[$selected_mon-1]." ".$selected_day; + $extra = " OR (e.event_rec_y = ".intval($selected_mon)." AND e.event_rec_m = ".intval($selected_day).") "; + } + else + { // Display whole of selected month + $start_time = $monthstart; + $end_time = $monthend; + $next10_start = $end_time + 1; + $cap_title = ''; + $extra = " OR e.event_rec_y = ".intval($month)." "; + } + + + $qry = " + SELECT e.*, ec.* + FROM #event as e + LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id WHERE (e.event_recurring = '0' AND + ((e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).") + OR (e.event_end >= ".intval($start_time)." AND e.event_end <= ".intval($end_time).") + OR (e.event_start <= ".intval($start_time)." AND e.event_end >= ".intval($end_time).") ) + {$extra}) + {$category_filter} + {$ecal_class->extra_query} + ORDER BY e.event_start ASC + "; + +// Query generates a list of event IDs in $idarray which meet the criteria. +// $idarray has one primary index location for each day of month, then secondary for events. + if ($cal_count=$sql->db_Select_gen($qry)) + { + while ($row = $sql->db_Fetch()) + { + if ($row['event_recurring']=='1') // Recurring events + { + if (($row['event_rec_y'] == $month) && (!in_array($row['event_id'], $idArray))) // Only allow one instance of each recurring event + { + $tmp = getdate($row['event_start']); + $row['event_start'] = mktime($tmp['hours'],$tmp['minutes'],0,$row['event_rec_y'],$row['event_rec_m'],$year); + $row['event_end'] = $row['event_start']; + $events[$row['event_rec_m']][] = $row; + $idArray[] = $row['event_id']; + } + } + else + { + if ($ds == 'one') + { + if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray)) + { + $events[$selected_day][] = $row; + $idArray[] = $row['event_id']; + } + } + else + { // Multiple events + if ($row['event_start'] < intval($start_time)) + { + $start_day = "1"; // Event starts before this month + } + else + { + $tmp = getdate($row['event_start']); + $start_day = $tmp['mday']; + } + if ($row['event_end'] < $row['event_start']) + { // End date before start date + $end_day = $start_day; + } + else + { + if ($row['event_end'] > intval($end_time)) + { + $end_day = "31"; // Event ends after this month + } + else + { + $tmp = getdate($row['event_end']); + $end_day = $tmp['mday']; + } + } + for ($i = $start_day; $i <= $end_day; $i++) + { + if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray)) + { + $events[$i][] = $row; + $idArray[] = $row['event_id']; + } + } + } + } + } + } +} + + +// event list +if(isset($events) && is_array($events)) +{ + $text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_START, FALSE, $calendar_shortcodes); + foreach ($events as $dom => $event){ + $text2 .= show_event($event); + } + $text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_END, FALSE, $calendar_shortcodes); +} + + +/* +$nextmonth = mktime(0, 0, 0, $month + 1, 1, $year)-1; +if (!isset($next10_start)) +{ + $next10_start = $nextmonth; +} +*/ + +// Show next 10 events after current event/day/month (doesn't show recurring events) +$qry = " +SELECT e.* FROM #event AS e +LEFT JOIN #event_cat AS ec ON e.event_category = ec.event_cat_id +WHERE e.event_start > '".intval($next10_start)."' {$ecal_class->extra_query} {$category_filter} +ORDER BY e.event_start ASC +LIMIT 0, 10 +"; + +$num = $sql->db_Select_gen($qry); +if ($num != 0) +{ + $gen = new convert; + $archive_events = ""; +// while ($events = $sql->db_Fetch()) + while ($thisevent = $sql->db_Fetch()) + { + $archive_events .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE, FALSE, $calendar_shortcodes); + } +} +else +{ + $archive_events = $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_EMPTY, FALSE, $calendar_shortcodes); +} + +$text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_START, FALSE, $calendar_shortcodes); +$text2 .= $archive_events; +$text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_END, FALSE, $calendar_shortcodes); + + +$caption = EC_LAN_80; // "Event List"; +$ns->tablerender($caption.(isset($cap_title) ? $cap_title : ""), $text2); +require_once(FOOTERF); + + +// Display one event in a form which can be expanded. +function show_event($day_events) +{ + global $tp, $cal_super, $_POST, $ds, $thisevent, $EVENT_ID, $EVENT_EVENT_TABLE, $calendar_shortcodes, $event_author_id, $event_author_name; + $text2 = ""; + foreach($day_events as $event) + { + $thisevent = $event; + $gen = new convert; + $lp = explode(".", $thisevent['event_author'],2); + if (preg_match("/[0-9]+/", $lp[0])) + { + $event_author_id = $lp[0]; + $event_author_name = $lp[1]; + } + $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE, FALSE, $calendar_shortcodes); + } + return $text2; +} + + +function headerjs() +{ + global $cal; + $script = $cal->load_files(); +/* + $script .= " + "; +*/ + return $script; +} + +?> diff --git a/e107_plugins/calendar_menu/images/b1.png b/e107_plugins/calendar_menu/images/b1.png new file mode 100644 index 000000000..107ae9a1c Binary files /dev/null and b/e107_plugins/calendar_menu/images/b1.png differ diff --git a/e107_plugins/calendar_menu/images/b10.png b/e107_plugins/calendar_menu/images/b10.png new file mode 100644 index 000000000..8463ca78c Binary files /dev/null and b/e107_plugins/calendar_menu/images/b10.png differ diff --git a/e107_plugins/calendar_menu/images/b11.png b/e107_plugins/calendar_menu/images/b11.png new file mode 100644 index 000000000..ee9ea7162 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b11.png differ diff --git a/e107_plugins/calendar_menu/images/b12.png b/e107_plugins/calendar_menu/images/b12.png new file mode 100644 index 000000000..9249a7e6b Binary files /dev/null and b/e107_plugins/calendar_menu/images/b12.png differ diff --git a/e107_plugins/calendar_menu/images/b13.png b/e107_plugins/calendar_menu/images/b13.png new file mode 100644 index 000000000..bdb87c0f9 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b13.png differ diff --git a/e107_plugins/calendar_menu/images/b14.png b/e107_plugins/calendar_menu/images/b14.png new file mode 100644 index 000000000..5efc22882 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b14.png differ diff --git a/e107_plugins/calendar_menu/images/b15.png b/e107_plugins/calendar_menu/images/b15.png new file mode 100644 index 000000000..a118fb986 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b15.png differ diff --git a/e107_plugins/calendar_menu/images/b16.png b/e107_plugins/calendar_menu/images/b16.png new file mode 100644 index 000000000..7ca6060fb Binary files /dev/null and b/e107_plugins/calendar_menu/images/b16.png differ diff --git a/e107_plugins/calendar_menu/images/b2.png b/e107_plugins/calendar_menu/images/b2.png new file mode 100644 index 000000000..8697768b3 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b2.png differ diff --git a/e107_plugins/calendar_menu/images/b3.png b/e107_plugins/calendar_menu/images/b3.png new file mode 100644 index 000000000..3aa7d2fef Binary files /dev/null and b/e107_plugins/calendar_menu/images/b3.png differ diff --git a/e107_plugins/calendar_menu/images/b4.png b/e107_plugins/calendar_menu/images/b4.png new file mode 100644 index 000000000..a2e6670fc Binary files /dev/null and b/e107_plugins/calendar_menu/images/b4.png differ diff --git a/e107_plugins/calendar_menu/images/b5.png b/e107_plugins/calendar_menu/images/b5.png new file mode 100644 index 000000000..61fa45010 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b5.png differ diff --git a/e107_plugins/calendar_menu/images/b6.png b/e107_plugins/calendar_menu/images/b6.png new file mode 100644 index 000000000..d04a29001 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b6.png differ diff --git a/e107_plugins/calendar_menu/images/b7.png b/e107_plugins/calendar_menu/images/b7.png new file mode 100644 index 000000000..d985772d4 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b7.png differ diff --git a/e107_plugins/calendar_menu/images/b8.png b/e107_plugins/calendar_menu/images/b8.png new file mode 100644 index 000000000..6f47d4ea7 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b8.png differ diff --git a/e107_plugins/calendar_menu/images/b9.png b/e107_plugins/calendar_menu/images/b9.png new file mode 100644 index 000000000..dfaaf71c0 Binary files /dev/null and b/e107_plugins/calendar_menu/images/b9.png differ diff --git a/e107_plugins/calendar_menu/images/cal1.png b/e107_plugins/calendar_menu/images/cal1.png new file mode 100644 index 000000000..458e656d0 Binary files /dev/null and b/e107_plugins/calendar_menu/images/cal1.png differ diff --git a/e107_plugins/calendar_menu/images/cal2.png b/e107_plugins/calendar_menu/images/cal2.png new file mode 100644 index 000000000..0830a242c Binary files /dev/null and b/e107_plugins/calendar_menu/images/cal2.png differ diff --git a/e107_plugins/calendar_menu/images/cal3.png b/e107_plugins/calendar_menu/images/cal3.png new file mode 100644 index 000000000..b47d0de7a Binary files /dev/null and b/e107_plugins/calendar_menu/images/cal3.png differ diff --git a/e107_plugins/calendar_menu/images/calendar_16.png b/e107_plugins/calendar_menu/images/calendar_16.png new file mode 100644 index 000000000..5360ab59c Binary files /dev/null and b/e107_plugins/calendar_menu/images/calendar_16.png differ diff --git a/e107_plugins/calendar_menu/images/calendar_32.png b/e107_plugins/calendar_menu/images/calendar_32.png new file mode 100644 index 000000000..c79efecfd Binary files /dev/null and b/e107_plugins/calendar_menu/images/calendar_32.png differ diff --git a/e107_plugins/calendar_menu/images/icon_ec.png b/e107_plugins/calendar_menu/images/icon_ec.png new file mode 100644 index 000000000..ec2294883 Binary files /dev/null and b/e107_plugins/calendar_menu/images/icon_ec.png differ diff --git a/e107_plugins/calendar_menu/images/star1.png b/e107_plugins/calendar_menu/images/star1.png new file mode 100644 index 000000000..f0d2e324e Binary files /dev/null and b/e107_plugins/calendar_menu/images/star1.png differ diff --git a/e107_plugins/calendar_menu/images/star2.png b/e107_plugins/calendar_menu/images/star2.png new file mode 100644 index 000000000..06be5de64 Binary files /dev/null and b/e107_plugins/calendar_menu/images/star2.png differ diff --git a/e107_plugins/calendar_menu/images/star3.png b/e107_plugins/calendar_menu/images/star3.png new file mode 100644 index 000000000..3c63989b1 Binary files /dev/null and b/e107_plugins/calendar_menu/images/star3.png differ diff --git a/e107_plugins/calendar_menu/images/star4.png b/e107_plugins/calendar_menu/images/star4.png new file mode 100644 index 000000000..6bbc73d22 Binary files /dev/null and b/e107_plugins/calendar_menu/images/star4.png differ diff --git a/e107_plugins/calendar_menu/images/star5.png b/e107_plugins/calendar_menu/images/star5.png new file mode 100644 index 000000000..159bb652e Binary files /dev/null and b/e107_plugins/calendar_menu/images/star5.png differ diff --git a/e107_plugins/calendar_menu/images/star6.png b/e107_plugins/calendar_menu/images/star6.png new file mode 100644 index 000000000..519dc2ea8 Binary files /dev/null and b/e107_plugins/calendar_menu/images/star6.png differ diff --git a/e107_plugins/calendar_menu/images/star7.png b/e107_plugins/calendar_menu/images/star7.png new file mode 100644 index 000000000..735e8c3ce Binary files /dev/null and b/e107_plugins/calendar_menu/images/star7.png differ diff --git a/e107_plugins/calendar_menu/images/star8.png b/e107_plugins/calendar_menu/images/star8.png new file mode 100644 index 000000000..1e95e2ae3 Binary files /dev/null and b/e107_plugins/calendar_menu/images/star8.png differ diff --git a/e107_plugins/calendar_menu/index.html b/e107_plugins/calendar_menu/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/calendar_menu/languages/English.php b/e107_plugins/calendar_menu/languages/English.php new file mode 100644 index 000000000..f4e2fafa6 --- /dev/null +++ b/e107_plugins/calendar_menu/languages/English.php @@ -0,0 +1,380 @@ + \ No newline at end of file diff --git a/e107_plugins/calendar_menu/languages/English_search.php b/e107_plugins/calendar_menu/languages/English_search.php new file mode 100644 index 000000000..8fbd91bad --- /dev/null +++ b/e107_plugins/calendar_menu/languages/English_search.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/e107_plugins/calendar_menu/log/index.html b/e107_plugins/calendar_menu/log/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/calendar_menu/next_event_menu.php b/e107_plugins/calendar_menu/next_event_menu.php new file mode 100644 index 000000000..9eae4b77a --- /dev/null +++ b/e107_plugins/calendar_menu/next_event_menu.php @@ -0,0 +1,153 @@ +retrieve($cache_tag, $ecal_class->max_cache_time)) + { + echo $cacheData; + return; + } + +include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); + +// Values defined through admin pages +$menu_title = $pref['eventpost_menuheading']; +$days_ahead = $pref['eventpost_daysforward']; +$show_count = $pref['eventpost_numevents']; +$show_recurring = $pref['eventpost_checkrecur']; +$link_in_heading = $pref['eventpost_linkheader']; + +// Now set defaults for anything not defined +if (!$menu_title) $menu_title = EC_LAN_140; +if (!$days_ahead) $days_ahead = 30; // Number of days ahead to go +if (!$show_count) $show_count = 3; // Number of events to show +if (!$show_recurring) $show_recurring = 1; // Zero to exclude recurring events +if (!$link_in_heading) $link_in_heading = 0; // Zero for simple heading, 1 to have clickable link + + +require($ecal_dir."calendar_shortcodes.php"); +if (is_readable(THEME."calendar_template.php")) +{ // Needs to be require in case second + require(THEME."calendar_template.php"); +} +else +{ + require($ecal_dir."calendar_template.php"); +} + +$site_time = $ecal_class->cal_timedate; +$end_time = $site_time + (86400 * $days_ahead); + + +// Build up query bit by bit + $cal_qry = "SELECT e.event_id, e.event_rec_m, e.event_rec_y, e.event_start, e.event_thread, e.event_title, e.event_recurring, e.event_allday, ec.* + FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id + WHERE (((e.event_start >= {$site_time} AND e.event_start < {$end_time}))"; + +if ($show_recurring > 0) +{ // This won't work properly under some circumstances if $days_ahead is greater than the number of days in the current month plus next month. + // If that matters, need another test on event_rec_y (which is actually the month) - plus the calculation to generate the values + $cal_datearray = $ecal_class->cal_date; + $first_day = $cal_datearray['mday']; + $first_month = $cal_datearray['mon']; + + $end_date = mktime(0,0,0,$first_month,$first_day,0) + (86400 * $days_ahead); + $end_datearray = getdate($end_date); + $last_month = $end_datearray['mon']; + $last_day = $end_datearray['mday']; + $cal_qry .= " OR ((e.event_recurring = '1') + AND "; + if ($first_month == $last_month) + { // All dates within current month + $cal_qry .= "(((e.event_rec_y = {$first_month}) + AND (e.event_rec_m >= {$first_day}) AND (e.event_rec_m < {$last_day}) ) ))"; + } + else + { // Dates overlap one or more months + $cal_qry .= "(((e.event_rec_y = {$first_month}) AND (e.event_rec_m >= {$first_day})) + OR ((e.event_rec_y = {$last_month}) AND (e.event_rec_m < {$last_day}))"; + $first_month++; + if ($first_month > 12) $first_month = 1; + if ($first_month <> $last_month) + { // Add a whole month in the middle + $cal_qry .= " OR (e.event_rec_y = {$first_month}) "; + } + $cal_qry .= "))"; + } +} + +$cal_qry .= ')'.$ecal_class->extra_query; // Puts in class filter if not calendar admin + +if (isset($pref['eventpost_fe_set'])) +{ + $cal_qry .= " AND find_in_set(ec.event_cat_id,'".$pref['eventpost_fe_set']."')"; +} + +$cal_qry .= " order by e.event_start LIMIT {$show_count}"; + + +$cal_totev = 0; +$cal_text = ''; +$cal_row = array(); +global $cal_row, $cal_totev; + +$cal_totev = $sql->db_Select_gen($cal_qry); + + +if ($cal_totev > 0) +{ + while ($cal_row = $sql->db_Fetch()) + { + $cal_totev --; // Can use this to modify inter-event gap + $cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,FALSE,$calendar_shortcodes); + } +} +else +{ + $cal_text.= EC_LAN_141; +} + +$calendar_title = $menu_title; +if ($link_in_heading == 1) +{ + $calendar_title = "" . $menu_title . ""; +} + +// Now handle the data, cache as well +ob_start(); // Set up a new output buffer +$ns->tablerender($calendar_title, $cal_text, 'next_event_menu'); +$cache_data = ob_get_flush(); // Get the page content, and display it +$e107cache->set($cache_tag, $cache_data); // Save to cache + + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/plugin.php b/e107_plugins/calendar_menu/plugin.php new file mode 100644 index 000000000..22ce7c80c --- /dev/null +++ b/e107_plugins/calendar_menu/plugin.php @@ -0,0 +1,280 @@ +db_Select("plugin", "plugin_version", "plugin_name='Event Calendar' AND plugin_installflag > 0"); +list($ecalVer) = $ecalSQL->db_Fetch(); +$ecalVer = preg_replace("/[a-zA-z\s]/", '', $ecalVer); + +// List of preferences ----------------------------------------------------------------------------------------------- +$eplug_prefs = array( +"eventpost_admin" => 0, +"eventpost_adminlog" => 0, +"eventpost_showeventcount" => 1, +"eventpost_forum" => 1, +"eventpost_recentshow" => 0, +"eventpost_super" => 0, +"eventpost_menulink" => 0, +"eventpost_dateformat" => 1, +"eventpost_fivemins" => 0, +"eventpost_weekstart" => "sun", +"eventpost_lenday" => 1, +"eventpost_caltime" => 0, +"eventpost_datedisplay" => 1, +"eventpost_timedisplay" => 0, +"eventpost_timecustom" => "%H%M", +"eventpost_dateevent" => 1, +"eventpost_datenext" => 1, +"eventpost_eventdatecustom" => "&A %d %B %Y", +"eventpost_nextdatecustom" => "%d %b", +"eventpost_mailsubject" => EC_ADLAN_12, +"eventpost_mailfrom" => EC_ADLAN_A151, +"eventpost_mailaddress" => EC_ADLAN_A152, +"eventpost_asubs" => 1, +"eventpost_emaillog" => 1, +"eventpost_menuheading" => EC_LAN_140, +"eventpost_daysforward" => 30, +"eventpost_numevents" => 3, +"eventpost_checkrecur" => 1, +"eventpost_linkheader" => 0, +"eventpost_fe_set" => "", +"eventpost_showcaticon" => 0, +"eventpost_namelink" => 1 ); + +// List of table names ----------------------------------------------------------------------------------------------- +$eplug_table_names = array("event","event_cat","event_subs" ); + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = array( +"CREATE TABLE ".MPREFIX."event ( + event_id int(11) unsigned NOT NULL auto_increment, + event_start int(10) NOT NULL default '0', + event_end int(10) NOT NULL default '0', + event_allday tinyint(1) unsigned NOT NULL default '0', + event_recurring tinyint(1) unsigned NOT NULL default '0', + event_datestamp int(10) unsigned NOT NULL default '0', + event_title varchar(200) NOT NULL default '', + event_location text NOT NULL, + event_details text NOT NULL, + event_author varchar(100) NOT NULL default '', + event_contact varchar(200) NOT NULL default '', + event_category smallint(5) unsigned NOT NULL default '0', + event_thread varchar(100) NOT NULL default '', + event_rec_m tinyint(2) unsigned NOT NULL default '0', + event_rec_y tinyint(2) unsigned NOT NULL default '0', + PRIMARY KEY (event_id) + ) TYPE=MyISAM;", + "CREATE TABLE ".MPREFIX."event_cat ( + event_cat_id smallint(5) unsigned NOT NULL auto_increment, + event_cat_name varchar(100) NOT NULL default '', + event_cat_icon varchar(100) NOT NULL default '', + event_cat_class int(10) unsigned NOT NULL default '0', + event_cat_subs tinyint(3) unsigned NOT NULL default '0', + event_cat_ahead tinyint(3) unsigned NOT NULL default '0', + event_cat_msg1 text, + event_cat_msg2 text, + event_cat_notify tinyint(3) unsigned NOT NULL default '0', + event_cat_last int(10) unsigned NOT NULL default '0', + event_cat_today int(10) unsigned NOT NULL default '0', + event_cat_lastupdate int(10) unsigned NOT NULL default '0', + event_cat_addclass int(10) unsigned NOT NULL default '0', + event_cat_description text, + event_cat_force_class int(10) unsigned NOT NULL default '0', + PRIMARY KEY (event_cat_id) + ) TYPE=MyISAM;" + , + "CREATE TABLE ".MPREFIX."event_subs ( + event_subid int(10) unsigned NOT NULL auto_increment, + event_userid int(10) unsigned NOT NULL default '0', + event_cat int(10) unsigned NOT NULL default '0', + PRIMARY KEY (event_subid) + ) TYPE=MyISAM;"); + + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$ec_dir = e_PLUGIN."calendar_menu/"; +$eplug_link = TRUE; +$eplug_link_name = EC_LAN_83; // "Calendar"; +$eplug_link_url = "".$ec_dir."calendar.php"; +$eplug_link_perms = "Everyone"; // Everyone, Guest, Member, Admin + + +// Text to display after plugin successfully installed ------------------------------------------------------------------ +$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas."; + + + +// upgrading ... // +$upgrade_add_prefs = ""; +$upgrade_remove_prefs = ""; +$upgrade_alter_tables = array(); +$version_notes = ""; + + +if (!function_exists('create_ec_log_dir')) +{ +function create_ec_log_dir() +{ +global $eplug_folder; + +$response = ""; +$cal_log_dir = e_PLUGIN.$eplug_folder.'/log'; + if (!is_dir($cal_log_dir)) + { // Need to create log directory + if (!mkdir($cal_log_dir,0666)) + { + $response = EC_ADLAN_A158."
    "; + } + } + if (!is_dir($cal_log_dir)) + { + $response .= EC_ADLAN_A153; + return $response; + } + +// Now check directory permissions + if (!is_writable($cal_log_dir."/")) + { + if (!chmod($cal_log_dir,0666)) + { + $response = EC_ADLAN_A154."
    "; + } + if (!is_writable($cal_log_dir."/")) + { + $response .= EC_ADLAN_A155; + } + } + return $response; +} +} + + +if ($ecalVer < 3.5) +{ +// To version 3.5 + +$upgrade_alter_tables = array( +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_class int(10) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_subs tinyint(3) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force tinyint(3) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_ahead tinyint(3) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg1 text", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg2 text", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_notify tinyint(3) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_last int(10) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_today int(10) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_lastupdate int(10) unsigned NOT NULL default '0'", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_addclass int(10) unsigned NOT NULL default '0'", +"CREATE TABLE ".MPREFIX."event_subs ( + event_subid int(10) unsigned NOT NULL auto_increment, + event_userid int(10) unsigned NOT NULL default '0', + event_cat int(10) unsigned NOT NULL default '0', + PRIMARY KEY (event_subid) + ) TYPE=MyISAM;" +); +$version_notes .= "3.5
    ".EC_ADLAN_A156."
    "; +} +// To version 3.6 - fair number of tweaks overall +if ($ecalVer < 3.6) +{ +$upgrade_alter_tables = array( +"ALTER TABLE ".MPREFIX."event_cat DROP event_cat_force", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_description text", +"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force_class int(10) unsigned NOT NULL default '0'" +); + $verprefs = array( + "eventpost_adminlog" => 0, + "eventpost_showeventcount" => 1, + "eventpost_menuheading" => EC_LAN_140, + "eventpost_daysforward" => 30, + "eventpost_numevents" => 3, + "eventpost_checkrecur" => 1, + "eventpost_linkheader" => 0, + "eventpost_showcaticon" => 0, + "eventpost_dateformat" => 1, + "eventpost_fivemins" => 0, + "eventpost_emaillog" => 1, + "eventpost_caltime" => 0, + "eventpost_datedisplay" => 1, + "eventpost_timedisplay" => 0, + "eventpost_timecustom" => "%H%M", + "eventpost_fe_set" => "", + "eventpost_namelink" => 1, + "eventpost_recentshow" => 0, + "eventpost_dateevent" => 1, + "eventpost_datenext" => 1, + "eventpost_eventdatecustom" => "&A %d %B %Y", + "eventpost_nextdatecustom" => "%d %b", + "eventpost_menulink" => 0 ); + $upgrade_add_prefs .= $verprefs; + $version_notes .= "3.6
    ".EC_ADLAN_A156."
    ".create_ec_log_dir()."
    + Configure
    "; + + $upgrade_remove_prefs = array( + "eventpost_addcat", + "eventpost_evtoday", + "eventpost_headercss", + "eventpost_daycss", + "eventpost_todaycss" + ); +} + + +$eplug_upgrade_done = EC_LAN_108."
    ".$version_notes; + + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/readme.pdf b/e107_plugins/calendar_menu/readme.pdf new file mode 100644 index 000000000..365d7f3b3 Binary files /dev/null and b/e107_plugins/calendar_menu/readme.pdf differ diff --git a/e107_plugins/calendar_menu/search/search_parser.php b/e107_plugins/calendar_menu/search/search_parser.php new file mode 100644 index 000000000..c08aadbb0 --- /dev/null +++ b/e107_plugins/calendar_menu/search/search_parser.php @@ -0,0 +1,40 @@ + DESC); + +$ps = $sch -> parsesearch('event', $return_fields, $search_fields, $weights, 'search_events', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_events($row) { + global $con; + $res['link'] = e_PLUGIN."calendar_menu/event.php?".time().".event.".$row['event_id']; + $res['title'] = $row['event_title']; + $res['summary'] = $row['event_details']; + $res['detail'] = $row['event_location']." | ".$con -> convert_date($row['event_start'], "long"); + return $res; +} + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/subs_menu.php b/e107_plugins/calendar_menu/subs_menu.php new file mode 100644 index 000000000..29a3d14d4 --- /dev/null +++ b/e107_plugins/calendar_menu/subs_menu.php @@ -0,0 +1,251 @@ + 0) && e_QUERY) +{ // Run with query of ?dd-mm[-yy] to test specific date + list($day,$month,$year) = explode("-",e_QUERY); + if (!isset($year) || ($year == 0)) $year = date("Y"); + $cal_starttime = mktime(0,0,0,$month,$day,$year); + echo "Debug run for {$day}-{$month}-{$year}
    "; +} +else +{ // Normal operation +$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y")); +} + +$log_requirement = 0; // Logging required 0=none, 1=summary, 2=detailed +if (isset($pref['eventpost_emaillog'])) $log_requirement = $pref['eventpost_emaillog']; +if ($debug_level >= 2) $log_requirement = 2; // Force full logging if debug + +if ($log_requirement > 0) +{ + $log_filename = $ec_dir.'log/calendar_mail.txt'; + if (!$run_from_menu) + { + if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0; + if (fwrite($handle,"\r\n\r\nMail subscriptions run started at ".date("D j M Y G:i:s")) === false) $log_requirement = 0; + fclose($handle); + } +} + +// Start with the 'in advance' emails +$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and +event_cat_last < " . intval($cal_starttime) . " and +event_cat_ahead > 0 and +event_start >= (" . intval($cal_starttime) . "+(86400*(event_cat_ahead))) and +event_start < (" . intval($cal_starttime) . "+(86400*(event_cat_ahead+1))) and +find_in_set(event_cat_notify,'1,3,5,7')"; + +send_mailshot($cal_args, 'Advance',1); + + + +// then for today +//$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y")); +$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and +event_cat_today < " . intval($cal_starttime) . " and +event_start >= (" . intval($cal_starttime) . ") and +event_start < (86400+" . intval($cal_starttime) . ") and +find_in_set(event_cat_notify,'2,3,6,7')"; + +send_mailshot($cal_args, 'today',2); + + +// Finally do 'day before' emails +$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and +event_cat_today < " . intval($cal_starttime) . " and +event_start >= (" . intval($cal_starttime) ." + 86400 ) and +event_start < (" . intval($cal_starttime) ." + 172800) and +find_in_set(event_cat_notify,'4,5,6,7')"; + +send_mailshot($cal_args, 'tomorrow',2); + + +if (($log_requirement > 0) && (!$run_from_menu)) +{ + if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0; + if (fwrite($handle," .. completed at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0; + fclose($handle); +} + +// Done + + +/* + Function to actually send a mailshot +*/ +function send_mailshot($cal_query, $shot_type, $msg_num) +{ + global $sql, $sql2; + global $log_requirement, $log_filename, $debug_level; + global $pref; + global $run_from_menu; + + if (($log_requirement > 1) && (!$run_from_menu)) + { + if (!$handle = fopen($log_filename, 'a')) $log_requirement = 0; + if (fwrite($handle,"\r\n Starting emails for ".$shot_type." at ".date("D j M Y G:i:s")) === false) $log_requirement = 0; + if ($debug_level >= 2) + { + if (fwrite($handle,"\r\n Query is: ".$cal_query."\r\n") === false) $log_requirement = 0; + } + } + +if ($num_cat_proc = $sql->db_Select_gen($cal_query)) + { // Got at least one event to process here + if ($log_requirement > 1) + { + if ($run_from_menu) if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0; + if (fwrite($handle," - ".$num_cat_proc." categories found to process\r\n") === false) $log_requirement = 0; + } + require_once(e_HANDLER . "mail.php"); + while ($cal_row = $sql->db_Fetch()) + { // Process one event at a time + extract($cal_row); + + if ($log_requirement > 1) + { + if (fwrite($handle," Processing event: ".$event_title." \r\n") === false) $log_requirement = 0; + } + + if ($msg_num == 1) + $sql2->db_Update("event_cat", "event_cat_last=" . time() . " where event_cat_id=" . intval($event_cat_id)); + else + $sql2->db_Update("event_cat", "event_cat_today=" . time() . " where event_cat_id=" . intval($event_cat_id)); + + +// Start of next try on query +// Four cases for the query: +// 1. No forced mailshots - based on event_subs table only Need INNER JOIN +// 2. Forced mailshot to members - send to all users (don't care about subscriptions) Don't need JOIN +// 3. Forced mailshot to group of members - based on user table only Don't need JOIN +// 4. Forced mailshot to group, plus optional subscriptions - use the lot! Need LEFT JOIN +// (Always block sent to banned members) + $manual_subs = (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1')); + $subs_fields = ''; + $subs_join = ''; + $where_clause = ''; + $group_clause = ''; + + + if ($event_cat_force_class != e_UC_MEMBER) + { // Cases 1, 3, 4 (basic query does for case 2) + + if ((!$event_cat_force_class) || ($manual_subs)) + { // Cases 1 & 4 - need to join with event_subs database + $subs_fields = ", es.* "; + if ($event_cat_force_class) $subs_join = "LEFT"; else $subs_join = "INNER"; + $subs_join .= " join #event_subs AS es on u.user_id=es.event_userid "; + $where_clause = " es.event_cat='".intval($event_category)."' "; + $group_clause = " GROUP BY u.user_id"; + } + + if ($event_cat_force_class) + { // cases 3 and 4 - ... and check for involuntary subscribers + if ($where_clause) $where_clause .= " OR "; + if ($event_cat_force_class == e_UC_ADMIN) + { + $where_clause .= "(u.user_admin = '1' )"; + } + else + { + $where_clause .= "find_in_set('".intval($event_cat_force_class)."', u.user_class)"; + } + } + + if ($where_clause) $where_clause = ' AND ('.$where_clause.' ) '; + } // End of cases 1, 3, 4 + + $cal_emilargs = "SELECT u.user_id, u.user_class, u.user_email, u.user_name, u.user_ban, u.user_admin{$subs_fields} + from #user AS u {$subs_join} + WHERE u.user_ban = '0' {$where_clause} {$group_clause}"; + + + if ($debug_level >= 2) + { + if (fwrite($handle,"\r\n Email selection query is: ".$cal_emilargs."\r\n") === false) $log_requirement = 0; + } + if ($num_shots = $sql2->db_Select_gen($cal_emilargs)) + { + if ($log_requirement > 1) + { + if (fwrite($handle," - ".$num_shots." emails found to send\r\n") === false) $log_requirement = 0; + } + while ($cal_emrow = $sql2->db_Fetch()) + { + extract($cal_emrow); + if ($msg_num == 1) + $cal_msg = $event_title . "\n\n" . $event_cat_msg1; + else + $cal_msg = $event_title . "\n\n" . $event_cat_msg2; + if ($debug_level == 0) $send_result = sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); + if ($log_requirement > 1) + { + $log_string = " Send to: ".$user_email." Name: ".$user_name; + if ($debug_level > 0) + { $log_string .= " *DEBUG* +"; } + else + { $log_string .= " Result = ".$send_result." +"; } + if (fwrite($handle,$log_string) === false) $log_requirement = 0; + } + } + } + } // while + if ($log_requirement > 1) + { + if (fwrite($handle," Completed emails for ".$shot_type." at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0; + fclose($handle); + } + } +} + + + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/subscribe.php b/e107_plugins/calendar_menu/subscribe.php new file mode 100644 index 000000000..be0de1e61 --- /dev/null +++ b/e107_plugins/calendar_menu/subscribe.php @@ -0,0 +1,110 @@ + toDB($_POST['event_list']); // IDs of allowed categories + $cal_subs = $tp -> toDB($_POST['event_subd']); // Checkbox results + $cal_db->db_Delete("event_subs", "event_userid='" . USERID . "'"); // Delete all for this user to start + foreach($cal_cats as $cal_row) + { // Now add in a subscription for each allowed category + if ($cal_subs[$cal_row]) + { + $cal_inargs = "0,'" . USERID . "','" . $cal_row . "'"; + $cal_db->db_Insert("event_subs", $cal_inargs); + } + // print $cal_row . $cal_subs[$cal_row] . "
    "; + } + $caltext = " + + +
    " . EC_LAN_130 . "
    " . EC_LAN_131 . "
     
    "; +} +else +{ + $caltext = "
    + + +"; + // Get list of currently subscribed + $cal_db->db_Select("event_subs", "event_cat", "where event_userid='" . USERID . "'", "nowhere"); + while ($cal_s = $cal_db->db_Fetch()) + { + extract($cal_s); + $cal_array[] = $event_cat; + } // while + + // Get list of categories that have subscriptions and are visible to this member + $cal_args = "select * from #event_cat + where event_cat_subs>0 and (find_in_set(event_cat_class,'".USERCLASS_LIST."') OR find_in_set(event_cat_force_class,'".USERCLASS_LIST."'))"; + if ($cal_db->db_Select_gen($cal_args)) + { + // echo $cal_args."
    "; + while ($cal_row = $cal_db->db_Fetch()) + { + extract($cal_row); + $caltext .= ""; + } + $caltext .= ""; + } + } + else + { + $caltext .= ""; + } + $caltext .= ""; + $caltext .= "
    " . EC_LAN_125 . "
    " . EC_LAN_126 . "" . EC_LAN_127 . "" . EC_LAN_136 . "
    "; + if (check_class($event_cat_force_class)) + { + $caltext .= EC_LAN_126; + } + else + { + $caltext .= " + {$event_cat_name}{$event_cat_description}
    " . EC_LAN_128 . "
    "; +} +} +else +{ + if (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1')) + $caltext = EC_LAN_142; // Register or log in + else + $caltext = EC_LAN_143; // No facility +} +$ns->tablerender(EC_LAN_124, $caltext); +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/admin_chatbox.php b/e107_plugins/chatbox_menu/admin_chatbox.php new file mode 100644 index 000000000..cbab947b7 --- /dev/null +++ b/e107_plugins/chatbox_menu/admin_chatbox.php @@ -0,0 +1,177 @@ +clear("chatbox"); + $message = CHBLAN_1; +} + +if (isset($_POST['prune'])) { + $chatbox_prune = $_POST['chatbox_prune']; + $prunetime = time() - $chatbox_prune; + + $sql->db_Delete("chatbox", "cb_datestamp < '$prunetime' "); + $e107cache->clear("chatbox"); + $message = CHBLAN_28; +} + +if (isset($_POST['recalculate'])) { + $sql->db_Update("user", "user_chats = 0"); + $qry = "SELECT u.user_id AS uid, count(c.cb_nick) AS count FROM #chatbox AS c + LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id + WHERE u.user_id > 0 + GROUP BY uid"; + + if ($sql -> db_Select_gen($qry)) { + $ret = array(); + while($row = $sql -> db_Fetch()) + { + $list[$row['uid']] = $row['count']; + } + } + + foreach($list as $uid => $cnt) + { + $sql->db_Update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'"); + } + $message = CHBLAN_33; +} + +if (isset($message)) { + $ns->tablerender("", "
    ".$message."
    "); +} + +$chatbox_posts = $pref['chatbox_posts']; + +$text = "
    +
    + + + + + + + + + + + + + + "; + + if($pref['smiley_activate']) + { + $text .= " + + + "; + } + + $text .= " + + + "; + + + $text .= " + + + "; + + $text .= " + + +
    ".CHBLAN_11.":
    ".CHBLAN_12."
    + +
    ".CHBLAN_32.": ". r_userclass("cb_mod", $pref['cb_mod'], 'off', "admin, classes")." +
    ".CHBLAN_36."". + ($pref['cb_layer'] == 0 ? "" : "")."  ". CHBLAN_37."
    ". + ($pref['cb_layer'] == 1 ? "" : "")." ".CHBLAN_29." -- ". CHBLAN_30.":
    ". + ($pref['cb_layer'] == 2 ? "" : "")."  ". CHBLAN_38." +
    ".CHBLAN_31."?: ". ($pref['cb_emote'] ? "" : "")." +
    ".CHBLAN_21.":
    ".CHBLAN_22."
    + ".CHBLAN_23." + +
    ".CHBLAN_34.": + +
    + +
    +
    +
    "; + +$ns->tablerender(CHBLAN_20, $text); + +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/chat.php b/e107_plugins/chatbox_menu/chat.php new file mode 100644 index 000000000..8d1a1bd85 --- /dev/null +++ b/e107_plugins/chatbox_menu/chat.php @@ -0,0 +1,168 @@ +db_Select("menus", "*", "menu_name='chatbox_menu'"); +$row = $sql->db_Fetch(); + +if (!check_class($row['menu_class'])) { + $ns->tablerender(CHATBOX_L23, "
    ".CHATBOX_L24."
    "); + require_once(FOOTERF); + exit; +} + +if(!isset($pref['cb_mod'])) +{ + $pref['cb_mod'] = e_UC_ADMIN; +} +define("CB_MOD", check_class($pref['cb_mod'])); + +if($_POST['moderate'] && CB_MOD) +{ + if(isset($_POST['block'])) + { + foreach(array_keys($_POST['block']) as $k){ $kk[] = intval($k); } + $blocklist = implode(",", $kk); + $sql->db_Select_gen("UPDATE #chatbox SET cb_blocked=1 WHERE cb_id IN ({$blocklist})"); + } + + if(isset($_POST['unblock'])) + { + foreach(array_keys($_POST['unblock']) as $k){ $kk[] = intval($k); } + $unblocklist = implode(",", $kk); + $sql->db_Select_gen("UPDATE #chatbox SET cb_blocked=0 WHERE cb_id IN ({$unblocklist})"); + } + + if(isset($_POST['delete'])) + { + $deletelist = implode(",", array_keys($_POST['delete'])); + $sql -> db_Select_gen("SELECT c.cb_id, u.user_id FROM #chatbox AS c + LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id + WHERE c.cb_id IN (".$deletelist.")"); + $rowlist = $sql -> db_getList(); + foreach ($rowlist as $row) { + $sql -> db_Select_gen("UPDATE #user SET user_chats=user_chats-1 where user_id = ".intval($row['user_id'])); + } + $sql -> db_Select_gen("DELETE FROM #chatbox WHERE cb_id IN ({$deletelist})"); + } + $e107cache->clear("chatbox"); + $message = CHATBOX_L18; +} + +// when coming from search.php +if (strstr(e_QUERY, "fs")) { + $cgtm = str_replace(".fs", "", e_QUERY); + $fs = TRUE; +} +// end search + +if (e_QUERY ? $from = e_QUERY : $from = 0); + +$chat_total = $sql->db_Count("chatbox"); + +$qry_where = (CB_MOD ? "1" : "cb_blocked=0"); + +// when coming from search.php calculate page number +if ($fs) { + $page_count = 0; + $row_count = 0; + $sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC"); + while ($row = $sql -> db_Fetch()) { + if ($row['cb_id'] == $cgtm) { + $from = $page_count; + break; + } + $row_count++; + if ($row_count == 30) { + $row_count = 0; + $page_count += 30; + } + } +} +// end search + +$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC LIMIT ".intval($from).", 30"); +$obj2 = new convert; + +$chatList = $sql->db_getList(); +foreach ($chatList as $row) +{ + $CHAT_TABLE_DATESTAMP = $obj2->convert_date($row['cb_datestamp'], "long"); + $CHAT_TABLE_NICK = preg_replace("/[0-9]+\./", "", $row['cb_nick']); + $cb_message = $tp->toHTML($row['cb_message']); + if($row['cb_blocked']) + { + $cb_message .= "
    ".CHATBOX_L25; + } + if(CB_MOD) + { + $cb_message .= "
    ".CHATBOX_L10; + if($row['cb_blocked']) + { + $cb_message .= "   ".CHATBOX_L7; + } + else + { + $cb_message .= "   ".CHATBOX_L9; + } + } + + $CHAT_TABLE_MESSAGE = $cb_message; + $CHAT_TABLE_FLAG = ($flag ? "forumheader3" : "forumheader4"); + + if (!$CHAT_TABLE) { + if (file_exists(THEME."chat_template.php")) + { + require_once(THEME."chat_template.php"); + } + else + { + require_once(e_PLUGIN."chatbox_menu/chat_template.php"); + } + } + $textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE); + $flag = (!$flag ? TRUE : FALSE); +} + +$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE_START); +$textend = preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE_END); +$text = $textstart.$textstring.$textend; +if(CB_MOD) +{ + $text = "
    ".$text."
    "; +} +if($message) +{ + $ns->tablerender("", $message); +} + +$ns->tablerender(CHATBOX_L20, $text); + + +require_once(e_HANDLER."np_class.php"); +$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21); + +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/chat_template.php b/e107_plugins/chatbox_menu/chat_template.php new file mode 100644 index 000000000..5ed23b703 --- /dev/null +++ b/e107_plugins/chatbox_menu/chat_template.php @@ -0,0 +1,27 @@ +
    "; +} +if(!$CHAT_TABLE){ + $CHAT_TABLE = "\n +
    +
    + bullet \n{CHAT_TABLE_NICK} ".CHATBOX_L22." {CHAT_TABLE_DATESTAMP}
    +
    {CHAT_TABLE_MESSAGE}
    \n +
    +
    \n"; + +} +if(!$CHAT_TABLE_END){ + $CHAT_TABLE_END = " +
    "; +} +// ##### ------------------------------------------------------------------------------------------ + + +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/chatbox_menu.php b/e107_plugins/chatbox_menu/chatbox_menu.php new file mode 100644 index 000000000..c8f534256 --- /dev/null +++ b/e107_plugins/chatbox_menu/chatbox_menu.php @@ -0,0 +1,266 @@ + toDB($_POST['nick']))); + + $cmessage = $_POST['cmessage']; + $cmessage = preg_replace("#\[.*?\](.*?)\[/.*?\]#s", "\\1", $cmessage); + + $fp = new floodprotect; + if($fp -> flood("chatbox", "cb_datestamp")) + { + if((strlen(trim($cmessage)) < 1000) && trim($cmessage) != "") + { + $cmessage = $tp -> toDB($cmessage, false, true); + if($sql -> db_Select("chatbox", "*", "cb_message='$cmessage' AND cb_datestamp+84600>".time())) + { + $emessage = CHATBOX_L17; + } + else + { + $datestamp = time(); + $ip = $e107->getip(); + if(USER) + { + $nick = USERID.".".USERNAME; + $sql -> db_Update("user", "user_chats=user_chats+1, user_lastpost='".time()."' WHERE user_id='".USERID."' "); + } + else if(!$nick) + { + $nick = "0.Anonymous"; + } + else + { + if($sql -> db_Select("user", "*", "user_name='$nick' ")){ + $emessage = CHATBOX_L1; + } + else + { + $nick = "0.".$nick; + } + } + if(!$emessage) + { + $sql -> db_Insert("chatbox", "0, '$nick', '$cmessage', '".time()."', '0' , '$ip' "); + $edata_cb = array("cmessage" => $cmessage, "ip" => $ip); + $e_event -> trigger("cboxpost", $edata_cb); + $e107cache->clear("nq_chatbox"); + } + } + } + else + { + $emessage = CHATBOX_L15; + } + } + else + { + $emessage = CHATBOX_L19; + } + } +} + +if(!USER && !$pref['anon_post']){ + if($pref['user_reg']) + { + $texta = "
    ".CHATBOX_L3."


    "; + } +} +else +{ + $cb_width = (defined("CBWIDTH") ? CBWIDTH : ""); + + if($pref['cb_layer'] == 2) + { + $texta = "\n
    +
    + "; + } + else + { + $texta = (e_QUERY ? "\n" : "\n"); + } + $texta .= "
    "; + + if(($pref['anon_post'] == "1" && USER == FALSE)) + { + $texta .= "\n
    "; + } + + if($pref['cb_layer'] == 2) + { + + $oc = "onclick=\"javascript:sendInfo('".SITEURL.$PLUGINS_DIRECTORY."chatbox_menu/chatbox_menu.php', 'chatbox_posts', this.form);\""; + } + else + { + $oc = ""; + } + $texta .= " + +
    + + "; + + if($pref['cb_emote'] && $pref['smiley_activate']){ + $texta .= " + + \n"; + } + + $texta .="
    \n
    \n"; +} + +if($emessage != ""){ + $texta .= "
    ".$emessage."
    "; +} + +if(!$text = $e107cache->retrieve("nq_chatbox")) +{ + global $pref,$tp; + $pref['chatbox_posts'] = ($pref['chatbox_posts'] ? $pref['chatbox_posts'] : 10); + $chatbox_posts = $pref['chatbox_posts']; + if(!isset($pref['cb_mod'])) + { + $pref['cb_mod'] = e_UC_ADMIN; + } + define("CB_MOD", check_class($pref['cb_mod'])); + + $qry = " + SELECT c.*, u.user_name FROM #chatbox AS c + LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id + ORDER BY c.cb_datestamp DESC LIMIT 0, ".intval($chatbox_posts); + + if($sql -> db_Select_gen($qry)) + { + $obj2 = new convert; + $cbpost = $sql -> db_getList(); + foreach($cbpost as $cb) + { + // get available vars + list($cb_uid, $cb_nick) = explode(".", $cb['cb_nick'], 2); + if($cb['user_name']) + { + $cb_nick = "{$cb['user_name']}"; + } + else + { + $cb_nick = $tp -> toHTML($cb_nick,FALSE,'emotes_off, no_make_clickable'); + $cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick); + } + + $datestamp = $obj2->convert_date($cb['cb_datestamp'], "short"); + if(!$pref['cb_wordwrap']) { $pref['cb_wordwrap'] = 30; } + $emotes_active = $pref['cb_emote'] ? 'emotes_on' : 'emotes_off'; + + $cb_message = $tp -> toHTML($cb['cb_message'], FALSE, $emotes_active, $cb_uid, $pref['menu_wordwrap']); + + $replace[0] = "["; $replace[1] = "]"; + $search[0] = "["; $search[1] = "]"; + $cb_message = str_replace($search, $replace, $cb_message); + + global $CHATBOXSTYLE; + if(!$CHATBOXSTYLE) + { + $bullet = (defined("BULLET") ? "" : ""); + // default chatbox style + $CHATBOXSTYLE = "\n
    + $bullet {USERNAME}
    {TIMEDATE}
    {MESSAGE}

    \n"; + } + + $search[0] = "/\{USERNAME\}(.*?)/si"; + $replace[0] = $cb_nick; + $search[1] = "/\{TIMEDATE\}(.*?)/si"; + $replace[1] = $datestamp; + $search[2] = "/\{MESSAGE\}(.*?)/si"; + $replace[2] = ($cb['cb_blocked'] ? CHATBOX_L6 : $cb_message); + + $text .= preg_replace($search, $replace, $CHATBOXSTYLE); + + } + } + else + { + $text .= "".CHATBOX_L11.""; + } + $total_chats = $sql -> db_Count("chatbox"); + if($total_chats > $chatbox_posts || CB_MOD) + { + $text .= "
    "; + } + $e107cache->set("nq_chatbox", $text); +} + +$caption = (file_exists(THEME."images/chatbox_menu.png") ? " ".CHATBOX_L2 : CHATBOX_L2); + +if($pref['cb_layer'] == 1) +{ + $text = $texta."
    ".$text."
    "; + $ns -> tablerender($caption, $text, 'chatbox'); +} +elseif($pref['cb_layer'] == 2 && isset($_POST['chat_submit'])) +{ + $text = $texta.$text; + $text = str_replace(e_IMAGE, e_IMAGE_ABS, $text); + echo $text; +} +else +{ + $text = $texta.$text; + if($pref['cb_layer'] == 2) + { + $text = "
    ".$text."
    "; + } + $ns -> tablerender($caption, $text, 'chatbox'); +} + +//$text = ($pref['cb_layer'] ? $texta."
    ".$text."
    " : $texta.$text); +//if(ADMIN && getperms("C")){$text .= "
    ";} +//$ns -> tablerender($caption, $text, 'chatbox'); + +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/chatbox_sql.php b/e107_plugins/chatbox_menu/chatbox_sql.php new file mode 100644 index 000000000..7f2a46a1f --- /dev/null +++ b/e107_plugins/chatbox_menu/chatbox_sql.php @@ -0,0 +1,9 @@ +CREATE TABLE chatbox ( + cb_id int(10) unsigned NOT NULL auto_increment, + cb_nick varchar(30) NOT NULL default '', + cb_message text NOT NULL, + cb_datestamp int(10) unsigned NOT NULL default '0', + cb_blocked tinyint(3) unsigned NOT NULL default '0', + cb_ip varchar(15) NOT NULL default '', + PRIMARY KEY (cb_id) + ) TYPE=MyISAM; \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/e_list.php b/e107_plugins/chatbox_menu/e_list.php new file mode 100644 index 000000000..8677e1d6d --- /dev/null +++ b/e107_plugins/chatbox_menu/e_list.php @@ -0,0 +1,41 @@ + db_Select("plugin", "*", "plugin_path = 'chatbox_menu' AND plugin_installflag = '1' ")){ + return; + } + + $LIST_CAPTION = $arr[0]; + $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); + + if($mode == "new_page" || $mode == "new_menu" ){ + $lvisit = $this -> getlvisit(); + $qry = "cb_datestamp>".$lvisit; + }else{ + $qry = "cb_id != '0' "; + } + $qry .= " ORDER BY cb_datestamp DESC LIMIT 0,".intval($arr[7]); + + $bullet = $this -> getBullet($arr[6], $mode); + + if(!$chatbox_posts = $sql -> db_Select("chatbox", "*", $qry)){ + $LIST_DATA = LIST_CHATBOX_2; + }else{ + while($row = $sql -> db_Fetch()) { + + $cb_id = substr($row['cb_nick'] , 0, strpos($row['cb_nick'] , ".")); + $cb_nick = substr($row['cb_nick'] , (strpos($row['cb_nick'] , ".")+1)); + $cb_message = ($row['cb_blocked'] ? CHATBOX_L6 : str_replace("
    ", " ", $tp -> toHTML($row['cb_message']))); + $rowheading = $this -> parse_heading($cb_message, $mode); + $ICON = $bullet; + $HEADING = $rowheading; + $AUTHOR = ($arr[3] ? ($cb_id != 0 ? "".$cb_nick."" : $cb_nick) : ""); + $CATEGORY = ""; + $DATE = ($arr[5] ? ($row['cb_datestamp'] ? $this -> getListDate($row['cb_datestamp'], $mode) : "") : ""); + $INFO = ""; + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/e_notify.php b/e107_plugins/chatbox_menu/e_notify.php new file mode 100644 index 000000000..81f6e10ce --- /dev/null +++ b/e107_plugins/chatbox_menu/e_notify.php @@ -0,0 +1,40 @@ + NT_LAN_CB_2); +} + + +if (!function_exists('notify_cboxpost')) { + function notify_cboxpost($data) { + global $nt; + include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php"); + $message = NT_LAN_CB_3.': '.USERNAME.' ('.NT_LAN_CB_4.': '.$data['ip'].' )
    '; + $message .= NT_LAN_CB_5.':
    '.$data['cmessage'].'

    '; + $nt -> send('cboxpost', NT_LAN_CB_6, $message); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/e_rss.php b/e107_plugins/chatbox_menu/e_rss.php new file mode 100644 index 000000000..c10417db5 --- /dev/null +++ b/e107_plugins/chatbox_menu/e_rss.php @@ -0,0 +1,44 @@ + db_Select('chatbox', "*", "cb_blocked=0 ORDER BY cb_datestamp DESC LIMIT 0,".$this -> limit)){ + $i=0; + while($rowrss = $sql -> db_Fetch()){ + $tmp = explode(".", $rowrss['cb_nick']); + $rss[$i]['author'] = $tmp[1]; + $rss[$i]['author_email'] = ''; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."chatbox_menu/chat.php?".$rowrss['cb_id']; + $rss[$i]['linkid'] = $rowrss['cb_id']; + $rss[$i]['title'] = ''; + $rss[$i]['description'] = $rowrss['cb_message']; + $rss[$i]['category_name'] = ''; + $rss[$i]['category_link'] = ''; + $rss[$i]['datestamp'] = $rowrss['cb_datestamp']; + $rss[$i]['enc_url'] = ""; + $rss[$i]['enc_leng'] = ""; + $rss[$i]['enc_type'] = ""; + $i++; + } +} + + +//##### ------------------------------------------------------------------------------------ + +$eplug_rss_data[] = $rss; +$eplug_rss_feed[] = $feed; +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/e_search.php b/e107_plugins/chatbox_menu/e_search.php new file mode 100644 index 000000000..c8ae9e0dc --- /dev/null +++ b/e107_plugins/chatbox_menu/e_search.php @@ -0,0 +1,11 @@ + e_PLUGIN.'chatbox_menu/search/search_parser.php', 'qtype' => CB_SCH_LAN_1, 'refpage' => 'chat.php', 'advanced' => e_PLUGIN.'chatbox_menu/search/search_advanced.php'); +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/e_status.php b/e107_plugins/chatbox_menu/e_status.php new file mode 100644 index 000000000..c43b58c0f --- /dev/null +++ b/e107_plugins/chatbox_menu/e_status.php @@ -0,0 +1,6 @@ + db_Count("chatbox"); +$text .= "
    ".ADLAN_115.": ".$chatbox_posts."
    "; +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/images/blocked.png b/e107_plugins/chatbox_menu/images/blocked.png new file mode 100644 index 000000000..be6625a68 Binary files /dev/null and b/e107_plugins/chatbox_menu/images/blocked.png differ diff --git a/e107_plugins/chatbox_menu/images/chatbox_16.png b/e107_plugins/chatbox_menu/images/chatbox_16.png new file mode 100644 index 000000000..aa3aab597 Binary files /dev/null and b/e107_plugins/chatbox_menu/images/chatbox_16.png differ diff --git a/e107_plugins/chatbox_menu/images/chatbox_32.png b/e107_plugins/chatbox_menu/images/chatbox_32.png new file mode 100644 index 000000000..d1dd53988 Binary files /dev/null and b/e107_plugins/chatbox_menu/images/chatbox_32.png differ diff --git a/e107_plugins/chatbox_menu/languages/English/English.php b/e107_plugins/chatbox_menu/languages/English/English.php new file mode 100644 index 000000000..6fff87e5d --- /dev/null +++ b/e107_plugins/chatbox_menu/languages/English/English.php @@ -0,0 +1,55 @@ +here to signup"); +define("CHATBOX_L4", "Submit"); +define("CHATBOX_L5", "Reset"); +define("CHATBOX_L6", "[blocked by admin]"); +define("CHATBOX_L7", "Unblock"); +define("CHATBOX_L8", "Info"); +define("CHATBOX_L9", "Block"); +define("CHATBOX_L10", "Delete"); +define("CHATBOX_L11", "No messages yet."); +define("CHATBOX_L12", "View all posts"); +define("CHATBOX_L13", "moderate chatbox"); +define("CHATBOX_L14", "Emotes"); +define("CHATBOX_L15", "Post too long, or empty post submitted"); +define("CHATBOX_L16", "Anonymous"); +define("CHATBOX_L17", "Duplicate post"); +define("CHATBOX_L18", "Chatbox messages moderated"); +define("CHATBOX_L19", "You may only post once every ".(FLOODPROTECT ? FLOODTIMEOUT : 'n/a')." seconds"); + +define("CHATBOX_L20", "Chatbox (all posts)"); +define("CHATBOX_L21", "Chat Posts"); +define("CHATBOX_L22", "on"); +define("CHATBOX_L23", "Error!"); +define("CHATBOX_L24", "You do not have the correct permissions to view this page."); +define("CHATBOX_L25", "[ this post has been blocked by admin ]"); + +// Notify +define("NT_LAN_CB_1", "Chatbox Events"); +define("NT_LAN_CB_2", "Message posted"); +define("NT_LAN_CB_3", "Posted by"); +define("NT_LAN_CB_4", "IP Address"); +define("NT_LAN_CB_5", "Message"); +define("NT_LAN_CB_6", "Chatbox Message Posted"); + +?> \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/languages/English/English_config.php b/e107_plugins/chatbox_menu/languages/English/English_config.php new file mode 100644 index 000000000..875d57861 --- /dev/null +++ b/e107_plugins/chatbox_menu/languages/English/English_config.php @@ -0,0 +1,56 @@ + \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php b/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php new file mode 100644 index 000000000..df6616f3f --- /dev/null +++ b/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/plugin.php b/e107_plugins/chatbox_menu/plugin.php new file mode 100644 index 000000000..47862b961 --- /dev/null +++ b/e107_plugins/chatbox_menu/plugin.php @@ -0,0 +1,102 @@ + '10', + 'cb_wordwrap' => '20', + 'cb_layer' => '0', + 'cb_layer_height' => '200', + 'cb_emote' => '0', + 'cb_mod' => e_UC_ADMIN +); + +// List of table names ----------------------------------------------------------------------------------------------- +$eplug_table_names = array( + "chatbox" +); + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = array( + "CREATE TABLE ".MPREFIX."chatbox ( + cb_id int(10) unsigned NOT NULL auto_increment, + cb_nick varchar(30) NOT NULL default '', + cb_message text NOT NULL, + cb_datestamp int(10) unsigned NOT NULL default '0', + cb_blocked tinyint(3) unsigned NOT NULL default '0', + cb_ip varchar(15) NOT NULL default '', + PRIMARY KEY (cb_id) + ) TYPE=MyISAM;" +); + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$eplug_link = FALSE; +$eplug_link_name = ''; +$eplug_link_url = ''; + + +// upgrading ... // +$upgrade_add_prefs = ""; +$upgrade_remove_prefs = ""; +$upgrade_alter_tables = ""; + + +if (!function_exists('chatbox_menu_uninstall')) { + function chatbox_menu_uninstall() { + global $sql; + $sql -> db_Update("user", "user_chats='0'"); + } +} + +if (!function_exists('chatbox_menu_install')) { + function chatbox_menu_install() { + global $sql; + $sql -> db_Update("user", "user_chats='0'"); + } +} + +?> diff --git a/e107_plugins/chatbox_menu/search/search_advanced.php b/e107_plugins/chatbox_menu/search/search_advanced.php new file mode 100644 index 000000000..d19842232 --- /dev/null +++ b/e107_plugins/chatbox_menu/search/search_advanced.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/e107_plugins/chatbox_menu/search/search_parser.php b/e107_plugins/chatbox_menu/search/search_parser.php new file mode 100644 index 000000000..5d821729d --- /dev/null +++ b/e107_plugins/chatbox_menu/search/search_parser.php @@ -0,0 +1,57 @@ + db_Count('chatbox'); + +// advanced +$advanced_where = ""; +if (isset($_GET['time']) && is_numeric($_GET['time'])) { + $advanced_where .= " cb_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +if (isset($_GET['author']) && $_GET['author'] != '') { + $advanced_where .= " cb_nick LIKE '%".$tp -> toDB($_GET['author'])."%' AND"; +} + +// basic +$return_fields = 'cb_id, cb_nick, cb_message, cb_datestamp'; +$search_fields = array('cb_nick', 'cb_message'); +$weights = array('1', '1'); +$no_results = LAN_198; +$where = $advanced_where; +$order = array('cb_datestamp' => DESC); + +$ps = $sch -> parsesearch('chatbox', $return_fields, $search_fields, $weights, 'search_chatbox', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_chatbox($row) { + global $con, $cb_count; + preg_match("/([0-9]+)\.(.*)/", $row['cb_nick'], $user); + $res['link'] = e_PLUGIN."chatbox_menu/chat.php?".$row['cb_id'].".fs"; + $res['pre_title'] = LAN_SEARCH_7; + $res['title'] = $user[2]; + $res['summary'] = $row['cb_message']; + $res['detail'] = $con -> convert_date($row['cb_datestamp'], "long"); + return $res; +} + +?> \ No newline at end of file diff --git a/e107_plugins/clock_menu/clock.js b/e107_plugins/clock_menu/clock.js new file mode 100644 index 000000000..89ae48d64 --- /dev/null +++ b/e107_plugins/clock_menu/clock.js @@ -0,0 +1,70 @@ + \ No newline at end of file diff --git a/e107_plugins/clock_menu/clock_menu.php b/e107_plugins/clock_menu/clock_menu.php new file mode 100644 index 000000000..25ba0f682 --- /dev/null +++ b/e107_plugins/clock_menu/clock_menu.php @@ -0,0 +1,65 @@ +\n
     
    \n"; +if (!isset($clock_flat) || !$clock_flat) { + $ns->tablerender($menu_pref['clock_caption'], "
    ".$text."
    ", 'clock'); +} else { + echo $text; +} +?> + + + + +\n\n"; +?> \ No newline at end of file diff --git a/e107_plugins/clock_menu/config.php b/e107_plugins/clock_menu/config.php new file mode 100644 index 000000000..321686652 --- /dev/null +++ b/e107_plugins/clock_menu/config.php @@ -0,0 +1,111 @@ +db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); + $ns->tablerender("", "
    ".CLOCK_AD_L1."
    "); +} + +$text = "
    +
    + "; + +// Title +$text .= " + + + "; + +// Format Time +$text .= " + + + "; + +// Date Prefix +$text .= " + + + "; + +// Date Suffix +$text .= " + + + "; + +$text .= " + + + "; + +$text .= " + + + "; + +$text .= " + + + "; + +$text .= " + + +
    ".CLOCK_AD_L2.": + +
    ".CLOCK_AD_L5.": ".($menu_pref['clock_format'] == 1 ? $rs->form_checkbox("clock_format", 1, 1) : $rs->form_checkbox("clock_format", 1, 0) )." +
    ".CLOCK_AD_L6."
    ".CLOCK_AD_L7.": + +
    ".CLOCK_AD_L8."
    ".CLOCK_AD_L9.": + 1 +
    ".CLOCK_AD_L13."
    ".CLOCK_AD_L10.": + 2 +
    ".CLOCK_AD_L13."
    ".CLOCK_AD_L11.": + 3 +
    ".CLOCK_AD_L13."
    ".CLOCK_AD_L12.": + 4 +
    ".CLOCK_AD_L13."
    + +
    +
    +
    "; +$ns->tablerender(CLOCK_AD_L4, $text); +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/clock_menu/languages/English.php b/e107_plugins/clock_menu/languages/English.php new file mode 100644 index 000000000..dafe3d022 --- /dev/null +++ b/e107_plugins/clock_menu/languages/English.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/e107_plugins/clock_menu/languages/admin/English.php b/e107_plugins/clock_menu/languages/admin/English.php new file mode 100644 index 000000000..91cc8c439 --- /dev/null +++ b/e107_plugins/clock_menu/languages/admin/English.php @@ -0,0 +1,44 @@ + diff --git a/e107_plugins/comment_menu/comment_menu.php b/e107_plugins/comment_menu/comment_menu.php new file mode 100644 index 000000000..f3a5622b2 --- /dev/null +++ b/e107_plugins/comment_menu/comment_menu.php @@ -0,0 +1,47 @@ +getCommentData(intval($menu_pref['comment_display'])); + +$text = ''; +// no posts yet .. +if(empty($data) || !is_array($data)){ + $text = CM_L1; +} + +global $row; +foreach($data as $row){ + $text .= $tp->parseTemplate($COMMENT_MENU_TEMPLATE, true, $comment_menu_shortcodes); +} + +$ns->tablerender($menu_pref['comment_caption'], $text, 'comment'); + +?> \ No newline at end of file diff --git a/e107_plugins/comment_menu/comment_menu_shortcodes.php b/e107_plugins/comment_menu/comment_menu_shortcodes.php new file mode 100644 index 000000000..100bc88a8 --- /dev/null +++ b/e107_plugins/comment_menu/comment_menu_shortcodes.php @@ -0,0 +1,73 @@ + e_sc -> parse_scbatch(__FILE__); + +/* +SC_BEGIN CM_ICON +return (defined("BULLET") ? "" : "bullet"); +SC_END + +SC_BEGIN CM_DATESTAMP +global $row; +$gen = new convert; +return $gen->convert_date($row['comment_datestamp'], "short"); +SC_END + +SC_BEGIN CM_HEADING +global $row; +return $row['comment_title']; +SC_END + +SC_BEGIN CM_URL_PRE +global $row; +return ($row['comment_url'] ? "" : ""); +SC_END + +SC_BEGIN CM_URL_POST +global $row; +return ($row['comment_url'] ? "" : ""); +SC_END + +SC_BEGIN CM_TYPE +global $row; +return $row['comment_type']; +SC_END + +SC_BEGIN CM_AUTHOR +global $row; +return $row['comment_author']; +SC_END + +SC_BEGIN CM_COMMENT +global $row, $menu_pref; +$COMMENT = ''; +if($menu_pref['comment_characters']>0){ + $COMMENT = $row['comment_comment']; + if (strlen($COMMENT) > $menu_pref['comment_characters']) + { + $COMMENT = substr($COMMENT, 0, $menu_pref['comment_characters']).$menu_pref['comment_postfix']; + } +} +return $COMMENT; +SC_END + +*/ +?> \ No newline at end of file diff --git a/e107_plugins/comment_menu/comment_menu_template.php b/e107_plugins/comment_menu/comment_menu_template.php new file mode 100644 index 000000000..24258de21 --- /dev/null +++ b/e107_plugins/comment_menu/comment_menu_template.php @@ -0,0 +1,38 @@ +"; +$sc_style['CM_AUTHOR']['post'] = ""; + +$sc_style['CM_DATESTAMP']['pre'] = " ".CM_L11." "; +$sc_style['CM_DATESTAMP']['post'] = ""; + +$sc_style['CM_COMMENT']['pre'] = ""; +$sc_style['CM_COMMENT']['post'] = "

    "; + +if (!isset($COMMENT_MENU_TEMPLATE)){ + $COMMENT_MENU_TEMPLATE = " + {CM_ICON} {CM_URL_PRE}{CM_TYPE} {CM_HEADING}{CM_URL_POST}
    + {CM_AUTHOR} {CM_DATESTAMP}
    + {CM_COMMENT}"; +} +?> \ No newline at end of file diff --git a/e107_plugins/comment_menu/config.php b/e107_plugins/comment_menu/config.php new file mode 100644 index 000000000..fb1cd450a --- /dev/null +++ b/e107_plugins/comment_menu/config.php @@ -0,0 +1,100 @@ +db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); + $ns->tablerender("", "
    ".CM_L10."
    "); +} + +$text = "
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".CM_L3.": + +
    ".CM_L4.": + +
    ".CM_L5.": + +
    ".CM_L6.": + +
    ".CM_L7.": +
    +
    +
    "; +$ns->tablerender(CM_L8, $text); +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/comment_menu/languages/English.php b/e107_plugins/comment_menu/languages/English.php new file mode 100644 index 000000000..22f02f850 --- /dev/null +++ b/e107_plugins/comment_menu/languages/English.php @@ -0,0 +1,29 @@ + diff --git a/e107_plugins/compliance_menu/compliance_menu.php b/e107_plugins/compliance_menu/compliance_menu.php new file mode 100644 index 000000000..d36417970 --- /dev/null +++ b/e107_plugins/compliance_menu/compliance_menu.php @@ -0,0 +1,11 @@ + + Valid XHTML 1.1!
    + Valid CSS! +
    "; +$caption = (file_exists(THEME."images/compliance_menu.png") ? " ".COMPLIANCE_L1 : COMPLIANCE_L1); +$ns->tablerender($caption, $text, 'compliance'); +?> \ No newline at end of file diff --git a/e107_plugins/compliance_menu/images/valid-xhtml11.png b/e107_plugins/compliance_menu/images/valid-xhtml11.png new file mode 100644 index 000000000..6d305e7df Binary files /dev/null and b/e107_plugins/compliance_menu/images/valid-xhtml11.png differ diff --git a/e107_plugins/compliance_menu/images/vcss.png b/e107_plugins/compliance_menu/images/vcss.png new file mode 100644 index 000000000..9b2f596e0 Binary files /dev/null and b/e107_plugins/compliance_menu/images/vcss.png differ diff --git a/e107_plugins/compliance_menu/languages/English.php b/e107_plugins/compliance_menu/languages/English.php new file mode 100644 index 000000000..badf88705 --- /dev/null +++ b/e107_plugins/compliance_menu/languages/English.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/e107_plugins/content/admin_content_config.php b/e107_plugins/content/admin_content_config.php new file mode 100644 index 000000000..7a295a299 --- /dev/null +++ b/e107_plugins/content/admin_content_config.php @@ -0,0 +1,566 @@ + db_Select($plugintable, "content_id,content_heading,content_parent", "content_id = '$del_id' "); + list($content_id, $content_heading, $content_parent) = $sql -> db_Fetch(); + + $checkarray = $aa -> getCategoryTree("", $content_id, TRUE); + unset($agc); //unset the globalised getCategoryTree array + $checkvalidparent = implode(",", array_keys($checkarray)); + $checkqry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($checkvalidparent)."' "; + + //check if subcats present + if(count($array) > 1){ + //subcategories found don't delete + $checkermsg .= CONTENT_ADMIN_CAT_LAN_36."
    "; + $checksubcat = TRUE; + }else{ + $checkermsg .= CONTENT_ADMIN_CAT_LAN_39."
    "; + $checksubcat = FALSE; + } + + //check if items present + if($sql -> db_Count($plugintable, "(*)", "WHERE ".$checkqry." ")){ + //items found, don't delete + $checkermsg .= CONTENT_ADMIN_CAT_LAN_37."
    "; + $checkitems = TRUE; + }else{ + $checkermsg .= CONTENT_ADMIN_CAT_LAN_38."
    "; + $checkitems = FALSE; + } + + if($checksubcat == FALSE && $checkitems == FALSE){ + if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ + @unlink(e_PLUGIN."content/menus/content_".$content_heading."_menu.php"); + $message = CONTENT_ADMIN_CAT_LAN_23."
    "; + } + }else{ + $message = $checkermsg; + } +} + +if(isset($delete) && $delete == 'content'){ + if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ + $e107cache->clear($plugintable); + $message = CONTENT_ADMIN_ITEM_LAN_3; + } +} + +if(isset($delete) && $delete == 'submitted'){ + if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ + $e107cache->clear($plugintable); + $message = CONTENT_ADMIN_SUBMIT_LAN_8; + } +} + +//update options +if(isset($_POST['updateoptions'])){ + $content_pref = $aa -> UpdateContentPref($_POST['options_type']); + $message = CONTENT_ADMIN_CAT_LAN_22."

    "; + if($_POST['options_type'] != "0"){ + $message .= $aa -> CreateParentMenu($_POST['options_type']); + } + $e107cache->clear($plugintable); +} + +//update the inheritance of options +if(isset($_POST['updateinherit'])){ + foreach($_POST['id'] as $k=>$v){ + //get current + $sql -> db_Select($plugintable, "content_pref", "content_id='".intval($k)."' "); + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + //assign or remove inherit option + if(isset($_POST['content_inherit']) && isset($_POST['content_inherit'][$k]) ){ + $content_pref['content_inherit'] = "1"; + }else{ + unset($content_pref['content_inherit']); + } + //update + $tmp = $eArrayStorage->WriteArray($content_pref); + $sql2 -> db_Update($plugintable, "content_pref='{$tmp}' WHERE content_id='".intval($k)."' "); + } + $message = CONTENT_ADMIN_CAT_LAN_22."

    "; + $e107cache->clear($plugintable); +} + +//update manager classes into preferences +if(isset($_POST['update_manager'])){ + $content_pref = $aa -> UpdateContentPref($_POST['options_type']); + $message = CONTENT_ADMIN_CAT_LAN_22."

    "; + $e107cache->clear($plugintable); +} + +//update page restriction classes into preferences +if(isset($_POST['update_restrict'])){ + $content_pref = $aa -> UpdateContentPref($_POST['options_type']); + $message = CONTENT_ADMIN_CAT_LAN_22."

    "; + $e107cache->clear($plugintable); +} + + +//pre-upload a new category icon in the create/edit category form +if(isset($_POST['uploadcaticon'])){ + + $pref['upload_storagetype'] = "1"; + require_once(e_HANDLER."upload_handler.php"); + $pathiconlarge = $_POST['iconpathlarge']; + $pathiconsmall = $_POST['iconpathsmall']; + $uploaded = file_upload($pathiconlarge); + + $icon = ""; + if($uploaded) { + $icon = $uploaded[0]['name']; + require_once(e_HANDLER."resize_handler.php"); + resize_image($pathiconlarge.$icon, $pathiconlarge.$icon, '48', "nocopy"); + resize_image($pathiconlarge.$icon, $pathiconsmall.$icon, '16', "copy"); + rename($pathiconsmall."thumb_".$icon , $pathiconsmall.$icon); + } + $message = ($icon ? CONTENT_ADMIN_CAT_LAN_58 : CONTENT_ADMIN_CAT_LAN_59); + +} + +if(isset($_POST['create_category'])){ + if($_POST['cat_heading'] && $_POST['parent'] != "none"){ + $adb -> dbCategory("create"); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } +} + +if(isset($_POST['update_category'])){ + if($_POST['cat_heading'] && $_POST['parent'] != "none"){ + $adb -> dbCategory("update"); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } +} + +if(isset($_POST['create_content'])){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['content_author_name'] && $_POST['parent'] != "none"){ + //$adb -> dbContentCreate("admin"); + $adb -> dbContent("create", ""); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } +} + +if(isset($_POST['update_content'])){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['content_author_name'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ + //$adb -> dbContentUpdate("admin"); + $adb -> dbContent("update", ""); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } +} + +if(isset($_POST['update_order'])){ + if(isset($qs[1])){ + if(isset($qs[2])){ + $message = $adb -> dbSetOrder("all", "ci", $_POST['order']); + }else{ + $message = $adb -> dbSetOrder("all", "ai", $_POST['order']); + } + }else{ + $message = $adb -> dbSetOrder("all", "cc", $_POST['order']); + } +} + +if(isset($message)){ + $ns -> tablerender("", "
    ".$message."
    "); +} + +// ##### End -------------------------------------------------------------------------------------- + +if(!e_QUERY){ //show main categories + $aform -> show_manage_content("", "", ""); + require_once(e_ADMIN."footer.php"); + exit; +}else{ + $qs = explode(".", e_QUERY); + + //manage content items + if($qs[0] == "content" && is_numeric($qs[1]) ){ + $aform -> show_manage_content("", "", ""); + + //edit content item + }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){ + $newqs = array_reverse($qs); + if($newqs[0] == "cu"){ //item; update redirect + $mainparent = $aa -> getMainParent($qs[2]); + $message = CONTENT_ADMIN_ITEM_LAN_2."

    "; + $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_89." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_91." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_124." ".CONTENT_ADMIN_ITEM_LAN_90.""; + + $ns -> tablerender("", "
    ".$message."
    "); + require_once(e_ADMIN."footer.php"); + exit; + } + $aform -> show_create_content("admin", $userid="", $username=""); + + //post submitted content item + }elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ + $newqs = array_reverse($qs); + if($newqs[0] == "cu"){ //item; submit post / update redirect + $mainparent = $aa -> getMainParent($qs[2]); + $message = CONTENT_ADMIN_ITEM_LAN_117."

    "; + $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_89." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_91." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_124." ".CONTENT_ADMIN_ITEM_LAN_90.""; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(e_ADMIN."footer.php"); + exit; + } + $aform -> show_create_content("sa", $userid="", $username=""); + + //create content item + }elseif($qs[0] == "content" && $qs[1] == "create" ){ + $newqs = array_reverse($qs); + if($newqs[0] == "cc"){ //item; create redirect + $mainparent = $aa -> getMainParent($qs[2]); + $message = CONTENT_ADMIN_ITEM_LAN_1."

    "; + $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_89." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(e_ADMIN."footer.php"); + exit; + } + $aform -> show_create_content("admin", $userid="", $username=""); + + + + //order : view categories + }elseif($qs[0] == "order" && !isset($qs[1])){ + $aform -> show_order(); + + //order global items of parent='2' + }elseif($qs[0] == "order" && is_numeric($qs[1]) && !isset($qs[2]) ){ + $aform -> show_content_order("ai"); + + //increase order of global items + }elseif($qs[0] == "order" && is_numeric($qs[1]) && $qs[2] == "inc" && isset($qs[3]) ){ + $message = $adb -> dbSetOrder("inc", "ai", $qs[3]); + $ns -> tablerender("", "
    ".$message."
    "); + $aform -> show_content_order("ai"); + + //decrease order of global items + }elseif($qs[0] == "order" && is_numeric($qs[1]) && $qs[2] == "dec" && isset($qs[3]) ){ + $message = $adb -> dbSetOrder("dec", "ai", $qs[3]); + $ns -> tablerender("", "
    ".$message."
    "); + $aform -> show_content_order("ai"); + + //order items with parent=2 or category='5' + }elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && !isset($qs[3]) ){ + $aform -> show_content_order("ci"); + + //increase order of items in category + }elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && $qs[3] == "inc" && isset($qs[4]) ){ + $message = $adb -> dbSetOrder("inc", "ci", $qs[4]); + $ns -> tablerender("", "
    ".$message."
    "); + $aform -> show_content_order("ci"); + + //decrease order of items in category + }elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && $qs[3] == "dec" && isset($qs[4]) ){ + $message = $adb -> dbSetOrder("dec", "ci", $qs[4]); + $ns -> tablerender("", "
    ".$message."
    "); + $aform -> show_content_order("ci"); + + //increase category order + }elseif($qs[0] == "order" && $qs[1] == "inc" && isset($qs[2]) ){ + $message = $adb -> dbSetOrder("inc", "cc", $qs[2]); + $ns -> tablerender("", "
    ".$message."
    "); + $aform -> show_order("admin"); + + //decrease category order + }elseif($qs[0] == "order" && $qs[1] == "dec" && isset($qs[2]) ){ + $message = $adb -> dbSetOrder("dec", "cc", $qs[2]); + $ns -> tablerender("", "
    ".$message."
    "); + $aform -> show_order("admin"); + + + + + }elseif($qs[0] == "submitted" && !isset($qs[1]) ){ + $aform -> show_submitted(); + + + + + }elseif($qs[0] == "option" && !isset($qs[1]) ){ + $aform -> show_options(); + + }elseif($qs[0] == "option" && isset($qs[1]) && (is_numeric($qs[1]) || $qs[1] == "default") ){ + $aform -> show_options_cat(); + + + + + //category content manager : choose category + }elseif($qs[0] == "manager" && !isset($qs[1]) ){ + if(!getperms("0")){ header("location:".e_SELF); exit; } + //$aform -> show_admin_contentmanager(); + $aform -> manager(); + + //category content manager : view contentmanager + }elseif($qs[0] == "manager" && isset($qs[1]) && is_numeric($qs[1]) ){ + if(!getperms("0")){ header("location:".e_SELF); exit; } + if(isset($qs[2])){ + $message = $adb -> dbAssignAdmins("admin", intval($qs[1]), $qs[2]); + $ns -> tablerender("", "
    ".$message."
    "); + } + $aform -> manager_category(); + + + + + //overview all categories + }elseif($qs[0] == "cat" && !isset($qs[1]) ){ + $aform -> manage_cat(); + + //create category + }elseif($qs[0] == "cat" && $qs[1] == "create" ){ + $newqs = array_reverse($qs); + if($newqs[0] == "pc"){ //category; create redirect + $message = CONTENT_ADMIN_CAT_LAN_11."

    "; + $message .= "

    ".CONTENT_ADMIN_CAT_LAN_50."

    "; + $message .= " + ".CONTENT_ADMIN_CAT_LAN_44." ".CONTENT_ADMIN_CAT_LAN_43."
    + ".CONTENT_ADMIN_CAT_LAN_42." ".CONTENT_ADMIN_CAT_LAN_43."
    + "; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(e_ADMIN."footer.php"); + exit; + } + $aform -> show_create_category(); + + //edit category + }elseif($qs[0] == "cat" && $qs[1] == "edit" && is_numeric($qs[2]) ){ + $newqs = array_reverse($qs); + if($newqs[0] == "pu"){ //category; update redirect + $message = CONTENT_ADMIN_CAT_LAN_12."

    + ".CONTENT_ADMIN_CAT_LAN_42." ".CONTENT_ADMIN_CAT_LAN_43."
    + ".CONTENT_ADMIN_CAT_LAN_53." ".CONTENT_ADMIN_CAT_LAN_43."
    "; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(e_ADMIN."footer.php"); + exit; + } + $aform -> show_create_category(); + + + + //restrict : choose category + }elseif($qs[0] == "restrict" && !isset($qs[1]) ){ + //if(!getperms("0")){ header("location:".e_SELF); exit; } + $aform -> restrict(); + + //restrict : view restrict for main parent + }elseif($qs[0] == "restrict" && isset($qs[1]) && is_numeric($qs[1]) ){ + //if(!getperms("0")){ header("location:".e_SELF); exit; } + $aform -> restrict_category(); + } + +} + +// ##### End -------------------------------------------------------------------------------------- + + +// ##### Display options -------------------------------------------------------------------------- +function admin_content_config_adminmenu(){ + + global $sql, $plugintable, $aa; + + //toggle to show categories in admin right hand menu + $showadmincat = TRUE; + + if(e_QUERY){ + $qs = explode(".", e_QUERY); + } + + if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && $qs[1] == "create"){ + $act = $qs[0].".".$qs[1]; + + }elseif(isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){ + $act = $qs[0].".".$qs[1]; + + }else{ + $act = (isset($qs[0]) ? $qs[0] : ""); + } + + if($act==""){$act="content";} + + $var['content']['text'] = CONTENT_ADMIN_MENU_LAN_0; + $var['content']['link'] = e_SELF; + + $var['content.create']['text'] = CONTENT_ADMIN_MENU_LAN_1; + $var['content.create']['link'] = e_SELF."?content.create"; + + $var['cat']['text'] = CONTENT_ADMIN_MENU_LAN_2; + $var['cat']['link'] = e_SELF."?cat"; + + $var['cat.create']['text'] = CONTENT_ADMIN_MENU_LAN_3; + $var['cat.create']['link'] = e_SELF."?cat.create"; + + $var['order']['text'] = CONTENT_ADMIN_MENU_LAN_15; + $var['order']['link'] = e_SELF."?order"; + + $var['option']['text'] = CONTENT_ADMIN_MENU_LAN_6; + $var['option']['link'] = e_SELF."?option"; + + if(getperms("0")){ + $var['manager']['text'] = CONTENT_ADMIN_MENU_LAN_17; + $var['manager']['link'] = e_SELF."?manager"; + } + + if($submittedcontents = $sql -> db_Count($plugintable, "(*)", "WHERE content_refer ='sa' ")){ + $var['submitted']['text'] = CONTENT_ADMIN_MENU_LAN_4." (".$submittedcontents.")"; + $var['submitted']['link'] = e_SELF."?submitted"; + } + + show_admin_menu(CONTENT_ADMIN_MENU_LAN_6, $act,$var); + + if(isset($qs[0]) && $qs[0] == "option" && isset($qs[1])){ + unset($var); + $var=array(); + $var['creation']['text'] = CONTENT_ADMIN_MENU_LAN_7; + $var['catcreation']['text'] = CONTENT_ADMIN_MENU_LAN_23; + $var['submission']['text'] = CONTENT_ADMIN_MENU_LAN_8; + $var['paththeme']['text'] = CONTENT_ADMIN_MENU_LAN_9; + $var['general']['text'] = CONTENT_ADMIN_MENU_LAN_10; + $var['menu']['text'] = CONTENT_ADMIN_MENU_LAN_14; + + $sql = new db; + $category_total = $sql -> db_Select($plugintable, "content_heading", "content_id='".$qs[1]."' "); + list($content_heading) = $sql -> db_Fetch(); + + show_admin_menu(CONTENT_ADMIN_MENU_LAN_6.": ".$content_heading."", $act, $var, TRUE); + + unset($var); + $var=array(); + $var['recentpages']['text'] = CONTENT_ADMIN_MENU_LAN_11; + $var['catpages']['text'] = CONTENT_ADMIN_MENU_LAN_12; + $var['contentpages']['text'] = CONTENT_ADMIN_MENU_LAN_13; + $var['authorpage']['text'] = CONTENT_ADMIN_MENU_LAN_18; + $var['archivepage']['text'] = CONTENT_ADMIN_MENU_LAN_16; + $var['toppage']['text'] = CONTENT_ADMIN_MENU_LAN_20; + $var['scorepage']['text'] = CONTENT_ADMIN_MENU_LAN_22; + show_admin_menu(CONTENT_ADMIN_MENU_LAN_21.": ".$content_heading."", $act, $var, TRUE); + + }else{ + + if($showadmincat){ + $sql2 = new db; + if($category_total = $sql2 -> db_Select($plugintable, "content_id, content_heading", "content_parent='0' ")){ + while($row = $sql2 -> db_Fetch()){ + + unset($var); + $var=array(); + + $array = $aa -> getCategoryTree("", $row['content_id'], FALSE); //get all categories from each main parent + $newarray = array_merge_recursive($array); + + $newparent=array(); + for($a=0;$a $value){ + $var['c'.$key]['text'] = $value; + $var['c'.$key]['link'] = e_SELF."?content.".$key; + } + if( isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){ + $act = ""; + }elseif( isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && ($qs[1] == "create" || $qs[1] == "edit") ){ + $act = ""; + }elseif( isset($qs[0]) && $qs[0] == "order" ){ + $act = ""; + }elseif( isset($qs[0]) && $qs[0] == "manager" ){ + $act = ""; + }else{ + if(isset($qs[0]) && isset($qs[1]) ){ + $act = "c".$qs[1]; + }else{ + $act = "c"; + } + } + + show_admin_menu(CONTENT_ADMIN_MENU_LAN_5." : ".$row['content_heading']."", $act, $var); + } + } + } + } + +} +// ##### End -------------------------------------------------------------------------------------- + +require_once(e_ADMIN."footer.php"); + +?> \ No newline at end of file diff --git a/e107_plugins/content/content.js b/e107_plugins/content/content.js new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/content/content.php b/e107_plugins/content/content.php new file mode 100644 index 000000000..100e2be25 --- /dev/null +++ b/e107_plugins/content/content.php @@ -0,0 +1,1470 @@ + setPageTitle(); + +require_once(HEADERF); + +//post comment +if(isset($_POST['commentsubmit'])){ + if(!is_object($sql)){ $sql = new db; } + if(!$sql -> db_Select($plugintable, "content_comment", "content_id='".intval($qs[1])."' ")){ + header("location:".e_BASE."index.php"); exit; + }else{ + $row = $sql -> db_Fetch(); + if(ANON === TRUE || USER === TRUE){ + //enter_comment($author_name, $comment, $table, $id, $pid, $subject) + $author = ($_POST['author_name'] ? $_POST['author_name'] : USERNAME); + $pid = "0"; + $rated = (isset($_POST['rateindex']) ? $_POST['rateindex'] : ""); + $cobj -> enter_comment($author, $_POST['comment'], $plugintable, $qs[1], $pid, $_POST['subject'], $rated); + if($qs[0] == "content" && is_numeric($qs[1])){ + if(!isset($qs[2])){ $cacheid = 1; }else{ $cacheid = $qs[2]; } + $e107cache->clear("comment.$plugintable.$qs[1].$cacheid"); + $e107cache->clear("$plugintable.content.$qs[1].$cacheid"); + } + if($qs[0] == "cat" && is_numeric($qs[1])){ + $e107cache->clear("comment.$plugintable.$qs[1]"); + } + $main = $aa -> getMainParent( (is_numeric($qs[1]) ? $qs[1] : $qs[2]) ); + $e107cache->clear("$plugintable.recent.$main"); + $e107cache->clear("$plugintable.cat.list.$main"); + $e107cache->clear("$plugintable.cat.$main"); + $e107cache->clear("$plugintable.author.$main"); + $e107cache->clear("$plugintable.top.$main"); + $e107cache->clear("$plugintable.score.$main"); + } + } +} + +//check active keyword search +$resultmenu = FALSE; +$searchfieldname = "searchfield_page"; +$searchfieldmenuname = "searchfieldmenu_menu"; +if(isset($_POST['searchsubmit']) || isset($_POST[$searchfieldname]) || isset($_POST[$searchfieldmenuname])){ //if active keyword search + if(isset($_POST[$searchfieldname]) && $_POST[$searchfieldname] != "" && $_POST[$searchfieldname] != CONTENT_LAN_18){ + $resultmenu = TRUE; + $searchkeyword = $_POST[$searchfieldname]; + } + if(isset($_POST[$searchfieldmenuname]) && $_POST[$searchfieldmenuname] != "" && $_POST[$searchfieldmenuname] != CONTENT_LAN_18){ + $resultmenu = TRUE; + $searchkeyword = $_POST[$searchfieldmenuname]; + } + //show search results + if($resultmenu == TRUE){ show_content_search_result($searchkeyword); } +} + +// ##### REDIRECTION MANAGEMENT ------------------------------------------------------- +//parent overview +if(!e_QUERY){ + show_content(); +}else{ + //recent of parent='X' + if( $qs[0] == "recent" && is_numeric($qs[1]) && intval($qs[1])>0 && ( !isset($qs[2]) || substr($qs[2],0,5) == "order" ) ){ + show_content_recent(); + + //item + }elseif( $qs[0] == "content" && is_numeric($qs[1]) && intval($qs[1])>0 ){ + show_content_item(); + + //all categories of parent='X' + }elseif( $qs[0] == "cat" && $qs[1] == "list" && is_numeric($qs[2]) && intval($qs[2])>0 && !isset($qs[3]) ){ + show_content_cat_all(); + + //category of parent='X' + }elseif( $qs[0] == "cat" && is_numeric($qs[1]) && intval($qs[1])>0 && (!isset($qs[2]) || $qs[2] == "view" || $qs[2] == "comment" || substr($qs[2],0,5) == "order") ){ + + if( isset($qs[2]) && $qs[2] == "comment" ){ + show_content_cat("comment"); + }elseif( isset($qs[2]) && $qs[2] == "view" ){ + show_content_cat('view'); + }else{ + show_content_cat(); + } + + //top rated of parent='X' + }elseif( $qs[0] == "top" && is_numeric($qs[1]) && intval($qs[1])>0 && !isset($qs[2]) ){ + show_content_top(); + + //top score of parent='X' + }elseif( $qs[0] == "score" && is_numeric($qs[1]) && intval($qs[1])>0 ){ + // && !isset($qs[2]) + show_content_score(); + + //authorlist of parent='X' + }elseif( $qs[0] == "author" && $qs[1] == "list" && is_numeric($qs[2]) && intval($qs[2])>0 && ( !isset($qs[3]) || substr($qs[3],0,5) == "order" ) ){ + show_content_author_all(); + + //authorlist of content_id='X' + }elseif( $qs[0] == "author" && is_numeric($qs[1]) && intval($qs[1])>0 && (!isset($qs[2]) || substr($qs[2],0,5) == "order") ){ + show_content_author(); + + //archive of parent='X' + }elseif( $qs[0] == "list" && is_numeric($qs[1]) && intval($qs[1])>0 ){ + show_content_archive(); + }else{ + //js_location(e_SELF); + header("location:".e_SELF); + } +} +// ##### ------------------------------------------------------------------------------ + +// ##### CONTENT SEARCH MENU ---------------------------- +function show_content_search_menu($mode, $mainparent){ + global $qs, $plugindir, $content_shortcodes, $tp, $ns, $rs, $aa; + global $plugintable, $gen, $content_pref; + global $CONTENT_SEARCH_TABLE_SELECT, $CONTENT_SEARCH_TABLE_ORDER, $CONTENT_SEARCH_TABLE_KEYWORD; + + if( (isset($content_pref["content_navigator_{$mode}"]) && $content_pref["content_navigator_{$mode}"]) || (isset($content_pref["content_search_{$mode}"]) && $content_pref["content_search_{$mode}"]) || (isset($content_pref["content_ordering_{$mode}"]) && $content_pref["content_ordering_{$mode}"]) ){ + + if(!isset($CONTENT_SEARCH_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_search_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_search_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_search_template.php"); + }else{ + require_once($plugindir."templates/default/content_search_template.php"); + } + } + } + if(isset($content_pref["content_navigator_{$mode}"]) && $content_pref["content_navigator_{$mode}"]){ + $CONTENT_SEARCH_TABLE_SELECT = $aa -> showOptionsSelect("page", $mainparent); + } + if(isset($content_pref["content_search_{$mode}"]) && $content_pref["content_search_{$mode}"]){ + $CONTENT_SEARCH_TABLE_KEYWORD = $aa -> showOptionsSearch("page", $mainparent); + } + if(isset($content_pref["content_ordering_{$mode}"]) && $content_pref["content_ordering_{$mode}"]){ + $CONTENT_SEARCH_TABLE_ORDER = $aa -> showOptionsOrder("page", $mainparent); + } + + $text = $tp -> parseTemplate($CONTENT_SEARCH_TABLE, FALSE, $content_shortcodes); + + if($content_pref["content_searchmenu_rendertype"] == "2"){ + $caption = CONTENT_LAN_77; + $ns -> tablerender($caption, $text); + }else{ + echo $text; + } + } + return TRUE; + +} + +function show_content_search_result($searchkeyword){ + global $row, $qs, $content_shortcodes, $ns, $rs, $tp, $plugindir, $plugintable, $gen, $aa, $content_pref, $datequery, $gen, $mainparent, $content_icon_path; + + $mainparent = $aa -> getMainParent( (is_numeric($qs[1]) ? $qs[1] : intval($qs[2])) ); + $content_pref = $aa -> getContentPref($mainparent); + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $searchkeyword = $tp -> toDB($searchkeyword); + $qry .= " AND (content_heading REGEXP '".$searchkeyword."' OR content_subheading REGEXP '".$searchkeyword."' OR content_summary REGEXP '".$searchkeyword."' OR content_text REGEXP '".$searchkeyword."' ) "; + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + + $sqlsr = ""; + if(!is_object($sqlsr)){ $sqlsr = new db; } + if(!$sqlsr -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_icon, content_datestamp", " ".$qry." ".$datequery." ORDER BY content_heading")){ + $textsr = "
    ".CONTENT_SEARCH_LAN_0."
    "; + }else{ + if(!isset($CONTENT_SEARCHRESULT_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_searchresult_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_searchresult_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_searchresult_template.php"); + }else{ + require_once($plugindir."templates/default/content_searchresult_template.php"); + } + } + } + $content_searchresult_table_string = ""; + if(!is_object($gen)){ $gen = new convert; } + while($row = $sqlsr -> db_Fetch()){ + + $row['content_heading'] = parsesearch($row['content_heading'], $searchkeyword, "full"); + $row['content_subheading'] = parsesearch($row['content_subheading'], $searchkeyword, "full"); + $row['content_text'] = parsesearch($row['content_text'], $searchkeyword, ""); + + $content_searchresult_table_string .= $tp -> parseTemplate($CONTENT_SEARCHRESULT_TABLE, FALSE, $content_shortcodes); + } + $textsr = $CONTENT_SEARCHRESULT_TABLE_START.$content_searchresult_table_string.$CONTENT_SEARCHRESULT_TABLE_END; + } + $caption = CONTENT_LAN_20; + $ns -> tablerender($caption, $textsr); + require_once(FOOTERF); + exit; +} + +function parsesearch($text, $match, $amount){ + $text = strip_tags($text); + $temp = stristr($text,$match); + $pos = strlen($text)-strlen($temp); + + if($amount == "full"){ + }else{ + if($pos < 140){ + $text = "...".substr($text, 0, 140)."..."; + }else{ + $text = "...".substr($text, ($pos-140), 280)."..."; + } + } + $text = preg_replace("/".$match."/i", "$match", $text); + return($text); +} + +// ##### CONTENT CACHE PRE ------------------------------ +function CachePre($cachestring=''){ + global $e107cache; + if($cache = $e107cache->retrieve($cachestring)){ + return $cache; + }else{ + ob_start(); + } +} +// ##### CONTENT CACHE POST ------------------------------ +function CachePost($cachestring=''){ + global $pref, $e107cache; + if($pref['cachestatus']){ + $cache = ob_get_contents(); + $e107cache->set($cachestring, $cache); + } + ob_end_flush(); // dump collected data +} + +// ##### CONTENT TYPE LIST ------------------------------ +function show_content(){ + global $qs, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $content_cat_icon_path_large, $content_cat_icon_path_small, $datequery, $content_icon_path, $eArrayStorage, $contenttotal, $row; + + if(is_readable(e_THEME.$pref['sitetheme']."/content/content_type_template.php")){ + require_once(e_THEME.$pref['sitetheme']."/content/content_type_template.php"); + }else{ + require_once(e_PLUGIN."content/templates/content_type_template.php"); + } + + $cachestr = "$plugintable.typelist"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + if(!is_object($sql)){ $sql = new db; } + if(!$sql -> db_Select($plugintable, "*", "content_parent = '0' AND content_class REGEXP '".e_CLASS_REGEXP."' ".$datequery." ORDER BY round(content_order)")){ + $text .= "
    ".CONTENT_LAN_21."
    "; + }else{ + + $sql2 = ""; + $content_type_table_string = ""; + $plist = $sql->db_getList(); + foreach($plist as $row) + { + if(!is_object($sql2)){ $sql2 = new db; } + + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + $content_pref["content_cat_icon_path_large"] = ($content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/" ); + $content_pref["content_cat_icon_path_small"] = ($content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/" ); + $content_cat_icon_path_large = $tp->replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp->replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]); + + $array = $aa -> getCategoryTree("", $row['content_id'], TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $contenttotal = $sql2 -> db_Count($plugintable, "(*)", "WHERE content_refer != 'sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."'" ); + $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE, FALSE, $content_shortcodes); + } + + $SUBMIT_LINE = FALSE; + $submit = FALSE; + $sql3 = ""; + if(!is_object($sql3)){ $sql3 = new db; } + if($sql3 -> db_Select($plugintable, "content_id, content_pref", "content_parent = '0' ".$datequery." ORDER BY content_parent")){ + while($row = $sql3 -> db_Fetch()){ + if(isset($row['content_pref']) && $row['content_pref']){ + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + } + if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ + $submit = TRUE; + break; + } + } + if($submit === TRUE){ + $content_type_table_string .= $CONTENT_TYPE_TABLE_LINE; + $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_SUBMIT, FALSE, $content_shortcodes); + $SUBMIT_LINE = TRUE; + } + } + + if(USERID){ + $personalmanagercheck = FALSE; + $array = $aa -> getCategoryTree("", "", TRUE); + $catarray = array_keys($array); + $qry = ""; + foreach($catarray as $catid){ + $qry .= " content_id='".$catid."' || "; + } + $qry = substr($qry,0,-3); + if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " ".$qry." ")){ + while($row = $sql -> db_Fetch()){ + if(isset($row['content_pref']) && $row['content_pref']){ + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + } + if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ + $personalmanagercheck = TRUE; + break; + } + } + } + if($personalmanagercheck == TRUE){ + if($SUBMIT_LINE != TRUE){ + $content_type_table_string .= $CONTENT_TYPE_TABLE_LINE; + } + $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_MANAGER, FALSE, $content_shortcodes); + } + } + $text = $CONTENT_TYPE_TABLE_START.$content_type_table_string.$CONTENT_TYPE_TABLE_END; + } + $caption = CONTENT_LAN_22; + $ns -> tablerender($caption, $text); + $cachecheck = CachePost($cachestr); +} + +// ##### CONTENT ARCHIVE ------------------------------------------ +function show_content_archive(){ + global $row, $ns, $plugindir, $plugintable, $sql, $aa, $rs, $e107cache, $tp, $pref, $content_pref, $cobj; + global $qs, $searchkeyword, $nextprevquery, $from, $number, $mainparent, $content_shortcodes; + global $CONTENT_ARCHIVE_TABLE, $CONTENT_ARCHIVE_TABLE_START, $datequery, $CONTENT_ARCHIVE_TABLE_LETTERS; + global $CONTENT_SEARCH_TABLE_SELECT, $CONTENT_SEARCH_TABLE_ORDER, $CONTENT_SEARCH_TABLE_KEYWORD, $CONTENT_ARCHIVE_TABLE_AUTHOR; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("archive", $mainparent); //show navigator/search/order menu + + if(!isset($CONTENT_ARCHIVE_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_archive_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_archive_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_archive_template.php"); + }else{ + require_once($plugindir."templates/default/content_archive_template.php"); + } + } + } + + $cachestr = "$plugintable.archive.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $text = ""; + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $number = (isset($content_pref["content_archive_nextprev_number"]) && $content_pref["content_archive_nextprev_number"] ? $content_pref["content_archive_nextprev_number"] : "30"); + $order = $aa -> getOrder(); + $nextprevquery = (isset($content_pref["content_archive_nextprev"]) && $content_pref["content_archive_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + $sql1 = new db; + + if(isset($content_pref["content_archive_letterindex"]) && $content_pref["content_archive_letterindex"]){ + $distinctfirstletter = $sql -> db_Select($plugintable, " DISTINCT(content_heading) ", "content_refer != 'sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ORDER BY content_heading ASC "); + while($row = $sql -> db_Fetch()){ + $head = $tp->toHTML($row['content_heading'], TRUE); + if(ord($head) < 128) { + $head_sub = strtoupper(substr($head,0,1)); + }else{ + $head_sub = substr($head,0,2); + } + $arrletters[] = $head_sub; + } + $arrletters = array_unique($arrletters); + $arrletters = array_values($arrletters); + sort($arrletters); + + if ($distinctfirstletter > 1){ + $CONTENT_ARCHIVE_TABLE_LETTERS = "
    "; + $int=TRUE; + for($i=0;$i0-9 "; + } + $int=FALSE; + }else{ + if(isset($qs[2]) && strtoupper($qs[2]) == strtoupper($arrletters[$i])){ + $class = 'nextprev_current'; + }else{ + $class = 'nextprev_link'; + } + $CONTENT_ARCHIVE_TABLE_LETTERS .= "".strtoupper($arrletters[$i])." "; + } + } + if(!isset($qs[2]) || (isset($qs[2]) && strtolower($qs[2])=='all') ){ + $class = 'nextprev_current'; + }else{ + $class = 'nextprev_link'; + } + $CONTENT_ARCHIVE_TABLE_LETTERS .= "ALL "; + $CONTENT_ARCHIVE_TABLE_LETTERS .= ""; + } + //check letter + if(isset($qs[2])){ + if($qs[2] == 'all'){ + $qry .= ''; + }elseif(strlen($qs[2]) == 1 && $qs[2] == '0'){ + $qry .= " AND content_heading NOT REGEXP '^[[:alpha:]]' "; + }elseif(strlen($qs[2]) == 1 && !is_numeric($qs[2]) ){ + $qry .= " AND content_heading LIKE '".$tp->toDB($qs[2])."%' "; + }else{ + $qry .= ''; + } + } + } + $CONTENT_ARCHIVE_TABLE_START = $tp -> parseTemplate($CONTENT_ARCHIVE_TABLE_START, FALSE, $content_shortcodes); + + $contenttotal = $sql1 -> db_Count($plugintable, "(*)", "WHERE content_refer !='sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' "); + if($from > $contenttotal-1){ header("location:".e_SELF); exit; } + + if($item = $sql1 -> db_Select($plugintable, "*", "content_refer !='sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ".$order." ".$nextprevquery )){ + $content_archive_table_string = ""; + while($row = $sql1 -> db_Fetch()){ + $CONTENT_ARCHIVE_TABLE_AUTHOR = $aa -> prepareAuthor("archive", $row['content_author'], $row['content_id']); + $content_archive_table_string .= $tp -> parseTemplate($CONTENT_ARCHIVE_TABLE, FALSE, $content_shortcodes); + } + $text .= $CONTENT_ARCHIVE_TABLE_START.$content_archive_table_string.$CONTENT_ARCHIVE_TABLE_END; + } + $text = $aa -> getCrumbPage("archive", $array, $mainparent).$text; + //$caption = CONTENT_LAN_84; + $caption = $content_pref['content_archive_caption']; + $ns->tablerender($caption, $text); + $aa -> ShowNextPrev("archive", $from, $number, $contenttotal); + $cachecheck = CachePost($cachestr); +} + +//this function renders the preview of a content_item +//used in recent list, view author list, category items list +function displayPreview($qry){ + global $qs, $array, $row, $gen, $rater, $aa, $sql2, $tp, $plugintable, $plugindir, $content_shortcodes, $content_pref, $mainparent, $CONTENT_RECENT_TABLE_AUTHORDETAILS; + global $CONTENT_RECENT_TABLE_START, $CONTENT_RECENT_TABLE_END, $CONTENT_RECENT_TABLE, $CONTENT_RECENT_TABLE_INFOPRE, $CONTENT_RECENT_TABLE_INFOPOST; + + if(!isset($CONTENT_RECENT_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_recent_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_recent_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_recent_template.php"); + }else{ + require_once($plugindir."templates/default/content_recent_template.php"); + } + } + } + if($resultitem = $sql2 -> db_Select($plugintable, "*", $qry )){ + $content_recent_table_string = ""; + while($row = $sql2 -> db_Fetch()){ + $CONTENT_RECENT_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("list", $row['content_author'], $row['content_id']); + $rdate = $tp -> parseTemplate('{CONTENT_RECENT_TABLE_DATE}', FALSE, $content_shortcodes); + $rauth = $tp -> parseTemplate('{CONTENT_RECENT_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes); + $rep = $tp -> parseTemplate('{CONTENT_RECENT_TABLE_EPICONS}', FALSE, $content_shortcodes); + $rpar = $tp -> parseTemplate('{CONTENT_RECENT_TABLE_PARENT}', FALSE, $content_shortcodes); + $redi = $tp -> parseTemplate('{CONTENT_RECENT_TABLE_EDITICON}', FALSE, $content_shortcodes); + $CONTENT_RECENT_TABLE_INFOPRE = FALSE; + $CONTENT_RECENT_TABLE_INFOPOST = FALSE; + if ($rdate!="" || $rauth!="" || $rep!="" || $rpar!="" || $redi!="" ) { + $CONTENT_RECENT_TABLE_INFOPRE = TRUE; + $CONTENT_RECENT_TABLE_INFOPOST = TRUE; + } + + $content_recent_table_string .= $tp -> parseTemplate($CONTENT_RECENT_TABLE, FALSE, $content_shortcodes); + } + } + $text = $CONTENT_RECENT_TABLE_START.$content_recent_table_string.$CONTENT_RECENT_TABLE_END; + + return $text; +} + +// ##### RECENT LIST ------------------------------------ +function show_content_recent(){ + global $qs, $sql2, $plugindir, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj; + global $nextprevquery, $from, $number, $mainparent, $datequery, $content_icon_path, $CONTENT_RECENT_TABLE; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("recent", $mainparent); //show navigator/search/order menu + + $cachestr = "$plugintable.recent.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $order = $aa -> getOrder(); + $number = ($content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5"); + $nextprevquery = ($content_pref["content_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + + $contenttotal = $sql2 -> db_Count($plugintable, "(*)", "WHERE content_refer != 'sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " ); + + if($from > $contenttotal-1){ js_location(e_SELF); } + + $recentqry = "content_refer !='sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ".$order." ".$nextprevquery; + $text = displayPreview($recentqry); + $text = $aa -> getCrumbPage("recent", $array, $mainparent).$text; + $caption = $content_pref['content_list_caption']; + if(isset($content_pref['content_list_caption_append_name']) && $content_pref['content_list_caption_append_name']){ + $caption .= " ".$array[intval($qs[1])][1]; + } + $ns -> tablerender($caption, $text); + $aa -> ShowNextPrev("", $from, $number, $contenttotal); + $cachecheck = CachePost($cachestr); +} + +// ##### CATEGORY LIST ------------------------------------ +function show_content_cat_all(){ + global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $aa, $e107cache, $tp, $pref, $content_pref, $totalitems; + global $sql, $datequery, $amount, $from, $content_cat_icon_path_large, $content_icon_path, $n, $mainparent, $CONTENT_CAT_TABLE, $CONTENT_CAT_TABLE_AUTHORDETAILS; + global $row, $datestamp, $comment_total, $gen, $authordetails, $rater, $crumb; + global $CONTENT_CAT_TABLE_INFO_PRE, $CONTENT_CAT_TABLE_INFO_POST, $CONTENT_CAT_LIST_TABLE_INFO_PRE, $CONTENT_CAT_LIST_TABLE_INFO_POST; + + unset($text); + + $mainparent = $aa -> getMainParent(intval($qs[2])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("catall", $mainparent); //show navigator/search/order menu + + if(!isset($CONTENT_CAT_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_cat_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_cat_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_cat_template.php"); + }else{ + require_once($plugindir."templates/default/content_cat_template.php"); + } + } + } + + $cachestr = "$plugintable.cat.list.$qs[2]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $order = $aa -> getOrder(); + $number = (isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5"); + $nextprevquery = (isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + + $content_cat_table_string = ""; + $newarray = array_merge_recursive($array); + for($a=0;$a $value){ + $totalitems = $aa -> countCatItems($key); + $sql -> db_Select($plugintable, "*", "content_id = '".$key."' "); + $row = $sql -> db_Fetch(); + + $date = $tp -> parseTemplate('{CONTENT_CAT_TABLE_DATE}', FALSE, $content_shortcodes); + $auth = $tp -> parseTemplate('{CONTENT_CAT_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes); + $ep = $tp -> parseTemplate('{CONTENT_CAT_TABLE_EPICONS}', FALSE, $content_shortcodes); + $com = $tp -> parseTemplate('{CONTENT_CAT_TABLE_COMMENT}', FALSE, $content_shortcodes); + $CONTENT_CAT_TABLE_INFO_PRE = FALSE; + $CONTENT_CAT_TABLE_INFO_POST = FALSE; + if ($date!="" || $auth!="" || $ep!="" || $com!="" ) { + $CONTENT_CAT_TABLE_INFO_PRE = TRUE; + $CONTENT_CAT_TABLE_INFO_POST = TRUE; + } + $CONTENT_CAT_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("catall", $row['content_author'], $row['content_id']); + $content_cat_table_string .= $tp -> parseTemplate($CONTENT_CAT_TABLE, FALSE, $content_shortcodes); + + } + $text = $CONTENT_CAT_TABLE_START.$content_cat_table_string.$CONTENT_CAT_TABLE_END; + $text = $aa -> getCrumbPage("catall", $array, $mainparent).$text; + $caption = $content_pref['content_catall_caption']; + $ns -> tablerender($caption, $text); + $cachecheck = CachePost($cachestr); +} + +function show_content_cat($mode=""){ + global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj, $datequery, $from; + global $CONTENT_RECENT_TABLE, $CONTENT_CAT_LIST_TABLE, $CONTENT_CAT_LISTSUB_TABLE_START, $CONTENT_CAT_LISTSUB_TABLE, $CONTENT_CAT_LISTSUB_TABLE_END, $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS, $CONTENT_CAT_LIST_TABLE_INFO_PRE, $CONTENT_CAT_LIST_TABLE_INFO_POST; + global $content_cat_icon_path_small, $content_cat_icon_path_large, $content_icon_path, $mainparent, $totalparent, $totalsubcat; + global $row, $datestamp, $comment_total, $gen, $authordetails, $rater, $crumb, $amount; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = "0,0.".implode(",0.", array_keys($array)); + $qry = " content_id = '".intval($qs[1])."' AND content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' "; + + show_content_search_menu("cat", $mainparent); //show navigator/search/order menu + + if(!isset($CONTENT_CAT_LIST_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_cat_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_cat_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_cat_template.php"); + }else{ + require_once($plugindir."templates/default/content_cat_template.php"); + } + } + } + + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $order = $aa -> getOrder(); + $number = (isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5"); + $nextprevquery = (isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + $capqs = array_reverse($array[intval($qs[1])]); + $caption = $content_pref['content_cat_caption']; + if(isset($content_pref['content_cat_caption_append_name']) && $content_pref['content_cat_caption_append_name']){ + $caption .= " ".$capqs[0]; + } + + // parent article + if(isset($content_pref["content_cat_showparent"]) && $content_pref["content_cat_showparent"]){ + if(!$resultparent = $sql -> db_Select($plugintable, "*", $qry )){ + header("location:".e_SELF."?cat.list.".$mainparent); exit; + }else{ + //if 'view' override the items pref to show only limited text adn show full catetgory text instead + if($mode=='view' || $mode=='comment'){ + $content_pref['content_cat_text_char'] = 'all'; + } + $row = $sql -> db_Fetch(); + $date = $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_DATE}', FALSE, $content_shortcodes); + $auth = $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes); + $ep = $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_EPICONS}', FALSE, $content_shortcodes); + $com = $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_COMMENT}', FALSE, $content_shortcodes); + if ($date!="" || $auth!="" || $ep!="" || $com!="" ) { + $CONTENT_CAT_LIST_TABLE_INFO_PRE = TRUE; + $CONTENT_CAT_LIST_TABLE_INFO_POST = TRUE; + } + $totalparent = $aa -> countCatItems($row['content_id']); + $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("cat", $row['content_author'], $row['content_id']); + $textparent = $tp -> parseTemplate($CONTENT_CAT_LIST_TABLE, FALSE, $content_shortcodes); + } + } + + $cachestr = "$plugintable.cat.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + + if(!$mode || $mode == "" || $mode=='view'){ + $check = (isset($qs[1]) && is_numeric($qs[1]) ? intval($qs[1]) : intval($mainparent)); + $array1 = $aa -> getCategoryTree("", $check, TRUE); + $newarray = array_merge_recursive($array1); + $levels = 0; + if(isset($content_pref['content_cat_levels']) && is_numeric($content_pref['content_cat_levels']) && $content_pref['content_cat_levels']>0){ + $levels = intval($content_pref['content_cat_levels']) + 1; + } + if($levels>0){ + for($a=0;$a CONTENTREGEXP($validsub)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' "; + + //list subcategories + if(isset($content_pref["content_cat_showparentsub"]) && $content_pref["content_cat_showparentsub"]){ + + $content_cat_listsub_table_string = ""; + for($i=0;$i db_Select($plugintable, "content_id, content_heading, content_subheading, content_icon, content_parent", " content_id = '".$subparent[$i]."' AND ".$subqry." " )){ + while($row = $sql -> db_Fetch()){ + $totalsubcat = $aa -> countCatItems($row['content_id']); + $content_cat_listsub_table_string .= $tp -> parseTemplate($CONTENT_CAT_LISTSUB_TABLE, FALSE, $content_shortcodes); + } + $textsubparent = $CONTENT_CAT_LISTSUB_TABLE_START.$content_cat_listsub_table_string.$CONTENT_CAT_LISTSUB_TABLE_END; + $captionsubparent = $content_pref['content_cat_sub_caption']; + } + } + } + + //list all contents within this category + unset($text); + + //also show content items of subcategories of this category ? + if(isset($content_pref["content_cat_listtype"]) && $content_pref["content_cat_listtype"]){ + $validitem = implode(",", $subparent); + $qrycat = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validitem)."' "; + }else{ + $qrycat = " content_parent = '".intval($qs[1])."' "; + } + $qrycat = " content_refer !='sa' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' AND ".$qrycat." "; + $contenttotal = $sql -> db_Count($plugintable, "(*)", "WHERE ".$qrycat); + $childqry = $qrycat." ".$order." ".$nextprevquery; + $textchild = displayPreview($childqry); + $captionchild = $content_pref['content_cat_item_caption']; + + $crumbpage = $aa -> getCrumbPage("cat", $array, $qs[1]); + if(isset($textparent)){ + $textparent = $crumbpage.$textparent; + }else{ + $textchild = $crumbpage.$textchild; + } + if(isset($content_pref["content_cat_menuorder"]) && $content_pref["content_cat_menuorder"] == "1"){ + if(isset($content_pref["content_cat_rendertype"]) && $content_pref["content_cat_rendertype"] == "1"){ + if(isset($textparent)){ $ns -> tablerender($caption, $textparent); } + if(isset($textsubparent)){ $ns -> tablerender($captionsubparent, $textsubparent); } + if(isset($textchild)){ $ns -> tablerender($captionchild, $textchild); } + }else{ + $ns -> tablerender($caption, (isset($textparent) ? $textparent : "").(isset($textsubparent) ? $textsubparent : "").$textchild); + } + if(isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"]){ + $aa->ShowNextPrev(FALSE, $from, $number, $contenttotal); + } + }else{ + if(isset($content_pref["content_cat_rendertype"]) && $content_pref["content_cat_rendertype"] == "1"){ + if(isset($textchild)){ $ns -> tablerender($captionchild, $textchild); } + if(isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"]){ + $aa->ShowNextPrev(FALSE, $from, $number, $contenttotal); + } + if(isset($textparent)){ $ns -> tablerender($caption, $textparent); } + if(isset($textsubparent)){ $ns -> tablerender($captionsubparent, $textsubparent); } + }else{ + if(isset($textchild)){ $ns -> tablerender($captionchild, $textchild); } + if(isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"]){ + $aa->ShowNextPrev(FALSE, $from, $number, $contenttotal); + } + $ns -> tablerender($caption, (isset($textparent) ? $textparent : "").(isset($textsubparent) ? $textsubparent : "")); + } + } + } + $cachecheck = CachePost($cachestr); + + if($mode == "comment"){ + $textparent = $aa -> getCrumbPage("cat", $array, $mainparent).$textparent; + if(isset($textparent)){ $ns -> tablerender($caption, $textparent); } + + if($resultitem = $sql -> db_Select($plugintable, "*", $qry )){ + $row = $sql -> db_Fetch(); + if($row['content_comment']){ + $cachestr = "comment.$plugintable.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + if( (isset($content_pref["content_cat_rating_all"]) && $content_pref["content_cat_rating_all"]) || (isset($content_pref["content_cat_rating"]) && $content_pref["content_cat_rating"] && $row['content_rate'])){ + $showrate = TRUE; + }else{ + $showrate = FALSE; + } + $cobj->compose_comment($plugintable, "comment", $qs[1], $width, $row['content_heading'], $showrate); + $cachecheck = CachePost($cachestr); + } + } + } +} + +// ##### AUTHOR LIST -------------------------------------- +function show_content_author_all(){ + global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $from, $sql, $aa, $e107cache, $tp, $pref, $mainparent, $content_pref, $cobj, $datequery, $authordetails, $i, $gen, $totalcontent, $row, $CONTENT_AUTHOR_TABLE, $CONTENT_AUTHOR_TABLE_START, $CONTENT_AUTHOR_TABLE_END, $CONTENT_AUTHOR_TABLE_DATE, $CONTENT_AUTHOR_TABLE_HEADING; + + $mainparent = $aa -> getMainParent(intval($qs[2])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("authorall", $mainparent); //show navigator/search/order menu + + if(!isset($CONTENT_AUTHOR_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_author_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_author_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_author_template.php"); + }else{ + require_once($plugindir."templates/default/content_author_template.php"); + } + } + } + + $cachestr = "$plugintable.author.list.$qs[2]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $number = (isset($content_pref["content_author_nextprev_number"]) && $content_pref["content_author_nextprev_number"] ? $content_pref["content_author_nextprev_number"] : "5"); + $nextprevquery = (isset($content_pref["content_author_nextprev"]) && $content_pref["content_author_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + $qry = " p.content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $dateqry = "AND p.content_datestamp < ".time()." AND (p.content_enddate=0 || p.content_enddate>".time().")"; + + $sql1 = new db; $sql2 = new db; + $contenttotal = $sql1 -> db_Select($plugintable." AS p", "DISTINCT(p.content_author)", "p.content_refer !='sa' AND ".$qry." ".$datequery." AND p.content_class REGEXP '".e_CLASS_REGEXP."'"); + + $query = " + SELECT DISTINCT(p.content_author) + FROM #$plugintable AS p + WHERE p.content_refer !='sa' AND ".$qry." ".$dateqry." AND p.content_class REGEXP '".e_CLASS_REGEXP."' + ORDER BY p.content_author"; + + $arr = array(); + $arr2 = array(); + if (!$sql1->db_Select_gen($query)){ + $text = CONTENT_LAN_15; + }else{ + while($row1 = $sql1 -> db_Fetch()){ + //parse db field and retrieve user info -> array($author_id, $author_name, $author_email, $content_author); + $arr[] = $aa->getAuthor($row1['content_author']); + } + //combine unique authors + for($i=0;$i$value){ + $db=''; + //prepare db field for author comparison + if(count($arr2[$key])==1){ + $db = " p.content_author='".$arr2[$key][0][3]."' "; + }else{ + for($k=0;$kdb_Count($plugintable." as p", "(*)", "WHERE ".$db ); + + $query = " + SELECT p.content_id, p.content_heading, p.content_datestamp + FROM #$plugintable AS p + WHERE (".$db.") AND p.content_refer !='sa' AND ".$qry." ".$dateqry." AND p.content_class REGEXP '".e_CLASS_REGEXP."' + ORDER BY p.content_datestamp ASC, p.content_author LIMIT 0,1"; + + //query to retrieve last created item for each author + if ($sql2->db_Select_gen($query)){ + while($row2 = $sql2 -> db_Fetch()){ + $arr3[] = array($key, $row2['content_id'], $row2['content_heading'], $row2['content_datestamp'], $amount); + } + } + } + } + + function cmp($a, $b) + { + $posa = strrpos($a[0], " "); + if($posa == TRUE){ + $la = substr($a[0], $posa); + }elseif($posa == FALSE){ + $la = $a[0]; + } + + $posb = strrpos($b[0], " "); + if($posb == TRUE){ + $lb = substr($b[0], $posb); + }elseif($posb == FALSE){ + $lb = $b[0]; + } + + if ($la == $lb) { + return 0; + } + return strcasecmp ($la, $lb); + } + //do an alpha ordering on the author (if 'firstname lastname', lastname is the comparison factor) + usort($arr3, "cmp"); + + $string = ""; + //only display number of records for nextprev + $max = $from+$number; + for($i=$from;$i<$max;$i++){ + if(is_array($arr3[$i])){ + $authordetails[$i][1] = $arr3[$i][0]; + $row['content_id'] = $arr3[$i][1]; + $row['content_heading'] = $arr3[$i][2]; + $row['content_datestamp'] = $arr3[$i][3]; + $totalcontent = $arr3[$i][4]; + $string .= $tp -> parseTemplate($CONTENT_AUTHOR_TABLE, FALSE, $content_shortcodes); + } + } + $text = $CONTENT_AUTHOR_TABLE_START.$string.$CONTENT_AUTHOR_TABLE_END; + $text = $aa -> getCrumbPage("authorall", $array, $mainparent).$text; + } + $caption = $content_pref['content_author_index_caption']; + $ns -> tablerender($caption, $text); + $aa -> ShowNextPrev("author", $from, $number, $contenttotal); + $cachecheck = CachePost($cachestr); +} + + +function show_content_author(){ + global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj; + global $nextprevquery, $from, $number, $content_icon_path; + global $CONTENT_RECENT_TABLE, $datequery, $crumb, $mainparent; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("author", $mainparent); //show navigator/search/order menu + + $cachestr = "$plugintable.author.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + if(array_key_exists($qs[1], $array)){ + $validparent = "0,0.".implode(",0.", array_keys($array)); + }else{ + $validparent = implode(",", array_keys($array)); + } + $order = $aa -> getOrder(); + $number = (isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5"); + $nextprevquery = (isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $sqla = ""; + if(!is_object($sqla)){ $sqla = new db; } + if(!$author = $sqla -> db_Select($plugintable, "content_author", "content_refer !='sa' AND ".$qry." ".$datequery." AND content_id = '".intval($qs[1])."' AND content_class REGEXP '".e_CLASS_REGEXP."' ")){ + header("location:".e_SELF."?author.list.".$mainparent); exit; + }else{ + list($content_author) = $sqla -> db_Fetch(); + $sqlb = new db; + $authordetails = $aa -> getAuthor($content_author); + $query = " content_author = '".$authordetails[3]."' || content_author REGEXP '^".$authordetails[1]."^' ".(is_numeric($content_author) ? " || content_author = '".$authordetails[0]."' " : "")." "; + $validparent = implode(",", array_keys($array)); + $qry = " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' AND (".$query.") "; + $contenttotal = $sqlb -> db_Count($plugintable, "(*)", "WHERE ".$qry." "); + $authorqry = $qry." ".$order." ".$nextprevquery; + $text = displayPreview($authorqry); + $text = $aa -> getCrumbPage("author", $array, $mainparent).$text; + $caption = $content_pref['content_author_caption']; + if(isset($content_pref['content_author_caption_append_name']) && $content_pref['content_author_caption_append_name']){ + $caption .= " ".$authordetails[1]; + } + $ns -> tablerender($caption, $text); + $aa -> ShowNextPrev("", $from, $number, $contenttotal); + } + $cachecheck = CachePost($cachestr); +} + +// ##### TOP RATED LIST ----------------------------------- +function show_content_top(){ + global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $cobj, $content_icon_path; + global $from, $datequery, $content_pref, $mainparent; + global $CONTENT_TOP_TABLE_AUTHOR, $authordetails, $row; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("top", $mainparent); //show navigator/search/order menu + + if(!isset($CONTENT_TOP_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_top_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_top_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_top_template.php"); + }else{ + require_once($plugindir."templates/default/content_top_template.php"); + } + } + } + $cachestr = "$plugintable.top.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $datequery1 = " AND p.content_datestamp < ".time()." AND (p.content_enddate=0 || p.content_enddate>".time().") "; + $qry = " p.content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $number = (isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : ""); + $np = ($number ? " LIMIT ".intval($from).", ".intval($number) : ""); + + $qry1 = " + SELECT p.*, r.*, (r.rate_rating / r.rate_votes) as rate_avg + FROM #rate AS r + LEFT JOIN #pcontent AS p ON p.content_id = r.rate_itemid + WHERE p.content_refer !='sa' AND ".$qry." ".$datequery1." AND p.content_class REGEXP '".e_CLASS_REGEXP."' AND r.rate_table='pcontent' + ORDER BY rate_avg DESC "; + $qry2 = $qry1." ".$np; + + if(!is_object($sql)){ $sql = new db; } + $total = $sql -> db_Select_gen($qry1); + if($sql->db_Select_gen($qry2)){ + while($row = $sql -> db_Fetch()){ + $CONTENT_TOP_TABLE_AUTHOR = $aa -> prepareAuthor("top", $row['content_author'], $row['content_id']); + $content_top_table_string .= $tp -> parseTemplate($CONTENT_TOP_TABLE, FALSE, $content_shortcodes); + } + $content_top_table_string = $aa -> getCrumbPage("top", $array, $mainparent).$content_top_table_string; + $text = $CONTENT_TOP_TABLE_START.$content_top_table_string.$CONTENT_TOP_TABLE_END; + $caption = $content_pref['content_top_caption']; + if(isset($content_pref['content_top_caption_append_name']) && $content_pref['content_top_caption_append_name']){ + $caption .= " ".$array[intval($qs[1])][1]; + } + $ns -> tablerender($caption, $text); + $aa -> ShowNextPrev("", $from, $number, $total); + } + $cachecheck = CachePost($cachestr); + unset($qry, $qry1, $qry2, $array, $validparent, $datequery); +} + + +// ##### TOP SCORE LIST ----------------------------------- +function show_content_score(){ + global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $cobj, $content_icon_path; + global $from, $datequery, $content_pref, $mainparent, $eArrayStorage, $CONTENT_SCORE_TABLE_SCORE, $CONTENT_SCORE_TABLE_AUTHOR, $authordetails, $row, $thisratearray; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + show_content_search_menu("score", $mainparent); //show navigator/search/order menu + + if(!isset($CONTENT_SCORE_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_score_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_score_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_score_template.php"); + }else{ + require_once($plugindir."templates/default/content_score_template.php"); + } + } + } + + $cachestr = "$plugintable.score.$qs[1]"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_score != '0' AND content_score != '' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' "; + $number = (isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5"); + + if(!is_object($sql)){ $sql = new db; } + $contenttotal = $sql -> db_Count($plugintable, "(*)", "WHERE ".$qry." "); + if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_author, content_icon, content_score", " ".$qry." ORDER BY content_score DESC LIMIT ".$from.",".$number." ")){ + $content_score_table_string = CONTENT_LAN_88; + }else{ + while($row = $sql -> db_Fetch()){ + $CONTENT_SCORE_TABLE_AUTHOR = $aa -> prepareAuthor("score", $row['content_author'], $row['content_id']); + $content_score_table_string .= $tp -> parseTemplate($CONTENT_SCORE_TABLE, FALSE, $content_shortcodes); + } + } + $content_score_table_string = $aa -> getCrumbPage("score", $array, $mainparent).$content_score_table_string; + $text = $CONTENT_SCORE_TABLE_START.$content_score_table_string.$CONTENT_SCORE_TABLE_END; + $caption = $content_pref['content_score_caption']; + if(isset($content_pref['content_score_caption_append_name']) && $content_pref['content_score_caption_append_name']){ + $caption .= " ".$array[intval($qs[1])][1]; + } + $ns -> tablerender($caption, $text); + $aa -> ShowNextPrev("", $from, $number, $contenttotal); + $cachecheck = CachePost($cachestr); +} + +// ##### CONTENT ITEM ------------------------------------------ +function show_content_item(){ + global $pref, $content_pref, $content_icon_path, $content_image_path, $content_file_path, $custom, $plugindir, $plugintable, $array, $content_shortcodes, $datequery, $order, $nextprevquery, $from, $number, $row, $qs, $gen, $sql, $aa, $tp, $rs, $cobj, $e107, $e107cache, $eArrayStorage, $ns, $rater, $ep, $row, $authordetails, $mainparent; + global $CONTENT_CONTENT_TABLE_TEXT, $CONTENT_CONTENT_TABLE_PAGENAMES, $CONTENT_CONTENT_TABLE_SUMMARY, $CONTENT_CONTENT_TABLE_CUSTOM_TAGS, $CONTENT_CONTENT_TABLE_PARENT, $CONTENT_CONTENT_TABLE_INFO_PRE, $CONTENT_CONTENT_TABLE_INFO_POST, $CONTENT_CONTENT_TABLE_AUTHORDETAILS, $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA, $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; + global $CONTENT_CONTENT_TABLE_PREV_PAGE, $CONTENT_CONTENT_TABLE_NEXT_PAGE; + + $mainparent = $aa -> getMainParent(intval($qs[1])); + $content_pref = $aa -> getContentPref($mainparent); + + show_content_search_menu("item", $mainparent); //show navigator/search/order menu + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $qry = "content_id='".intval($qs[1])."' AND content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' "; + + if(!$resultitem = $sql -> db_Select($plugintable, "*", $qry)){ + header("location:".e_SELF."?recent.".$mainparent); exit; + }else{ + $row = $sql -> db_Fetch(); + + //update refer count outside of cache (count visits ^ count unique ips) + if(isset($content_pref["content_log"]) && $content_pref["content_log"]){ + $ip = $e107->getip(); + $self = e_SELF; + $refertmp = explode("^", $row['content_refer']); + if(strpos($self, "admin") === FALSE){ + if(strpos($refertmp[1], $ip) === FALSE){ + $referiplist = ($refertmp[1] ? $refertmp[1]."-".$ip : $ip ); + $contentrefernew = ($refertmp[0]+1)."^".$referiplist; + }else{ + $contentrefernew = ($refertmp[0]+1)."^".$refertmp[1]; + } + $sql = new db; + $sql -> db_Update($plugintable, "content_refer='".$contentrefernew."' WHERE content_id='".intval($qs[1])."' "); + + $e107cache->clear("$plugintable.content.$qs[1]"); + $e107cache->clear("$plugintable.recent.$mainparent"); + $e107cache->clear("$plugintable.cat.list.$mainparent"); + $e107cache->clear("$plugintable.cat.$mainparent"); + $e107cache->clear("$plugintable.author.$mainparent"); + $e107cache->clear("$plugintable.top.$mainparent"); + } + } + + if(!isset($qs[2])){ $cacheid = 1; }else{ $cacheid = $qs[2]; } + $cachestr = "$plugintable.content.$qs[1].$cacheid"; + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + $content_pref["content_cat_icon_path_large"] = ($content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/" ); + $content_pref["content_cat_icon_path_small"] = ($content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/" ); + $content_pref["content_icon_path"] = ($content_pref["content_icon_path"] ? $content_pref["content_icon_path"] : "{e_PLUGIN}content/images/icon/" ); + $content_pref["content_image_path"] = ($content_pref["content_image_path"] ? $content_pref["content_image_path"] : "{e_PLUGIN}content/images/image/" ); + $content_pref["content_file_path"] = ($content_pref["content_file_path"] ? $content_pref["content_file_path"] : "{e_PLUGIN}content/images/file/" ); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); + $number = (isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5"); + $nextprevquery = (isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : ""); + + $CONTENT_CONTENT_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("content", $row['content_author'], $row['content_id']); + $CONTENT_CONTENT_TABLE_TEXT = $row['content_text']; + + $CONTENT_CONTENT_TABLE_PREV_PAGE = FALSE; + $CONTENT_CONTENT_TABLE_NEXT_PAGE = FALSE; + $lastpage = FALSE; //boolean whether or not the current page is the last page + if(preg_match_all("/\[newpage.*?]/si", $row['content_text'], $matches)){ + //remove html bbcode (since we're splitting the text, the html bbcode would not be parsed) + $row['content_text'] = preg_replace("/\\[html\](.*?)\[\/html\]/si", '\1', $row['content_text']); + //split newpage + $pages = preg_split("/\[newpage.*?]/si", $row['content_text'], -1, PREG_SPLIT_NO_EMPTY); + $pages = array_values($pages); + + //remove empty values + if(trim($pages[0]) == ""){ + unset($pages[0]); + } + $pages = array_values($pages); + + if(count($pages) == count($matches[0])){ + }elseif(count($pages) > count($matches[0])){ + $matches[0] = array_pad($matches[0], -count($pages), "[newpage]"); + }elseif(count($pages) < count($matches[0])){ + } + + $CONTENT_CONTENT_TABLE_TEXT = $pages[(!$qs[2] ? 0 : $qs[2]-1)]; + $options = ""; + for ($i=0; $i < count($pages); $i++) { + if(!isset($qs[2])){ $idp = 1; }else{ $idp = $qs[2]; } + if($idp == $i+1){ $pre = CONTENT_LAN_92; }else{ $pre = ""; } + if($matches[0][$i] == "[newpage]"){ + $pagename[$i] = CONTENT_LAN_78; + }else{ + $arrpagename = explode("[newpage=", $matches[0][$i]); + $pagename[$i] = substr($arrpagename[1],0,-1); + } + if(isset($content_pref["content_content_pagenames_nextprev"]) && $content_pref["content_content_pagenames_nextprev"]){ + if($idp>1){ + if(isset($content_pref["content_content_pagenames_nextprev_prevhead"]) && $content_pref["content_content_pagenames_nextprev_prevhead"]){ + $cap = $content_pref["content_content_pagenames_nextprev_prevhead"]; + $cap = str_replace("{PAGETITLE}", $pagename[$idp-2], $cap); + }else{ + $cap = CONTENT_LAN_90; + } + $CONTENT_CONTENT_TABLE_PREV_PAGE = "".$cap.""; + }else{ + $CONTENT_CONTENT_TABLE_PREV_PAGE = ' '; + } + if($idp".$cap.""; + }else{ + $CONTENT_CONTENT_TABLE_NEXT_PAGE = ' '; + } + } + + //0:normal links, 1:selectbox + //$content_pref["content_content_pagenames_rendertype"] = "1"; + if(isset($content_pref["content_content_pagenames_rendertype"]) && $content_pref["content_content_pagenames_rendertype"] == "1"){ + $page = CONTENT_LAN_79." ".($i+1)." ".$pre." ".$pagename[$i]; + $url = e_SELF."?".$qs[0].".".$qs[1].".".($i+1); + $options .= $rs -> form_option($page, ($idp == ($i+1) ? "1" : "0"), $url , ""); + }else{ + $options .= CONTENT_LAN_79." ".($i+1)." ".$pre." : ".$pagename[$i]."
    "; + } + + if($idp==1){ + $CONTENT_CONTENT_TABLE_SUMMARY = (isset($content_pref["content_content_summary"]) && $content_pref["content_content_summary"] && $row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : ""); + $CONTENT_CONTENT_TABLE_SUMMARY = $tp -> replaceConstants($CONTENT_CONTENT_TABLE_SUMMARY); + }else{ + $CONTENT_CONTENT_TABLE_SUMMARY = ""; + } + //render custom/preset on first page + if(isset($content_pref['content_content_multipage_preset']) && $content_pref['content_content_multipage_preset']){ + if($idp == '1'){ + $lastpage = TRUE; + } + //render custom/preset on last page + }else{ + if($idp == count($pages)){ + $lastpage = TRUE; + } + } + } + if($content_pref["content_content_pagenames_rendertype"] == "1"){ + $selectjs = "onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\""; + $CONTENT_CONTENT_TABLE_PAGENAMES = $rs -> form_select_open("pagenames", $selectjs).$rs -> form_option(CONTENT_LAN_89, "1", "none" , "").$options.$rs -> form_select_close(); + }else{ + $CONTENT_CONTENT_TABLE_PAGENAMES = $options; + } + + }else{ + $CONTENT_CONTENT_TABLE_SUMMARY = (isset($content_pref["content_content_summary"]) && $content_pref["content_content_summary"] && $row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : ""); + $CONTENT_CONTENT_TABLE_SUMMARY = $tp -> replaceConstants($CONTENT_CONTENT_TABLE_SUMMARY); + $lastpage = TRUE; + } + + $CONTENT_CONTENT_TABLE_TEXT = $tp -> replaceConstants($CONTENT_CONTENT_TABLE_TEXT); + $CONTENT_CONTENT_TABLE_TEXT = $tp -> toHTML($CONTENT_CONTENT_TABLE_TEXT, TRUE, ""); + + $custom = $eArrayStorage->ReadArray($row['content_pref']); + + $date = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_DATE}', FALSE, $content_shortcodes); + $auth = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes); + $ep = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_EPICONS}', FALSE, $content_shortcodes); + $edit = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_EDITICON}', FALSE, $content_shortcodes); + $par = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_PARENT}', FALSE, $content_shortcodes); + $com = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_COMMENT}', FALSE, $content_shortcodes); + $score = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_SCORE}', FALSE, $content_shortcodes); + $ref = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_REFER}', FALSE, $content_shortcodes); + $ico = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_ICON}', FALSE, $content_shortcodes); + $sub = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_SUBHEADING}', FALSE, $content_shortcodes); + $rat = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_RATING}', FALSE, $content_shortcodes); + $fil = $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_FILE}', FALSE, $content_shortcodes); + + $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = FALSE; + $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = FALSE; + $CONTENT_CONTENT_TABLE_INFO_PRE = FALSE; + $CONTENT_CONTENT_TABLE_INFO_POST = FALSE; + + if ($date!="" || $auth!="" || $ep!="" || $edit!="" || $par!="" || $com!="" || $score!="" || $ref!="" || $sub!="" || $rat!="" || $fil!="") { + $CONTENT_CONTENT_TABLE_INFO_PRE = TRUE; + $CONTENT_CONTENT_TABLE_INFO_POST = TRUE; + } + if($CONTENT_CONTENT_TABLE_INFO_PRE || $ico==''){ + $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = TRUE; + $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = TRUE; + } + + if(!isset($CONTENT_CONTENT_TABLE)){ + //if no theme has been set, use default theme + if(!$content_pref["content_theme"]){ + + //if custom layout is set + if($row['content_layout']){ + //if custom layout file exists + if(is_readable($plugindir."templates/default/".$row['content_layout'])){ + require_once($plugindir."templates/default/".$row['content_layout']); + }else{ + require_once($plugindir."templates/default/content_content_template.php"); + } + }else{ + require_once($plugindir."templates/default/content_content_template.php"); + } + }else{ + //if custom layout is set + if($row['content_layout']){ + //if custom layout file exists + if(is_readable($tp->replaceConstants($content_pref["content_theme"]).$row['content_layout'])){ + require_once($tp->replaceConstants($content_pref["content_theme"]).$row['content_layout']); + }else{ + //if default layout from the set theme exists + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php"); + //else use default theme, default layout + }else{ + require_once($plugindir."templates/default/content_content_template.php"); + } + } + //if no custom layout is set + }else{ + //if default layout from the set theme exists + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php"); + //else use default theme, default layout + }else{ + require_once($plugindir."templates/default/content_content_template.php"); + } + } + } + } + + $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); + + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = ""; + $CUSTOM_TAGS = FALSE; + if($lastpage === TRUE && !empty($custom)){ + $CONTENT_CONTENT_TABLE_CUSTOM_PRE = ""; + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = ""; + //ksort($custom); + foreach($custom as $k => $v){ + if($k == "content_custom_presettags"){ + if(isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]){ + foreach($v as $ck => $cv){ + if(is_array($cv)){ //date + if(!($cv['day']=="" && $cv['month']=="" && $cv['year']=="")){ + $vv = $cv['day']." ".$months[($cv['month']-1)]." ".$cv['year']; + } + }else{ + $vv = $cv; + } + if( isset($ck) && $ck != "" && isset($vv) && $vv!="" ){ + $CUSTOM_TAGS = TRUE; + $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true); + $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true); + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_TABLE_CUSTOM); + } + } + } + }else{ + if(isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]){ + $key = substr($k,15); + if( isset($key) && $key != "" && isset($v) && $v!="" ){ + $CUSTOM_TAGS = TRUE; + $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true); + $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true); + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_TABLE_CUSTOM); + } + } + } + } + if($CUSTOM_TAGS === TRUE){ + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = $CONTENT_CONTENT_TABLE_CUSTOM_START.$CONTENT_CONTENT_TABLE_CUSTOM_TAGS.$CONTENT_CONTENT_TABLE_CUSTOM_END; + } + } + $text = $tp -> parseTemplate($CONTENT_CONTENT_TABLE, FALSE, $content_shortcodes); + $text = $aa -> getCrumbPage("item", $array, $row['content_parent']).$text; + $caption = $row['content_heading']; + $ns -> tablerender($caption, $text); + $cachecheck = CachePost($cachestr); + + //recheck some thing when caching is enabled + $pages = preg_split("/\[newpage.*?]/si", $row['content_text'], -1, PREG_SPLIT_NO_EMPTY); + $pages = array_values($pages); + $cachestr = "comment.$plugintable.$qs[1].$cacheid"; + if(count($pages) == 0){ + $lastpage = TRUE; + }else{ + if($cacheid == count($pages)){ + $lastpage = TRUE; + } + } + if($lastpage && ($row['content_comment'] || (isset($content_pref["content_content_comment_all"]) && $content_pref["content_content_comment_all"]))){ + $cachecheck = CachePre($cachestr); + if($cachecheck){ + echo $cachecheck; + return; + } + if((isset($content_pref["content_content_rating"]) && $content_pref["content_content_rating"] && $row['content_rate']) || (isset($content_pref["content_content_rating_all"]) && $content_pref["content_content_rating_all"]) ){ + $showrate = TRUE; + }else{ + $showrate = FALSE; + } + $width = 0; + $cobj->compose_comment($plugintable, "comment", $qs[1], $width, $row['content_heading'], $showrate); + $cachecheck = CachePost($cachestr); + } + } //close sql +} + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/e107_plugins/content/content_manager.php b/e107_plugins/content/content_manager.php new file mode 100644 index 000000000..ec09281b1 --- /dev/null +++ b/e107_plugins/content/content_manager.php @@ -0,0 +1,179 @@ + setPageTitle(); + +//if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$tp->toJS("delete")],$matches)){ +// $delete = $matches[1]; +// $del_id = $matches[2]; +//} + +if(isset($_POST['delete'])){ + $tmp = array_pop(array_flip($_POST['delete'])); + list($delete, $del_id) = explode("_", $tmp); +} + +//these have to be set for the tinymce wysiwyg +$e_wysiwyg = "content_text"; +//if(check_class($pref['post_html']) && $pref['wysiwyg'] && $e_wysiwyg == TRUE){ +if($pref['wysiwyg'] && $e_wysiwyg == TRUE){ + require_once(e_HANDLER."tiny_mce/wysiwyg.php"); + define("e_WYSIWYG",TRUE); + $tiny = wysiwyg($e_wysiwyg); +}else{ + define("e_WYSIWYG",FALSE); +} + +//include js +function headerjs(){ + global $tiny; + echo "\n"; + echo $tiny; +} +// ##### DB --------------------------------------------------------------------------------------- + +require_once(HEADERF); + +if(isset($_POST['create_content'])){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ + $adb -> dbContent("create", "contentmanager"); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } +} + +if(isset($_POST['update_content'])){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ + $adb -> dbContent("update", "contentmanager"); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } +} + +if($delete == 'content' && is_numeric($del_id)){ + if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ + $message = CONTENT_ADMIN_ITEM_LAN_3; + $e107cache->clear("content"); + } +} + +if(isset($message)){ + $ns -> tablerender("", "
    ".$message."
    "); +} + +if(!e_QUERY){ + if(USERID){ + $aform -> show_contentmanager("edit", USERID, USERNAME); + require_once(FOOTERF); + exit; + }else{ + header("location:".$plugindir."content.php"); exit; + } +}else{ + + if($qs[0] == "c"){ + $message = CONTENT_ADMIN_ITEM_LAN_1."

    ".CONTENT_ADMIN_ITEM_LAN_55; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(FOOTERF); + exit; + + }elseif($qs[0] == "u"){ + $message = CONTENT_ADMIN_ITEM_LAN_2."

    ".CONTENT_ADMIN_ITEM_LAN_55; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(FOOTERF); + exit; + + //show list of items in this category + }elseif($qs[0] == "content" && is_numeric($qs[1])){ + $aform -> show_manage_content("contentmanager", USERID, USERNAME); + + //create new item + }elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2])){ + $aform -> show_create_content("contentmanager", USERID, USERNAME); + + //edit item + }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2])){ + $aform -> show_create_content("contentmanager", USERID, USERNAME); + + //manage submitted + }elseif($qs[0] == "content" && $qs[1] == "submitted" && is_numeric($qs[2])){ + //$aform -> show_submitted("contentmanager", USERID, USERNAME, $qs[2]); + $aform -> show_submitted($qs[2]); + + //post submitted content item + }elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ + $newqs = array_reverse($qs); + if($newqs[0] == "cu"){ //item; submit post / update redirect + $mainparent = $aa -> getMainParent($qs[2]); + $message = CONTENT_ADMIN_ITEM_LAN_117."

    "; + $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_89." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_91." ".CONTENT_ADMIN_ITEM_LAN_90."
    "; + $message .= CONTENT_ADMIN_ITEM_LAN_124." ".CONTENT_ADMIN_ITEM_LAN_90.""; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(e_ADMIN."footer.php"); + exit; + } + $aform -> show_create_content("sa", USERID, USERNAME); + + }else{ + header("location:".e_SELF); exit; + } +} + + +require_once(FOOTERF); + + + +?> \ No newline at end of file diff --git a/e107_plugins/content/content_shortcodes.php b/e107_plugins/content/content_shortcodes.php new file mode 100644 index 000000000..db979c5d6 --- /dev/null +++ b/e107_plugins/content/content_shortcodes.php @@ -0,0 +1,1030 @@ + e_sc -> parse_scbatch(__FILE__); +/* + +SC_BEGIN CONTENT_NEXTPREV +global $CONTENT_NEXTPREV; +return $CONTENT_NEXTPREV; +SC_END + +// CONTENT_TYPE_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_TYPE_TABLE_TOTAL +global $contenttotal; +return $contenttotal." ".($contenttotal == 1 ? CONTENT_LAN_53 : CONTENT_LAN_54); +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_HEADING +global $CONTENT_TYPE_TABLE_HEADING, $contenttotal, $row, $tp; +$row['content_heading'] = $tp -> toHTML($row['content_heading'], TRUE, "emotes_off, no_make_clickable"); +return ($contenttotal != "0" ? "".$row['content_heading']."" : $row['content_heading'] ); +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_LINK +global $row, $tp; +$text = " +[".CONTENT_TYPE_LAN_0."] +[".CONTENT_TYPE_LAN_1."] +[".CONTENT_TYPE_LAN_2."] +[".CONTENT_TYPE_LAN_3."] +[".CONTENT_TYPE_LAN_4."] +[".CONTENT_TYPE_LAN_5."]"; +return $text; +SC_END + + +SC_BEGIN CONTENT_TYPE_TABLE_SUBHEADING +global $CONTENT_TYPE_TABLE_SUBHEADING, $contenttotal, $row, $tp; +$row['content_subheading'] = $tp -> toHTML($row['content_subheading'], TRUE, "emotes_off, no_make_clickable"); +return ($row['content_subheading'] ? $row['content_subheading'] : ""); +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_ICON +global $CONTENT_TYPE_TABLE_ICON, $contenttotal, $row, $aa, $content_cat_icon_path_large, $content_pref; +if($contenttotal != "0"){ + $CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]); +}else{ + $CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]); +} +return $CONTENT_TYPE_TABLE_ICON; +SC_END + +// CONTENT_TYPE_TABLE_SUBMIT ------------------------------------------------ +SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_ICON +global $CONTENT_TYPE_TABLE_SUBMIT_ICON, $plugindir; +return "".CONTENT_ICON_SUBMIT.""; +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_HEADING +global $CONTENT_TYPE_TABLE_SUBMIT_HEADING, $plugindir; +return "".CONTENT_LAN_65.""; +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING +global $CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING; +return CONTENT_LAN_66; +SC_END + +// CONTENT_TYPE_TABLE_MANAGER ------------------------------------------------ +SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_ICON +global $CONTENT_TYPE_TABLE_MANAGER_ICON, $plugindir; +return "".CONTENT_ICON_CONTENTMANAGER.""; +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_HEADING +global $CONTENT_TYPE_TABLE_MANAGER_HEADING, $plugindir; +return "".CONTENT_LAN_67.""; +SC_END + +SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_SUBHEADING +global $CONTENT_TYPE_TABLE_MANAGER_SUBHEADING; +return CONTENT_LAN_68; +SC_END + +// CONTENT_TOP_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_TOP_TABLE_HEADING +global $CONTENT_TOP_TABLE_HEADING, $row, $qs; +return "".$row['content_heading'].""; +SC_END + +SC_BEGIN CONTENT_TOP_TABLE_ICON +global $CONTENT_TOP_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent; +if($content_pref["content_top_icon"]){ +$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); +$width = (isset($content_pref["content_top_icon_width"]) && $content_pref["content_top_icon_width"] ? $content_pref["content_top_icon_width"] : $width); +return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); +} +SC_END + +SC_BEGIN CONTENT_TOP_TABLE_AUTHOR +global $CONTENT_TOP_TABLE_AUTHOR; +return $CONTENT_TOP_TABLE_AUTHOR; +SC_END + +SC_BEGIN CONTENT_TOP_TABLE_RATING +global $CONTENT_TOP_TABLE_RATING, $row; +$row['rate_avg'] = round($row['rate_avg'], 1); +$row['rate_avg'] = (strlen($row['rate_avg'])>1 ? $row['rate_avg'] : $row['rate_avg'].".0"); +$tmp = explode(".", $row['rate_avg']); +$rating = ""; +$rating .= $row['rate_avg']." "; +for($c=1; $c<= $tmp[0]; $c++){ + $rating .= ""; +} +if($tmp[0] < 10){ + for($c=9; $c>=$tmp[0]; $c--){ + $rating .= ""; + } +} +$rating .= ""; +return $rating; +SC_END + +// CONTENT_SCORE_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_SCORE_TABLE_HEADING +global $CONTENT_SCORE_TABLE_HEADING, $row, $qs; +return "".$row['content_heading'].""; +SC_END + +SC_BEGIN CONTENT_SCORE_TABLE_ICON +global $CONTENT_SCORE_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent; +if(isset($content_pref["content_score_icon"]) && $content_pref["content_score_icon"]){ +$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); +$width = (isset($content_pref["content_score_icon_width"]) && $content_pref["content_score_icon_width"] ? $content_pref["content_score_icon_width"] : $width); +return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); +} +SC_END + +SC_BEGIN CONTENT_SCORE_TABLE_AUTHOR +global $CONTENT_SCORE_TABLE_AUTHOR; +return $CONTENT_SCORE_TABLE_AUTHOR; +SC_END + +SC_BEGIN CONTENT_SCORE_TABLE_SCORE +global $CONTENT_SCORE_TABLE_SCORE, $row; +$score = $row['content_score']; +$height = "height:8px;"; +$img = ""; +$img .= ""; +$img .= ""; +$img .= ""; +if($score < 100){ + $empty = 100-$score; + $img .= ""; +} +$img .= ""; +return $score."/100 ".$img; +SC_END + +// CONTENT_SUBMIT_TYPE_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_HEADING +global $CONTENT_SUBMIT_TYPE_TABLE_HEADING, $row; +return "".$row['content_heading'].""; +SC_END + +SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING +global $CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING, $row; +return ($row['content_subheading'] ? $row['content_subheading'] : ""); +SC_END + +SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_ICON +global $CONTENT_SUBMIT_TYPE_TABLE_ICON, $aa, $row, $content_cat_icon_path_large, $content_pref; +return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "content.submit.".$row['content_id'], "", $content_pref["content_blank_caticon"]); +SC_END + +// CONTENT_CONTENT_TABLEMANAGER ------------------------------------------------ +SC_BEGIN CONTENT_CONTENTMANAGER_CATEGORY +global $CONTENT_CONTENTMANAGER_CATEGORY, $row, $content_pref; +if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) || (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) ){ +return "".$row['content_heading'].""; +} +SC_END + +SC_BEGIN CONTENT_CONTENTMANAGER_ICONNEW +global $CONTENT_CONTENTMANAGER_ICONNEW, $row, $content_pref; +if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ +return "".CONTENT_ICON_NEW.""; +//return ""; +} +SC_END + +SC_BEGIN CONTENT_CONTENTMANAGER_ICONEDIT +global $CONTENT_CONTENTMANAGER_ICONEDIT, $row, $content_pref; +if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ +return "".CONTENT_ICON_EDIT.""; +//return ""; +} +SC_END + +SC_BEGIN CONTENT_CONTENTMANAGER_ICONSUBM +global $CONTENT_CONTENTMANAGER_ICONSUBM, $row, $content_pref, $plugintable; +if(isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])){ + if(!is_object($sqls)){ $sqls = new db; } + $num = $sqls -> db_Count($plugintable, "(*)", "WHERE content_refer = 'sa' AND content_parent='".intval($row['content_id'])."' "); + if($num>0){ + return "".CONTENT_ICON_SUBMIT_SMALL.""; + } +} +SC_END + + +// CONTENT_AUTHOR_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_AUTHOR_TABLE_NAME +global $CONTENT_AUTHOR_TABLE_NAME, $authordetails, $i, $qs, $row; +$name = ($authordetails[$i][1] == "" ? "... ".CONTENT_LAN_29." ..." : $authordetails[$i][1]); +$authorlink = "".$name.""; +return $authorlink; +SC_END + +SC_BEGIN CONTENT_AUTHOR_TABLE_ICON +global $CONTENT_AUTHOR_TABLE_ICON, $qs, $row; +return "".CONTENT_ICON_AUTHORLIST.""; +SC_END + +SC_BEGIN CONTENT_AUTHOR_TABLE_TOTAL +global $CONTENT_AUTHOR_TABLE_TOTAL, $totalcontent, $mainparent, $content_pref; +if($content_pref["content_author_amount"]){ +$CONTENT_AUTHOR_TABLE_TOTAL = $totalcontent." ".($totalcontent==1 ? CONTENT_LAN_53 : CONTENT_LAN_54); +return $CONTENT_AUTHOR_TABLE_TOTAL; +} +SC_END + +SC_BEGIN CONTENT_AUTHOR_TABLE_LASTITEM +global $CONTENT_AUTHOR_TABLE_LASTITEM, $gen, $row, $mainparent, $content_pref; +if($content_pref["content_author_lastitem"]){ +if(!is_object($gen)){ $gen = new convert; } +$CONTENT_AUTHOR_TABLE_LASTITEM = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short")); +$CONTENT_AUTHOR_TABLE_LASTITEM .= " : ".$row['content_heading'].""; +return $CONTENT_AUTHOR_TABLE_LASTITEM; +} +SC_END + +// CONTENT_CAT_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_CAT_TABLE_INFO_PRE +global $CONTENT_CAT_TABLE_INFO_PRE; +if($CONTENT_CAT_TABLE_INFO_PRE === TRUE){ +$CONTENT_CAT_TABLE_INFO_PRE = " "; +return $CONTENT_CAT_TABLE_INFO_PRE; +} +SC_END +SC_BEGIN CONTENT_CAT_TABLE_INFO_POST +global $CONTENT_CAT_TABLE_INFO_POST; +if($CONTENT_CAT_TABLE_INFO_POST === TRUE){ +$CONTENT_CAT_TABLE_INFO_POST = " "; +return $CONTENT_CAT_TABLE_INFO_POST; +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_ICON +global $CONTENT_CAT_TABLE_ICON, $aa, $totalitems, $row, $content_pref, $qs, $content_cat_icon_path_large, $mainparent; +if(isset($content_pref["content_catall_icon"]) && $content_pref["content_catall_icon"]){ + //$qry = ($totalitems > 0 ? "cat.".$row['content_id'] : ""); + $qry = "cat.".$row['content_id']; + return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, $qry, "", $content_pref["content_blank_caticon"]); +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_HEADING +global $CONTENT_CAT_TABLE_HEADING, $row, $totalitems, $tp; +//return ($totalitems > 0 ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : $tp -> toHTML($row['content_heading'], TRUE, "") ); +return "".$tp -> toHTML($row['content_heading'], TRUE, "").""; +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_AMOUNT +global $CONTENT_CAT_TABLE_AMOUNT, $aa, $row, $totalitems, $mainparent, $content_pref; +if(isset($content_pref["content_catall_amount"]) && $content_pref["content_catall_amount"]){ +$n = $totalitems; +$CONTENT_CAT_TABLE_AMOUNT = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); +return $CONTENT_CAT_TABLE_AMOUNT; +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_SUBHEADING +global $CONTENT_CAT_TABLE_SUBHEADING, $row, $tp, $mainparent, $content_pref; +if(isset($content_pref["content_catall_subheading"]) && $content_pref["content_catall_subheading"]){ +return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_DATE +global $CONTENT_CAT_TABLE_DATE, $gen, $row, $mainparent, $content_pref, $gen; +if(isset($content_pref["content_catall_date"]) && $content_pref["content_catall_date"]){ +if(!is_object($gen)){ $gen = new convert; } +$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); +$DATE = ($datestamp != "" ? $datestamp : ""); +return $DATE; +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_AUTHORDETAILS +global $CONTENT_CAT_TABLE_AUTHORDETAILS; +return $CONTENT_CAT_TABLE_AUTHORDETAILS; +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_EPICONS +global $CONTENT_CAT_TABLE_EPICONS, $row, $tp, $mainparent, $content_pref; +$EPICONS = ""; +if($row['content_pe'] && isset($content_pref["content_catall_peicon"]) && $content_pref["content_catall_peicon"]){ + $EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}"); + $EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}"); + $EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); +return $EPICONS; +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_COMMENT +global $CONTENT_CAT_TABLE_COMMENT, $row, $qs, $comment_total, $mainparent, $content_pref, $plugintable; +if($row['content_comment'] && isset($content_pref["content_catall_comment"]) && $content_pref["content_catall_comment"]){ +$sqlc = new db; +$comment_total = $sqlc -> db_Select("comments", "*", "comment_item_id='".$row['content_id']."' AND comment_type='".$plugintable."' AND comment_pid='0' "); +return "".CONTENT_LAN_57." ".$comment_total.""; +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_TEXT +global $CONTENT_CAT_TABLE_TEXT, $row, $tp, $mainparent, $content_pref; +if($row['content_text'] && isset($content_pref["content_catall_text"]) && $content_pref["content_catall_text"] && ($content_pref["content_catall_text_char"] > 0 || $content_pref["content_catall_text_char"] == 'all')){ + if($content_pref["content_catall_text_char"] == 'all'){ + $CONTENT_CAT_TABLE_TEXT = $row['content_text']; + }else{ + $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']); + $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak"); + + $rowtext = strip_tags($rowtext); + $words = explode(" ", $rowtext); + $CONTENT_CAT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_catall_text_char"])); + if($content_pref["content_catall_text_link"]){ + $CONTENT_CAT_TABLE_TEXT .= " ".$content_pref["content_catall_text_post"].""; + }else{ + $CONTENT_CAT_TABLE_TEXT .= " ".$content_pref["content_catall_text_post"]; + } + } +return $CONTENT_CAT_TABLE_TEXT; +} +SC_END + +SC_BEGIN CONTENT_CAT_TABLE_RATING +global $CONTENT_CAT_TABLE_RATING, $row, $rater, $mainparent, $content_pref, $plugintable; +$RATING = ""; +if($row['content_rate'] && isset($content_pref["content_catall_rating"]) && $content_pref["content_catall_rating"]){ +return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); +} +return $RATING; +SC_END + +// CONTENT_CAT_LIST_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_PRE +global $CONTENT_CAT_LIST_TABLE_INFO_PRE; +if($CONTENT_CAT_LIST_TABLE_INFO_PRE === TRUE){ +$CONTENT_CAT_LIST_TABLE_INFO_PRE = " "; +return $CONTENT_CAT_LIST_TABLE_INFO_PRE; +} +SC_END +SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_POST +global $CONTENT_CAT_LIST_TABLE_INFO_POST; +if($CONTENT_CAT_LIST_TABLE_INFO_POST === TRUE){ +$CONTENT_CAT_LIST_TABLE_INFO_POST = " "; +return $CONTENT_CAT_LIST_TABLE_INFO_POST; +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_ICON +global $CONTENT_CAT_LIST_TABLE_ICON, $aa, $row, $qs, $content_pref, $content_cat_icon_path_large, $mainparent; +if(isset($content_pref["content_cat_icon"]) && $content_pref["content_cat_icon"]){ +return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]);; +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_HEADING +global $CONTENT_CAT_LIST_TABLE_HEADING, $tp, $row, $totalparent, $tp; +return ($totalparent > 0 ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : $tp -> toHTML($row['content_heading'], TRUE, "") ); +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_SUMMARY +global $CONTENT_CAT_LIST_TABLE_SUMMARY, $tp, $row, $mainparent; +return ($row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : ""); +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_TEXT +global $CONTENT_CAT_LIST_TABLE_TEXT, $tp, $row, $mainparent, $content_pref; +if($row['content_text'] && isset($content_pref["content_cat_text"]) && $content_pref["content_cat_text"] && ($content_pref["content_cat_text_char"] > 0 || $content_pref["content_cat_text_char"] == 'all')){ + if($content_pref["content_cat_text_char"] == 'all'){ + //$CONTENT_CAT_LIST_TABLE_TEXT = $row['content_text']; + $CONTENT_CAT_LIST_TABLE_TEXT = $tp->toHTML($row['content_text'], TRUE, "constants"); + }else{ + $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']); + $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak constants"); + + $rowtext = strip_tags($rowtext); + $words = explode(" ", $rowtext); + $CONTENT_CAT_LIST_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_cat_text_char"])); + if($content_pref["content_cat_text_link"]){ + $CONTENT_CAT_LIST_TABLE_TEXT .= " ".$content_pref["content_cat_text_post"].""; + }else{ + $CONTENT_CAT_LIST_TABLE_TEXT .= " ".$content_pref["content_cat_text_post"]; + } + } +return $CONTENT_CAT_LIST_TABLE_TEXT; +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_AMOUNT +global $CONTENT_CAT_LIST_TABLE_AMOUNT, $aa, $row, $mainparent, $content_pref, $totalparent; +if(isset($content_pref["content_cat_amount"]) && $content_pref["content_cat_amount"]){ +$n = $totalparent; +$n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); +return $n; +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_SUBHEADING +global $CONTENT_CAT_LIST_TABLE_SUBHEADING, $tp, $row, $mainparent, $content_pref; +if(isset($content_pref["content_cat_subheading"]) && $content_pref["content_cat_subheading"]){ +return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_DATE +global $CONTENT_CAT_LIST_TABLE_DATE, $row, $gen, $mainparent, $content_pref, $gen; +if(isset($content_pref["content_cat_date"]) && $content_pref["content_cat_date"]){ +if(!is_object($gen)){ $gen = new convert; } +$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); +return ($datestamp != "" ? $datestamp : ""); +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_AUTHORDETAILS +global $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS; +return $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS; +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_EPICONS +global $CONTENT_CAT_LIST_TABLE_EPICONS, $row, $tp, $qs, $mainparent, $content_pref; +$EPICONS = ""; +if( (isset($content_pref["content_cat_peicon"]) && $content_pref["content_cat_peicon"] && $row['content_pe']) || (isset($content_pref["content_cat_peicon_all"]) && $content_pref["content_cat_peicon_all"])){ + $EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.$qs[1]}"); + $EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.$qs[1]}"); + $EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.$qs[1]}"); +return $EPICONS; +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_COMMENT +global $CONTENT_CAT_LIST_TABLE_COMMENT, $qs, $row, $comment_total, $mainparent, $content_pref, $sql, $plugintable; +if($row['content_comment'] && isset($content_pref["content_cat_comment"]) && $content_pref["content_cat_comment"]){ + $comment_total = $sql -> db_Count("comments", "(*)", "WHERE comment_item_id='".intval($qs[1])."' AND comment_type='".$plugintable."' AND comment_pid='0' "); + return "".CONTENT_LAN_57." ".$comment_total.""; +} +SC_END + +SC_BEGIN CONTENT_CAT_LIST_TABLE_RATING +global $CONTENT_CAT_LIST_TABLE_RATING, $row, $rater, $content_pref, $mainparent, $plugintable; +$RATING = ""; +if( (isset($content_pref["content_cat_rating_all"]) && $content_pref["content_cat_rating_all"]) || (isset($content_pref["content_cat_rating"]) && $content_pref["content_cat_rating"] && $row['content_rate'])){ + return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); +} +return $RATING; +SC_END + +// CONTENT_CAT_LISTSUB ------------------------------------------------ +SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_ICON +global $CONTENT_CAT_LISTSUB_TABLE_ICON, $aa, $row, $content_pref, $qs, $mainparent, $content_cat_icon_path_small; +if(isset($content_pref["content_catsub_icon"]) && $content_pref["content_catsub_icon"]){ +return $aa -> getIcon("catsmall", $row['content_icon'], $content_cat_icon_path_small, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]); +} +SC_END + +SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_HEADING +global $CONTENT_CAT_LISTSUB_TABLE_HEADING, $tp, $row, $totalsubcat, $tp; +return ($totalsubcat > 0 ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : $tp -> toHTML($row['content_heading'], TRUE, "") ); +SC_END + +SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_AMOUNT +global $CONTENT_CAT_LISTSUB_TABLE_AMOUNT, $aa, $row, $content_pref, $mainparent, $totalsubcat; +if(isset($content_pref["content_catsub_amount"]) && $content_pref["content_catsub_amount"]){ +$n = $totalsubcat; +$n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); +return $n; +} +SC_END + +SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_SUBHEADING +global $CONTENT_CAT_LISTSUB_TABLE_SUBHEADING, $row, $tp, $content_pref, $mainparent; +if(isset($content_pref["content_catsub_subheading"]) && $content_pref["content_catsub_subheading"]){ +return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); +} +SC_END + +// CONTENT_SEARCH_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_SEARCH_TABLE_SELECT +global $CONTENT_SEARCH_TABLE_SELECT; +return $CONTENT_SEARCH_TABLE_SELECT; +SC_END + +SC_BEGIN CONTENT_SEARCH_TABLE_ORDER +global $CONTENT_SEARCH_TABLE_ORDER; +return $CONTENT_SEARCH_TABLE_ORDER; +SC_END + +SC_BEGIN CONTENT_SEARCH_TABLE_KEYWORD +global $CONTENT_SEARCH_TABLE_KEYWORD; +return $CONTENT_SEARCH_TABLE_KEYWORD; +SC_END + +// CONTENT_SEARCHRESULT_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_SEARCHRESULT_TABLE_ICON +global $CONTENT_SEARCHRESULT_TABLE_ICON, $aa, $row, $content_icon_path, $qs, $content_pref, $mainparent; +$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); +return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); +SC_END + +SC_BEGIN CONTENT_SEARCHRESULT_TABLE_HEADING +global $CONTENT_SEARCHRESULT_TABLE_HEADING, $row, $qs, $tp; +return ($row['content_heading'] ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : ""); +SC_END + +SC_BEGIN CONTENT_SEARCHRESULT_TABLE_SUBHEADING +global $CONTENT_SEARCHRESULT_TABLE_SUBHEADING, $row, $tp; +return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); +SC_END + +SC_BEGIN CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS +global $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS, $qs, $aa, $row; +$authordetails = $aa -> getAuthor($row['content_author']); +$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS = $authordetails[1]; +if(USER){ + if(is_numeric($authordetails[3])){ + $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER.""; + }else{ + $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER; + } +}else{ + $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER; +} +$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_AUTHORLIST.""; +return $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS; +SC_END + +SC_BEGIN CONTENT_SEARCHRESULT_TABLE_DATE +global $CONTENT_SEARCHRESULT_TABLE_DATE, $gen, $row; +$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short")); +return $datestamp; +SC_END + +SC_BEGIN CONTENT_SEARCHRESULT_TABLE_TEXT +global $CONTENT_SEARCHRESULT_TABLE_TEXT, $row, $tp; +return ($row['content_text'] ? $tp -> toHTML($row['content_text'], TRUE, "") : ""); +SC_END + +// CONTENT_RECENT_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_RECENT_TABLE_INFOPRE +global $CONTENT_RECENT_TABLE_INFOPRE; +if($CONTENT_RECENT_TABLE_INFOPRE === TRUE){ +$CONTENT_RECENT_TABLE_INFOPRE = " "; +return $CONTENT_RECENT_TABLE_INFOPRE; +} +SC_END +SC_BEGIN CONTENT_RECENT_TABLE_INFOPOST +global $CONTENT_RECENT_TABLE_INFOPOST; +if($CONTENT_RECENT_TABLE_INFOPOST === TRUE){ +$CONTENT_RECENT_TABLE_INFOPOST = " "; +return $CONTENT_RECENT_TABLE_INFOPOST; +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_ICON +global $CONTENT_RECENT_TABLE_ICON, $aa, $row, $content_icon_path, $content_pref, $mainparent; +if(isset($content_pref["content_list_icon"]) && $content_pref["content_list_icon"]){ +$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); +return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_HEADING +global $CONTENT_RECENT_TABLE_HEADING, $row, $tp; +return ($row['content_heading'] ? "".$tp->toHTML($row['content_heading'], TRUE, "")."" : ""); +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_SUBHEADING +global $CONTENT_RECENT_TABLE_SUBHEADING, $tp, $content_pref, $qs, $row, $mainparent; +if (isset($content_pref["content_list_subheading"]) && $content_pref["content_list_subheading"] && $row['content_subheading'] && $content_pref["content_list_subheading_char"] && $content_pref["content_list_subheading_char"] != "" && $content_pref["content_list_subheading_char"] != "0"){ + if(strlen($row['content_subheading']) > $content_pref["content_list_subheading_char"]) { + $row['content_subheading'] = substr($row['content_subheading'], 0, $content_pref["content_list_subheading_char"]).$content_pref["content_list_subheading_post"]; + } + $CONTENT_RECENT_TABLE_SUBHEADING = ($row['content_subheading'] != "" && $row['content_subheading'] != " " ? $row['content_subheading'] : ""); +}else{ + $CONTENT_RECENT_TABLE_SUBHEADING = ($row['content_subheading'] ? $row['content_subheading'] : ""); +} +return $tp->toHTML($CONTENT_RECENT_TABLE_SUBHEADING, TRUE, ""); +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_SUMMARY +global $CONTENT_RECENT_TABLE_SUMMARY, $content_pref, $tp, $qs, $row, $mainparent; +if (isset($content_pref["content_list_summary"]) && $content_pref["content_list_summary"]){ + if($row['content_summary'] && $content_pref["content_list_summary_char"] && $content_pref["content_list_summary_char"] != "" && $content_pref["content_list_summary_char"] != "0"){ + if(strlen($row['content_summary']) > $content_pref["content_list_summary_char"]) { + $row['content_summary'] = substr($row['content_summary'], 0, $content_pref["content_list_summary_char"]).$content_pref["content_list_summary_post"]; + } + $CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] != "" && $row['content_summary'] != " " ? $row['content_summary'] : ""); + }else{ + $CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] ? $row['content_summary'] : ""); + } +return $tp->toHTML($CONTENT_RECENT_TABLE_SUMMARY, TRUE, ""); +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_TEXT +global $CONTENT_RECENT_TABLE_TEXT, $content_pref, $qs, $row, $mainparent, $tp; +if(isset($content_pref["content_list_text"]) && $content_pref["content_list_text"] && $content_pref["content_list_text_char"] > 0){ + $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']); + //$rowtext = str_replace ("
    ", " ", $rowtext); + $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak"); + $rowtext = strip_tags($rowtext); + $words = explode(" ", $rowtext); + $CONTENT_RECENT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_list_text_char"])); + if($CONTENT_RECENT_TABLE_TEXT){ + if($content_pref["content_list_text_link"]){ + $CONTENT_RECENT_TABLE_TEXT .= " ".$content_pref["content_list_text_post"].""; + }else{ + $CONTENT_RECENT_TABLE_TEXT .= " ".$content_pref["content_list_text_post"]; + } + } +} +return $CONTENT_RECENT_TABLE_TEXT; +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_DATE +global $CONTENT_RECENT_TABLE_DATE, $content_pref, $qs, $row, $mainparent; +if(isset($content_pref["content_list_date"]) && $content_pref["content_list_date"]){ +$datestyle = ($content_pref["content_list_datestyle"] ? $content_pref["content_list_datestyle"] : "%d %b %Y"); +return strftime($datestyle, $row['content_datestamp']); +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_EPICONS +global $CONTENT_RECENT_TABLE_EPICONS, $tp, $content_pref, $qs, $row, $mainparent; +$CONTENT_RECENT_TABLE_EPICONS = ""; +if(isset($content_pref["content_list_peicon"]) && $content_pref["content_list_peicon"]){ + if($row['content_pe'] || isset($content_pref["content_list_peicon_all"]) && $content_pref["content_list_peicon_all"]){ + $CONTENT_RECENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); + $CONTENT_RECENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); + $CONTENT_RECENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); + } +} +return $CONTENT_RECENT_TABLE_EPICONS; +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_AUTHORDETAILS +global $CONTENT_RECENT_TABLE_AUTHORDETAILS; +return $CONTENT_RECENT_TABLE_AUTHORDETAILS; +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_EDITICON +global $CONTENT_RECENT_TABLE_EDITICON, $content_pref, $qs, $row, $mainparent, $plugindir; +if(ADMIN && getperms("P") && isset($content_pref["content_list_editicon"]) && $content_pref["content_list_editicon"]){ +return $CONTENT_RECENT_TABLE_EDITICON = "".CONTENT_ICON_EDIT.""; +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_REFER +global $CONTENT_RECENT_TABLE_REFER, $content_pref, $qs, $row, $mainparent; +if($content_pref["content_log"] && $content_pref["content_list_refer"]){ + $refercounttmp = explode("^", $row['content_refer']); + $CONTENT_RECENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : "0"); + if($CONTENT_RECENT_TABLE_REFER > 0){ + return $CONTENT_RECENT_TABLE_REFER; + } +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_RATING +global $CONTENT_RECENT_TABLE_RATING, $rater, $row, $qs, $content_pref, $plugintable, $mainparent; +if($content_pref["content_list_rating"]){ + if($content_pref["content_list_rating_all"] || $row['content_rate']){ + return $rater->composerating($plugintable, $row['content_id'], $enter=FALSE, $userid=FALSE); + } +} +SC_END + +SC_BEGIN CONTENT_RECENT_TABLE_PARENT +global $CONTENT_RECENT_TABLE_PARENT, $content_pref, $mainparent, $row, $array, $aa; +if(isset($content_pref["content_list_parent"]) && $content_pref["content_list_parent"]){ +return $aa -> getCrumbItem($row['content_parent'], $array); +} +SC_END + +// CONTENT_ARCHIVE_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_ARCHIVE_TABLE_LETTERS +global $CONTENT_ARCHIVE_TABLE_LETTERS, $content_pref, $mainparent; +if($content_pref["content_archive_letterindex"]){ +return $CONTENT_ARCHIVE_TABLE_LETTERS; +} +SC_END + +SC_BEGIN CONTENT_ARCHIVE_TABLE_HEADING +global $CONTENT_ARCHIVE_TABLE_HEADING, $row, $qs; +return "".$row['content_heading'].""; +SC_END + +SC_BEGIN CONTENT_ARCHIVE_TABLE_DATE +global $CONTENT_ARCHIVE_TABLE_DATE, $row, $content_pref, $qs, $mainparent; +if(isset($content_pref["content_archive_date"]) && $content_pref["content_archive_date"]){ +$datestyle = ($content_pref["content_archive_datestyle"] ? $content_pref["content_archive_datestyle"] : "%d %b %Y"); +return strftime($datestyle, $row['content_datestamp']); +} +SC_END + +SC_BEGIN CONTENT_ARCHIVE_TABLE_AUTHOR +global $CONTENT_ARCHIVE_TABLE_AUTHOR; +return $CONTENT_ARCHIVE_TABLE_AUTHOR; +SC_END + +// CONTENT_CONTENT_TABLE ------------------------------------------------ +SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE +global $CONTENT_CONTENT_TABLE_INFO_PRE; +if($CONTENT_CONTENT_TABLE_INFO_PRE === TRUE){ +$CONTENT_CONTENT_TABLE_INFO_PRE = " "; +return $CONTENT_CONTENT_TABLE_INFO_PRE; +} +SC_END +SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST +global $CONTENT_CONTENT_TABLE_INFO_POST; +if($CONTENT_CONTENT_TABLE_INFO_POST === TRUE){ +$CONTENT_CONTENT_TABLE_INFO_POST = " "; +return $CONTENT_CONTENT_TABLE_INFO_POST; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA +global $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA; +if($CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA === TRUE){ +$CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = " "; +return $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA; +} +SC_END +SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA +global $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; +if($CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA === TRUE){ +$CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = " "; +return $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_PARENT +global $CONTENT_CONTENT_TABLE_PARENT, $aa, $array, $row, $content_pref, $mainparent; +if(isset($content_pref["content_content_parent"]) && $content_pref["content_content_parent"]){ +return $aa -> getCrumbItem($row['content_parent'], $array); +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_ICON +global $CONTENT_CONTENT_TABLE_ICON, $qs, $row, $aa, $content_pref, $content_icon_path, $mainparent; +if(isset($content_pref["content_content_icon"]) && $content_pref["content_content_icon"]){ +$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); +return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "", $width, $content_pref["content_blank_icon"]); +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_HEADING +global $CONTENT_CONTENT_TABLE_HEADING, $row, $tp; +$CONTENT_CONTENT_TABLE_HEADING = ($row['content_heading'] ? $tp -> toHTML($row['content_heading'], TRUE, "") : ""); +return $CONTENT_CONTENT_TABLE_HEADING; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_REFER +global $CONTENT_CONTENT_TABLE_REFER, $sql, $qs, $content_pref, $plugintable, $mainparent; +if(isset($content_pref["content_content_refer"]) && $content_pref["content_content_refer"]){ + $sql -> db_Select($plugintable, "content_refer", "content_id='".intval($qs[1])."' "); + list($content_refer) = $sql -> db_Fetch(); + $refercounttmp = explode("^", $content_refer); + $CONTENT_CONTENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : ""); +return $CONTENT_CONTENT_TABLE_REFER; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_SUBHEADING +global $CONTENT_CONTENT_TABLE_SUBHEADING, $row, $tp, $content_pref, $qs, $mainparent; +$CONTENT_CONTENT_TABLE_SUBHEADING = ($content_pref["content_content_subheading"] && $row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); +return $CONTENT_CONTENT_TABLE_SUBHEADING; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_COMMENT +global $CONTENT_CONTENT_TABLE_COMMENT, $cobj, $qs, $content_pref, $mainparent, $row, $plugintable; +if((isset($content_pref["content_content_comment"]) && $content_pref["content_content_comment"] && $row['content_comment']) || $content_pref["content_content_comment_all"] ){ +return $cobj -> count_comments($plugintable, $qs[1]); +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_DATE +global $CONTENT_CONTENT_TABLE_DATE, $gen, $row, $qs, $content_pref, $mainparent; +if(isset($content_pref["content_content_date"]) && $content_pref["content_content_date"]){ + $gen = new convert; + $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); + $CONTENT_CONTENT_TABLE_DATE = ($datestamp != "" ? $datestamp : ""); +return $CONTENT_CONTENT_TABLE_DATE; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_AUTHORDETAILS +global $CONTENT_CONTENT_TABLE_AUTHORDETAILS; +return $CONTENT_CONTENT_TABLE_AUTHORDETAILS; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_EPICONS +global $CONTENT_CONTENT_TABLE_EPICONS, $content_pref, $qs, $row, $tp, $mainparent; +$CONTENT_CONTENT_TABLE_EPICONS = ""; +if(($content_pref["content_content_peicon"] && $row['content_pe']) || $content_pref["content_content_peicon_all"]){ + $CONTENT_CONTENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); + $CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); + $CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); +return $CONTENT_CONTENT_TABLE_EPICONS; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_EDITICON +global $CONTENT_CONTENT_TABLE_EDITICON, $content_pref, $qs, $row, $plugindir, $mainparent; +if(ADMIN && getperms("P") && isset($content_pref["content_content_editicon"])){ + $CONTENT_CONTENT_TABLE_EDITICON = "".CONTENT_ICON_EDIT.""; +return $CONTENT_CONTENT_TABLE_EDITICON; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_RATING +global $CONTENT_CONTENT_TABLE_RATING, $content_pref, $qs, $row, $rater, $plugintable, $mainparent; +if(($content_pref["content_content_rating"] && $row['content_rate']) || $content_pref["content_content_rating_all"] ){ +return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_FILE +global $CONTENT_CONTENT_TABLE_FILE, $row, $content_file_path, $content_pref, $mainparent; +if($content_pref["content_content_attach"]){ +$filestmp = explode("[file]", $row['content_file']); +foreach($filestmp as $key => $value) { + if($value == "") { + unset($filestmp[$key]); + } +} +$files = array_values($filestmp); +$content_files_popup_name = str_replace("'", "", $row['content_heading']); +$file = ""; +$filesexisting = "0"; +for($i=0;$i".CONTENT_ICON_FILE." "; + }else{ + $file .= " "; + } +} +$CONTENT_CONTENT_TABLE_FILE = ($filesexisting == "0" ? "" : CONTENT_LAN_41." ".($filesexisting == 1 ? CONTENT_LAN_42 : CONTENT_LAN_43)." ".$file." "); +return $CONTENT_CONTENT_TABLE_FILE; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_SCORE +global $CONTENT_CONTENT_TABLE_SCORE, $row; +$score = $row['content_score']; +if($score){ + $height = "height:8px;"; + $img = ""; + $img .= ""; + $img .= ""; + $img .= ""; + if($score < 100){ + $empty = 100-$score; + $img .= ""; + } + $img .= ""; + return $img." ".$score; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_SUMMARY +global $CONTENT_CONTENT_TABLE_SUMMARY; +return $CONTENT_CONTENT_TABLE_SUMMARY; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_TEXT +global $CONTENT_CONTENT_TABLE_TEXT; +return $CONTENT_CONTENT_TABLE_TEXT; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_IMAGES +global $CONTENT_CONTENT_TABLE_IMAGES, $row, $content_image_path, $aa, $tp, $authordetails, $content_pref, $mainparent; +if($content_pref["content_content_images"]){ +$authordetails = $aa -> getAuthor($row['content_author']); +$imagestmp = explode("[img]", $row['content_image']); +foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } +} +$images = array_values($imagestmp); +$content_image_popup_name = $row['content_heading']; +$CONTENT_CONTENT_TABLE_IMAGES = ""; +require_once(e_HANDLER."popup_handler.php"); +$pp = new popup; +$gen = new convert; +$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); +for($i=0;$i toHTML($row['content_subheading'], TRUE); + $popupname = $tp -> toHTML($content_image_popup_name, TRUE); + $author = $tp -> toHTML($authordetails[1], TRUE); + $oTitle = $popupname." ".($i+1); + $oText = $popupname." ".($i+1)."
    ".$subheading."
    ".$author." (".$datestamp.")"; + $CONTENT_CONTENT_TABLE_IMAGES .= $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText); +} +return $CONTENT_CONTENT_TABLE_IMAGES; +} +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_CUSTOM_TAGS +global $CONTENT_CONTENT_TABLE_CUSTOM_TAGS; +return $CONTENT_CONTENT_TABLE_CUSTOM_TAGS; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_PAGENAMES +global $CONTENT_CONTENT_TABLE_PAGENAMES; +return $CONTENT_CONTENT_TABLE_PAGENAMES; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_NEXT_PAGE +global $CONTENT_CONTENT_TABLE_NEXT_PAGE; +return $CONTENT_CONTENT_TABLE_NEXT_PAGE; +SC_END + +SC_BEGIN CONTENT_CONTENT_TABLE_PREV_PAGE +global $CONTENT_CONTENT_TABLE_PREV_PAGE; +return $CONTENT_CONTENT_TABLE_PREV_PAGE; +SC_END + + + + +// PRINT PAGE ------------------------------------------------ + +//content images (from uploaded area) used in the print page +SC_BEGIN CONTENT_PRINT_IMAGES +global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent; +if($content_pref["content_content_images"]){ +$imagestmp = explode("[img]", $row['content_image']); +foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } +} +$images = array_values($imagestmp); +$CONTENT_PRINT_IMAGES = ""; +for($i=0;$i

    "; + } +} +return $CONTENT_PRINT_IMAGES; +} +SC_END + + +// PDF PAGE ------------------------------------------------ + +//content images (from uploaded area) used in the pdf creation +SC_BEGIN CONTENT_PDF_IMAGES +global $CONTENT_PDF_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent; +if($content_pref["content_content_images"]){ +$imagestmp = explode("[img]", $row['content_image']); +foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } +} +$images = array_values($imagestmp); +$CONTENT_PDF_IMAGES = ""; +for($i=0;$i"; + } +} +return $CONTENT_PDF_IMAGES; +} +SC_END + +*/ +?> diff --git a/e107_plugins/content/content_sql.php b/e107_plugins/content/content_sql.php new file mode 100644 index 000000000..de6714f14 --- /dev/null +++ b/e107_plugins/content/content_sql.php @@ -0,0 +1,51 @@ + +# Table structure for table `content` +# + +CREATE TABLE pcontent ( + content_id int(10) unsigned NOT NULL auto_increment, + content_heading varchar(255) NOT NULL default '', + content_subheading varchar(255) NOT NULL default '', + content_summary text NOT NULL, + content_text longtext NOT NULL, + content_author varchar(255) NOT NULL default '', + content_icon varchar(255) NOT NULL default '', + content_file text NOT NULL, + content_image text NOT NULL, + content_parent varchar(50) NOT NULL default '', + content_comment tinyint(1) unsigned NOT NULL default '0', + content_rate tinyint(1) unsigned NOT NULL default '0', + content_pe tinyint(1) unsigned NOT NULL default '0', + content_refer text NOT NULL, + content_datestamp int(10) unsigned NOT NULL default '0', + content_enddate int(10) unsigned NOT NULL default '0', + content_class varchar(255) NOT NULL default '', + content_pref text NOT NULL, + content_order varchar(10) NOT NULL default '0', + content_score tinyint(3) unsigned NOT NULL default '0', + content_meta text NOT NULL, + content_layout varchar(255) NOT NULL default '', + PRIMARY KEY (content_id) +) TYPE=MyISAM; +# -------------------------------------------------------- + diff --git a/e107_plugins/content/content_submit.php b/e107_plugins/content/content_submit.php new file mode 100644 index 000000000..e9611af3a --- /dev/null +++ b/e107_plugins/content/content_submit.php @@ -0,0 +1,145 @@ + setPageTitle(); + +require_once(HEADERF); + +if(isset($_POST['create_content'])){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none" && $_POST['content_author_name'] != "" && $_POST['content_author_email'] != ""){ + $adb -> dbContent("create", "submit"); + }else{ + $message = CONTENT_ADMIN_SUBMIT_LAN_4; + } +} + +if(isset($qs[0]) && $qs[0] == "s"){ + $message = CONTENT_ADMIN_SUBMIT_LAN_2."

    ".CONTENT_ADMIN_SUBMIT_LAN_5; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(FOOTERF); + exit; +} +if(isset($qs[0]) && $qs[0] == "d"){ + $message = CONTENT_ADMIN_SUBMIT_LAN_3."

    ".CONTENT_ADMIN_SUBMIT_LAN_5; + $ns -> tablerender("", "
    ".$message."
    "); + require_once(FOOTERF); + exit; +} + +if(isset($message)){ + $ns -> tablerender("", "
    ".$message."
    "); +} + +if(!isset($qs[0])){ + if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_icon, content_pref", "content_parent = '0' AND content_class REGEXP '".e_CLASS_REGEXP."' ORDER BY content_heading")){ + $text .= "
    ".CONTENT_ADMIN_SUBMIT_LAN_0."
    "; + }else{ + if(!isset($CONTENT_SUBMIT_TYPE_TABLE)){ + if(is_readable(e_THEME.$pref['sitetheme']."/content/content_submit_type_template.php")){ + require_once(e_THEME.$pref['sitetheme']."/content/content_submit_type_template.php"); + }else{ + require_once(e_PLUGIN."content/templates/content_submit_type_template.php"); + } + } + $sql2 = ""; + $content_submit_type_table_string = ""; + $count = "0"; + while($row = $sql -> db_Fetch()){ + if(!is_object($sql2)){ $sql2 = new db; } + + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + $content_pref["content_cat_icon_path_large"] = ($content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/" ); + $content_pref["content_cat_icon_path_small"] = ($content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/" ); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ + $content_submit_type_table_string .= $tp -> parseTemplate($CONTENT_SUBMIT_TYPE_TABLE, FALSE, $content_shortcodes); + $count = $count + 1; + } + } + if($count == "0"){ + $text .= "
    ".CONTENT_ADMIN_SUBMIT_LAN_0."
    "; + }else{ + $text = $CONTENT_SUBMIT_TYPE_TABLE_START.$content_submit_type_table_string.$CONTENT_SUBMIT_TYPE_TABLE_END; + } + } + $caption = CONTENT_ADMIN_SUBMIT_LAN_1; + $ns -> tablerender($caption, $text); +} + +if(isset($qs[0]) && $qs[0]=="content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])){ + //check if valid categories exist for this main parent + $array = $aa -> getCategoryTree("", intval($qs[2]), TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $sql2 = new db; + //$contenttotal = $sql2 -> db_Count($plugintable, "(*)", "WHERE ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " ); + $aform -> show_create_content("submit"); +} + +require_once(FOOTERF); + +?> diff --git a/e107_plugins/content/content_update.php b/e107_plugins/content/content_update.php new file mode 100644 index 000000000..57168dc80 --- /dev/null +++ b/e107_plugins/content/content_update.php @@ -0,0 +1,368 @@ +db_Select("plugin", "plugin_version", "plugin_path = 'content'")) +{ + $row = $sql->db_Fetch(); + $content_version = $row['plugin_version']; +} + +//create table if it doesn't exist +if(!$sql->db_Query("SHOW COLUMNS FROM ".MPREFIX."pcontent")) { + $query = "CREATE TABLE ".MPREFIX."pcontent ( + content_id int(10) unsigned NOT NULL auto_increment, + content_heading varchar(255) NOT NULL default '', + content_subheading varchar(255) NOT NULL default '', + content_summary text NOT NULL, + content_text longtext NOT NULL, + content_author varchar(255) NOT NULL default '', + content_icon varchar(255) NOT NULL default '', + content_file text NOT NULL, + content_image text NOT NULL, + content_parent varchar(50) NOT NULL default '', + content_comment tinyint(1) unsigned NOT NULL default '0', + content_rate tinyint(1) unsigned NOT NULL default '0', + content_pe tinyint(1) unsigned NOT NULL default '0', + content_refer text NOT NULL, + content_datestamp int(10) unsigned NOT NULL default '0', + content_enddate int(10) unsigned NOT NULL default '0', + content_class varchar(255) NOT NULL default '', + content_pref text NOT NULL, + content_order varchar(10) NOT NULL default '0', + content_score tinyint(3) unsigned NOT NULL default '0', + content_meta text NOT NULL, + content_layout varchar(255) NOT NULL default '', + PRIMARY KEY (content_id) + ) TYPE=MyISAM;"; + + $sql->db_Select_gen($query); +} + +$text = ""; +$main_convert = ""; +//main convert + +$newcontent = $sql -> db_Count($plugintable, "(*)", ""); +if($newcontent == 0){ + + unset($text); + + //possible database values + //content page: $content_parent == "1" && $content_type == "1" //added at 20051031 + //content page: $content_parent == "0" && $content_type == "1" + //review category: $content_parent == "0" && $content_type == "10" + //article category: $content_parent == "0" && $content_type == "6" + //review: $content_type == "3" || $content_type == "16" + //article: $content_type == "0" || $content_type == "15" + + // ##### STAGE 1 : ANALYSE OLD CONTENT -------------------------------------------------------- + $sql = new db; + $totaloldcontentrows = $sql -> db_Count("content"); + $totaloldrowscat_article = $sql -> db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '6'"); + $totaloldrowscat_review = $sql -> db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '10'"); + $totaloldrowsitem_content = $sql -> db_Count("content", "(*)", "WHERE (content_parent = '0' || content_parent = '1') AND content_type = '1'"); + $totaloldrowsitem_review = $sql -> db_Count("content", "(*)", "WHERE content_type = '3' || content_type = '16'"); + $totaloldrowsitem_article = $sql -> db_Count("content", "(*)", "WHERE content_type = '0' || content_type = '15'"); + + if($totaloldrowsitem_content == 0 && $totaloldrowsitem_article == 0 && $totaloldrowsitem_review == 0){ + $totaloldrowsitem_content = "1"; + $totaloldrowsitem_article = "1"; + $totaloldrowsitem_review = "1"; + + //if no old records exist, create a few default categories + $main_convert = create_defaults(); + }else{ + + //analyse unknown rows + $unknown_array = $ac -> analyse_unknown(); + + if($totaloldcontentrows == 0){ + $totaloldrowsitem_content = "1"; + $totaloldrowsitem_article = "1"; + $totaloldrowsitem_review = "1"; + } + + //create mainparent + $content_mainarray = $ac -> create_mainparent("content", $totaloldrowsitem_content, "1"); + $article_mainarray = $ac -> create_mainparent("article", $totaloldrowsitem_article, "2"); + $review_mainarray = $ac -> create_mainparent("review", $totaloldrowsitem_review, "3"); + + //convert categories + $article_cat_array = $ac -> convert_category("article", "content_parent = '0' AND content_type = '6'", "2"); + $review_cat_array = $ac -> convert_category("review", "content_parent = '0' AND content_type = '10'", "3"); + + //convert rows + $content_array = $ac -> convert_row("content", "(content_parent = '0' || content_parent = '1') AND content_type = '1'", "1"); + $article_array = $ac -> convert_row("article", "content_type = '0' || content_type = '15'", "2"); + $review_array = $ac -> convert_row("review", "content_type = '3' || content_type = '16'", "3"); + + //convert comments + $ac -> convert_comments(); + + //convert rating + $ac -> convert_rating(); + + $conversion_analyses_rows_total = $totaloldcontentrows; + + $conversion_analyses_rows_converted = (count($article_cat_array[1]) + count($review_cat_array[1]) + count($content_array[2]) + count($article_array[2]) + count($review_array[2])); + + $conversion_analyses_rows_warning = (count($content_array[4]) + count($content_array[5]) + count($article_array[4]) + count($article_array[5]) + count($review_array[4]) + count($review_array[5])); + + $conversion_analyses_rows_failed = (count($article_cat_array[2]) + count($review_cat_array[2]) + count($content_array[3]) + count($article_array[3]) + count($review_array[3]) + count($unknown_array[1])); + + + //only output detailed information if developer mode is set + if ($pref['developer']) { + showlink(); + $SPACER = " "; + $text = " + "; + + //conversion analysis + $text .= " + + + + "; + + $text .= $SPACER; + + //old content table : analysis + $text .= " + + + + "; + + $text .= $SPACER; + + //unknown rows + if(count($unknown_array[0]) > 0){ + $text .= ""; + $text .= " + + + + "; + } + + $text .= " + + ".$SPACER." + + ".$ac -> results_conversion_mainparent($content_mainarray, $review_mainarray, $article_mainarray)." + + ".$SPACER." + + + ".$ac -> results_conversion_row("content", $content_array, $totaloldrowsitem_content)." + + ".$SPACER." + + + ".$ac -> results_conversion_category("review", $review_cat_array, $totaloldrowscat_review)." + ".$ac -> results_conversion_row("review", $review_array, $totaloldrowsitem_review)." + + ".$SPACER." + + + ".$ac -> results_conversion_category("article", $article_cat_array, $totaloldrowscat_article)." + ".$ac -> results_conversion_row("article", $article_array, $totaloldrowsitem_article)." + + ".$SPACER." + +
    ".CONTENT_ADMIN_CONVERSION_LAN_11." + ".CONTENT_ADMIN_CONVERSION_LAN_48." + +
    ".CONTENT_ADMIN_CONVERSION_LAN_16." + ".CONTENT_ADMIN_CONVERSION_LAN_48." + +
    ".CONTENT_ADMIN_CONVERSION_LAN_51."
    ".CONTENT_ICON_ERROR." ".count($unknown_array[0])." ".CONTENT_ADMIN_CONVERSION_LAN_51." + ".CONTENT_ADMIN_CONVERSION_LAN_48." + +
    content : ".CONTENT_ADMIN_CONVERSION_LAN_27."
    review : ".CONTENT_ADMIN_CONVERSION_LAN_27."
    article : ".CONTENT_ADMIN_CONVERSION_LAN_27."
    "; + + $main_convert = array($caption, $text); + } + + } +} + +$text = ""; +//update to 1.1 parent values to new style +$upgrade_1_1 = FALSE; +if($thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" )){ + while($row = $sql -> db_Fetch()){ + if( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){ + //if item with old parent value exists, you need to upgrade to 1.1 + $upgrade_1_1 = TRUE; + } + } +} +if($upgrade_1_1 === TRUE){ + $text .= $ac -> upgrade_1_1(); +} + +//upgrade to 1.2 table structure (add score, meta, layout fields) +$text .= $ac -> upgrade_1_2(); + +//upgrade to 1.21 (update content_author fields) +$text .= $ac -> upgrade_1_21(); + +//upgrade to 1.22 (update preference storage method) +$text .= $ac -> upgrade_1_22(); + +//upgrade to 1.23 (update preference storage method) +$text .= $ac -> upgrade_1_23(); + +//upgrade to 1.24 (update custom theme) +$text .= $ac -> upgrade_1_24(); + +//render message +if(isset($text)){ + //only output detailed information if developer mode is set + if ($pref['developer']) { + $caption = CONTENT_ADMIN_CONVERSION_LAN_63; + $ns -> tablerender($caption, $text); + } +} + +//render primary conversion results +if(is_array($main_convert)){ + if(isset($main_convert[1])){ + //only output detailed information if developer mode is set + if ($pref['developer']) { + $ns -> tablerender($main_convert[0], $main_convert[1]); + } + } +} + +//finally set the new content plugin version number +set_content_version(); + + + + +//create default mainparent category for content, review and article +function create_defaults() +{ + global $ns, $ac, $plugindir; + + $plugindir = e_PLUGIN."content/"; + + if(!is_object($ac)){ + require_once($plugindir."handlers/content_convert_class.php"); + $ac = new content_convert; + } + + $content_mainarray = $ac -> create_mainparent("content", "1", "1"); + $article_mainarray = $ac -> create_mainparent("article", "1", "2"); + $review_mainarray = $ac -> create_mainparent("review", "1", "3"); + + $main_convert = ''; + //only output detailed information if developer mode is set + if ($pref['developer']) { + showlink(); + + $text = ""; + $text .= $ac -> results_conversion_mainparent($content_mainarray, $review_mainarray, $article_mainarray); + $text .= "
    "; + + $main_convert = array(CONTENT_ADMIN_CONVERSION_LAN_52, $text); + } + return $main_convert; +} + + + +//show link to start managing the content management plugin +function showlink() +{ + global $ns, $pref; + //only output detailed information if developer mode is set + if ($pref['developer']) { + $text = "
    ".CONTENT_ADMIN_CONVERSION_LAN_46."
    "; + $caption = CONTENT_ADMIN_CONVERSION_LAN_47; + $ns -> tablerender($caption, $text); + } +} + + + +//update content plugin version number +function set_content_version() +{ + global $sql, $pref; + $new_version = "1.24"; + $sql->db_Update('plugin',"plugin_version = '{$new_version}' WHERE plugin_path='content'"); + $text = ''; + //only output detailed information if developer mode is set + if ($pref['developer']) { + $text = CONTENT_ADMIN_CONVERSION_LAN_62." $new_version
    "; + } + return $text; +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/content_update_check.php b/e107_plugins/content/content_update_check.php new file mode 100644 index 000000000..95c2cb559 --- /dev/null +++ b/e107_plugins/content/content_update_check.php @@ -0,0 +1,85 @@ +db_Select("plugin", "plugin_version", "plugin_path = 'content'")){ + return FALSE; //needed + }else{ + $row = $sql->db_Fetch(); + + //if version < 1.23, return FALSE = needed + if($row['plugin_version'] < 1.24){ + return FALSE; //needed + } + + $newcontent = $sql -> db_Count("pcontent", "(*)", ""); + + //if no rows in new table && no old content table exists, return FALSE = needed + $exists = mysql_query("SELECT 1 FROM ".MPREFIX."content LIMIT 0"); + if($newcontent == 0 && !$exists){ + return FALSE; //needed + } + + //if parent value is old style, return FALSE = needed + if($newcontent > 0){ + if($thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" )){ + while($row = $sql -> db_Fetch()){ + if( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){ + //if item with old parent value exists, you need to upgrade to 1.1 + return FALSE; //needed + } + } + } + } + + //if added fields are not present, return FALSE = needed + $field1 = $sql->db_Field("pcontent",19); + $field2 = $sql->db_Field("pcontent",20); + $field3 = $sql->db_Field("pcontent",21); + if($field1 != "content_score" && $field2 != "content_meta" && $field3 != "content_layout"){ + return FALSE; //needed + } + + //else if passing all above checks, return TRUE = not needed + return TRUE; + } + } +} + + + +?> + \ No newline at end of file diff --git a/e107_plugins/content/e_comment.php b/e107_plugins/content/e_comment.php new file mode 100644 index 000000000..ac48ffa92 --- /dev/null +++ b/e107_plugins/content/e_comment.php @@ -0,0 +1,31 @@ +".time().") AND c.content_class REGEXP '".e_CLASS_REGEXP."' "; + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_emailprint.php b/e107_plugins/content/e_emailprint.php new file mode 100644 index 000000000..e12464738 --- /dev/null +++ b/e107_plugins/content/e_emailprint.php @@ -0,0 +1,174 @@ + db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_image, content_parent, content_datestamp, content_class", "content_id='".intval($id)."' "); + $row = $sql -> db_Fetch(); + + if(!check_class($row['content_class'])){ + header("location:".e_PLUGIN."content/content.php"); exit; + } + $row['content_heading'] = $tp -> toHTML($row['content_heading']); + $row['content_subheading'] = $tp -> toHTML($row['content_subheading']); + $row['content_text'] = $tp -> replaceConstants($row['content_text']); + $row['content_text'] = preg_replace("/\{EMAILPRINT\}|\[newpage\]/", "", $tp -> toHTML($row['content_text'], TRUE)); + $authordetails = $aa -> getAuthor($row['content_author']); + $row['content_datestamp'] = $con -> convert_date($row['content_datestamp'], "long"); + + $mainparent = $aa -> getMainParent($id); + $content_pref = $aa -> getContentPref($mainparent); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $img = $tp -> parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes); + + $text = " + ".$row['content_heading']." +
    + ".$row['content_subheading']." +
    + ".$authordetails[1].", ".$row['content_datestamp']." +

    +
    ".$img."
    + ".$row['content_text']." +


    + ".CONTENT_EMAILPRINT_LAN_1." ".SITENAME." +
    + ( ".SITEURLBASE.e_PLUGIN_ABS."content/content.php?content.".$row['content_id']." ) + "; + + require_once(e_HANDLER.'bbcode_handler.php'); + $e_bb = new e_bbcode; + $text = $e_bb->parseBBCodes($text, ''); + + return $text; +} + +function email_item($id) +{ + $plugintable = "pcontent"; + if(!is_object($sql)){ $sql = new db; } + if($sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_parent, content_datestamp, content_class", "content_id='".intval($id)."' ")){ + while($row = $sql -> db_Fetch()){ + $tmp = explode(".",$row['content_parent']); + if(!check_class($row['content_class'])){ + header("location:".e_PLUGIN."content/content.php"); exit; + } + $message = SITEURL.e_PLUGIN."content/content.php?content.".$id."\n\n".$row['content_heading']."\n".$row['content_subheading']."\n"; + } + return $message; + } +} + + +function print_item_pdf($id){ + global $tp, $content_shortcodes; + global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent, $eArrayStorage; + + //in this section you decide what to needs to be output to the pdf file + $con = new convert; + + require_once(e_PLUGIN."content/content_shortcodes.php"); + + require_once(e_PLUGIN."content/handlers/content_class.php"); + $aa = new content; + + if(!is_object($sql)){ $sql = new db; } + $sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='".intval($id)."' "); + $row = $sql -> db_Fetch(); + + if(!check_class($row['content_class'])){ + header("location:".e_PLUGIN."content/content.php"); exit; + } + $authordetails = $aa -> getAuthor($row['content_author']); + $row['content_datestamp'] = $con -> convert_date($row['content_datestamp'], "long"); + $img = $tp -> parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes); + + $mainparent = $aa -> getMainParent(intval($id)); + $content_pref = $aa -> getContentPref($mainparent); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $img = $tp -> parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes); + + //add custom and preset tags if present + $custom = $eArrayStorage->ReadArray($row['content_pref']); + $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); + + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = ""; + if(!empty($custom)){ + foreach($custom as $k => $v){ + if($k == "content_custom_presettags"){ + if(isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]){ + foreach($v as $ck => $cv){ + if(is_array($cv)){ //date + if(!($cv['day']=="" && $cv['month']=="" && $cv['year']=="")){ + $vv = $cv['day']." ".$months[($cv['month']-1)]." ".$cv['year']; + } + }else{ + $vv = $cv; + } + if( isset($ck) && $ck != "" && isset($vv) && $vv!="" ){ + $CUSTOM_TAGS = TRUE; + $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true); + $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true); + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY." : ".$CONTENT_CONTENT_TABLE_CUSTOM_VALUE."
    "; + } + } + } + }else{ + if(isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]){ + $key = substr($k,15); + if( isset($key) && $key != "" && isset($v) && $v!="" ){ + $CUSTOM_TAGS = TRUE; + $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true); + $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true); + $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY." : ".$CONTENT_CONTENT_TABLE_CUSTOM_VALUE."
    "; + } + } + } + } + } + + $text = " + ".$row['content_heading']."
    + ".$row['content_subheading']."
    + ".$authordetails[1].", ".$row['content_datestamp']."
    +
    + ".$row['content_text']."
    + ".($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "")." +
    ".$img."
    + "; + + //the following defines are processed in the document properties of the pdf file + + //Do NOT add parser function to the variables, leave them as raw data ! + //as the pdf methods will handle this ! + $text = $text; //define text + $creator = SITENAME; //define creator + $author = $authordetails[1]; //define author + $title = $row['content_heading']; //define title + $subject = $row['content_subheading']; //define subject + $keywords = ""; //define keywords + + //define url to use in the header of the pdf file + $url = SITEURLBASE.e_PLUGIN_ABS."content/content.php?content.".$row['content_id']; + + //always return an array with the following data: + return array($text, $creator, $author, $title, $subject, $keywords, $url); +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_frontpage.php b/e107_plugins/content/e_frontpage.php new file mode 100644 index 000000000..62cea44ad --- /dev/null +++ b/e107_plugins/content/e_frontpage.php @@ -0,0 +1,21 @@ + db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1)='0'")) { + while ($row = $sql2 -> db_Fetch()) { + $front_page['content_'.$row['content_id']]['title'] = CONT_FP_1.': '.$row['content_heading']; + $front_page['content_'.$row['content_id']]['page'][] = array('page' => $PLUGINS_DIRECTORY.'content/content.php?recent.'.$row['content_id'], 'title' => $row['content_heading'].' '.CONT_FP_2); + if ($sql -> db_Select("pcontent", "content_id, content_heading", "content_parent = '".$row['content_id']."' ORDER BY content_heading")){ + while ($row2 = $sql -> db_Fetch()) { + $front_page['content_'.$row['content_id']]['page'][] = array('page' => $PLUGINS_DIRECTORY.'content/content.php?content.'.$row2['content_id'], 'title' => $row2['content_heading']); + } + } + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_latest.php b/e107_plugins/content/e_latest.php new file mode 100644 index 000000000..3d7b67842 --- /dev/null +++ b/e107_plugins/content/e_latest.php @@ -0,0 +1,20 @@ + db_Count($plugintable, '(*)', "WHERE content_refer='sa' "); +$text .= " +
    + +"; +if($reported_content) { + $text .= " ".CONTENT_LATEST_LAN_1." $reported_content"; +} else { + $text .= CONTENT_LATEST_LAN_1." ".$reported_content; +} +$text .= "
    "; + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_list.php b/e107_plugins/content/e_list.php new file mode 100644 index 000000000..b35457a67 --- /dev/null +++ b/e107_plugins/content/e_list.php @@ -0,0 +1,111 @@ + db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){ + return; + } + + require_once(e_PLUGIN."content/handlers/content_class.php"); + $aa = new content; + + $datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") "; + + global $contentmode; + //contentmode : content_144 (content_ + idvalue) + if($contentmode){ + $headingquery = " AND content_id = '".substr($contentmode,8)."' "; + }else{ + $headingquery = ""; + } + + //get main parent types + $sqlm = new db; + if(!$mainparents = $sqlm -> db_Select("pcontent", "*", "content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading")){ + $LIST_DATA = "no valid content category"; + }else{ + while($rowm = $sqlm -> db_Fetch()){ + $ICON = ""; + $HEADING = ""; + $AUTHOR = ""; + $CATEGORY = ""; + $DATE = ""; + $INFO = ""; + $LIST_CAPTION = $rowm['content_heading']; + + //global var for this main parent + $mainparent = $rowm['content_id']; + + //get path variables + $content_recent_pref = $aa -> getContentPref($mainparent); + $content_recent_pref["content_icon_path"] = ($content_recent_pref["content_icon_path"] ? $content_recent_pref["content_icon_path"] : "{e_PLUGIN}content/images/icon/" ); + $content_icon_path = $tp -> replaceConstants($content_recent_pref["content_icon_path"]); + + //prepare query string + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_class REGEXP '".e_CLASS_REGEXP."' "; + + //check so only the preferences from the correct content_type (article, content, review etc) are used and rendered + if(substr($contentmode,8) == $rowm['content_id']){ + + if($mode == "new_page" || $mode == "new_menu" ){ + $lvisit = $this -> getlvisit(); + $qry = $qry." AND content_datestamp>".$lvisit; + }else{ + $qry = $qry." ".$datequery; + } + $qry .= " ORDER BY content_datestamp DESC LIMIT 0,".intval($arr[7]); + + //get recent content for each main parent + $sqli = new db; + if(!$resultitem = $sqli -> db_Select("pcontent", "*", $qry)){ + $LIST_DATA = "no items in ".$rowm['content_heading']; + }else{ + $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); + + while($rowi = $sqli -> db_Fetch()){ + $rowheading = $this -> parse_heading($rowi['content_heading'], $mode); + $HEADING = "".$rowheading.""; + //category + if($arr[4]){ + $crumb = ""; + if(array_key_exists($rowi['content_parent'], $array)){ + $newarr = $array[$rowi['content_parent']]; + $newarr = array_reverse($newarr); + $CATEGORY = "".$newarr[0].""; + } + } + + $DATE = ($arr[5] ? $this -> getListDate($rowi['content_datestamp'], $mode) : ""); + //$ICON = $this -> getBullet($arr[6], $mode); + + $image_link_append = ""; + if($rowi['content_icon'] && file_exists(e_PLUGIN."content/images/icon/".$rowi['content_icon'])){ + $ICON = $image_link_append.""; + }else{ + $ICON = ""; + } + + //get author details + if($arr[3]){ + $authordetails = $aa -> getAuthor($rowi['content_author']); + if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0"){ + $AUTHOR = "".$authordetails[1].""; + }else{ + $AUTHOR = $authordetails[1]; + } + }else{ + $AUTHOR = ""; + } + $INFO = ""; + + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + } + } + } + + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_meta.php b/e107_plugins/content/e_meta.php new file mode 100644 index 000000000..9cd5959de --- /dev/null +++ b/e107_plugins/content/e_meta.php @@ -0,0 +1,52 @@ +\n"; + +if(e_QUERY){ + $qs = explode(".", e_QUERY); + + if(is_numeric($qs[0])){ + $from = array_shift($qs); + }else{ + $from = "0"; + } +} +if(isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && is_numeric($qs[1]) ){ + $add_meta_keywords = ''; + //meta keywords from content item + if($sql -> db_Select('pcontent', "content_meta", "content_id='".intval($qs[1])."'")){ + list($row['content_meta']) = $sql -> db_Fetch(); + $exmeta = $row['content_meta']; + if($exmeta != ""){ + $exmeta = str_replace(", ", ",", $exmeta); + $exmeta = str_replace(" ", ",", $exmeta); + $exmeta = str_replace(",", ", ", $exmeta); + $add_meta_keywords = $exmeta; + } + } + if($add_meta_keywords){ + define("META_MERGE", TRUE); + define("META_KEYWORDS", " ".$add_meta_keywords); + } +} + + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_notify.php b/e107_plugins/content/e_notify.php new file mode 100644 index 000000000..7ac5c1722 --- /dev/null +++ b/e107_plugins/content/e_notify.php @@ -0,0 +1,36 @@ + CONTENT_NOTIFY_LAN_2); + +if (!function_exists('notify_content')) { + function notify_content($data) { + global $nt; + foreach ($data as $key => $value) { + $message .= $key.': '.$value.'
    '; + } + $nt -> send('content', CONTENT_NOTIFY_LAN_3, $message); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_rss.php b/e107_plugins/content/e_rss.php new file mode 100644 index 000000000..9f6d74fd4 --- /dev/null +++ b/e107_plugins/content/e_rss.php @@ -0,0 +1,76 @@ +$v){ + $eplug_rss_feed[] = $v; +} + +function get_rss(){ + global $aa; + + require_once(e_PLUGIN."content/handlers/content_class.php"); + $aa = new content; + $rss = array(); + $array = $aa -> getCategoryTree('', '', FALSE); + foreach($array as $k=>$v){ + $name = ''; + for($i=0;$i "; + $i++; + } + $name = substr($name,0,-3); + $feed['name'] = $name; + $feed['url'] = 'content'; //the identifier for the rss feed url + $feed['topic_id'] = $k; //the topic_id, empty on default (to select a certain category) + $feed['path'] = 'content'; //this is the plugin path location + $feed['text'] = 'this is the rss feed for content category : '.$name; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $rss[] = $feed; + } + return $rss; +} +//##### ------------------------------------------------------------------------------------ + + +//##### create rss data, return as array $eplug_rss_data ----------------------------------- +$mainparent = $aa -> getMainParent($this->topicid); +$content_pref = $aa -> getContentPref($mainparent); +$array = $aa -> getCategoryTree("", $mainparent, TRUE); +$datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") "; +$qry = " content_refer !='sa' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '".$this->topicid."' ORDER BY content_datestamp DESC LIMIT 0,".$this -> limit; + +$rss = array(); +$sqlrss = new db; +if($items = $sqlrss -> db_Select('pcontent', "*", $qry )){ + $i=0; + while($rowrss = $sqlrss -> db_Fetch()){ + //$author = array($author_id, $author_name, $author_email, $content_author); + $author = $aa -> getAuthor($rowrss['content_author']); + $rss[$i]['author'] = $author[1]; + $rss[$i]['author_email'] = $author[2]; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."content/content.php?content.".$rowrss['content_id']; + $rss[$i]['linkid'] = $rowrss['content_id']; + $rss[$i]['title'] = $rowrss['content_heading']; + $rss[$i]['description'] = $rowrss['content_subheading']; + $rss[$i]['category_name'] = $array[$rowrss['content_parent']][count($array[$rowrss['content_parent']])-1]; + $rss[$i]['category_link'] = $e107->base_path.$PLUGINS_DIRECTORY."content/content.php?cat.".$rowrss['content_parent']; + $rss[$i]['datestamp'] = $rowrss['content_datestamp']; + $rss[$i]['enc_url'] = ""; + $rss[$i]['enc_leng'] = ""; + $rss[$i]['enc_type'] = ""; + $i++; + } +} +$eplug_rss_data[] = $rss; +//##### ------------------------------------------------------------------------------------ + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_search.php b/e107_plugins/content/e_search.php new file mode 100644 index 000000000..4145f3247 --- /dev/null +++ b/e107_plugins/content/e_search.php @@ -0,0 +1,11 @@ + e_PLUGIN.'content/search/search_parser.php', 'qtype' => CONT_SCH_LAN_1, 'refpage' => 'content.php', 'advanced' => e_PLUGIN.'content/search/search_advanced.php'); + +?> \ No newline at end of file diff --git a/e107_plugins/content/e_status.php b/e107_plugins/content/e_status.php new file mode 100644 index 000000000..6f87fbe7c --- /dev/null +++ b/e107_plugins/content/e_status.php @@ -0,0 +1,18 @@ + db_Count("pcontent", "(*)", "WHERE LEFT(content_parent,1) != '0' AND content_refer != 'sa'"); +if($total == 0){ +$text .= "
    Content: ".$total."
    "; +}else{ +$text .= ""; +} +$maincat = $sql -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1) = '0' ORDER BY content_heading"); +$text .= ""; +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_class.php b/e107_plugins/content/handlers/content_class.php new file mode 100644 index 000000000..bdab9f0c3 --- /dev/null +++ b/e107_plugins/content/handlers/content_class.php @@ -0,0 +1,1513 @@ +".time().") "; + +require_once($plugindir."handlers/content_defines.php"); + +if(!is_object($sql)){ $sql = new db; } + +class content{ + + function ContentDefaultPrefs(){ + global $tp; + + //ADMIN CREATE FORM + $content_pref['content_admin_subheading'] = "1"; //should subheading be available + $content_pref['content_admin_summary'] = "1"; //should summary be available + $content_pref['content_admin_startdate'] = "1"; //should start date be available + $content_pref['content_admin_enddate'] = "1"; //should end date be available + $content_pref['content_admin_icon'] = "0"; //should icon be available to add when creating an item + $content_pref['content_admin_attach'] = "0"; //should file be available to add when creating an item + $content_pref['content_admin_images'] = "0"; //should image be available to add when creating an item + $content_pref['content_admin_comment'] = "1"; //should comment be available to add when creating an item + $content_pref['content_admin_rating'] = "1"; //should rating be available to add when creating an item + $content_pref['content_admin_score'] = "1"; //should score be available to add when creating an item + $content_pref['content_admin_pe'] = "1"; //should printemailicons be available to add when creating an item + $content_pref['content_admin_visibility'] = "1"; //should visibility be available to add when creating an item + $content_pref['content_admin_meta'] = "0"; //should metatags be available to add when creating an item + $content_pref['content_admin_custom_number'] = "0"; //how many customtags should be available to add when creating an item + $content_pref['content_admin_images_number'] = "0"; //how many images should be available to add when creating an item + $content_pref['content_admin_files_number'] = "0"; //how many files should be available to add when creating an item + $content_pref['content_admin_layout'] = "0"; //should the option for choosing a layout template be shown + $content_pref['content_admin_customtags'] = "0"; //should options for adding additional data be shown + $content_pref['content_admin_presettags'] = "0"; //should preset data tags be shown + + //ADMIN CREATE CATEGORY FORM + $content_pref['content_admincat_subheading'] = '1'; //should subheading be available + $content_pref['content_admincat_startdate'] = '1'; //should startdate be available + $content_pref['content_admincat_enddate'] = '1'; //should enddate be available + $content_pref['content_admincat_uploadicon'] = '1'; //should uploadicon be available + $content_pref['content_admincat_selecticon'] = '1'; //should selecticon be available + $content_pref['content_admincat_comment'] = '1'; //should comment be available + $content_pref['content_admincat_rating'] = '1'; //should rating be available + $content_pref['content_admincat_pe'] = '1'; //should print email icons be available + $content_pref['content_admincat_visibility'] = '1'; //should visibility be available + + //SUBMIT FORM + $content_pref['content_submit'] = "0"; //should users be able to submit an item + $content_pref['content_submit_class'] = "0"; //define which userclass is able to submit an item + $content_pref['content_submit_directpost'] ="0"; //should submission be direclty posted as an item, or have them validated by admins + $content_pref['content_submit_subheading'] = '1'; //should subheading be available + $content_pref['content_submit_summary'] = '1'; //should summary be available + $content_pref['content_submit_startdate'] = '1'; //should startdate be available + $content_pref['content_submit_enddate'] = '1'; //should enddate be available + $content_pref['content_submit_icon'] = "0"; //should icon be available to add when submitting an item + $content_pref['content_submit_attach'] = "0"; //should file be available to add when submitting an item + $content_pref['content_submit_images'] = "0"; //should image be available to add when submitting an item + $content_pref['content_submit_comment'] = "0"; //should comment be available to add when submitting an item + $content_pref['content_submit_rating'] = "0"; //should rating be available to add when submitting an item + $content_pref['content_submit_score'] = "0"; //should score be available to add when submitting an item + $content_pref['content_submit_pe'] = "0"; //should printemailicons be available to add when submitting an item + $content_pref['content_submit_visibility'] = "0"; //should visibility be available to add when submitting an item + $content_pref['content_submit_meta'] = "0"; //should metatags be available to add when submitting an item + $content_pref['content_submit_custom_number'] = "0"; //how many customtags should be available to add when submitting an item + $content_pref['content_submit_images_number'] = "0"; //how many images should be available to add when submitting an item + $content_pref['content_submit_files_number'] = "0"; //how many files should be available to add when submitting an item + $content_pref['content_submit_layout'] = "0"; //should the option for choosing a layout template be shown + $content_pref['content_submit_customtags'] = "0"; //should options for adding additional data be shown + $content_pref['content_submit_presettags'] = "0"; //should preset data tags be shown + + //PATH THEME CSS + $content_pref['content_cat_icon_path_large'] = "{e_PLUGIN}content/images/cat/48/"; //default path to large categry icons + $content_pref['content_cat_icon_path_small'] = "{e_PLUGIN}content/images/cat/16/"; //default path to small category icons + + $content_pref['content_icon_path'] = "{e_PLUGIN}content/images/icon/"; //default path to item icons + $content_pref['content_icon_path_tmp'] = "{e_PLUGIN}content/images/icon/tmp/"; //default tmp path to item icons + + $content_pref['content_image_path'] = "{e_PLUGIN}content/images/image/"; //default path to item images + $content_pref['content_image_path_tmp'] = "{e_PLUGIN}content/images/image/tmp/"; //default tmp path to item images + + $content_pref['content_file_path'] = "{e_PLUGIN}content/images/file/"; //default path to item file attachments + $content_pref['content_file_path_tmp'] = "{e_PLUGIN}content/images/file/tmp/"; //default tmp path to item file attachments + + $content_pref['content_theme'] = "{e_PLUGIN}content/templates/default/"; //choose theme for main parent + $content_pref['content_layout'] = "content_content_template.php"; //choose default layout scheme + + //GENERAL + $content_pref['content_log'] = "0"; //activate log + $content_pref['content_blank_icon'] = "0"; //use blank icon if no icon present + $content_pref['content_blank_caticon'] = "0"; //use blank caticon if no caticon present + $content_pref['content_breadcrumb_catall'] = "0"; //show breadcrumb on all categories page + $content_pref['content_breadcrumb_cat'] = "0"; //show breadcrumb on single category page + $content_pref['content_breadcrumb_authorall'] = "0"; //show breadcrumb on all author page + $content_pref['content_breadcrumb_author'] = "0"; //show breadcrumb on single author page + $content_pref['content_breadcrumb_recent'] = "0"; //show breadcrumb on recent page + $content_pref['content_breadcrumb_item'] = "0"; //show breadcrumb on content item page + $content_pref['content_breadcrumb_top'] = "0"; //show breadcrumb on top rated page + $content_pref['content_breadcrumb_archive'] = "0"; //show breadcrumb on archive page + $content_pref['content_breadcrumb_seperator{$id}'] = ">"; //seperator character between breadcrumb + $content_pref['content_breadcrumb_rendertype'] = "2"; //how to render the breadcrumb + $content_pref['content_navigator_catall'] = "0"; //show navigator on all categories page + $content_pref['content_navigator_cat'] = "0"; //show navigator on single category page + $content_pref['content_navigator_authorall'] = "0"; //show navigator on all author page + $content_pref['content_navigator_author'] = "0"; //show navigator on single author page + $content_pref['content_navigator_recent'] = "0"; //show navigator on recent page + $content_pref['content_navigator_item'] = "0"; //show navigator on content item page + $content_pref['content_navigator_top'] = "0"; //show navigator on top rated page + $content_pref['content_navigator_archive'] = "0"; //show navigator on archive page + $content_pref['content_search_catall'] = "0"; //show search keyword on all categories page + $content_pref['content_search_cat'] = "0"; //show search keyword on single category page + $content_pref['content_search_authorall'] = "0"; //show search keyword on all author page + $content_pref['content_search_author'] = "0"; //show search keyword on single author page + $content_pref['content_search_recent'] = "0"; //show search keyword on recent page + $content_pref['content_search_item'] = "0"; //show search keyword on content item page + $content_pref['content_search_top'] = "0"; //show search keyword on top rated page + $content_pref['content_search_archive'] = "0"; //show search keyword on archive page + $content_pref['content_ordering_catall'] = "0"; //show ordering on all categories page + $content_pref['content_ordering_cat'] = "0"; //show ordering on single category page + $content_pref['content_ordering_authorall'] = "0"; //show ordering on all author page + $content_pref['content_ordering_author'] = "0"; //show ordering on single author page + $content_pref['content_ordering_recent'] = "0"; //show ordering on recent page + $content_pref['content_ordering_item'] = "0"; //show ordering on content item page + $content_pref['content_ordering_top'] = "0"; //show ordering on top rated page + $content_pref['content_ordering_archive'] = "0"; //show ordering on archive page + $content_pref['content_searchmenu_rendertype'] = "1"; //rendertype for searchmenu (1=echo, 2=in separate menu) + $content_pref['content_nextprev'] = "1"; //use nextprev buttons + $content_pref['content_nextprev_number'] = "10"; //how many items on a page + $content_pref['content_defaultorder'] = "orderddate"; //default sort and order method + //upload icon/image size handling + $content_pref['content_upload_image_size'] = "500"; //resize size of uploaded image + $content_pref['content_upload_image_size_thumb'] = "100"; //resize size of created thumb on uploaded image + $content_pref['content_upload_icon_size'] = "100"; //resize size of uploaded icon + + //CONTENT ITEM PREVIEW + $content_pref['content_list_icon'] = "0"; //show icon + $content_pref['content_list_subheading'] = "1"; //show subheading + $content_pref['content_list_summary'] = "1"; //show summary + $content_pref['content_list_text'] = "0"; //show (part of) text + $content_pref['content_list_date'] = "0"; //show date + $content_pref['content_list_authorname'] = "0"; //show authorname + $content_pref['content_list_authorprofile'] = "0"; //show link to author profile + $content_pref['content_list_authoremail'] = "0"; //show authoremail + $content_pref['content_list_authoricon'] = "0"; //show link to author list + $content_pref['content_list_rating'] = "1"; //show rating system + $content_pref['content_list_peicon'] = "1"; //show printemailicons + $content_pref['content_list_parent'] = "0"; //show parent cat + $content_pref['content_list_refer'] = "0"; //show refer count + $content_pref['content_list_subheading_char'] = "100"; //how many subheading characters + $content_pref['content_list_subheading_post'] = "[...]"; //use a postfix for too long subheadings + $content_pref['content_list_summary_char'] = "100"; //how many summary characters + $content_pref['content_list_summary_post'] = "[...]"; //use a postfix for too long summary + $content_pref['content_list_text_char'] = "60"; //how many text words + $content_pref['content_list_text_post'] = CONTENT_LAN_16; //use a postfix for too long text + $content_pref['content_list_text_link'] = "1"; //show link to content item on postfix + $content_pref['content_list_authoremail_nonmember'] = "0"; //show email non member author + $content_pref['content_list_peicon_all'] = "0"; //override printemail icons + $content_pref['content_list_rating_all'] = "0"; //override rating system + $content_pref['content_list_editicon'] = "0"; //show link to admin edit item + $content_pref['content_list_datestyle'] = "%d %b %Y"; //choose datestyle for given date + $content_pref['content_list_caption'] = CONTENT_LAN_23; //caption for recent list + $content_pref['content_list_caption_append_name'] = '1'; //append category heading to caption + + //CATEGORY PAGES + //sections of content category in 'view all categories page' + $content_pref['content_catall_icon'] = "1"; //show icon + $content_pref['content_catall_subheading'] = "1"; //show subheading + $content_pref['content_catall_text'] = "0"; //show text + $content_pref['content_catall_date'] = "0"; //show date + $content_pref['content_catall_rating'] = "1"; //show rating + $content_pref['content_catall_authorname'] = "0"; //show author name + $content_pref['content_catall_authoremail'] = "0"; //show author email + $content_pref['content_catall_authorprofile'] = "0"; //show link to author profile + $content_pref['content_catall_authoricon'] = "0"; //show link to author list + $content_pref['content_catall_peicon'] = "1"; //show pe icons + $content_pref['content_catall_comment'] = "1"; //show amount of comments + $content_pref['content_catall_amount'] = "0"; //show amount of items + $content_pref['content_catall_text_char'] = "65"; //define amount of words of text to display + $content_pref['content_catall_text_post'] = CONTENT_LAN_16; //define postfix is text is too long + $content_pref['content_catall_text_link'] = "1"; //define if link to category should be added on postfix + $content_pref['content_catall_caption'] = CONTENT_LAN_25; //caption for all categories page + //sections of content category in 'view category' page + $content_pref['content_cat_icon'] = "1"; //show icon + $content_pref['content_cat_subheading'] = "1"; //show subheading + $content_pref['content_cat_text'] = "0"; //show text + $content_pref['content_cat_date'] = "0"; //show date + $content_pref['content_cat_authorname'] = "0"; //show author name + $content_pref['content_cat_authoremail'] = "0"; //show author email + $content_pref['content_cat_authorprofile'] = "0"; //show link to author profile + $content_pref['content_cat_authoricon'] = "0"; //show link to author list + $content_pref['content_cat_rating'] = "1"; //show rating + $content_pref['content_cat_peicon'] = "1"; //show pe icons + $content_pref['content_cat_comment'] = "1"; //show amount of comments + $content_pref['content_cat_amount'] = "1"; //show amount of items + $content_pref['content_cat_caption'] = CONTENT_LAN_26; //caption for single category page + $content_pref['content_cat_caption_append_name'] = '1'; //append category heading to caption + $content_pref['content_cat_sub_caption'] = CONTENT_LAN_28; //caption for subcategories + $content_pref['content_cat_item_caption'] = CONTENT_LAN_31; //caption for items in category + + //sections of subcategories in 'view category page' + $content_pref['content_catsub_icon'] = "1"; //show icon + $content_pref['content_catsub_subheading'] = "1"; //show subheading + $content_pref['content_catsub_amount'] = "1"; //show amount of items + $content_pref['content_cat_showparent'] = "1"; //show parent item in category page + $content_pref['content_cat_showparentsub'] = "1"; //show subcategories in category page + $content_pref['content_cat_listtype'] = "0"; //also show items from subategories + $content_pref['content_cat_menuorder'] = "1"; //order of parent and child items + $content_pref['content_cat_rendertype'] = "2"; //render method of the menus + $content_pref['content_cat_text_char'] = "65"; //define amount of words of text to display + $content_pref['content_cat_text_post'] = CONTENT_LAN_16; //define postfix is text is too long + $content_pref['content_cat_text_link'] = "1"; //define if link to category should be added on postfix + $content_pref['content_cat_authoremail_nonmember'] = "0"; //define if the email of a non-member will be displayed + $content_pref['content_cat_peicon_all'] = "0"; //override printemail icons + $content_pref['content_cat_rating_all'] = "0"; //override rating system + + //CONTENT PAGE + $content_pref['content_content_icon'] = "0"; //show icon + $content_pref['content_content_subheading'] = "1"; //show subheading + $content_pref['content_content_summary'] = "1"; //show summary + $content_pref['content_content_date'] = "0"; //show date + $content_pref['content_content_authorname'] = "1"; //show authorname + $content_pref['content_content_authorprofile'] = "0"; //show link to author profile + $content_pref['content_content_authoremail'] = "0"; //show suthoremail + $content_pref['content_content_authoricon'] = "0"; //show link to author list + $content_pref['content_content_parent'] = "0"; //show parent category + $content_pref['content_content_rating'] = "1"; //show rating system + $content_pref['content_content_peicon'] = "1"; //show printemailicons + $content_pref['content_content_refer'] = "0"; //show refer count + $content_pref['content_content_comment'] = "0"; //show amount of comments + $content_pref['content_content_authoremail_nonmember'] = "0"; //show email non member + $content_pref['content_content_peicon_all'] = "0"; //override printemail icons + $content_pref['content_content_rating_all'] = "0"; //override rating system + $content_pref['content_content_comment_all'] = "0"; //override comment system + $content_pref['content_content_editicon'] = "0"; //show link in content page to admin edit item + $content_pref['content_content_customtags'] = "0"; //should additional data be shown + $content_pref['content_content_presettags'] = "0"; //should preset data tags be shown + $content_pref['content_content_attach'] = "0"; //show attachments + $content_pref['content_content_images'] = "0"; //show images + $content_pref['content_content_pagenames_rendertype'] = "0"; //rendertype for articleindex on multipage content items + $content_pref['content_content_multipage_preset'] = "0"; //render custom/preset in multipage item first/last page + + //AUTHOR PAGE + $content_pref['content_author_lastitem'] = "0"; //show last item reference + $content_pref['content_author_amount'] = "1"; //show amount of items from this author + $content_pref['content_author_nextprev'] = "1"; //use next prev buttons + $content_pref['content_author_nextprev_number'] = "20"; //amount of items per page + $content_pref['content_author_index_caption'] = CONTENT_LAN_32; //caption for author index page + $content_pref['content_author_caption'] = CONTENT_LAN_32; //caption for single author page + $content_pref['content_author_caption_append_name'] = '1'; //append author name to caption + + //ARCHIVE PAGE + $content_pref['content_archive_nextprev'] = "1"; //archive : choose to show next/prev links + $content_pref['content_archive_nextprev_number'] = "30"; //archive : choose amount to use in next/prev + $content_pref['content_archive_letterindex'] = "0"; //archive : letter index + $content_pref['content_archive_datestyle'] = "%d %b %Y"; //archive : choose datestyle for given date + $content_pref['content_archive_date'] = "1"; //archive : section: show date + $content_pref['content_archive_authorname'] = "0"; //archive : section: show authorname + $content_pref['content_archive_authorprofile'] = "0"; //archive : section: show link to author profile + $content_pref['content_archive_authoricon'] = "0"; //archive : section: show link to author list + $content_pref['content_archive_authoremail'] = "0"; //archive : section: show author email + $content_pref['content_archive_authoremail_nonmember'] = "0"; //archive : show link to email of non-member author + $content_pref['content_archive_caption'] = CONTENT_LAN_84; //caption for archive page + + //TOP RATED PAGE + $content_pref['content_top_icon'] = "0"; //top : section: show icon + $content_pref['content_top_authorname'] = "0"; //top : section: show authorname + $content_pref['content_top_authorprofile'] = "0"; //top : section: show link to author profile + $content_pref['content_top_authoricon'] = "0"; //top : section: show link to author list + $content_pref['content_top_authoremail'] = "0"; //top : section: show author email + $content_pref['content_top_authoremail_nonmember'] = "0"; //top : show link to email of non-member author + $content_pref['content_top_icon_width'] = ''; //use this size for icon + $content_pref['content_top_caption'] = CONTENT_LAN_38; //caption for top rated page + $content_pref['content_top_caption_append_name'] = '1'; //append category heading to caption + + //TOP SCORE PAGE + $content_pref['content_score_icon'] = "0"; //score : section: show icon + $content_pref['content_score_authorname'] = "0"; //score : section: show authorname + $content_pref['content_score_authorprofile'] = "0"; //score : section: show link to author profile + $content_pref['content_score_authoricon'] = "0"; //score : section: show link to author list + $content_pref['content_score_authoremail'] = "0"; //score : section: show author email + $content_pref['content_score_authoremail_nonmember'] = "0"; //score : show link to email of non-member author + $content_pref['content_score_icon_width'] = ''; //use this size for icon + $content_pref['content_score_caption'] = CONTENT_LAN_87; //caption for top score page + $content_pref['content_score_caption_append_name'] = '1'; //append category heading to caption + + //MENU OPTIONS + $content_pref['content_menu_caption'] = CONTENT_MENU_LAN_0; //caption of menu + $content_pref['content_menu_search'] = "0"; //show search keyword + $content_pref['content_menu_sort'] = "0"; //show sorting methods + $content_pref['content_menu_links'] = "1"; //show content links + $content_pref['content_menu_links_dropdown'] = "0"; //rendertype of content links (in dropdown or as normal links) + $content_pref['content_menu_links_icon'] = "0"; //define icon for content links (only with normallinks) + $content_pref['content_menu_links_caption'] = CONTENT_MENU_LAN_4; //define caption for link list (only is normallinks is selected) + $content_pref['content_menu_viewallcat'] = "1"; //menu: view link to all categories + $content_pref['content_menu_viewallauthor'] = "1"; //menu: view link to all authors + $content_pref['content_menu_viewallitems'] = "1"; //menu: view link to all items (archive) + $content_pref['content_menu_viewtoprated'] = "0"; //menu: view link to top rated items + $content_pref['content_menu_viewtopscore'] = "0"; //menu: view link to top score items + $content_pref['content_menu_viewrecent'] = "1"; //menu: view link to recent items + $content_pref['content_menu_viewsubmit'] = "0"; //view link to submit content item (only if it is allowed) + $content_pref['content_menu_viewicon'] = "0"; //choose icon to display for links + $content_pref['content_menu_cat'] = "1"; //view categories + $content_pref['content_menu_cat_main'] = "1"; //show main parent in the category list + $content_pref['content_menu_cat_number'] = "1"; //show number of items in category + $content_pref['content_menu_cat_icon'] = "0"; //choose icon to display for categories + $content_pref['content_menu_cat_icon_default'] = "0"; //choose default icon is no icon present (only if category_icon is selected) + $content_pref['content_menu_cat_caption'] = CONTENT_MENU_LAN_3; //define caption for category list + $content_pref['content_menu_cat_dropdown'] = "0"; //rendertype of categories (in dropdown or as normal links) + $content_pref['content_menu_recent'] = "1"; //view recent list + $content_pref['content_menu_recent_caption'] = CONTENT_MENU_LAN_2; //caption of recent list + $content_pref['content_menu_recent_number'] = "5"; //number of recent items to show + $content_pref['content_menu_recent_date'] = "0"; //show date in recent list + $content_pref['content_menu_recent_datestyle'] = "%d %b %Y"; //choose datestyle for given date + $content_pref['content_menu_recent_author'] = "0"; //show author in recent list + $content_pref['content_menu_recent_subheading'] = "0"; //show subheading in recent list + $content_pref['content_menu_recent_subheading_char'] = "80"; //number of characters of subheading to show + $content_pref['content_menu_recent_subheading_post'] = "[...]"; //postfix for too long subheadings + $content_pref['content_menu_recent_icon'] = "0"; //choose icon to display for recent items + $content_pref['content_menu_recent_icon_width'] = "50"; //specify width of icon (only if content_icon is set) + + $content_pref['content_inherit'] = '0'; //inherit options from default preferences + + //CONTENT MANAGER + $content_pref['content_manager_approve'] = '0'; //class for managers who can approve submitted items + $content_pref['content_manager_personal'] = '0'; //class for managers who can manage personal items + $content_pref['content_manager_category'] = '0'; //class for managers who can manage all items in a category + + //PAGE RESTRICTION (NOT YET IN USE) + $content_pref['content_restrict_managecontent'] = '0'; + $content_pref['content_restrict_createcontent'] = '0'; + $content_pref['content_restrict_managecat'] = '0'; + $content_pref['content_restrict_createcat'] = '0'; + $content_pref['content_restrict_order'] = '0'; + $content_pref['content_restrict_options'] = '0'; + $content_pref['content_restrict_adminmanager'] = '0'; + $content_pref['content_restrict_restrict'] = '0'; + $content_pref['content_restrict_recent'] = '0'; + $content_pref['content_restrict_allcat'] = '0'; + $content_pref['content_restrict_onecat'] = '0'; + $content_pref['content_restrict_contentitem'] = '0'; + $content_pref['content_restrict_author'] = '0'; + $content_pref['content_restrict_archive'] = '0'; + $content_pref['content_restrict_toprated'] = '0'; + $content_pref['content_restrict_topscore'] = '0'; + $content_pref['content_restrict_submit'] = '0'; + $content_pref['content_restrict_frontmanager'] = '0'; + + return $content_pref; + } + + + + function getContentPref($id="") { + global $sql, $plugintable, $qs, $tp, $eArrayStorage; + + $plugintable = "pcontent"; + +//echo "get content pref : ".$id."
    "; + + if($id && $id!="0"){ //if $id; use prefs from content table + $id = intval($id); + $num_rows = $sql -> db_Select($plugintable, "content_pref", "content_id='$id' "); + $row = $sql -> db_Fetch(); + if (empty($row['content_pref'])) { + //if no prefs present yet, get them from core (default preferences) + $num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + //if those are not present, insert the default ones given in this file + if ($num_rows == 0) { + $content_pref = $this -> ContentDefaultPrefs(); + $tmp = $eArrayStorage->WriteArray($content_pref); + $sql -> db_Insert("core", "'$plugintable', '{$tmp}' "); + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + } + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + + //create array of custom preset tags + foreach($content_pref['content_custom_preset_key'] as $ck => $cv){ + if(!empty($cv)){ + $string[] = $cv; + } + } + if($string){ + $content_pref['content_custom_preset_key'] = $string; + }else{ + unset($content_pref['content_custom_preset_key']); + } + + //finally we can store the new default prefs into the db + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sql -> db_Update($plugintable, "content_pref='{$tmp1}' WHERE content_id='$id' "); + $sql -> db_Select($plugintable, "content_pref", "content_id='$id' "); + $row = $sql -> db_Fetch(); + } + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + + if(e_PAGE == "admin_content_config.php" && isset($qs[0]) && $qs[0] == 'option'){ + }else{ + //check inheritance, if set, get core prefs (default prefs) + if(isset($content_pref['content_inherit']) && $content_pref['content_inherit']!=''){ + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + } + + }else{ //if not $id; use prefs from default core table + $num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + if ($num_rows == 0) { + $content_pref = $this -> ContentDefaultPrefs(); + $tmp = $eArrayStorage->WriteArray($content_pref); + $sql -> db_Insert("core", "'$plugintable', '{$tmp}' "); + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + } + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + return $content_pref; + } + + //admin + function UpdateContentPref($id){ + global $qs, $plugintable, $sql, $tp, $eArrayStorage; + + if(!is_object($sql)){ $sql = new db; } + +//echo "update content pref : ".$id."
    "; + + //insert default preferences into core + if($id == "0"){ + $num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + if ($num_rows == 0) { + $sql -> db_Insert("core", "'$plugintable', '' "); + }else{ + $row = $sql -> db_Fetch(); + } + + //insert category preferences into plugintable + }else{ + $sql -> db_Select($plugintable, "content_pref", "content_id='".intval($id)."' "); + $row = $sql -> db_Fetch(); + $current = $eArrayStorage->ReadArray($row['content_pref']); + foreach($current as $k => $v){ + if(isset($qs[0]) && $qs[0] == 'option' ){ + if( strpos($k, "content_manager_") === 0 || strpos($k, "content_restrict_") === 0 ){ + $content_pref[$k] = $tp->toDB($v); + } + }elseif(isset($qs[0]) && ($qs[0] == 'manager' || $qs[0] == 'restrict')){ + if( strpos($k, "content_") === 0 ){ + $content_pref[$k] = $tp->toDB($v); + } + } + } + } + + //create array of custom preset tags + foreach($_POST['content_custom_preset_key'] as $ck => $cv){ + if(!empty($cv)){ + $string[] = $cv; + } + } + $_POST['content_custom_preset_key'] = $string; + + //echo "
    "; print_r($_POST); echo "
    "; + + foreach($_POST as $k => $v){ + if(strpos($k, "content_") === 0){ + $content_pref[$k] = $tp->toDB($v); + } + } + + //create new array of preferences + $tmp = $eArrayStorage->WriteArray($content_pref); + if($id == "0"){ + $sql -> db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = '$plugintable' "); + }else{ + $sql -> db_Update($plugintable, "content_pref='{$tmp}' WHERE content_id='".intval($id)."' "); + } + + return $content_pref; + } + + function CONTENTREGEXP($var){ + return "(^|,)(".str_replace(",", "|", $var).")(,|$)"; + } + + function getCategoryTree($id, $parent, $classcheck=TRUE){ + //id : content_parent of an item + global $plugintable, $datequery; + global $agc; + + if($parent){ + $agc = ""; + $qrygc = " content_id = '".intval($parent)."' "; + }else{ + $qrygc = " content_parent = '0' "; + } + if($id){ + $qrygc = " content_parent = '0.".intval($id)."' "; + } + + if($classcheck == TRUE){ + $qrygc .= " AND content_class REGEXP '".e_CLASS_REGEXP."' "; + } + + $datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") "; + + $sqlgetcat = new db; + if($sqlgetcat -> db_Select($plugintable, "content_id, content_heading, content_parent", " ".$qrygc." ".$datequery." " )){ + while($row = $sqlgetcat -> db_Fetch()){ + if($agc){ + if($row['content_parent'] != "0"){ + if(array_key_exists(substr($row['content_parent'],2), $agc)){ + if(is_array($agc[substr($row['content_parent'],2)])){ + $agc[$row['content_id']] = array_merge_recursive($agc[substr($row['content_parent'],2)], array($row['content_id'], $row['content_heading'])); + }else{ + $agc[$row['content_id']] = array($agc[substr($row['content_parent'],2)], array($row['content_id'], $row['content_heading'])); + } + + }else{ + $agc[$row['content_id']] = array($row['content_id'], $row['content_heading']); + } + }else{ + $agc[$row['content_id']] = array($row['content_id'], $row['content_heading']); + } + }else{ + $agc[$row['content_id']] = array($row['content_id'], $row['content_heading']); + } + $this -> getCategoryTree($row['content_id'], "", $classcheck); + } + } + return $agc; + } + + + + function getCrumbItem($id, $arr){ + //$id : content_parent of item + //$arr : array of all categories + $crumb = ""; + if(is_array($arr)){ + if(array_key_exists($id, $arr)){ + for($i=0;$i".$arr[$id][$i+1]." > "; + $i++; + } + $crumb = substr($crumb,0,-3); + } + } + return $crumb; + } + + function ShowNextPrev($mode='', $from='0', $number, $total){ + global $content_pref, $qs, $tp, $plugindir, $content_shortcodes, $CONTENT_NEXTPREV; + + if($total<=$number){ + return; + } + + $modepref = ($mode ? "content_{$mode}_nextprev" : "content_nextprev"); + if(isset($content_pref[$modepref]) && $content_pref[$modepref]){ + $np_querystring = e_SELF."?[FROM]".(isset($qs[0]) ? ".".$qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : ""); + $parms = $total.",".$number.",".$from.",".$np_querystring.""; + + $CONTENT_NEXTPREV = $tp->parseTemplate("{NEXTPREV={$parms}}"); + + if(!isset($CONTENT_NP_TABLE)){ + if(!$content_pref["content_theme"]){ + require_once($plugindir."templates/default/content_np_template.php"); + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_np_template.php")){ + require_once($tp->replaceConstants($content_pref["content_theme"])."content_np_template.php"); + }else{ + require_once($plugindir."templates/default/content_np_template.php"); + } + } + } + echo $tp -> parseTemplate($CONTENT_NP_TABLE, FALSE, $content_shortcodes); + } + } + + function getCrumbPage($mode, $arr, $parent){ + global $qs, $ns, $content_pref, $plugintable; + + if(isset($content_pref["content_breadcrumb_{$mode}"]) && $content_pref["content_breadcrumb_{$mode}"]){ + $crumb = ''; + if(array_key_exists($parent, $arr)){ + $sep = (isset($content_pref["content_breadcrumb_seperator"]) ? $content_pref["content_breadcrumb_seperator"] : ">"); + if($content_pref["content_breadcrumb_base"] && isset($content_pref["content_breadcrumb_base"])){ + $crumb .= "".CONTENT_LAN_58." ".$sep." "; + } + if($content_pref["content_breadcrumb_self"] && isset($content_pref["content_breadcrumb_self"])){ + $crumb .= "".CONTENT_LAN_59." ".$sep." "; + } + for($i=0;$i".$arr[$parent][$i+1]." ".$sep." "; + $i++; + } + } + if($qs[0] == "recent"){ + $crumb .= "".CONTENT_LAN_60.""; + } + if($qs[0] == "author"){ + $crumb .= "".CONTENT_LAN_85.""; + if(is_numeric($qs[1])){ + global $sql; + $sql->db_Select($plugintable, "content_author","content_id='".intval($qs[1])."'"); + $row=$sql->db_Fetch(); + $au = $this->getAuthor($row['content_author']); + $crumb .= " ".$sep." ".$au[1].""; + } + } + if($qs[0] == "list"){ + $crumb .= "".CONTENT_LAN_13.""; + } + if($qs[0] == "top"){ + $crumb .= "".CONTENT_LAN_8.""; + } + if($qs[0] == "score"){ + $crumb .= "".CONTENT_LAN_12.""; + } + if($qs[0] == "content"){ + global $row; + $crumb .= $row['content_heading']; + } + $crumb = trim($crumb); + if(substr($crumb,-strlen(trim($sep))) == trim($sep)){ + $crumb = substr($crumb,0,-strlen(trim($sep))); + } + + $crumb = ""; + if(isset($content_pref["content_breadcrumb_rendertype"]) && $content_pref["content_breadcrumb_rendertype"] == "1"){ + echo $crumb; + return ""; + }elseif(isset($content_pref["content_breadcrumb_rendertype"]) && $content_pref["content_breadcrumb_rendertype"] == "2"){ + $ns -> tablerender(CONTENT_LAN_24, $crumb); + return ""; + }else{ + return $crumb; + } + }else{ + return ""; + } + } + + + + function countCatItems($id){ + global $sqlcountitemsincat, $plugintable, $datequery; + //$id : category content_id + + if(!is_object($sqlcountitemsincat)){ $sqlcountitemsincat = new db; } + $n = $sqlcountitemsincat -> db_Count($plugintable, "(*)", "WHERE content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent='".intval($id)."' AND content_refer != 'sa' ".$datequery." "); + + return $n; + } + + + function getCategoryHeading($id){ + global $plugintable, $sql; + $qry = " + SELECT c.*, p.* + FROM pcontent as c + LEFT JOIN pcontent as p ON p.content_id = c.content_parent + WHERE c.content_id = '".intval($id)."' "; + $sql -> db_Select_gen($qry); + $row2 = $sql -> db_Fetch(); + return $row2['content_heading']; + } + function getPageHeading($id){ + global $plugintable, $sql; + $sql -> db_Select($plugintable, "content_heading", "content_id='".intval($id)."' "); + $row2 = $sql -> db_Fetch(); + return $row2['content_heading']; + } + function setPageTitle(){ + global $plugintable, $sql, $qs; + + //content page + if(e_PAGE == "content.php"){ + //main parent overview + if(!e_QUERY){ + $page = CONTENT_PAGETITLE_LAN_0; + }else{ + $sql -> db_Select($plugintable, "content_heading", "content_id = '".intval($qs[1])."' "); + $row = $sql -> db_Fetch(); + + $page = CONTENT_PAGETITLE_LAN_0; + + //recent of parent='2' + if($qs[0] == "recent" && is_numeric($qs[1]) && !isset($qs[2])){ + $page .= " / ".$row['content_heading']." / ".CONTENT_PAGETITLE_LAN_2; + + //item + }elseif($qs[0] == "content" && isset($qs[1]) && is_numeric($qs[1]) ){ + $page .= " / ".$this -> getCategoryHeading($qs[1])." / ".$this -> getPageHeading($qs[1]); + + //all categories of parent='2' + }elseif($qs[0] == "cat" && $qs[1] == "list" && is_numeric($qs[2])){ + $page .= " / ".$this -> getPageHeading($qs[2])." / ".CONTENT_PAGETITLE_LAN_13; + + //category of parent='2' and content_id='5' + }elseif($qs[0] == "cat" && is_numeric($qs[1]) && (!isset($qs[2]) || isset($qs[2]) && $qs[2]=='view') ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_3." / ".$row['content_heading']; + + //top rated of parent='2' + }elseif($qs[0] == "top" && is_numeric($qs[1]) && !isset($qs[2])){ + $page .= " / ".$this -> getPageHeading($qs[1])." / ".CONTENT_PAGETITLE_LAN_4; + + //top score of parent='2' + }elseif($qs[0] == "score" && is_numeric($qs[1]) && !isset($qs[2])){ + $page .= " / ".$this -> getPageHeading($qs[1])." / ".CONTENT_PAGETITLE_LAN_15; + + //authorlist of parent='2' + }elseif($qs[0] == "author" && $qs[1] == "list" && is_numeric($qs[2])){ + $page .= " / ".$this -> getPageHeading($qs[2])." / ".CONTENT_PAGETITLE_LAN_14; + + //authorlist of parent='2' and content_id='5' + }elseif($qs[0] == "author" && is_numeric($qs[1]) && !isset($qs[2])){ + $sql -> db_Select($plugintable, "content_author", "content_id='".intval($qs[1])."' "); + $row2 = $sql -> db_Fetch(); + $authordetails = $this -> getAuthor($row2['content_author']); + $page .= " / ".CONTENT_PAGETITLE_LAN_5." / ".$authordetails[1]; + + //archive of parent='2' + }elseif($qs[0] == "list" && is_numeric($qs[1]) && !isset($qs[2])){ + $page .= " / ".CONTENT_PAGETITLE_LAN_6; + } + } + + }elseif(e_PAGE == "content_submit.php"){ + //submit page : view categories + if(!e_QUERY){ + $page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_7; + }else{ + $page = CONTENT_PAGETITLE_LAN_0; + + //submit page : submit item + if($qs[0] == "content" && $qs[1] == "submit" && is_numeric($qs[2]) ){ + $page = " / ".CONTENT_PAGETITLE_LAN_8; + } + } + + }elseif(e_PAGE == "content_manager.php"){ + //manager page : view categories + if(!e_QUERY){ + $page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_9; + }else{ + $page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_9; + + //manager page : view items + if($qs[0] == "content" && is_numeric($qs[1]) ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_10; + + //manager page : edit item + }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_11; + + //manager page : create new item + }elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2]) ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_12; + } + } + } + define("e_PAGETITLE", $page); + + } + + + + function getAuthor($content_author) { + global $sql, $plugintable, $datequery; + + if(is_numeric($content_author)){ + if(!$sql -> db_Select("user", "user_id, user_name, user_email", "user_id=$content_author")){ + $author_id = "0"; + $author_name = ""; + $author_email = ""; + }else{ + list($author_id, $author_name, $author_email) = $sql -> db_Fetch(); + } + $getauthor = array($author_id, $author_name, $author_email, $content_author); + }else{ + $tmp = explode("^", $content_author); + if(isset($tmp[0]) && is_numeric($tmp[0]) ){ + $author_id = $tmp[0]; + $author_name = (isset($tmp[1]) ? $tmp[1] : ""); + $author_email = (isset($tmp[2]) ? $tmp[2] : ""); + }else{ + $author_id = "0"; + $author_name = $tmp[0]; + $author_email = (isset($tmp[1]) ? $tmp[1] : ""); + } + $getauthor = array($author_id, $author_name, $author_email, $content_author); + } + return $getauthor; + } + + + + function getMainParent($id){ + global $sql, $plugintable; + + $category_total = $sql -> db_Select($plugintable, "content_id, content_parent", "content_id='".intval($id)."' "); + $row = $sql -> db_Fetch(); + if($row['content_parent'] == 0){ + $mainparent = $row['content_id']; + }else{ + if(strpos($row['content_parent'], ".")){ + $newid = substr($row['content_parent'],2); + }else{ + $newid = $row['content_parent']; + } + $mainparent = $this -> getMainParent( $newid ); + } + return ($mainparent ? $mainparent : "0"); + } + + + + //admin + function ShowOptionCat($currentparent=""){ + global $qs, $sql, $rs, $plugintable, $tp, $content_pref, $stylespacer; + $string = ""; + + if($currentparent == "submit"){ + $mainparent = $this -> getMainParent( intval($qs[2]) ); + $catarray = $this -> getCategoryTree("", intval($mainparent), FALSE); + }else{ + $catarray = $this -> getCategoryTree("", "", FALSE); + } + $array = array_keys($catarray); + + foreach($array as $catid){ + $category_total = $sql -> db_Select($plugintable, "content_id, content_heading, content_parent", "content_id='".intval($catid)."' "); + $row = $sql -> db_Fetch(); + + $pre = ""; + if($row['content_parent'] == "0"){ //main parent level + }else{ //sub level + for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ + $pre .= "  "; + } + } + $emptystring = "----------------"; + + if($qs[0] == "cat"){ + + $js = ""; + $catstring = ""; + $name = $pre.$row['content_heading']; + $selectjs = "if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }"; + $label = $catid; + if($row['content_parent'] == 0){ + $name = $row['content_heading']; + $js = "style='font-weight:bold;'"; + } + if($qs[1] == "create"){ + $checkid = (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : ""); + $value = e_SELF."?cat.create.".$catid; + $sel = ($catid == $checkid ? "1" : "0"); + }elseif($qs[1] == "edit"){ + $checkid = ($currentparent ? $currentparent : ""); + $value = e_SELF."?cat.edit.".$qs[2].".".$catid; + $sel = ($catid == $checkid ? "1" : "0"); + } + + //manage items + }elseif($qs[0] == "" || $qs[0] == "content"){ + + $catstring = ""; + $js = ""; + $label = $catid; + $selectjs = "if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }"; + $name = $pre.$row['content_heading']; + if($row['content_parent'] == 0){ + $name = $row['content_heading']; + $js = "style='font-weight:bold;'"; + } + if($qs[1] == "create" || $qs[1] == "submit"){ + $checkid = (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : ""); + $value = e_SELF."?content.".$qs[1].".".$catid; + $sel = ($catid == $checkid ? "1" : "0"); + }else{ + $checkid = ($currentparent ? $currentparent : ""); + $sel = ($catid == $checkid ? "1" : "0"); + if($qs[1] == "" || is_numeric($qs[1])){ + $value = e_SELF."?content.".$catid; + }else{ + $value = e_SELF."?content.".$qs[1].".".$qs[2].".".$catid; + } + } + } + $string .= $rs -> form_option($name, $sel, $value, ($label ? "label='".$label."'" : "label='none'")." ".$js ).$catstring; + } + $selectjs = " onchange=\" document.getElementById('parent').value=this.options[this.selectedIndex].label; ".$selectjs." \""; + $text = $rs -> form_select_open("parent1", $selectjs); + + if(!isset($qs[0])){ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); + }elseif( $qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); + }elseif( $qs[0] == "content" && ($qs[1] == "create" || $qs[1] == "submit") ){ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); + }elseif( $qs[0] == "content" && is_numeric($qs[1]) ){ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); + }elseif($qs[0] == "cat" && $qs[1] == "create"){ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."  ", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.create", "label='0' style='font-weight:bold;'"); + }else{ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."  ", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.edit.".$qs[2].".0", "label='0' style='font-weight:bold;'"); + } + $text .= $string; + $text .= $rs -> form_select_close(); + + return $text; + } + + + + function getOrder(){ + global $qs, $content_pref; + + if(isset($qs[0]) && substr($qs[0],0,5) == "order"){ + $orderstring = $qs[0]; + }elseif(isset($qs[1]) && substr($qs[1],0,5) == "order"){ + $orderstring = $qs[1]; + }elseif(isset($qs[2]) && substr($qs[2],0,5) == "order"){ + $orderstring = $qs[2]; + }elseif(isset($qs[3]) && substr($qs[3],0,5) == "order"){ + $orderstring = $qs[3]; + }else{ + $orderstring = ($content_pref["content_defaultorder"] ? $content_pref["content_defaultorder"] : "orderddate" ); + } + + if(substr($orderstring,6) == "heading"){ + $orderby = "content_heading"; + $orderby2 = ""; + }elseif(substr($orderstring,6) == "date"){ + $orderby = "content_datestamp"; + $orderby2 = ", content_heading ASC"; + }elseif(substr($orderstring,6) == "parent"){ + $orderby = "content_parent"; + $orderby2 = ", content_heading ASC"; + }elseif(substr($orderstring,6) == "refer"){ + $orderby = "content_refer"; + $orderby2 = ", content_heading ASC"; + }elseif(substr($orderstring,6) == "author"){ + + }elseif(substr($orderstring,6) == "order"){ + if($qs[0] == "cat"){ + $orderby = "SUBSTRING_INDEX(content_order, '.', 1)+0"; + }elseif($qs[0] != "cat"){ + $orderby = "SUBSTRING_INDEX(content_order, '.', -1)+0"; + } + $orderby2 = ", content_heading ASC"; + }else{ + $orderstring = "orderddate"; + $orderby = "content_datestamp"; + $orderby2 = ", content_heading ASC"; + } + $order = " ORDER BY ".$orderby." ".(substr($orderstring,5,1) == "a" ? "ASC" : "DESC")." ".$orderby2." "; + return $order; + } + + + + function getIcon($mode, $icon, $path="", $linkid="", $width="", $blank=""){ + global $content_cat_icon_path_small, $content_cat_icon_path_large, $content_icon_path, $content_pref; + + $blank = (!$blank ? "0" : $blank); + $border = "border:0;"; + $hrefpre = ($linkid ? "" : ""); + $hrefpost = ($linkid ? "" : ""); + + if($mode == "item"){ + $path = (!$path ? $content_icon_path : $path); + $width = ($width ? "width:".$width."px;" : ""); + //$border = "border:1px solid #000;"; + $border = ''; + $icon = ($icon ? $path.$icon : ($blank ? $content_icon_path."blank.gif" : "")); + + }elseif($mode == "catsmall"){ + $path = (!$path ? $content_cat_icon_path_small : $path); + $icon = ($icon ? $path.$icon : ""); + + }elseif($mode == "catlarge"){ + $path = (!$path ? $content_cat_icon_path_large : $path); + $icon = ($icon ? $path.$icon : ""); + }else{ + $path = (!$path ? $content_icon_path : $path); + $hrefpre = ""; + $hrefpost = ""; + $width = ""; + $icon = ($icon ? $path.$icon : ($blank ? $content_icon_path."blank.gif" : "")); + } + + if($icon && file_exists($icon)){ + $iconstring = $hrefpre."".$hrefpost; + }else{ + $iconstring = ""; + if($blank){ + if(file_exists($content_icon_path."blank.gif")){ + if($mode == "catsmall"){ + $width = ($width ? "width:".$width."px;" : "width:16px;"); + }elseif($mode == "catlarge"){ + $width = ($width ? "width:".$width."px;" : "width:48px;"); + } + $iconstring = $hrefpre."".$hrefpost; + } + } + } + return $iconstring; + } + + function prepareAuthor($mode, $author, $id){ + global $aa, $content_pref; + if($mode == ''){return;} + + $authorinfo = ""; + if( (isset($content_pref["content_{$mode}_authorname"]) && $content_pref["content_{$mode}_authorname"]) || (isset($content_pref["content_{$mode}_authoremail"]) && $content_pref["content_{$mode}_authoremail"]) || (isset($content_pref["content_{$mode}_authoricon"]) && $content_pref["content_{$mode}_authoricon"]) || (isset($content_pref["content_{$mode}_authorprofile"]) && $content_pref["content_{$mode}_authorprofile"]) ){ + $authordetails = $this -> getAuthor($author); + if(isset($content_pref["content_{$mode}_authorname"]) && $content_pref["content_{$mode}_authorname"]){ + if(isset($content_pref["content_{$mode}_authoremail"]) && $authordetails[2]){ + if($authordetails[0] == "0"){ + if(isset($content_pref["content_{$mode}_authoremail_nonmember"]) && $content_pref["content_{$mode}_authoremail_nonmember"] && strpos($authordetails[2], "@") ){ + //$authorinfo = "".$authordetails[1].""; + + $authorinfo = preg_replace("#([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "".$authordetails[1]."", $authordetails[2]); + }else{ + $authorinfo = $authordetails[1]; + } + }else{ + //$authorinfo = "".$authordetails[1].""; + + $authorinfo = preg_replace("#([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "".$authordetails[1]."", $authordetails[2]); + } + }else{ + $authorinfo = $authordetails[1]; + } + if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0" && isset($content_pref["content_{$mode}_authorprofile"]) && $content_pref["content_{$mode}_authorprofile"]){ + $authorinfo .= " ".CONTENT_ICON_USER.""; + } + } + if(isset($content_pref["content_{$mode}_authoricon"]) && $content_pref["content_{$mode}_authoricon"]){ + $authorinfo .= " ".CONTENT_ICON_AUTHORLIST.""; + } + } + return $authorinfo; + } + + + //admin + function popupHelp($text, $image="", $width="320", $title=""){ + //$image : full path to the image you want to show on screen (uses a default doc image) + //$width : the width of the popup (uses a default width of 500) + //$title : the window title of the popup (uses a default title of ...) + //$text : the help text to show into the popup + + if(!$image || !file_exists($image)){ + $image = e_IMAGE."admin_images/docs_16.png"; + } + if(!$width){ $width = "320"; } + if(!$title){ $title = "content management help area"; } + + $popup = ""; + + return $popup; + } + + + + //search by keyword + function showOptionsSearch($mode, $searchtypeid=""){ + global $plugindir, $plugintable, $qs, $rs; + + if(!is_object($rs)){ + require_once(e_HANDLER."form_handler.php"); + $rs = new form; + } + if(!isset($searchtypeid)){ + $searchtypeid = (is_numeric($qs[1]) ? $qs[1] : $qs[2]); + } + + if($mode == "menu"){ + $CONTENT_SEARCH_TABLE_KEYWORD = $rs -> form_open("post", $plugindir."content.php?recent.$searchtypeid", "contentsearchmenu_{$mode}", "", "enctype='multipart/form-data'")."
    ".$rs -> form_close(); + }else{ + $searchfieldname = "searchfield_{$mode}"; + $CONTENT_SEARCH_TABLE_KEYWORD = $rs -> form_open("post", $plugindir."content.php?recent.$searchtypeid", "contentsearch_{$mode}", "", "enctype='multipart/form-data'")."
    + +
    + ".$rs -> form_close(); + } + return $CONTENT_SEARCH_TABLE_KEYWORD; + } + + + + //redirection links in dropdown + function showOptionsSelect($mode, $searchtypeid=""){ + global $plugindir, $plugintable, $rs, $qs, $content_pref; + + if(!is_object($rs)){ + require_once(e_HANDLER."form_handler.php"); + $rs = new form; + } + if(!isset($searchtypeid)){ + $searchtypeid = (is_numeric($qs[1]) ? $qs[1] : $qs[2]); + } + $catarray = ""; + $mainparent = $this -> getMainParent( $searchtypeid ); + $content_pref = $this -> getContentPref($mainparent); + $parent = $this -> getCategoryTree("", $mainparent, TRUE); + $parent = array_merge_recursive($parent); + for($a=0;$a form_option($emptystring, "0", "none"); + } + foreach($newparent as $key => $value){ + $n = ""; + if($mode == "page" || ($mode == "menu" && isset($content_pref["content_menu_cat_number"])) ){ + $n = $this -> countCatItems($key); + $n = " (".$n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54).")"; + } + if( ($content_pref["content_menu_cat_main"] && $key == $mainparent) || $key != $mainparent ){ + $value = (strlen($value) > 25 ? substr($value,0,25)."..." : $value); + $catarray .= $rs -> form_option($value.$n, 0, $plugindir."content.php?cat.".$key); + } + } + + if($mode == "page" || ($mode == "menu" && ($content_pref["content_menu_links"] && $content_pref["content_menu_links_dropdown"]) || ($content_pref["content_menu_cat"] && $content_pref["content_menu_cat_dropdown"]) ) ){ + if($mode == "menu"){ $style = "style='width:100%;' "; }else{ $style = ""; } + $CONTENT_SEARCH_TABLE_SELECT = " + ".$rs -> form_open("post", $plugindir."content.php".(e_QUERY ? "?".e_QUERY : ""), "contentredirect".$mode, "", "enctype='multipart/form-data'")." +
    "; + $text .= $rs -> form_option(CONTENT_ORDER_LAN_0, 1, "none"); + + if($qs[0] == "author" && $qs[1] == "list"){ + $text .= $rs -> form_option(CONTENT_ORDER_LAN_11, ($check == "orderaauthor" ? "1" : "0"), $baseurl."?".$qry.".orderaauthor" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_12, ($check == "orderdauthor" ? "1" : "0"), $baseurl."?".$qry.".orderdauthor" ); + }else{ + $text .= $rs -> form_option(CONTENT_ORDER_LAN_1, ($check == "orderaheading" ? "1" : "0"), $baseurl."?".$qry.".orderaheading" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_2, ($check == "orderdheading" ? "1" : "0"), $baseurl."?".$qry.".orderdheading" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_3, ($check == "orderadate" ? "1" : "0"), $baseurl."?".$qry.".orderadate" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_4, ($check == "orderddate" ? "1" : "0"), $baseurl."?".$qry.".orderddate" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_5, ($check == "orderarefer" ? "1" : "0"), $baseurl."?".$qry.".orderarefer" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_6, ($check == "orderdrefer" ? "1" : "0"), $baseurl."?".$qry.".orderdrefer" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_7, ($check == "orderaparent" ? "1" : "0"), $baseurl."?".$qry.".orderaparent" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_8, ($check == "orderdparent" ? "1" : "0"), $baseurl."?".$qry.".orderdparent" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_9, ($check == "orderaorder" ? "1" : "0"), $baseurl."?".$qry.".orderaorder" ); + $text .= $rs -> form_option(CONTENT_ORDER_LAN_10, ($check == "orderdorder" ? "1" : "0"), $baseurl."?".$qry.".orderdorder" ); + } + $text .= $rs -> form_select_close(); + $text .= "
    "; + $text .= $rs -> form_close(); + } + } + return $text; + } + + + + function CreateParentMenu($parentid){ + global $plugintable, $plugindir, $tp, $datequery; + + if(!is_object($sqlcreatemenu)){ $sqlcreatemenu = new db; } + if(!$sqlcreatemenu -> db_Select($plugintable, "*", "content_id='".intval($parentid)."' ")){ + return FALSE; + }else{ + $row = $sqlcreatemenu -> db_Fetch(); + } + + $content_path_menu = $plugindir."menus/"; + if(!is_writable($content_path_menu)){ + echo "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_path_menu." ".CONTENT_ADMIN_ITEM_LAN_23."
    "; + return FALSE; + } + + $menufile = "content_".$row['content_heading']; + $menuname = $row['content_heading']; + + $data = chr(60)."?php\n". chr(47)."*\n+---------------------------------------------------------------+\n| e107 website system\n| ".e_PLUGIN."content/menus/".$menufile."_menu.php\n|\n| Steve Dunstan 2001-2002\n| http://e107.org\n| jalist@e107.org\n|\n| Released under the terms and conditions of the\n| GNU General Public License (http://gnu.org).\n+---------------------------------------------------------------+\n\nThis file has been generated by ".e_PLUGIN."content/handlers/content_class.php.\n\n*". chr(47)."\n\n"; + $data .= "\n"; + $data .= "unset(\$text);\n"; + $data .= "\$text = \"\";\n"; + $data .= "\$menutypeid = \"$parentid\";\n"; + $data .= "\$menuname = \"$menuname\";\n"; + $data .= "\n"; + $data .= "\$plugindir = e_PLUGIN.'content/';\n"; + $data .= "\$plugintable = \"pcontent\"; //name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)\n"; + $data .= "\$datequery = \" AND content_datestamp < \".time().\" AND (content_enddate=0 || content_enddate>\".time().\") \";\n"; + $data .= "\n"; + $data .= "require_once(e_PLUGIN.'content/handlers/content_class.php');\n"; + $data .= "\$aa = new content;\n"; + $data .= "require_once(e_HANDLER.'form_handler.php');\n"; + $data .= "\$rs = new form;\n"; + $data .= "\$gen = new convert;\n"; + $data .= "global \$tp;\n"; + $data .= "\n"; + $data .= "\$lan_file = e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content.php';\n"; + $data .= "include_once(file_exists(\$lan_file) ? \$lan_file : e_PLUGIN.'content/languages/English/lan_content.php');\n"; + $data .= "\n"; + $data .= "\$bullet = (defined('BULLET') ? \"\" : \"bullet\");\n"; + $data .= "\n"; + $data .= "\$content_pref = \$aa -> getContentPref(\$menutypeid);\n"; + $data .= "\$content_icon_path = \$tp -> replaceConstants(\$content_pref[\"content_icon_path\"]);\n"; + $data .= "\$content_cat_icon_path_small = \$tp -> replaceConstants(\$content_pref[\"content_cat_icon_path_small\"]);\n"; + $data .= "\n"; + $data .= " \$break = FALSE;\n"; + $data .= "//##### SEARCH SELECT ORDER --------------------------------------------------\n"; + $data .= "//show search box\n"; + $data .= "if(\$content_pref[\"content_menu_search\"]){\n"; + $data .= " \$text .= \$aa -> showOptionsSearch(\"menu\", \$menutypeid);\n"; + $data .= " \$break = TRUE;\n"; + $data .= "}\n"; + $data .= "//show select box (with either links to other content pages, to categories, to both, or don't show at all)\n"; + $data .= "if( (\$content_pref[\"content_menu_links\"] && \$content_pref[\"content_menu_links_dropdown\"]) || (\$content_pref[\"content_menu_cat\"] && \$content_pref[\"content_menu_cat_dropdown\"]) ){\n"; + $data .= " \$text .= \$aa -> showOptionsSelect(\"menu\", \$menutypeid);\n"; + $data .= " \$break = TRUE;\n"; + $data .= "}\n"; + $data .= "//show order box\n"; + $data .= "if(\$content_pref[\"content_menu_sort\"]){\n"; + $data .= " \$text .= \$aa -> showOptionsOrder(\"menu\", \$menutypeid);\n"; + $data .= " \$break = TRUE;\n"; + $data .= "}\n"; + $data .= "\n"; + $data .= "//show links list if chosen so\n"; + $data .= "if(\$content_pref[\"content_menu_links\"] && !\$content_pref[\"content_menu_links_dropdown\"]){\n"; + $data .= " if(\$break === TRUE){\n"; + $data .= " \$text .= \"
    \";\n"; + $data .= " }\n"; + $data .= " \$text .= (\$content_pref[\"content_menu_links_caption\"] != \"\" ? \$content_pref[\"content_menu_links_caption\"] : CONTENT_MENU_LAN_4).\"
    \";\n"; + $data .= "\n"; + $data .= " //define icon\n"; + $data .= " if(\$content_pref[\"content_menu_links_icon\"] == \"0\"){ \$linksicon = \"\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_links_icon\"] == \"1\"){ \$linksicon = \$bullet;\n"; + $data .= " }elseif(\$content_pref[\"content_menu_links_icon\"] == \"2\"){ \$linksicon = \"·\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_links_icon\"] == \"3\"){ \$linksicon = \"º\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_links_icon\"] == \"4\"){ \$linksicon = \"»\";\n"; + $data .= " }\n"; + $data .= "\n"; + $data .= " if(\$content_pref[\"content_menu_viewallcat\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_6.\"
    \";\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_viewallauthor\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_7.\"
    \";\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_viewallitems\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_83.\"
    \";\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_viewtoprated\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_8.\"
    \";\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_viewtopscore\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_12.\"
    \";\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_viewrecent\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_61.\"
    \";\n"; + $data .= " }\n"; + $data .= " if( \$content_pref[\"content_menu_viewsubmit\"] && \$content_pref[\"content_submit\"] && check_class(\$content_pref[\"content_submit_class\"]) ){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_75.\"
    \";\n"; + $data .= " }\n"; + $data .= " \$text .= \"
    \";\n"; + $data .= "}\n"; + $data .= "\n"; + $data .= "//get category array\n"; + $data .= "\$array = \$aa -> getCategoryTree(\"\", intval(\$menutypeid), TRUE);\n"; + $data .= "\n"; + $data .= "//##### CATEGORY LIST --------------------------------------------------\n"; + $data .= "if(!\$content_pref[\"content_menu_cat_dropdown\"]){\n"; + $data .= " if(\$content_pref[\"content_menu_cat\"]){\n"; + $data .= " \$text .= (\$content_pref[\"content_menu_cat_caption\"] != \"\" ? \$content_pref[\"content_menu_cat_caption\"] : CONTENT_MENU_LAN_3).\"
    \";\n"; + $data .= "\n"; + $data .= " \$newparent = \"\";\n"; + $data .= " \$checkid = \"\";\n"; + $data .= " \$newarray = array_merge_recursive(\$array);\n"; + $data .= " for(\$a=0;\$a\";\n"; + $data .= " }else{\n"; + $data .= " //default category icon\n"; + $data .= " if(\$content_pref[\"content_menu_cat_icon_default\"] == \"0\"){ \$ICON = \"\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"1\"){ \$ICON = \$bullet;\n"; + $data .= " }elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"2\"){ \$ICON = \"·\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"3\"){ \$ICON = \"º\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"4\"){ \$ICON = \"»\";\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= " //display category list\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= (\$ICON ? \"\" : \"\");\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= \"
    \".\$ICON.\"\";\n"; + $data .= " \$text .= \"\".\$row['content_heading'].\"\";\n"; + $data .= " \$text .= (\$content_pref[\"content_menu_cat_number\"] ? \" (\".\$aa -> countCatItems(\$row['content_id']).\")\" : \"\");\n"; + $data .= " \$text .= \"
    \";\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= "}\n"; + $data .= "\n"; + $data .= "//##### RECENT --------------------------------------------------\n"; + $data .= "if(\$content_pref[\"content_menu_recent\"]){\n"; + $data .= " \$text .= \"
    \";\n"; + $data .= "\n"; + $data .= " //prepare query paramaters\n"; + $data .= " \$validparent = implode(\",\", array_keys(\$array));\n"; + $data .= " \$qry = \" content_parent REGEXP '\".\$aa -> CONTENTREGEXP(\$validparent).\"' \";\n"; + $data .= "\n"; + $data .= " \$sql1 = new db;\n"; + $data .= " \$contenttotal = \$sql1 -> db_Count(\$plugintable, \"(*)\", \"WHERE content_refer != 'sa' AND \".\$qry.\" \".\$datequery.\" AND content_class REGEXP '\".e_CLASS_REGEXP.\"' \" );\n"; + $data .= "\n"; + $data .= " if(\$resultitem = \$sql1 -> db_Select(\$plugintable, \"*\", \"content_refer !='sa' AND \".\$qry.\" \".\$datequery.\" AND content_class REGEXP '\".e_CLASS_REGEXP.\"' ORDER BY content_datestamp DESC LIMIT 0,\".\$content_pref[\"content_menu_recent_number\"] )){\n"; + $data .= "\n"; + $data .= " \$text .= (\$content_pref[\"content_menu_recent_caption\"] != \"\" ? \$content_pref[\"content_menu_recent_caption\"] : CONTENT_MENU_LAN_2).\"
    \";\n"; + $data .= " while(\$row = \$sql1 -> db_Fetch()){\n"; + $data .= "\n"; + $data .= " \$ICON = \"\";\n"; + $data .= " \$DATE = \"\";\n"; + $data .= " \$AUTHOR = \"\";\n"; + $data .= " \$SUBHEADING = \"\";\n"; + $data .= "\n"; + $data .= " if(\$content_pref[\"content_menu_recent_date\"]){\n"; + $data .= " \$datestyle = (\$content_pref[\"content_archive_datestyle\"] ? \$content_pref[\"content_archive_datestyle\"] : \"%d %b %Y\");\n"; + $data .= " \$DATE = strftime(\$datestyle, \$row['content_datestamp']);\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_recent_author\"]){\n"; + $data .= " \$authordetails = \$aa -> getAuthor(\$row['content_author']);\n"; + $data .= " \$AUTHOR = \$authordetails[1];\n"; + $data .= " }\n"; + $data .= "\n"; + $data .= " //subheading\n"; + $data .= " if(\$content_pref[\"content_menu_recent_subheading\"] && \$row['content_subheading']){\n"; + $data .= " if(\$content_pref[\"content_menu_recent_subheading_char\"] && \$content_pref[\"content_menu_recent_subheading_char\"] != \"\" && \$content_pref[\"content_menu_recent_subheading_char\"] != \"0\"){\n"; + $data .= " if(strlen(\$row['content_subheading']) > \$content_pref[\"content_menu_recent_subheading_char\"]) {\n"; + $data .= " \$row['content_subheading'] = substr(\$row['content_subheading'], 0, \$content_pref[\"content_menu_recent_subheading_char\"]).\$content_pref[\"content_menu_recent_subheading_post\"];\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= " \$SUBHEADING = \$row['content_subheading'];\n"; + $data .= " }\n"; + $data .= "\n"; + $data .= " //define icon\n"; + $data .= " \$recenticonwidth = \"\";\n"; + $data .= " if(\$content_pref[\"content_menu_recent_icon\"] == \"0\"){ \$ICON = \"\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_recent_icon\"] == \"1\"){ \$ICON = \$bullet;\n"; + $data .= " }elseif(\$content_pref[\"content_menu_recent_icon\"] == \"2\"){ \$ICON = \"·\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_recent_icon\"] == \"3\"){ \$ICON = \"º\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_recent_icon\"] == \"4\"){ \$ICON = \"»\";\n"; + $data .= " }elseif(\$content_pref[\"content_menu_recent_icon\"] == \"5\"){\n"; + $data .= " if(\$content_pref[\"content_menu_recent_icon\"] == \"5\"){\n"; + $data .= " if(\$content_pref[\"content_menu_recent_icon_width\"]){\n"; + $data .= " \$recenticonwidth = \" width:\".\$content_pref[\"content_menu_recent_icon_width\"].\"px; \";\n"; + $data .= " }else{\n"; + $data .= " \$recenticonwidth = \" width:50px; \";\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= " if(\$content_pref[\"content_menu_recent_icon\"] == \"5\" && \$row['content_icon'] != \"\" && file_exists(\$content_icon_path.\$row['content_icon'])){\n"; + $data .= " \$ICON = \"\";\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= "\n"; + $data .= " //display recent list\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= (\$ICON ? \"\" : \"\");\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= \"\";\n"; + $data .= " \$text .= \"
    \".\$ICON.\"\";\n"; + $data .= " \$text .= \"\".\$row['content_heading'].\"
    \";\n"; + $data .= " \$text .= (\$DATE ? \$DATE.\"
    \" : \"\" );\n"; + $data .= " \$text .= (\$AUTHOR ? \$AUTHOR.\"
    \" : \"\" );\n"; + $data .= " \$text .= (\$SUBHEADING ? \$SUBHEADING.\"
    \" : \"\" );\n"; + $data .= " \$text .= \"
    \";\n"; + $data .= " }\n"; + $data .= " }\n"; + $data .= "}\n"; + $data .= "\n"; + $data .= "if(!isset(\$text)){ \$text = CONTENT_MENU_LAN_1; }\n"; + $data .= "\$caption = (\$content_pref[\"content_menu_caption\"] != \"\" ? \$content_pref[\"content_menu_caption\"] : CONTENT_MENU_LAN_0.\" \".\$menuname);\n"; + $data .= "\$ns -> tablerender(\$caption, \$text, '$menufile');\n"; + $data .= "\n"; + $data .= "?".chr(62); + + if(file_exists($plugindir."menus/".$menufile."_menu.php")){ + $message = ""; + }else{ + $fp = @fopen($plugindir."menus/".$menufile."_menu.php", "w"); + if (!@fwrite($fp, $data)) { + $message = CONTENT_ADMIN_CAT_LAN_51; + } else { + fclose($fp); + $message = CONTENT_ADMIN_CAT_LAN_50; + } + } + return $message; + } +} //close class + +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_convert_class.php b/e107_plugins/content/handlers/content_convert_class.php new file mode 100644 index 000000000..ad13dc1d3 --- /dev/null +++ b/e107_plugins/content/handlers/content_convert_class.php @@ -0,0 +1,914 @@ +".time().") "; + +$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'; +include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php'); +$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php'; +include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php'); + +require_once($plugindir."handlers/content_class.php"); +$aa = new content; + +class content_convert{ + + + //update content_author + function upgrade_1_2(){ + global $sql; + + $text = ""; + $field1 = $sql->db_Field("pcontent",19); + $field2 = $sql->db_Field("pcontent",20); + $field3 = $sql->db_Field("pcontent",21); + if($field1 != "content_score" && $field2 != "content_meta" && $field3 != "content_layout"){ + mysql_query("ALTER TABLE ".MPREFIX."pcontent ADD content_score TINYINT ( 3 ) UNSIGNED NOT NULL DEFAULT '0';"); + mysql_query("ALTER TABLE ".MPREFIX."pcontent ADD content_meta TEXT NOT NULL;"); + mysql_query("ALTER TABLE ".MPREFIX."pcontent ADD content_layout VARCHAR ( 255 ) NOT NULL DEFAULT '';"); + $text = CONTENT_ADMIN_CONVERSION_LAN_64."
    "; + } + return $text; + } + + //update content_author + function upgrade_1_21(){ + global $sql; + $sql = new db; $sql1 = new db; + $upgrade = FALSE; + if($sql -> db_Select("pcontent", "content_id, content_author", "content_author != '' ")){ + while($row = $sql -> db_Fetch()){ + if(is_numeric($row['content_author'])){ + }else{ + $tmp = explode("^", $row['content_author']); + if($tmp[0] == "0"){ + $upgrade = TRUE; + $newauthor = $tmp[1].($tmp[2] ? "^".$tmp[2] : ""); + $sql1 -> db_Update("pcontent", " content_author = '".$newauthor."' WHERE content_id='".$row['content_id']."' "); + } + } + } + } + if($upgrade){ + return CONTENT_ADMIN_CONVERSION_LAN_65."
    "; + }else{ + return FALSE; + } + } + + //update preferences storage method + function upgrade_1_22(){ + global $sql, $sql2, $eArrayStorage, $tp, $aa; + + $upgrade = TRUE; + + $sqlc = new db; + $sqld = new db; + + //convert preferences for core default preferences + if($sqlc -> db_Select("core", "*", "e107_name='pcontent' ")){ + $row = $sqlc -> db_Fetch(); + + $tmp = $eArrayStorage->ReadArray($row['e107_value']); + + //replace the id value for the content_pref + $content_pref = array(); + foreach($tmp as $k=>$v){ + if(substr($k,-2) == "_0"){ + $k = str_replace("_0", "", $k); + } + if(strpos($k, "content_") === 0){ + $content_pref[$k] = $tp->toDB($v); + } + } + if(!isset($content_pref['content_admin_subheading'])){ + //add new options to the preferences + $content_pref = $this->upgrade_1_22_prefs($content_pref); + + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sqld -> db_Update("core", "e107_value = '{$tmp1}' WHERE e107_name = 'pcontent' "); + }else{ + $upgrade=FALSE; + } + } + + //convert preferences for all main parents + if($sqlc -> db_Select("pcontent", "content_id, content_heading, content_pref", "LEFT(content_parent, 1) = '0' ")){ + while($row=$sqlc->db_Fetch()){ + + $id = $row['content_id']; + $tmp = $eArrayStorage->ReadArray($row['content_pref']); + + //replace the id value for the content_pref + $l = strlen($id); + $content_pref = array(); + foreach($tmp as $k=>$v){ + if(substr($k,-($l+1)) == "_".$id){ + $k = str_replace("_".$id, "", $k); + } + if(strpos($k, "content_") === 0){ + $content_pref[$k] = $tp->toDB($v); + } + } + //add new options to the preferences + if(!isset($content_pref['content_admin_subheading'])){ + $content_pref = $this->upgrade_1_22_prefs($content_pref); + + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sqld -> db_Update("pcontent", "content_pref='{$tmp1}' WHERE content_id='$id' "); + }else{ + $upgrade=FALSE; + } + + //update menus + $plugintable = "pcontent"; + $plugindir = e_PLUGIN."content/"; + if(!is_object($aa)){ + require_once($plugindir."handlers/content_class.php"); + $aa = new content; + } + if($row['content_parent']==0){ + //remove menu + @unlink(e_PLUGIN."content/menus/content_".$row['content_heading']."_menu.php"); + //create menu + $aa -> CreateParentMenu($id); + } + } + } + + if($upgrade===TRUE){ + return CONTENT_ADMIN_CONVERSION_LAN_66."
    "; + } + } + + //add new preferences that come with this upgrade + function upgrade_1_22_prefs($content_pref){ + + //create : item page + $content_pref['content_admin_subheading'] = '1'; + $content_pref['content_admin_summary'] = '1'; + $content_pref['content_admin_startdate'] = '1'; + $content_pref['content_admin_enddate'] = '1'; + + //create : category page + $content_pref['content_admincat_subheading'] = '1'; + $content_pref['content_admincat_comment'] = '1'; + $content_pref['content_admincat_rating'] = '1'; + $content_pref['content_admincat_pe'] = '1'; + $content_pref['content_admincat_visibility'] = '1'; + $content_pref['content_admincat_startdate'] = '1'; + $content_pref['content_admincat_enddate'] = '1'; + $content_pref['content_admincat_uploadicon'] = '1'; + $content_pref['content_admincat_selecticon'] = '1'; + + //create : submit page + $content_pref['content_submit_subheading'] = '1'; + $content_pref['content_submit_summary'] = '1'; + $content_pref['content_submit_startdate'] = '1'; + $content_pref['content_submit_enddate'] = '1'; + + //content manager + $content_pref['content_manager_approve'] = '255'; + $content_pref['content_manager_personal'] = '255'; + $content_pref['content_manager_category'] = '255'; + + return $content_pref; + } + + + //update preferences storage method + function upgrade_1_23(){ + global $sql, $sql2, $eArrayStorage, $tp, $aa; + + $upgrade = TRUE; + + $sqlc = new db; + $sqld = new db; + //add new preferences in core + if($sqlc -> db_Select("core", "*", "e107_name='pcontent' ")){ + $row = $sqlc -> db_Fetch(); + + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + + //add new options to the preferences + if(!isset($content_pref['content_admin_subheading'])){ + $content_pref = $this->upgrade_1_23_prefs($content_pref); + + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sqld -> db_Update("core", "e107_value = '{$tmp1}' WHERE e107_name = 'pcontent' "); + }else{ + $upgrade=FALSE; + } + } + + //add new preferences for each main parent + if($sqlc -> db_Select("pcontent", "content_id, content_heading, content_pref", "content_parent = '0' ")){ + while($row=$sqlc->db_Fetch()){ + + $id = $row['content_id']; + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + + if(!isset($content_pref['content_admin_subheading'])){ + //add new options to the preferences + $content_pref = $this->upgrade_1_23_prefs($content_pref); + + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sqld -> db_Update("pcontent", "content_pref='{$tmp1}' WHERE content_id='$id' "); + }else{ + $upgrade=FALSE; + } + } + } + if($upgrade===TRUE){ + return CONTENT_ADMIN_CONVERSION_LAN_67."
    "; + } + } + //add new preferences that come with this upgrade + function upgrade_1_23_prefs($content_pref){ + + $content_pref['content_list_caption'] = CONTENT_LAN_23; //caption for recent list + $content_pref['content_list_caption_append_name'] = '1'; //append category heading to caption + $content_pref['content_catall_caption'] = CONTENT_LAN_25; //caption for all categories page + $content_pref['content_cat_caption'] = CONTENT_LAN_26; //caption for single category page + $content_pref['content_cat_caption_append_name'] = '1'; //append category heading to caption + $content_pref['content_cat_sub_caption'] = CONTENT_LAN_28; //caption for subcategories + $content_pref['content_cat_item_caption'] = CONTENT_LAN_31; //caption for items in category + $content_pref['content_author_index_caption'] = CONTENT_LAN_32; //caption for author index page + $content_pref['content_author_caption'] = CONTENT_LAN_32; //caption for single author page + $content_pref['content_author_caption_append_name'] = '1'; //append author name to caption + $content_pref['content_archive_caption'] = CONTENT_LAN_84; //caption for archive page + $content_pref['content_top_icon_width'] = ''; //use this size for icon + $content_pref['content_top_caption'] = CONTENT_LAN_38; //caption for top rated page + $content_pref['content_top_caption_append_name'] = '1'; //append category heading to caption + $content_pref['content_score_icon_width'] = ''; //use this size for icon + $content_pref['content_score_caption'] = CONTENT_LAN_87; //caption for top score page + $content_pref['content_score_caption_append_name'] = '1'; //append category heading to caption + + return $content_pref; + } + + //update custom theme + function upgrade_1_24(){ + global $sql, $sql2, $eArrayStorage, $tp, $aa; + + $upgrade = TRUE; + + $sqlc = new db; + $sqld = new db; + //add new preferences in core + if($sqlc -> db_Select("core", "*", "e107_name='pcontent' ")){ + $row = $sqlc -> db_Fetch(); + + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + + //update theme + if(strpos($content_pref['content_theme'], "{e_")!==FALSE){ + }else{ + $content_pref['content_theme'] = "{e_PLUGIN}content/templates/".$content_pref['content_theme']."/"; + } + + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sqld -> db_Update("core", "e107_value = '{$tmp1}' WHERE e107_name = 'pcontent' "); + } + + //add new preferences for each main parent + if($sqlc -> db_Select("pcontent", "content_id, content_heading, content_pref", "content_parent = '0' ")){ + while($row=$sqlc->db_Fetch()){ + + $id = $row['content_id']; + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + + //update theme + if(strpos($content_pref['content_theme'], "{e_")!==FALSE){ + }else{ + $content_pref['content_theme'] = "{e_PLUGIN}content/templates/".$content_pref['content_theme']."/"; + } + + $tmp1 = $eArrayStorage->WriteArray($content_pref); + $sqld -> db_Update("pcontent", "content_pref='{$tmp1}' WHERE content_id='$id' "); + } + } + return CONTENT_ADMIN_CONVERSION_LAN_68."
    "; + } + + //convert rows + function upgrade_1_1(){ + global $sql, $sql2, $tp, $plugintable, $eArrayStorage; + $plugintable = "pcontent"; + + $count = "0"; + $sql = new db; + $thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" ); + if($thiscount > 0){ + while($row = $sql -> db_Fetch()){ + + //main parent + if($row['content_parent'] == "0"){ + $newparent = "0"; + + //subcat + }elseif(substr($row['content_parent'],0,2) == "0."){ + $newparent = "0".strrchr($row['content_parent'], "."); + + //item + }elseif( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){ + $newparent = substr(strrchr($row['content_parent'], "."),1); + } + + $sql2 -> db_Update("pcontent", " content_parent = '".$newparent."', content_pref='' WHERE content_id='".$row['content_id']."' "); + } + } + return CONTENT_ADMIN_CONVERSION_LAN_58."

    ".CONTENT_ADMIN_CONVERSION_LAN_46."
    "; + } + + + + + function show_main_intro(){ + global $sql, $ns, $rs, $type, $type_id, $action, $sub_action, $id, $plugintable; + $plugintable = "pcontent"; + + if(!is_object($sql)){ $sql = new db; } + $newcontent = $sql -> db_Count($plugintable, "(*)", ""); + if($newcontent > 0){ + return false; + }else{ + + $text .= " +
    +
    + ".$rs -> form_open("post", e_SELF, "dataform")." + "; + + $oldcontent = $sql -> db_Count("content", "(*)", ""); + if($oldcontent > 0){ + $text .= ""; + + $text .= ""; + $text .= ""; + $text .= ""; + $text .= " + + + + "; + + $text .= ""; + $text .= ""; + $text .= ""; + $text .= " + + + + "; + + $text .= ""; + $text .= ""; + $text .= ""; + $text .= " + + + + "; + + }else{ + $text .= ""; + $text .= ""; + $text .= " + + + + "; + } + + $text .= "
    ".CONTENT_ADMIN_MAIN_LAN_8." ".CONTENT_ADMIN_MAIN_LAN_9." ".CONTENT_ADMIN_MAIN_LAN_11."
    ".CONTENT_ADMIN_MAIN_LAN_18."
    ".CONTENT_ADMIN_MAIN_LAN_19."
    ".CONTENT_ADMIN_CONVERSION_LAN_43."".$rs -> form_button("submit", "convert_table", CONTENT_ADMIN_CONVERSION_LAN_59)."
    ".CONTENT_ADMIN_MAIN_LAN_22."
    ".CONTENT_ADMIN_MAIN_LAN_23."
    ".CONTENT_ADMIN_CONVERSION_LAN_54."".$rs -> form_button("submit", "create_default", CONTENT_ADMIN_CONVERSION_LAN_60)."
    ".CONTENT_ADMIN_MAIN_LAN_20."
    ".CONTENT_ADMIN_MAIN_LAN_21."
    ".CONTENT_ADMIN_CONVERSION_LAN_56."".$rs -> form_button("button", "fresh", CONTENT_ADMIN_CONVERSION_LAN_61, "onclick=\"document.location='".e_PLUGIN."content/admin_content_config.php?type.0.cat.create'\" + ")."
    ".CONTENT_ADMIN_MAIN_LAN_8." ".CONTENT_ADMIN_MAIN_LAN_9." ".CONTENT_ADMIN_MAIN_LAN_24."
    ".CONTENT_ADMIN_MAIN_LAN_25."
    ".CONTENT_ADMIN_CONVERSION_LAN_54."".$rs -> form_button("submit", "create_default", CONTENT_ADMIN_CONVERSION_LAN_60)."
    ".$rs -> form_close()." +
    +
    "; + + $ns -> tablerender(CONTENT_ADMIN_MAIN_LAN_7, $text); + return true; + } + } + + //function to insert default preferences for a main parent + function insert_default_prefs($id){ + global $sql, $aa, $plugintable, $eArrayStorage; + $plugintable = "pcontent"; + $plugindir = e_PLUGIN."content/"; + unset($content_pref, $tmp); + + if(!is_object($aa)){ + require_once($plugindir."handlers/content_class.php"); + $aa = new content; + } + + $content_pref = $aa -> ContentDefaultPrefs($id); + $tmp = $eArrayStorage->WriteArray($content_pref); + + $sql -> db_Update($plugintable, "content_pref='$tmp' WHERE content_id='$id' "); + } + + + //function to convert comments + function convert_comments(){ + global $plugintable; + $plugintable = "pcontent"; + + if(!is_object($sqlcc)){ $sqlcc = new db; } + $numc = $sqlcc -> db_Count("comments", "(*)", "WHERE comment_type = '1' "); + if($numc > 0){ + $sqlcc -> db_Update("comments", "comment_type = '".$plugintable."' WHERE comment_type = '1' "); + } + } + + + //function to convert rating + function convert_rating(){ + global $plugintable; + $plugintable = "pcontent"; + + if(!is_object($sqlcr)){ $sqlcr = new db; } + $numr = $sqlcr -> db_Count("rate", "(*)", "WHERE (rate_table = 'article' || rate_table = 'review' || rate_table = 'content') "); + if($numr > 0){ + $sqlcr -> db_Update("rate", "rate_table = '".$plugintable."' WHERE (rate_table = 'article' || rate_table = 'review' || rate_table = 'content') "); + } + } + + + //create main parent + function create_mainparent($name, $tot, $order){ + global $sql, $aa, $plugintable, $tp; + $plugintable = "pcontent"; + + $sql = new db; + $sql -> db_Select("content", "MAX(content_id) as maxcid", "", "mode=no_where"); + list($maxcid) = $sql -> db_Fetch(); + $newid = $maxcid + $order; + + // ##### STAGE 4 : INSERT MAIN PARENT FOR ARTICLE --------------------------------------------- + $checkinsert = FALSE; + if($tot > 0){ + //if(!is_object($sql)){ $sql = new db; } + $sql = new db; + if(!$sql -> db_Select($plugintable, "content_heading", "content_heading = '".$name."' AND content_parent = '0' ")){ + $name = $tp -> toDB($name); + + $sql -> db_Insert($plugintable, "'".$newid."', '".$name."', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '".time()."', '0', '0', '', '".$order."', '0', '', '' "); + + //check if row is present in the db (is it a valid insert) + //if(!is_object($sql2)){ $sql2 = new db; } + $sql2 = new db; + if(!$sql2 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' ")){ + $message = CONTENT_ADMIN_CONVERSION_LAN_45; + }else{ + $message = $name." ".CONTENT_ADMIN_CONVERSION_LAN_7."
    "; + $checkinsert = TRUE; + + //select main parent id + $sql3 = new db; + //if(!is_object($sql3)){ $sql3 = new db; } + $sql3 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' AND content_parent = '0' "); + list($main_id) = $sql3 -> db_Fetch(); + + //insert default preferences + $this -> insert_default_prefs($main_id); + + //create menu + $aa -> CreateParentMenu($main_id); + + $message .= $name." ".CONTENT_ADMIN_CONVERSION_LAN_8."
    "; + } + }else{ + $message = CONTENT_ADMIN_CONVERSION_LAN_9." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_10." : ".CONTENT_ADMIN_CONVERSION_LAN_53."
    "; + } + }else{ + $message = CONTENT_ADMIN_CONVERSION_LAN_9." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_10."
    "; + } + $create_mainparent = array($checkinsert, $message); + return $create_mainparent; + } + + + //analayse unknown rows + function analyse_unknown(){ + global $sql; + + if(!is_object($sql)){ $sql = new db; } + $totaloldrowsunknown = $sql -> db_Select("content", "*", " NOT ( (content_parent = '1' AND content_type = '1') || (content_parent = '0' AND content_type = '1') || (content_parent = '0' AND content_type = '6') || (content_parent = '0' AND content_type = '10') || (content_type = '3' || content_type = '16') || (content_type = '0' || content_type = '15') ) "); + + while($row = $sql -> db_Fetch()){ + $unknown_bug[] = $row['content_id']." ".$row['content_heading']; + $unknown_bug_id[] = $row['content_id']; + $unknown_bug_type[] = "parent=".$row['content_parent']." - type=".$row['content_type']; + } + $analyse_unknown = array($unknown_bug, $unknown_bug_id); + return $analyse_unknown; + } + + + //convert categories + function convert_category($name, $query, $ordernr){ + global $sql, $plugintable, $tp; + $plugintable = "pcontent"; + + // ##### STAGE 7 : INSERT CATEGORY ---------------------------------------------------- + if(!is_object($sql)){ $sql = new db; } + if(!$sql -> db_Select("content", "*", " ".$query." ORDER BY content_id " )){ + $cat_present = false; + }else{ + $count = $ordernr; + $cat_present = true; + while($row = $sql -> db_Fetch()){ + + //select main parent id + if(!is_object($sql2)){ $sql2 = new db; } + $sql2 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' AND content_parent = '0' "); + list($main_id) = $sql2 -> db_Fetch(); + + //summary can contain link to image in e107_images/link_icons/".$summary." THIS STILL NEEDS TO BE CHECKED + $newcontent_heading = $tp -> toDB($row['content_heading']); + $newcontent_subheading = ($row['content_subheading'] ? $tp -> toDB($row['content_subheading']) : ""); + $newcontent_summary = ($row['content_summary'] ? $tp -> toDB($row['content_summary']) : ""); + $newcontent_text = $tp -> toDB($row['content_content']); + $newcontent_author = (is_numeric($row['content_author']) ? $row['content_author'] : "0^".$row['content_author']); + $newcontent_icon = ""; + $newcontent_attach = ""; + $newcontent_images = ""; + $newcontent_parent = "0.".$main_id; //make each category a first level subcat of the main parent + $newcontent_comment = $row['content_comment']; + $newcontent_rate = "0"; + $newcontent_pe = $row['content_pe_icon']; + $newcontent_refer = ""; + $newcontent_starttime = $row['content_datestamp']; + $newcontent_endtime = "0"; + $newcontent_class = $row['content_class']; + $newcontent_pref = ""; + $newcontent_score = "0"; + $newcontent_meta = ""; + $newcontent_layout = ""; + + if(!is_object($sql3)){ $sql3 = new db; } + $sql3 -> db_Insert($plugintable, "'".$row['content_id']."', '".$newcontent_heading."', '".$newcontent_subheading."', '".$newcontent_summary."', '".$newcontent_text."', '".$newcontent_author."', '".$newcontent_icon."', '".$newcontent_attach."', '".$newcontent_images."', '".$newcontent_parent."', '".$newcontent_comment."', '".$newcontent_rate."', '".$newcontent_pe."', '".$newcontent_refer."', '".$newcontent_starttime."', '".$newcontent_endtime."', '".$newcontent_class."', '".$newcontent_pref."', '".$count."', '".$newcontent_score."', '".$newcontent_meta."', '".$newcontent_layout."' "); + + if(!$sql3 -> db_Select($plugintable, "content_id, content_heading", "content_heading = '".$newcontent_heading."' ")){ + $bug_cat_insert[] = $row['content_id']." ".$row['content_heading']; + }else{ + $valid_cat_insert[] = $row['content_id']." ".$row['content_heading']; + $count = $count + 1; + } + } + } + $convert_category = array($cat_present, $valid_cat_insert, $bug_cat_insert, $count); + return $convert_category; + } + + + //convert rows + function convert_row($name, $query, $startorder){ + global $sql, $tp, $plugintable, $eArrayStorage; + $plugintable = "pcontent"; + + // ##### STAGE 8 : INSERT ROW ------------------------------------------------------------- + if(!is_object($sql)){ $sql = new db; } + if(!$thiscount = $sql -> db_Select("content", "*", " ".$query." ORDER BY content_id " )){ + $check_present = false; + }else{ + $count = $startorder; + $check_present = true; + while($row = $sql -> db_Fetch()){ + + $oldcontentid = $row['content_id']; + + //select main parent id + if(!is_object($sql2)){ $sql2 = new db; } + $sql2 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' AND content_parent = '0' "); + list($main_id) = $sql2 -> db_Fetch(); + + //item is in main cat + if($row['content_parent'] == "0"){ + $newcontent_parent = $main_id; + + //item is in sub cat + }else{ + //select old review cat heading + if(!is_object($sql3)){ $sql3 = new db; } + if(!$sql3 -> db_Select("content", "content_id, content_heading", "content_id = '".$row['content_parent']."' ")){ + $bug_oldcat[] = $row['content_id']." ".$row['content_heading']; + $newcontent_parent = $main_id; + }else{ + list($old_cat_id, $old_cat_heading) = $sql3 -> db_Fetch(); + + //select new cat id from the cat with the old_cat_heading + if(!is_object($sql4)){ $sql4 = new db; } + if(!$sql4 -> db_Select($plugintable, "content_id", "content_heading = '".$old_cat_heading."' AND content_parent = '0.".$main_id."' ")){ + $bug_newcat[] = $row['content_id']." ".$row['content_heading']; + $newcontent_parent = $main_id; + }else{ + list($new_cat_id) = $sql4 -> db_Fetch(); + $newcontent_parent = $new_cat_id; + } + } + } + + if (strstr($row['content_content'], "{EMAILPRINT}")) { + $row['content_content'] = str_replace("{EMAILPRINT}", "", $row['content_content']); + } + + $newcontent_heading = $tp -> toDB($row['content_heading']); + $newcontent_subheading = ($row['content_subheading'] ? $tp -> toDB($row['content_subheading']) : ""); + //summary can contain link to image in e107_images/link_icons/".$summary." THIS STILL NEEDS TO BE CHECKED + $newcontent_summary = ($row['content_summary'] ? $tp -> toDB($row['content_summary']) : ""); + $newcontent_text = $tp -> toDB($row['content_content']); + //$newcontent_author = (is_numeric($row['content_author']) ? $row['content_author'] : "0^".$row['content_author']); + $newcontent_author = $row['content_author']; + $newcontent_icon = ""; + $newcontent_attach = ""; + $newcontent_images = ""; + $newcontent_comment = $row['content_comment']; + $newcontent_rate = "0"; + $newcontent_pe = $row['content_pe_icon']; + $newcontent_refer = ($row['content_type'] == "15" || $row['content_type'] == "16" ? "sa" : ""); + $newcontent_starttime = $row['content_datestamp']; + $newcontent_endtime = "0"; + $newcontent_class = $row['content_class']; + $newcontent_pref = ""; + $newcontent_score = ($row['content_review_score'] && $row['content_review_score'] != "none" ? $row['content_review_score'] : "0"); + $newcontent_meta = ""; + $newcontent_layout = ""; + + if(!is_object($sql5)){ $sql5 = new db; } + $sql5 -> db_Insert($plugintable, "'".$row['content_id']."', '".$newcontent_heading."', '".$newcontent_subheading."', '".$newcontent_summary."', '".$newcontent_text."', '".$newcontent_author."', '".$newcontent_icon."', '".$newcontent_attach."', '".$newcontent_images."', '".$newcontent_parent."', '".$newcontent_comment."', '".$newcontent_rate."', '".$newcontent_pe."', '".$newcontent_refer."', '".$newcontent_starttime."', '".$newcontent_endtime."', '".$newcontent_class."', '".$newcontent_pref."', '1.".$count."', '".$newcontent_score."', '".$newcontent_meta."', '".$newcontent_layout."' "); + + if(!is_object($sql6)){ $sql6 = new db; } + if(!$sql6 -> db_Select($plugintable, "content_id, content_heading", "content_heading = '".$newcontent_heading."' ")){ + $bug_insert[] = $row['content_id']." ".$row['content_heading']; + }else{ + $valid_insert[] = $row['content_id']." ".$row['content_heading']; + $count = $count + 1; + } + } + } + $convert_row = array($check_present, $count, $valid_insert, $bug_insert, $bug_oldcat, $bug_newcat); + return $convert_row; + } + + + //show output of the category conversion + function results_conversion_category($name, $array, $oldrows){ + + //no pages present + if($array[0] === false){ + if( !(count($array[1]) > 0 || count($array[2]) > 0) ){ + $text .= "".CONTENT_ADMIN_CONVERSION_LAN_34." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_35.""; + } + + //pages present + }else{ + + //valid inserts + if(count($array[1]) > 0 ){ + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_3." : ".count($array[1])." ".CONTENT_ADMIN_CONVERSION_LAN_38." + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + + //bug inserts + if(count($array[2]) > 0 ){ + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_3." : ".count($array[2])." ".CONTENT_ADMIN_CONVERSION_LAN_39." + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_3." : ".CONTENT_ADMIN_CONVERSION_LAN_27." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + return $text; + } + + + //show output of the item conversion + function results_conversion_row($name, $array, $oldrows){ + + //no rows present + if($array[0] === false){ + $text .= "".CONTENT_ADMIN_CONVERSION_LAN_34." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_36.""; + + //rows present + }else{ + + //valid insert + if(count($array[2]) > 0 ){ + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[2])." ".CONTENT_ADMIN_CONVERSION_LAN_38." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + //bugs : old category + if(count($array[4]) > 0 ){ + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[4])." ".CONTENT_ADMIN_CONVERSION_LAN_31." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + //bugs : new category + if(count($array[5]) > 0 ){ + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[5])." ".CONTENT_ADMIN_CONVERSION_LAN_31." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + //bugs : insertion failed + if(count($array[3]) > 0 ){ + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[3])." ".CONTENT_ADMIN_CONVERSION_LAN_39." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + + //analyses + $text .= " + + ".CONTENT_ADMIN_CONVERSION_LAN_6." : ".CONTENT_ADMIN_CONVERSION_LAN_27." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + } + + + return $text; + } + + + //show output of the mainparent conversion + function results_conversion_mainparent($content, $review, $article){ + $text = "".CONTENT_ADMIN_CONVERSION_LAN_50.""; + $text .= " + + ".($content[0] == "1" ? CONTENT_ICON_OK : CONTENT_ICON_ERROR)." ".CONTENT_ADMIN_CONVERSION_LAN_20." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + + + ".($review[0] == "1" ? CONTENT_ICON_OK : CONTENT_ICON_ERROR)." ".CONTENT_ADMIN_CONVERSION_LAN_21." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + + + ".($article[0] == "1" ? CONTENT_ICON_OK : CONTENT_ICON_ERROR)." ".CONTENT_ADMIN_CONVERSION_LAN_22." + + ".CONTENT_ADMIN_CONVERSION_LAN_48." + + + "; + + + + return $text; + } + +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_db_class.php b/e107_plugins/content/handlers/content_db_class.php new file mode 100644 index 000000000..5c65a547d --- /dev/null +++ b/e107_plugins/content/handlers/content_db_class.php @@ -0,0 +1,522 @@ +".time().") "; + +if (!defined('ADMIN_WIDTH')) { define("ADMIN_WIDTH", "width:98%;"); } + +//icon, file, image upload +if(isset($_POST['uploadfile'])){ + + if($_POST['uploadtype']){ + $pref['upload_storagetype'] = "1"; + require_once(e_HANDLER."upload_handler.php"); + $mainparent = $aa -> getMainParent(intval($_POST['parent'])); + $content_pref = $aa -> getContentPref($mainparent); + + if($_POST['content_id']){ + $newpid = $_POST['content_id']; + }else{ + $sql -> db_select("pcontent", "MAX(content_id) as aid", "content_id!='0' "); + list($aid) = $sql -> db_Fetch(); + $newpid = $aid+1; + } + } + + //icon + if($_POST['uploadtype'] == "1"){ + $pref['upload_storagetype'] = "1"; + $pathtmp = $_POST['tmppathicon']; + $uploaded = file_upload($pathtmp); + $new = ""; + if($uploaded){ + $uporg = $uploaded[0]['name']; + $resize = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); + if($uporg){ + $new = $newpid."_".$uporg; + rename($pathtmp.$uporg, $pathtmp.$new); + require_once(e_HANDLER."resize_handler.php"); + resize_image($pathtmp.$new, $pathtmp.$new, $resize, "nocopy"); + } + } + $message = ($new ? CONTENT_ADMIN_ITEM_LAN_106 : CONTENT_ADMIN_ITEM_LAN_107); + + //file + }elseif($_POST['uploadtype'] == "2"){ + $pref['upload_storagetype'] = "1"; + $pathtmp = $_POST['tmppathfile']; + $uploaded = file_upload($pathtmp); + $new = ""; + if($uploaded){ + $uporg = $uploaded[0]['name']; + if($uporg){ + $new = $newpid."_".$uporg; + rename($pathtmp.$uporg, $pathtmp.$new); + } + } + $message = ($new ? CONTENT_ADMIN_ITEM_LAN_108 : CONTENT_ADMIN_ITEM_LAN_109); + + //image + }elseif($_POST['uploadtype'] == "3"){ + $pref['upload_storagetype'] = "1"; + $pathtmp = $_POST['tmppathimage']; + $uploaded = file_upload($pathtmp); + $new = ""; + if($uploaded){ + $uporg = $uploaded[0]['name']; + $resize = (isset($content_pref["content_upload_image_size"]) && $content_pref["content_upload_image_size"] ? $content_pref["content_upload_image_size"] : "500"); + $resizethumb = (isset($content_pref["content_upload_image_size_thumb"]) && $content_pref["content_upload_image_size_thumb"] ? $content_pref["content_upload_image_size_thumb"] : "100"); + if($uporg){ + $new = $newpid."_".$uporg; + rename($pathtmp.$uporg, $pathtmp.$new); + require_once(e_HANDLER."resize_handler.php"); + resize_image($pathtmp.$new, $pathtmp.$new, $resizethumb, "copy"); + resize_image($pathtmp.$new, $pathtmp.$new, $resize, "nocopy"); + } + } + $message = ($new ? CONTENT_ADMIN_ITEM_LAN_110 : CONTENT_ADMIN_ITEM_LAN_111); + } +} + +class contentdb{ + + //function dbContentUpdate($mode, $type){ + function dbContent($mode, $type){ + //$mode : create or update + //$type : none(=admin), submit, contentmanager + global $pref, $qs, $sql, $ns, $rs, $aa, $tp, $plugintable, $e107cache, $eArrayStorage, $e_event; + + $_POST['content_heading'] = $tp -> toDB(trim($_POST['content_heading'])); + $_POST['content_subheading'] = $tp -> toDB($_POST['content_subheading']); + $_POST['content_summary'] = $tp -> toDB($_POST['content_summary']); + + if(e_WYSIWYG){ + $_POST['content_text'] = $tp->createConstants($_POST['content_text']); // convert e107_images/ to {e_IMAGE} etc. + } + //the problem with tiny_mce is it's storing e_HTTP with an image path, while it should only use the {e_xxx} variables + //this small check resolves this, and stores the paths correctly + if(strstr($_POST['content_text'],e_HTTP."{e_")){ + $_POST['content_text'] = str_replace(e_HTTP."{e_", "{e_", $_POST['content_text']); + } + + $_POST['content_text'] = $tp -> toDB($_POST['content_text']); + $_POST['parent'] = ($_POST['parent'] ? intval($_POST['parent']) : "0"); + $_POST['content_class'] = ($_POST['content_class'] ? intval($_POST['content_class']) : "0"); + $_POST['content_meta'] = $tp -> toDB($_POST['content_meta']); + + if(USER){ + if($_POST['content_author_id']){ + if(!($_POST['content_author_id'] == USERID && $_POST['content_author_name'] == USERNAME && $_POST['content_author_email'] == USEREMAIL) ){ + + $author = $_POST['content_author_id']; + + if($_POST['content_author_name'] != CONTENT_ADMIN_ITEM_LAN_14){ + $author .= "^".$_POST['content_author_name']; + } + if($_POST['content_author_email'] != CONTENT_ADMIN_ITEM_LAN_15){ + $author .= "^".$_POST['content_author_email']; + } + + }else{ + $author = $_POST['content_author_id']; + } + }else{ + $author = $_POST['content_author_name']; + if($_POST['content_author_email'] != "" && $_POST['content_author_email'] != CONTENT_ADMIN_ITEM_LAN_15){ + $author .= "^".$_POST['content_author_email']; + } + } + }else{ + $author = $_POST['content_author_name']; + if($_POST['content_author_email'] != "" && $_POST['content_author_email'] != CONTENT_ADMIN_ITEM_LAN_15){ + $author .= "^".$_POST['content_author_email']; + } + } + + $mainparent = $aa -> getMainParent(intval($_POST['parent'])); + $content_pref = $aa -> getContentPref($mainparent); + + $content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/"); + $content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/"); + $content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/"); + + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); + $content_tmppath_icon = $tp -> replaceConstants($content_pref["content_icon_path_tmp"]); + $content_tmppath_file = $tp -> replaceConstants($content_pref["content_file_path_tmp"]); + $content_tmppath_image = $tp -> replaceConstants($content_pref["content_image_path_tmp"]); + + //move icon to correct folder + if($_POST['content_icon']){ + $icon = $tp->toDB($_POST['content_icon']); + if($icon && file_exists($content_tmppath_icon.$icon)){ + rename($content_tmppath_icon.$icon, $content_icon_path.$icon); + } + } + + $sumf = 0; + $sumi = 0; + foreach($_POST as $k => $v){ + if(strpos($k, "content_files") === 0){ + $sumf = $sumf+1; + } + if(strpos($k, "content_images") === 0){ + $sumi = $sumi+1; + } + } + //move attachments to correct folder + $totalattach = ""; + for($i=0;$i<$sumf;$i++){ + $attach{$i} = $tp->toDB($_POST["content_files{$i}"]); + if($attach{$i} && file_exists($content_tmppath_file.$attach{$i})){ + rename($content_tmppath_file.$attach{$i}, $content_file_path.$attach{$i}); + } + if($attach{$i} && file_exists($content_file_path.$attach{$i})){ + $totalattach .= "[file]".$attach{$i}; + } + } + //move images to correct folder + $totalimages = ""; + for($i=0;$i<$sumi;$i++){ + $image{$i} = $tp->toDB($_POST["content_images{$i}"]); + if($image{$i} && file_exists($content_tmppath_image.$image{$i})){ + rename($content_tmppath_image.$image{$i}, $content_image_path.$image{$i}); + } + if($image{$i} && file_exists($content_tmppath_image."thumb_".$image{$i})){ + rename($content_tmppath_image."thumb_".$image{$i}, $content_image_path."thumb_".$image{$i}); + } + if($image{$i} && file_exists($content_image_path.$image{$i})){ + $totalimages .= "[img]".$image{$i}; + } + } + + if($_POST['update_datestamp']){ + $starttime = time(); + }else{ + if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none" && $_POST['ne_day'] != "0" && $_POST['ne_month'] != "0" && $_POST['ne_year'] != "0"){ + $newstarttime = mktime( 0, 0, 0, intval($_POST['ne_month']), intval($_POST['ne_day']), intval($_POST['ne_year'])); + }else{ + $newstarttime = time(); + } + if(isset($_POST['content_datestamp']) && $_POST['content_datestamp'] != "" && $_POST['content_datestamp'] != "0"){ + if($newstarttime != $starttime){ + $starttime = $newstarttime; + }else{ + $starttime = intval($_POST['content_datestamp']); + } + }else{ + $starttime = time(); + } + } + + if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none" && $_POST['end_day'] != "0" && $_POST['end_month'] != "0" && $_POST['end_year'] != "0"){ + $endtime = mktime( 0, 0, 0, intval($_POST['end_month']), intval($_POST['end_day']), intval($_POST['end_year'])); + }else{ + $endtime = "0"; + } + + //custom additional data tags + for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ + if(isset($_POST["content_custom_key_{$i}"]) && isset($_POST["content_custom_value_{$i}"]) && $_POST["content_custom_value_{$i}"] != ""){ + $keystring = $tp->toDB($_POST["content_custom_key_{$i}"]); + $custom["content_custom_{$keystring}"] = $tp->toDB($_POST["content_custom_value_{$i}"]); + } + } + //preset additional data tags + if(isset($_POST['content_custom_preset_key']) && $_POST['content_custom_preset_key']){ + $custom['content_custom_presettags'] = $tp->toDB($_POST['content_custom_preset_key']); + } + if($custom){ + $contentprefvalue = $eArrayStorage->WriteArray($custom); + }else{ + $contentprefvalue = ""; + } + + $_POST['content_layout'] = (!$_POST['content_layout'] || $_POST['content_layout'] == "content_content_template.php" ? "" : $tp->toDB($_POST['content_layout'])); + + //content_order : not added in the sql + //content_refer : only added in sql if posting submitted item + //$refer = (isset($_POST['content_refer']) && $_POST['content_refer']=='sa' ? ", content_refer='' " : ""); + + if($mode == "create"){ + if($type == "submit"){ + $refer = ($content_pref["content_submit_directpost"] ? "" : "sa"); + }else{ + $refer = ""; + } + $sql -> db_Insert($plugintable, "'0', '".$_POST['content_heading']."', '".$_POST['content_subheading']."', '".$_POST['content_summary']."', '".$_POST['content_text']."', '".$tp->toDB($author)."', '".$icon."', '".$totalattach."', '".$totalimages."', '".$_POST['parent']."', '".intval($_POST['content_comment'])."', '".intval($_POST['content_rate'])."', '".intval($_POST['content_pe'])."', '".$refer."', '".$starttime."', '".$endtime."', '".$_POST['content_class']."', '".$contentprefvalue."', '0', '".intval($_POST['content_score'])."', '".$_POST['content_meta']."', '".$_POST['content_layout']."' "); + + $e107cache->clear("$plugintable"); + + //trigger event for notify + $edata_cs = array("content_heading" => $_POST['content_heading'], "content_subheading" => $_POST['content_subheading'], "content_author" => $_POST['content_author_name']); + $e_event->trigger("content", $edata_cs); + + if(!$type || $type == "admin"){ + js_location(e_SELF."?".e_QUERY.".cc"); + }elseif($type == "contentmanager"){ + js_location(e_SELF."?c"); + }elseif($type == "submit"){ + if($content_pref["content_submit_directpost"]){ + js_location(e_SELF."?s"); + }else{ + js_location(e_SELF."?d"); + } + } + } + + if($mode == "update"){ + if($type == "submit"){ + if(isset($_POST['content_refer']) && $_POST['content_refer']=='sa'){ + $refer = ", content_refer='' "; + }else{ + $refer = ""; + } + }else{ + if(isset($_POST['content_refer']) && $_POST['content_refer']=='sa'){ + $refer = ", content_refer='' "; + }else{ + $refer = ""; + } + } + $sql -> db_Update($plugintable, "content_heading = '".$_POST['content_heading']."', content_subheading = '".$_POST['content_subheading']."', content_summary = '".$_POST['content_summary']."', content_text = '".$_POST['content_text']."', content_author = '".$tp->toDB($author)."', content_icon = '".$icon."', content_file = '".$totalattach."', content_image = '".$totalimages."', content_parent = '".$_POST['parent']."', content_comment = '".intval($_POST['content_comment'])."', content_rate = '".intval($_POST['content_rate'])."', content_pe = '".intval($_POST['content_pe'])."' ".$refer.", content_datestamp = '".$starttime."', content_enddate = '".$endtime."', content_class = '".$_POST['content_class']."', content_pref = '".$contentprefvalue."', content_score='".intval($_POST['content_score'])."', content_meta='".$_POST['content_meta']."', content_layout='".$_POST['content_layout']."' WHERE content_id = '".intval($_POST['content_id'])."' "); + + $e107cache->clear("$plugintable"); + $e107cache->clear("comment.$plugintable.{$_POST['content_id']}"); + if(!$type || $type == "admin"){ + js_location(e_SELF."?".e_QUERY.".cu"); + }elseif($type == "contentmanager"){ + js_location(e_SELF."?u"); + } + } + } + + + //function dbCategoryUpdate($mode){ + function dbCategory($mode){ + global $pref, $sql, $ns, $rs, $aa, $tp, $plugintable, $e107cache, $content_cat_icon_path_large, $content_cat_icon_path_small; + + $_POST['cat_heading'] = $tp -> toDB($_POST['cat_heading']); + $_POST['cat_subheading'] = $tp -> toDB($_POST['cat_subheading']); + if(e_WYSIWYG){ + $_POST['cat_text'] = $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc. + } + $_POST['cat_text'] = $tp -> toDB($_POST['cat_text']); + $_POST['parent'] = ($_POST['parent'] == "0" || $_POST['parent']==$_POST['cat_id'] ? "0" : "0.".intval($_POST['parent'])); + $_POST['cat_class'] = ($_POST['cat_class'] ? intval($_POST['cat_class']) : "0"); + + if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){ + $starttime = mktime( 0, 0, 0, intval($_POST['ne_month']), intval($_POST['ne_day']), intval($_POST['ne_year'])); + }else{ + $starttime = time(); + } + if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){ + $endtime = mktime( 0, 0, 0, intval($_POST['end_month']), intval($_POST['end_day']), intval($_POST['end_year'])); + }else{ + $endtime = "0"; + } + + if($mode == "create"){ + $sql -> db_Insert($plugintable, "'0', '".$_POST['cat_heading']."', '".$_POST['cat_subheading']."', '', '".$_POST['cat_text']."', '".ADMINID."', '".$tp->toDB($_POST["cat_icon"])."', '', '', '".$_POST['parent']."', '".intval($_POST['cat_comment'])."', '".intval($_POST['cat_rate'])."', '".intval($_POST['cat_pe'])."', '', '".$starttime."', '".$endtime."', '".$_POST['cat_class']."', '', '0', '0', '', '' "); + + // check and insert default pref values if new main parent + create menu file + if($_POST['parent'] == "0"){ + $iid = mysql_insert_id(); + $content_pref = $aa -> getContentPref($iid); + $aa -> CreateParentMenu($iid); + } + $e107cache->clear("$plugintable"); + js_location(e_SELF."?".e_QUERY.".pc"); + + }elseif($mode == "update"){ + $sql -> db_Update($plugintable, "content_heading = '".$_POST['cat_heading']."', content_subheading = '".$_POST['cat_subheading']."', content_summary = '', content_text = '".$_POST['cat_text']."', content_author = '".ADMINID."', content_icon = '".$tp->toDB($_POST["cat_icon"])."', content_image = '', content_parent = '".$_POST['parent']."', content_comment = '".intval($_POST['cat_comment'])."', content_rate = '".intval($_POST['cat_rate'])."', content_pe = '".intval($_POST['cat_pe'])."', content_refer = '0', content_datestamp = '".$starttime."', content_enddate = '".$endtime."', content_class = '".intval($_POST['cat_class'])."' WHERE content_id = '".intval($_POST['cat_id'])."' "); + + // check and insert default pref values if new main parent + create menu file + if($_POST['parent'] == "0"){ + @unlink(e_PLUGIN."content/menus/content_".$_POST['menuheading']."_menu.php"); + $content_pref = $aa -> getContentPref($_POST['cat_id']); + $aa -> CreateParentMenu($_POST['cat_id']); + } + $e107cache->clear("$plugintable"); + js_location(e_SELF."?".e_QUERY.".pu"); + } + } + + + function dbAssignAdmins($mode, $id, $value){ + global $plugintable, $qs, $sql, $eArrayStorage; + + if($mode == "admin"){ + $id = intval($id); + $sql -> db_Select($plugintable, "content_pref", "content_id = '".intval($id)."' "); + $row = $sql -> db_Fetch(); + + //get current preferences + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + + //assign new preferences + if($value == "clear"){ + $content_pref["content_manager_allowed"] = ""; + }else{ + $content_pref["content_manager_allowed"] = $value; + } + + //create new array of preferences + $tmp = $eArrayStorage->WriteArray($content_pref); + + $sql -> db_Update($plugintable, "content_pref = '{$tmp}' WHERE content_id = '".intval($id)."' "); + + $message = CONTENT_ADMIN_CAT_LAN_34; + return $message; + }else{ + return FALSE; + } + } + + + + function dbDelete($mode, $cat, $del_id){ + global $plugintable, $sql, $_POST, $e107cache; + + if($mode == "admin"){ + if($cat == "cat"){ + if($sql -> db_Delete($plugintable, "content_id='".intval($del_id)."' ")){ + $e107cache->clear("$plugintable"); + $message = CONTENT_ADMIN_CAT_LAN_23; + return $message; + } + }elseif($cat == "content"){ + if($sql -> db_Delete($plugintable, "content_id='".intval($del_id)."' ")){ + $e107cache->clear("$plugintable"); + $message = CONTENT_ADMIN_ITEM_LAN_3; + return $message; + } + } + }else{ + return FALSE; + } + } + + + + function dbSetOrder($mode, $type, $order){ + global $plugintable, $sql, $aa, $qs, $_POST, $e107cache; + //$mode : all, inc, dec + //$type : cc (category order), ai (global all items), ci (items in category) + //$order : posted values or id-currentorder + + if($mode == "all"){ + foreach ($order as $cid){ + //each order value in the db has two numbers (a-b) where a = category item order, and b = global item order + //146.3.cat : category order + //35.3.ci.1-0 : category item order + //35.3.ai.1-0 : global item order + + $tmp = explode(".", $cid); + $old = explode("-", $tmp[3]); + $old[0] = ($old[0] == "" ? "0" : $old[0]); + $old[1] = ($old[1] == "" ? "0" : $old[1]); + + $tmp[0] = intval($tmp[0]); + $tmp[1] = intval($tmp[1]); + $old[0] = intval($old[0]); + $old[1] = intval($old[1]); + + if($tmp[2] == "cat"){ + $sql->db_Update($plugintable, "content_order='".$tmp[1]."' WHERE content_id='".$tmp[0]."' " ); + + }elseif($tmp[2] == "ci"){ + $sql->db_Update($plugintable, "content_order='".$tmp[1].".".$old[1]."' WHERE content_id='".$tmp[0]."' " ); + + }elseif($tmp[2] == "ai"){ + $sql->db_Update($plugintable, "content_order='".$old[0].".".$tmp[1]."' WHERE content_id='".$tmp[0]."' " ); + } + $message = CONTENT_ADMIN_ORDER_LAN_2; + } + + }elseif($mode == "inc"){ + + $tmp = explode("-", $order); + $tmp[0] = intval($tmp[0]); + $tmp[1] = intval($tmp[1]); + $tmp[2] = intval($tmp[2]); + + if($type == "cc"){ + $mainparent = $aa -> getMainParent($tmp[0]); + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_id REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_order='".($tmp[1]-1)."' "; + $sql->db_Update($plugintable, "content_order=content_order+1 WHERE ".$qry." " ); + $sql->db_Update($plugintable, "content_order=content_order-1 WHERE content_id='".$tmp[0]."' " ); + + }elseif($type == "ci"){ + $sql->db_Update($plugintable, "content_order='".$tmp[1].".".$tmp[2]."' WHERE content_parent = '".intval($qs[2])."' AND SUBSTRING_INDEX(content_order, '.', 1) = '".($tmp[1]-1)."' " ); + $sql->db_Update($plugintable, "content_order='".($tmp[1]-1).".".$tmp[2]."' WHERE content_id='".$tmp[0]."' " ); + + }elseif($type == "ai"){ + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND SUBSTRING_INDEX(content_order, '.', -1) = '".($tmp[2]-1)."' "; + $sql->db_Update($plugintable, " content_order=content_order+0.1 WHERE ".$qry." " ); + $sql->db_Update($plugintable, "content_order='".$tmp[1].".".($tmp[2]-1)."' WHERE content_id='".$tmp[0]."' " ); + + } + $message = CONTENT_ADMIN_ORDER_LAN_0; + + }elseif($mode == "dec"){ + + $tmp = explode("-", $order); + $tmp[0] = intval($tmp[0]); + $tmp[1] = intval($tmp[1]); + $tmp[2] = intval($tmp[2]); + if($type == "cc"){ + $mainparent = $aa -> getMainParent($tmp[0]); + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_id REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_order='".($tmp[1]+1)."' "; + $sql->db_Update($plugintable, "content_order=content_order-1 WHERE ".$qry." " ); + $sql->db_Update($plugintable, "content_order=content_order+1 WHERE content_id='".$tmp[0]."' " ); + + }elseif($type == "ci"){ + $sql->db_Update($plugintable, "content_order='".$tmp[1].".".$tmp[2]."' WHERE content_parent = '".intval($qs[2])."' AND SUBSTRING_INDEX(content_order, '.', 1) = '".($tmp[1]+1)."' " ); + $sql->db_Update($plugintable, "content_order='".($tmp[1]+1).".".$tmp[2]."' WHERE content_id='".$tmp[0]."' " ); + + }elseif($type == "ai"){ + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND SUBSTRING_INDEX(content_order, '.', -1) = '".($tmp[2]+1)."' "; + $sql->db_Update($plugintable, "content_order=content_order-0.1 WHERE ".$qry." " ); + $sql->db_Update($plugintable, "content_order='".$tmp[1].".".($tmp[2]+1)."' WHERE content_id='".$tmp[0]."' " ); + } + $message = CONTENT_ADMIN_ORDER_LAN_1; + } + $e107cache->clear("$plugintable"); + return $message; + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_defines.php b/e107_plugins/content/handlers/content_defines.php new file mode 100644 index 000000000..592b67f50 --- /dev/null +++ b/e107_plugins/content/handlers/content_defines.php @@ -0,0 +1,33 @@ +"); } +if (!defined('CONTENT_ICON_LINK')) { define("CONTENT_ICON_LINK", "".CONTENT_ICON_LAN_15.""); } +if (!defined('CONTENT_ICON_DELETE')) { define("CONTENT_ICON_DELETE", "".CONTENT_ICON_LAN_1.""); } +if (!defined('CONTENT_ICON_DELETE_BASE')) { define("CONTENT_ICON_DELETE_BASE", $imagedir."delete_16.png"); } +if (!defined('CONTENT_ICON_OPTIONS')) { define("CONTENT_ICON_OPTIONS", "".CONTENT_ICON_LAN_2.""); } +if (!defined('CONTENT_ICON_USER')) { define("CONTENT_ICON_USER", "".CONTENT_ICON_LAN_3.""); } +if (!defined('CONTENT_ICON_FILE')) { define("CONTENT_ICON_FILE", "".CONTENT_ICON_LAN_4.""); } +if (!defined('CONTENT_ICON_NEW')) { define("CONTENT_ICON_NEW", "".CONTENT_ICON_LAN_5.""); } +if (!defined('CONTENT_ICON_SUBMIT')) { define("CONTENT_ICON_SUBMIT", "".CONTENT_ICON_LAN_6.""); } +if (!defined('CONTENT_ICON_SUBMIT_SMALL')) { define("CONTENT_ICON_SUBMIT_SMALL", "".CONTENT_ICON_LAN_6.""); } +if (!defined('CONTENT_ICON_AUTHORLIST')) { define("CONTENT_ICON_AUTHORLIST", "".CONTENT_ICON_LAN_7.""); } +if (!defined('CONTENT_ICON_WARNING')) { define("CONTENT_ICON_WARNING", "".CONTENT_ICON_LAN_8.""); } +if (!defined('CONTENT_ICON_OK')) { define("CONTENT_ICON_OK", "".CONTENT_ICON_LAN_9.""); } +if (!defined('CONTENT_ICON_ERROR')) { define("CONTENT_ICON_ERROR", "".CONTENT_ICON_LAN_10.""); } +if (!defined('CONTENT_ICON_ORDERCAT')) { define("CONTENT_ICON_ORDERCAT", "".CONTENT_ICON_LAN_11.""); } +if (!defined('CONTENT_ICON_ORDERALL')) { define("CONTENT_ICON_ORDERALL", "".CONTENT_ICON_LAN_12.""); } +if (!defined('CONTENT_ICON_CONTENTMANAGER')) { define("CONTENT_ICON_CONTENTMANAGER", "".CONTENT_ICON_LAN_14.""); } +if (!defined('CONTENT_ICON_CONTENTMANAGER_SMALL')) { define("CONTENT_ICON_CONTENTMANAGER_SMALL", "".CONTENT_ICON_LAN_13.""); } +if (!defined('CONTENT_ICON_ORDER_UP')) { define("CONTENT_ICON_ORDER_UP", "".CONTENT_ADMIN_ITEM_LAN_63.""); } +if (!defined('CONTENT_ICON_ORDER_DOWN')) { define("CONTENT_ICON_ORDER_DOWN", "".CONTENT_ADMIN_ITEM_LAN_64.""); } + +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_form_class.php b/e107_plugins/content/handlers/content_form_class.php new file mode 100644 index 000000000..e78a716c6 --- /dev/null +++ b/e107_plugins/content/handlers/content_form_class.php @@ -0,0 +1,3856 @@ +".time().") "; + +$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); + +if (!defined('ADMIN_WIDTH')) { define("ADMIN_WIDTH", "width:98%;"); } + +$stylespacer = "style='border:0; height:20px;'"; + +//only used in admin pages, for normal rows (+ in content_submit.php creation form) +$TOPIC_ROW_NOEXPAND = " + + {TOPIC_TOPIC} + {TOPIC_FIELD} + +"; +//only used in admin pages, for expanding rows (+ in content_submit.php creation form) +$TOPIC_ROW = " + + {TOPIC_TOPIC} + + {TOPIC_HEADING} +
    +
    {TOPIC_HELP}

    + {TOPIC_FIELD} +
    + +"; + +//only used in admin pages, for a spacer row +//$TOPIC_ROW_SPACER = ""; +$TOPIC_ROW_SPACER = ""; + +class contentform{ + + function ContentItemPreview(){ + global $ns, $sql, $aa, $qs, $tp, $mainparent; + + $TRPRE = ""; + $TRPOST = ""; + $TDPRE1 = ""; + $TDPRE2 = ""; + $TDPOST = ""; + $CONTENT_CONTENT_PREVIEW = " + + {CONTENT_CONTENT_PREVIEW_CATEGORY} + {CONTENT_CONTENT_PREVIEW_HEADING} + {CONTENT_CONTENT_PREVIEW_SUBHEADING} + {CONTENT_CONTENT_PREVIEW_SUMMARY} + {CONTENT_CONTENT_PREVIEW_TEXT} + {CONTENT_CONTENT_PREVIEW_AUTHORNAME} + {CONTENT_CONTENT_PREVIEW_AUTHOREMAIL} + {CONTENT_CONTENT_PREVIEW_STARTDATE} + {CONTENT_CONTENT_PREVIEW_ENDDATE} + {CONTENT_CONTENT_PREVIEW_COMMENT} + {CONTENT_CONTENT_PREVIEW_RATE} + {CONTENT_CONTENT_PREVIEW_PE} + {CONTENT_CONTENT_PREVIEW_CLASS} + {CONTENT_CONTENT_PREVIEW_SCORE} + {CONTENT_CONTENT_PREVIEW_META} + {CONTENT_CONTENT_PREVIEW_LAYOUT} + {CONTENT_CONTENT_PREVIEW_CUSTOM} + + {CONTENT_CONTENT_PREVIEW_PARENT} + {CONTENT_CONTENT_PREVIEW_ICON} + {CONTENT_CONTENT_PREVIEW_ATTACH} + {CONTENT_CONTENT_PREVIEW_IMAGES} + {CONTENT_CONTENT_PREVIEW_PAGENAMES} +
    \n"; + + $_POST['parent'] = intval($_POST['parent']); + $mainparent = $aa -> getMainParent( $_POST['parent'] ); + $content_pref = $aa -> getContentPref($mainparent); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); + + $content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/"); + $content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/"); + $content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/"); + + $content_tmppath_icon = $tp -> replaceConstants($content_pref["content_icon_path_tmp"]); + $content_tmppath_file = $tp -> replaceConstants($content_pref["content_file_path_tmp"]); + $content_tmppath_image = $tp -> replaceConstants($content_pref["content_image_path_tmp"]); + + if($sql -> db_Select("pcontent", "content_heading", " content_id='".$_POST['parent']."' ")){ + $row = $sql -> db_Fetch(); + $PARENT = $row['content_heading']; + } + $content_heading = $tp -> post_toHTML($_POST['content_heading']); + $content_subheading = $tp -> post_toHTML($_POST['content_subheading']); + $content_summary = $tp -> post_toHTML($_POST['content_summary']); + $content_text = $_POST['content_text']; + if(e_WYSIWYG){ + $content_text = $tp->createConstants($content_text); // convert e107_images/ to {e_IMAGE} etc. + } + + //the problem with tiny_mce is it's storing e_HTTP with an image path, while it should only use the {e_xxx} variables + //this small check resolves this, and stores the paths correctly + if(strstr($content_text,e_HTTP."{e_")){ + $content_text = str_replace(e_HTTP."{e_", "{e_", $content_text); + } + $content_text = $tp->post_toHTML($content_text,TRUE); + + $CONTENT_CONTENT_PREVIEW_CATEGORY = ($_POST['parent'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_57.$TDPOST.$TDPRE2.$PARENT.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_HEADING = ($content_heading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_11.$TDPOST.$TDPRE2.$content_heading.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_SUBHEADING = ($content_subheading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_16.$TDPOST.$TDPRE2.$content_subheading.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_SUMMARY = ($content_summary ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_17.$TDPOST.$TDPRE2.$content_summary.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_TEXT = ($content_text ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_18.$TDPOST.$TDPRE2.$content_text.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_AUTHORNAME = ($_POST['content_author_name'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_14.$TDPOST.$TDPRE2.$_POST['content_author_name'].$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_AUTHOREMAIL = ($_POST['content_author_email'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_15.$TDPOST.$TDPRE2.$_POST['content_author_email'].$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_COMMENT = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_36.$TDPOST.$TDPRE2.($_POST['content_comment'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_RATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_37.$TDPOST.$TDPRE2.($_POST['content_rate'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_PE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_38.$TDPOST.$TDPRE2.($_POST['content_pe'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_CLASS = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_39.$TDPOST.$TDPRE2.r_userclass_name($_POST['content_class']).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_SCORE = ($_POST['content_score'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_40.$TDPOST.$TDPRE2.($_POST['content_score']!="none" ? $_POST['content_score']."/100" : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_40." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_META = ($_POST['content_meta'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_53.$TDPOST.$TDPRE2.($_POST['content_meta']!="" ? $_POST['content_meta'] : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_53." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_LAYOUT = ($_POST['content_layout'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_92.$TDPOST.$TDPRE2.($_POST['content_layout'] == "none" || $_POST['content_layout'] =="content_content_template.php" ? CONTENT_ADMIN_ITEM_LAN_120 : substr($_POST['content_layout'],25 ,-4)).$TDPOST.$TRPOST : ""); + + //start date + if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){ + $CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.$_POST['ne_day']." ".$months[($_POST['ne_month']-1)]." ".$_POST['ne_year'].$TDPOST.$TRPOST; + }else{ + $CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.strftime("%d %b %Y", time()).$TDPOST.$TRPOST; + } + //end date + if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){ + $CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.$_POST['end_day']." ".$months[($_POST['end_month']-1)]." ".$_POST['end_year'].$TDPOST.$TRPOST; + }else{ + $CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_DATE_LAN_16." ".CONTENT_ADMIN_ITEM_LAN_119.$TDPOST.$TRPOST; + } + $CONTENT_CONTENT_PREVIEW_CUSTOM = ""; + + //custom tags + for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ + if($_POST["content_custom_key_{$i}"] != "" && $_POST["content_custom_value_{$i}"] != ""){ + $CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$_POST["content_custom_key_{$i}"].$TDPOST.$TDPRE2.$_POST["content_custom_value_{$i}"].$TDPOST.$TRPOST; + } + } + //custom preset tags + foreach($_POST['content_custom_preset_key'] as $k => $v){ + if($k != "" && $v != ""){ + $CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$k.$TDPOST.$TDPRE2.$v.$TDPOST.$TRPOST; + } + } + + //icon + if($_POST['content_icon'] && file_exists($content_tmppath_icon.$_POST['content_icon'])){ + $ICON = ""; + }elseif($_POST['content_icon'] && file_exists($content_icon_path.$_POST['content_icon'])){ + $ICON = ""; + }else{ + $ICON = CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_114." ".CONTENT_ADMIN_ITEM_LAN_119; + } + $CONTENT_CONTENT_PREVIEW_ICON = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_114.$TDPOST.$TDPRE2.$ICON.$TDPOST.$TRPOST; + + //images and attachments + $file = FALSE; + $image = FALSE; + $ATTACH = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_24.$TDPOST.$TDPRE2; + $IMAGES = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_31.$TDPOST.$TDPRE2; + foreach($_POST as $k => $v){ + if(strpos($k, "content_files") === 0){ + if($v && file_exists($content_tmppath_file.$v)){ + $ATTACH .= CONTENT_ICON_FILE." ".$v."
    "; + $file = TRUE; + }elseif($v && file_exists($content_file_path.$v)){ + $ATTACH .= CONTENT_ICON_FILE." ".$v."
    "; + $file = TRUE; + } + } + if(strpos($k, "content_images") === 0){ + if($v && file_exists($content_tmppath_image.$v)){ + $IMAGES .= " "; + $image = TRUE; + }elseif($v && file_exists($content_image_path.$v)){ + $IMAGES .= " "; + $image = TRUE; + } + } + } + if($file !== TRUE){ + $ATTACH .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_24." ".CONTENT_ADMIN_ITEM_LAN_119; + } + if($image !== TRUE){ + $IMAGES .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_31." ".CONTENT_ADMIN_ITEM_LAN_119; + } + $CONTENT_CONTENT_PREVIEW_ATTACH = $ATTACH.$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_IMAGES = $IMAGES.$TDPOST.$TRPOST; + + $caption = CONTENT_ADMIN_ITEM_LAN_46." ".$_POST['content_heading']; + $preview = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_PREVIEW); + $ns -> tablerender($caption, $preview); + } + + function show_create_content($mode, $userid="", $username=""){ + global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $plugintable, $plugindir, $pref, $eArrayStorage; + global $message, $stylespacer, $TOPIC_ROW_SPACER, $TOPIC_ROW, $TOPIC_ROW_NOEXPAND; + + $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); + + //if create, first show category select (as preferences need to be loaded from the selected category) + if( $qs[1] == "create" && !isset($qs[2]) ){ + $text = " +
    + ".$rs -> form_open("post", e_SELF."?".e_QUERY."", "dataform", "", "enctype='multipart/form-data'")." + + "; + + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; + $TOPIC_FIELD = $aa -> ShowOptionCat().$rs->form_hidden("parent", ""); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + $text .= "
    ".CONTENT_ADMIN_MAIN_LAN_2."
    "; + $caption = CONTENT_ADMIN_MAIN_LAN_2; + $ns->tablerender($caption, $text); + return; + } + + if($mode == 'submit' || $mode=='contentmanager' || ($mode=='sa' && e_PAGE=='content_manager.php') ){ + $border = "border:1px solid #5d6e75;"; + $padding = "padding:6px;"; + $tableprop = "border-collapse: collapse; border-spacing:0px;"; + $TOPIC_ROW_NOEXPAND = " + + {TOPIC_TOPIC} + {TOPIC_FIELD} + "; + + $TOPIC_ROW = " + + {TOPIC_TOPIC} + + {TOPIC_HEADING} +
    +
    {TOPIC_HELP}

    + {TOPIC_FIELD} +
    + + "; + + $TOPIC_TITLE_ROW = "{TOPIC_CAPTION}"; + $TOPIC_ROW_SPACER = ""; + }else{ + $tableprop = ""; + $TOPIC_ROW_SPACER = ""; + } + + if($mode == "submit"){ + $mainparent = $aa -> getMainParent( intval($qs[2]) ); + $array = $aa -> getCategoryTree("", $mainparent, FALSE); + }else{ + $array = $aa -> getCategoryTree("", "", FALSE); + $mainparent = $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : intval($qs[2])) ); + } + + $content_pref = $aa -> getContentPref($mainparent); + + $content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/"); + $content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/"); + $content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/"); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); + $content_tmppath_icon = $tp -> replaceConstants($content_pref["content_icon_path_tmp"]); + $content_tmppath_file = $tp -> replaceConstants($content_pref["content_file_path_tmp"]); + $content_tmppath_image = $tp -> replaceConstants($content_pref["content_image_path_tmp"]); + + if(!is_object($sql)){ $sql = new db; } + $sql2 = new db; + + //check submit permissions + if($mode == 'submit'){ + //check if current item exists (item is a (sub)category) + if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){ + //check submit perms from main parent + if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ + }else{ + header("location:".$plugindir."content_submit.php"); exit; + } + }else{ + header("location:".$plugindir."content_submit.php"); exit; + } + } + + //check manager permissions + if($mode == "contentmanager"){ + //get current item + if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){ + $rowpcm = $sql -> db_Fetch(); + + //if edit item (query holds item id) + if( isset($qs[1]) && $qs[1] == "edit" && is_numeric($qs[2]) ){ + //get parent + $sql2 -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".$rowpcm['content_parent']."' "); + $rowpcm2 = $sql2 -> db_Fetch(); + $pcmcheckpref = $rowpcm2['content_pref']; + $p = $rowpcm['content_parent']; + //create item (query holds category id) + }else{ + $pcmcheckpref = $rowpcm['content_pref']; + $p = $qs[2]; + } + + $pcm_pref = $eArrayStorage->ReadArray($pcmcheckpref); + + //user is allowed to work here + if( (isset($pcm_pref["content_manager_personal"]) && check_class($pcm_pref["content_manager_personal"])) || (isset($pcm_pref["content_manager_category"]) && check_class($pcm_pref["content_manager_category"])) ){ + if($qs[1] == "edit"){ + //if personal manager, assign author query + if( isset($pcm_pref["content_manager_personal"]) && check_class($pcm_pref["content_manager_personal"]) ){ + if(isset($userid) && isset($username) ){ + $userid = intval($userid); + $l = strlen($userid)+1; + $userquery = " AND (content_author = '".$userid."' || LEFT(content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' || content_author REGEXP '\\\^".$username."' ) "; + }else{ + $userquery = ""; + } + } + //if category manager, no author query is needed + if( isset($pcm_pref["content_manager_category"]) && check_class($pcm_pref["content_manager_category"]) ){ + $userquery = ""; + } + } + //user is not allowed to work here + }else{ + header("location:".$plugindir."content_manager.php"); exit; + } + } + + }else{ + $userquery = ""; + } + + //get preferences for submit page + if($mode == "submit"){ + $checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : ""); + $checksummary = (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : ""); + $checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : ""); + $checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : ""); + $checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : ""); + $checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : ""); + $checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : ""); + $checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : ""); + $checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : ""); + $checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : ""); + $checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : ""); + $checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : ""); + $checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : ""); + $checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : ""); + $checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : ""); + $checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : ""); + $checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) ? $content_pref["content_submit_custom_number"] : ""); + $checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : ""); + $checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : ""); + + //get preferences for admin area; posted submitted item. + }elseif($mode == "sa"){ + + //show all preferences from the submit options. if submit pref is not set, check if create prefs are set and use those + $checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : "")); + + $checksummary = (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : "")); + + $checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : "")); + + $checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : "")); + + $checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : "")); + + $checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : "")); + + $checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : "")); + + $checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : "")); + + $checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : "")); + + $checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : "")); + + $checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : "")); + + $checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : "")); + + $checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : "")); + + $checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : "")); + + $checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : "")); + + $checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : "")); + + $checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) && $content_pref["content_submit_custom_number"] != "0" ? $content_pref["content_submit_custom_number"] : (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : "")); + + $checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : "")); + + $checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : "")); + + //normal admin content create preferences + }else{ + + $checksubheading = (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : ""); + $checksummary = (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : ""); + $checkstartdate = (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : ""); + $checkenddate = (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : ""); + $checkicon = (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : ""); + $checkattach = (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : ""); + $checkattachnumber = (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : ""); + $checkimages = (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : ""); + $checkimagesnumber = (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : ""); + $checkcomment = (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : ""); + $checkrating = (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : ""); + $checkscore = (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : ""); + $checkpe = (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : ""); + $checkvisibility = (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : ""); + $checkmeta = (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : ""); + $checkcustom = (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : ""); + $checkcustomnumber = (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : ""); + $checklayout = (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : ""); + $checkpreset = (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : ""); + } + if($mode == "contentmanager"){ // used in contentmanager + $authordetails = $aa -> getAuthor(USERID); + } + if( !isset($authordetails) ){ + $authordetails = $aa -> getAuthor(USERID); + } + + if( ($qs[1] == "edit" || $qs[1] == "sa") && is_numeric($qs[2]) && !isset($_POST['preview_content']) && !isset($message)){ + if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ".$userquery." ")){ + if($mode == "contentmanager"){ + header("location:".$plugindir."content_manager.php"); exit; + }else{ + header("location:".e_SELF."?content"); exit; + } + }else{ + $row = $sql -> db_Fetch(); + + $row['content_heading'] = $tp -> toForm($row['content_heading']); + $row['content_subheading'] = $tp -> toForm($row['content_subheading']); + $row['content_summary'] = $tp -> toForm($row['content_summary']); + $row['content_text'] = $tp -> toForm($row['content_text']); + $row['content_meta'] = $tp -> toForm($row['content_meta']); + $authordetails = $aa -> getAuthor($row['content_author']); + } + } + + if(isset($_POST['preview_content'])){ + $this -> ContentItemPreview(); + } + + //re-prepare the posted fields for the form (after preview) + if( isset($_POST['preview_content']) || isset($message) ){ + + $row['content_parent'] = $_POST['parent']; + $row['content_heading'] = $tp -> post_toForm($_POST['content_heading']); + $row['content_subheading'] = $tp -> post_toForm($_POST['content_subheading']); + $row['content_summary'] = $tp -> post_toForm($_POST['content_summary']); + $row['content_text'] = $tp -> post_toForm($_POST['content_text']); + $authordetails[0] = $_POST['content_author_id']; + $authordetails[1] = $_POST['content_author_name']; + $authordetails[2] = $_POST['content_author_email']; + $ne_day = $_POST['ne_day']; + $ne_month = $_POST['ne_month']; + $ne_year = $_POST['ne_year']; + $end_day = $_POST['end_day']; + $end_month = $_POST['end_month']; + $end_year = $_POST['end_year']; + $row['content_comment'] = $_POST['content_comment']; + $row['content_rate'] = $_POST['content_rate']; + $row['content_pe'] = $_POST['content_pe']; + $row['content_class'] = $_POST['content_class']; + $row['content_refer'] = $_POST['content_refer']; + $row['content_datestamp'] = $_POST['content_datestamp']; + $row['content_score'] = $_POST['content_score']; + $row['content_meta'] = $_POST['content_meta']; + $row['content_layout'] = $_POST['content_layout']; + $row['content_icon'] = $_POST['content_icon']; + + //images and attachments + foreach($_POST as $k => $v){ + if(strpos($k, "content_files") === 0){ + $row['content_file'] .= "[file]".$v; + } + if(strpos($k, "content_images") === 0){ + $row['content_image'] .= "[img]".$v; + } + } + //custom tags + for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ + $keystring = $tp -> post_toForm($_POST["content_custom_key_{$i}"]); + $custom["content_custom_{$keystring}"] = $tp -> post_toForm($_POST["content_custom_value_{$i}"]); + } + //preset tags + foreach($_POST['content_custom_preset_key'] as $k => $v){ + $k = $tp -> post_toForm($k); + $custom['content_custom_presettags'][$k] = $tp -> post_toForm($v); + } + } + + $content_author_id = (isset($authordetails[0]) && $authordetails[0] != "" ? $authordetails[0] : USERID); + $content_author_name = (isset($authordetails[1]) && $authordetails[1] != "" ? $authordetails[1] : USERNAME); + $content_author_email = (isset($authordetails[2]) ? $authordetails[2] : USEREMAIL); + + $formurl = e_SELF."?".e_QUERY; + $text = " +
    + ".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")." + "; + + $hidden = ""; + if($mode == "contentmanager"){ + if($qs[1] == "edit"){ + $hidden .= $rs -> form_hidden("parent", $row['content_parent']); + }else{ + $hidden .= $rs -> form_hidden("parent", intval($qs[2])); + } + }else{ + if($mode == "submit"){ + $parent = "submit"; + }else{ + $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") ); + } + //category parent + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; + $TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", ""); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + //$text .= $TOPIC_ROW_SPACER; + } + + //heading + $row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_11; + $TOPIC_FIELD = $rs -> form_text("content_heading", 74, $row['content_heading'], 250); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + if($checksubheading){ + //subheading + $row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_16; + $TOPIC_FIELD = $rs -> form_text("content_subheading", 74, $row['content_subheading'], 250); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_subheading", $row['content_subheading']); + } + + if($checksummary){ + //summary + $row['content_summary'] = (isset($row['content_summary']) ? $row['content_summary'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_17; + $TOPIC_FIELD = $rs -> form_textarea("content_summary", 74, 5, $row['content_summary']); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_summary", $row['content_summary']); + } + + //text + if(e_WYSIWYG){ + $row['content_text'] = $tp->replaceConstants($row['content_text'], true); + } + require_once(e_HANDLER."ren_help.php"); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_18; + $insertjs = (!e_WYSIWYG) ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'": ""; + $TOPIC_FIELD = $rs -> form_textarea("content_text", 74, 20, $row['content_text'], $insertjs)."
    "; + if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."
    ".display_help("helpb"); } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + //author + $content_author_name_value = ($content_author_name ? $content_author_name : CONTENT_ADMIN_ITEM_LAN_14); + $content_author_name_js = ($content_author_name ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_name.value=='".CONTENT_ADMIN_ITEM_LAN_14."'){document.getElementById('dataform').content_author_name.value='';}\""); + $content_author_email_value = ($content_author_email ? $content_author_email : CONTENT_ADMIN_ITEM_LAN_15); + $content_author_email_js = ($content_author_email ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_email.value=='".CONTENT_ADMIN_ITEM_LAN_15."'){document.getElementById('dataform').content_author_email.value='';}\""); + + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_51; + $TOPIC_FIELD = "(".CONTENT_ADMIN_ITEM_LAN_71.")
    +
    + +
    ".CONTENT_ADMIN_ITEM_LAN_14."".$rs -> form_text("content_author_name", 70, $content_author_name_value, 100, "tbox", "", "", $content_author_name_js )."
    ".CONTENT_ADMIN_ITEM_LAN_15."".$rs -> form_text("content_author_email", 70, $content_author_email_value, 100, "tbox", "", "", $content_author_email_js )." + ".$rs -> form_hidden("content_author_id", $content_author_id)." +
    "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){ + $startdate = getdate($row['content_datestamp']); + $ne_day = $startdate['mday']; + $ne_month = $startdate['mon']; + $ne_year = $startdate['year']; + }else{ + $ne_day = (isset($ne_day) ? $ne_day : "0"); + $ne_month = (isset($ne_month) ? $ne_month : "0"); + $ne_year = (isset($ne_year) ? $ne_year : "0"); + } + + $smarray = getdate(); + $current_year = $smarray['year']; + + if($checkstartdate){ + //start date + $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73; + $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17; + $TOPIC_FIELD = " + ".$rs -> form_select_open("ne_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); + for($count=1; $count<=31; $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_day) && $ne_day == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); + for($count=1; $count<=12; $count++){ + $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($ne_month) && $ne_month == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); + for($count=($current_year-5); $count<=($current_year+1); $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_year) && $ne_year == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("ne_day", $ne_day); + $hidden .= $rs -> form_hidden("ne_month", $ne_month); + $hidden .= $rs -> form_hidden("ne_year", $ne_year); + } + + + if(isset($row['content_enddate']) && $row['content_enddate'] != "0" && $row['content_enddate'] != ""){ + $enddate = getdate($row['content_enddate']); + $end_day = $enddate['mday']; + $end_month = $enddate['mon']; + $end_year = $enddate['year']; + }else{ + $end_day = (isset($end_day) ? $end_day : "0"); + $end_month = (isset($end_month) ? $end_month : "0"); + $end_year = (isset($end_year) ? $end_year : "0"); + } + + if($checkenddate){ + //end date + $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74; + $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18; + $TOPIC_FIELD = " + ".$rs -> form_select_open("end_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); + for($count=1; $count<=31; $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, (isset($end_day) && $end_day == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); + for($count=1; $count<=12; $count++){ + $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($end_month) && $end_month == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); + for($count=($current_year-5); $count<=($current_year+1); $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, (isset($end_year) && $end_year == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("end_day", $end_day); + $hidden .= $rs -> form_hidden("end_month", $end_month); + $hidden .= $rs -> form_hidden("end_year", $end_year); + } + + //$text .= $TOPIC_ROW_SPACER; + if( $checkicon || $checkattach || $checkimages ){ + //$text .= $TOPIC_ROW_SPACER; + + //upload icon + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_104; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_112; + $TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_113; + + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'thumb_*'); + $iconlist = $fl->get_files($content_tmppath_icon,"",$rejectlist); + $filelist = $fl->get_files($content_tmppath_file,"",$rejectlist); + $imagelist = $fl->get_files($content_tmppath_image,"",$rejectlist); + + $TOPIC_FIELD = ""; + if(!FILE_UPLOADS){ + $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_21.""; + }else{ + if(!is_writable($content_tmppath_icon)){ + $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."
    "; + } + if(!is_writable($content_tmppath_file)){ + $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."
    "; + } + if(!is_writable($content_tmppath_image)){ + $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."
    "; + } + $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; + $TOPIC_FIELD .= "
    + + ".$rs -> form_select_open("uploadtype")." + ".($checkicon ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')." + ".($checkattach ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')." + ".($checkimages ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')." + ".$rs -> form_select_close()." + + + + "; + } + $TOPIC_FIELD .= "
    "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + } + + if($checkicon){ + //icon + $row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_20; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_75; + $TOPIC_HELP = ""; + $TOPIC_FIELD = " + ".$rs -> form_text("content_icon", 60, $row['content_icon'], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divicon')\"")." + "; + + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("content_icon", $row['content_icon']); + } + + if($checkattach){ + //file + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_24; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_76; + $TOPIC_HELP = ""; + $TOPIC_FIELD = ""; + $filetmp = explode("[file]", $row['content_file']); + foreach($filetmp as $key => $value) { + if($value == "") { + unset($filetmp[$key]); + } + } + $attachments = array_values($filetmp); + for($i=0;$i<$checkattachnumber;$i++){ + $k=$i+1; + $num = (strlen($k) == 1 ? "0".$k : $k); + $attachments[$i] = ($attachments[$i] ? $attachments[$i] : ""); + + //choose file + $TOPIC_FIELD .= " +
    + ".$num." ".$rs -> form_text("content_files".$i."", 60, $attachments[$i], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divfile".$i."')\"")." +
    "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("content_file", $row['content_file']); + } + + if($checkimages){ + //image + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_31; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_77; + $TOPIC_HELP = ""; + $TOPIC_FIELD = ""; + $imagestmp = explode("[img]", $row['content_image']); + foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } + } + $imagesarray = array_values($imagestmp); + for($i=0;$i<$checkimagesnumber;$i++){ + $k=$i+1; + $num = (strlen($k) == 1 ? "0".$k : $k); + $imagesarray[$i] = ($imagesarray[$i] ? $imagesarray[$i] : ""); + + //choose image + $TOPIC_FIELD .= " +
    + ".$num." ".$rs -> form_text("content_images".$i."", 60, $imagesarray[$i], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divimage".$i."')\"")." +
    "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("content_image", $row['content_image']); + } + + if($checkcomment || $checkrating || $checkpe || $checkvisibility || $checkscore || $checkmeta || $checklayout ){ + //$text .= $TOPIC_ROW_SPACER; + } + if($checkcomment){ + //comment + $row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_36; + $TOPIC_FIELD = " + ".$rs -> form_radio("content_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." + ".$rs -> form_radio("content_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86." + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_comment", $row['content_comment']); + } + + if($checkrating){ + //rating + $row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_37; + $TOPIC_FIELD = " + ".$rs -> form_radio("content_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." + ".$rs -> form_radio("content_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86." + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_rate", $row['content_rate']); + } + + if($checkpe){ + //print/email/pdf icons + $row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_38; + $TOPIC_FIELD = " + ".$rs -> form_radio("content_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." + ".$rs -> form_radio("content_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86." + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_pe", $row['content_pe']); + } + + if($checkvisibility){ + //userclass + $row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_39; + $TOPIC_FIELD = r_userclass("content_class",$row['content_class'], "CLASSES"); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_class", $row['content_class']); + } + + if($checkscore){ + //score + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_40; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_score")." + ".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_41, 0, "none"); + for($a=1; $a<=100; $a++){ + $TOPIC_FIELD .= $rs -> form_option($a, ($row['content_score'] == $a ? "1" : "0"), $a); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_score", $row['content_score']); + } + + if($checkmeta){ + //meta + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_53; + $TOPIC_FIELD = CONTENT_ADMIN_ITEM_LAN_70."
    ".$rs -> form_text("content_meta", 74, $row['content_meta'], 250); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_meta", $row['content_meta']); + } + + if($checklayout){ + global $fl; + + if(!isset($content_pref["content_theme"])){ + $dir = $plugindir."templates/default"; + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){ + $dir = $tp->replaceConstants($content_pref["content_theme"]); + }else{ + $dir = $plugindir."templates/default"; + } + } + //get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE) + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak'); + $templatelist = $fl->get_files($dir,"content_content",$rejectlist); + + //template + $check = ""; + if(isset($row['content_layout']) && $row['content_layout'] != ""){ + $check = $row['content_layout']; + }else{ + if(isset($content_pref["content_layout"])){ + $check = $content_pref["content_layout"]; + } + } + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_92; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_layout")." + ".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_94, 0, "none"); + foreach($templatelist as $template){ + $templatename = substr($template['fname'], 25, -4); + $templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename); + $TOPIC_FIELD .= $rs -> form_option($templatename, ($check == $template['fname'] ? "1" : "0"), $template['fname']); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("content_layout", $row['content_layout']); + } + + if( $checkcustom && $checkcustomnumber ){ + //$text .= $TOPIC_ROW_SPACER; + } + + if(!(isset($_POST['preview_content']) || isset($message))){ + if(isset($row['content_pref']) && $row['content_pref']){ + $custom = $eArrayStorage->ReadArray($row['content_pref']); + } + } + + //custom data + $existing_custom = "0"; + $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_54; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_84; + $TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_68; + $TOPIC_CHECK_VALID = FALSE; + $TOPIC_FIELD = ""; + if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD = ""; } + if(!empty($custom)){ + foreach($custom as $k => $v){ + if(substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){ + $key = substr($k,15); + + $key = $tp -> post_toForm($key); + $v = $tp -> post_toForm($v); + + if($checkcustom && $checkcustomnumber){ + $TOPIC_FIELD .= " + + + + "; + }else{ + $TOPIC_FIELD .= " + ".$rs -> form_hidden("content_custom_key_".$existing_custom, $key)." + ".$rs -> form_hidden("content_custom_value_".$existing_custom, $v); + $TOPIC_CHECK_VALID = TRUE; + } + $existing_custom = $existing_custom + 1; + } + } + } + + if($checkcustom && $checkcustomnumber){ + $TOPIC_CHECK_VALID = TRUE; + for($i=$existing_custom;$i<$checkcustomnumber;$i++){ + $TOPIC_FIELD .= " + + + + "; + } + } + if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD .= "
    ".$rs -> form_text("content_custom_key_".$existing_custom."", 20, $key, 100)."".$rs -> form_text("content_custom_value_".$existing_custom."", 70, $v, 250)."
    ".$rs -> form_text("content_custom_key_".$i."", 20, "", 100)."".$rs -> form_text("content_custom_value_".$i."", 70, "", 250)."
    "; } + if($TOPIC_CHECK_VALID){ $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); } + + //preset custom data fields + if(count($content_pref["content_custom_preset_key"]) > 0){ + //$text .= $TOPIC_ROW_SPACER; + } + + for($i=0;$i parseCustomPresetTag($content_pref["content_custom_preset_key"][$i], $custom['content_custom_presettags']); + }else{ + $tmp = explode("^", $content_pref["content_custom_preset_key"][$i]); + if(is_array($custom['content_custom_presettags'][$tmp[0]])){ + $tmp[0] = $tp -> post_toForm($tmp[0]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][day]", $custom['content_custom_presettags'][$tmp[0]][day]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][month]", $custom['content_custom_presettags'][$tmp[0]][month]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][year]", $custom['content_custom_presettags'][$tmp[0]][year]); + }else{ + $tmp[0] = $tp -> post_toForm($tmp[0]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]]", $custom['content_custom_presettags'][$tmp[0]]); + } + } + } + } + + $text .= $TOPIC_ROW_SPACER." + + ".($hidden ? $hidden : ""); + + $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; + if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){ + if($qs[1] == "sa"){ + $text .= $rs -> form_hidden("content_refer", $row['content_refer']); + } + $text .= $rs -> form_hidden("content_datestamp", $row['content_datestamp']); + $text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); + $text .= $rs -> form_button("submit", "update_content", ($qs[1] == "sa" ? CONTENT_ADMIN_ITEM_LAN_43 : CONTENT_ADMIN_ITEM_LAN_45), $js ); + $text .= $rs -> form_hidden("content_id", $qs[2]); + $text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".CONTENT_ADMIN_ITEM_LAN_42; + }else{ + $text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); + $text .= $rs -> form_button("submit", "create_content", CONTENT_ADMIN_ITEM_LAN_44, $js); + } + $text .= " + + + + + +
    "; + + $caption = ($qs[1] == "edit" ? CONTENT_ADMIN_ITEM_LAN_45 : CONTENT_ADMIN_ITEM_LAN_44); + $ns -> tablerender($caption, $text); + } + + + function parseCustomPresetTag($tag, $values){ + global $rs, $TOPIC_ROW_NOEXPAND, $months, $tp; + + $tmp = explode("^", $tag); + + $str = ""; + if($tmp[1] == "text"){ + $str = $rs -> form_text("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tp -> post_toForm($values[$tmp[0]]), $tmp[3], "tbox", "", "", ""); + + }elseif($tmp[1] == "area"){ + $str = $rs -> form_textarea("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tmp[3], $tp -> post_toForm($values[$tmp[0]]), "", "", "", "", ""); + + }elseif($tmp[1] == "select"){ + $str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}]", ""); + $str .= $rs -> form_option($tmp[2], ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", ""); + for($i=3;$i post_toForm($tmp[$i]); + $str .= $rs -> form_option($tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), $tmp[$i], ""); + } + $str .= $rs -> form_select_close(); + + }elseif($tmp[1] == "date"){ + $str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][day]", "")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, "0", ""); + for($i=1;$i<=31;$i++){ + $str .= $rs -> form_option($i, ($values[$tmp[0]]['day'] == $i ? "1" : "0"), $i, ""); + } + $str .= $rs -> form_select_close(); + + $str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][month]", "")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, "0", ""); + for($i=1;$i<=12;$i++){ + $str .= $rs -> form_option($months[($i-1)], ($values[$tmp[0]]['month'] == $i ? "1" : "0"), $i, ""); + } + $str .= $rs -> form_select_close(); + + $str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][year]", "")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, "0", ""); + for($i=$tmp[2];$i<=$tmp[3];$i++){ + $str .= $rs -> form_option($i, ($values[$tmp[0]]['year'] == $i ? "1" : "0"), $i, ""); + } + $str .= $rs -> form_select_close(); + + }elseif($tmp[1] == "radio"){ + for($i=2;$i form_radio("content_custom_preset_key[{$tmp[0]}]", $tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), "", "")." ".$tmp[$i]; + $i++; + } + + }elseif($tmp[1] == "checkbox"){ + $str = $rs -> form_checkbox("content_custom_preset_key[{$tmp[0]}]", $tp -> post_toForm($tmp[2]), ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", ""); + } + + $TOPIC_TOPIC = $tmp[0]; + $TOPIC_FIELD = $str; + $text = preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + return $text; + } + + + + function show_manage_content($mode, $userid="", $username=""){ + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $eArrayStorage; + + if($mode != "contentmanager"){ + //category parent + global $TOPIC_TOPIC, $TOPIC_FIELD, $TOPIC_ROW_NOEXPAND; + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; + $parent = (is_numeric($qs[1]) ? $qs[1] : ""); + $TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", ""); + $text = "
    + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + $text .= "
    ".CONTENT_ADMIN_MAIN_LAN_2."
    "; + $caption = CONTENT_ADMIN_MAIN_LAN_2; + $ns -> tablerender($caption, $text); + } + + if(!isset($qs[1])){ + return; + } + + $mainparent = $aa -> getMainParent($qs[1]); + $content_pref = $aa -> getContentPref($mainparent); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); + + if($mode == "contentmanager"){ + $personalmanagercheck = FALSE; + if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($qs[1])."' ")){ + $rowpcm = $sql -> db_Fetch(); + $curpref = $eArrayStorage->ReadArray($rowpcm['content_pref']); + + //only show personal items + if( isset($curpref["content_manager_personal"]) && check_class($curpref["content_manager_personal"]) ){ + $l = strlen($userid)+1; + $qryuser = " AND (content_author = '".$userid."' || LEFT(content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' || content_author REGEXP '\\\^".$username."' ) "; + $personalmanagercheck = TRUE; + } + //show all items in this category + if(isset($curpref["content_manager_category"]) && check_class($curpref["content_manager_category"]) ){ + $qryuser = ''; + $personalmanagercheck = TRUE; + } + } + if($personalmanagercheck == TRUE){ + /* + $qryuser = ""; + if(getperms("0")){ + $userid = USERID; + $username = USERNAME; + }else{ + //use user restriction (personal admin) + if(isset($userid) && isset($username) ){ + $userid = intval($userid); + $qryuser = " AND (content_author = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 2) = '".$userid."^".$username."' OR content_author REGEXP '".$username."' )"; + + //$qryuser = " AND (content_author = '".$userid."' || LEFT(content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' || content_author REGEXP '\\\^".$username."' ) "; + } + } + */ + $formtarget = $plugindir."content_manager.php?content.".intval($qs[1]); + $qrycat = " content_parent = '".intval($qs[1])."' "; + $qryfirst = " content_parent = '".intval($qs[1])."' "; + $qryletter = ""; + + }else{ + header("location:".$plugindir."content_manager.php"); exit; + } + }else{ + $array = $aa -> getCategoryTree("", intval($qs[1]), TRUE); + $validparent = implode(",", array_keys($array)); + $qrycat = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $qryuser = ""; + if( !(isset($qs[2]) && is_numeric($qs[2])) ){ + $formtarget = e_SELF."?content.".intval($qs[1]); + $qryfirst = " ".$qrycat." "; + $qryletter = ""; + } + } + + $text = ""; + // -------- SHOW FIRST LETTERS FIRSTNAMES ------------------------------------ + if(!is_object($sql)){ $sql = new db; } + $distinctfirstletter = $sql -> db_Select($plugintable, " DISTINCT(content_heading) ", "content_refer != 'sa' AND ".$qryfirst." ".$qryuser." ORDER BY content_heading ASC "); + while($row = $sql -> db_Fetch()){ + $head = $tp->toHTML($row['content_heading'], TRUE); + if(ord($head) < 128) { + $head_sub = strtoupper(substr($head,0,1)); + }else{ + $head_sub = substr($head,0,2); + } + $arrletters[] = $head_sub; + } + $arrletters = array_unique($arrletters); + $arrletters = array_values($arrletters); + sort($arrletters); + + if ($distinctfirstletter == 0){ + $text .= "
    ".CONTENT_ADMIN_ITEM_LAN_4."
    "; + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_5, $text); + return; + + }elseif ($distinctfirstletter != 1){ + + $text .= " +
    +
    + + + + +
    ".CONTENT_ADMIN_ITEM_LAN_6."
    "; + for($i=0;$i"; + } + } + $text .= " + +
    +
    +
    "; + } + // --------------------------------------------------------------------------- + + // -------- CHECK FOR FIRST LETTER SUBMISSION -------------------------------- + $letter=(isset($_POST['letter']) ? $_POST['letter'] : ""); + if ($letter != "" && $letter != "all" ) { $qryletter .= " AND content_heading LIKE '".$tp->toDB($letter)."%' "; }else{ $qryletter .= ""; } + + $qryitem = " ".$qrycat." AND content_refer != 'sa' ".$qryletter." ".$qryuser." ORDER BY content_datestamp DESC"; + // --------------------------------------------------------------------------- + + $sql2 = new db; + if(!$content_total = $sql2 -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon", $qryitem)){ + $text .= "
    ".CONTENT_ADMIN_ITEM_LAN_4."
    "; + }else{ + if($content_total < 50 || (isset($letter) && $letter!='') ){ + $text .= " +
    + ".$rs -> form_open("post", e_SELF."?".e_QUERY, "deletecontentform","","", "")." + + + + + + + + "; + while($row = $sql2 -> db_Fetch()){ + $delete_heading = str_replace("'", "\'", $row['content_heading']); + $authordetails = $aa -> getAuthor($row['content_author']); + $caticon = $content_icon_path.$row['content_icon']; + $deleteicon = CONTENT_ICON_DELETE; + $cid = $row['content_id']; + $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); + $text .= " + + + + + + + "; + } + $text .= "
    ".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_9."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_12."
    ".$cid."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." + ".CONTENT_ICON_LINK." + ".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." + ".CONTENT_ICON_EDIT." + toJS(CONTENT_ADMIN_JS_LAN_1."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$cid." : ".$delete_heading."]")."')\"/> +
    + ".$rs -> form_close()." +
    "; + } else { + $text .= "
    ".CONTENT_ADMIN_ITEM_LAN_7."
    "; + } + } + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_5, $text); + } + + + + //show_submitted("contentmanager", USERID, USERNAME, $qs[2]); + function show_submitted($cat=''){ + global $qs, $rs, $ns, $aa, $plugintable, $tp; + + $catqry = ''; + if($cat && is_numeric($cat)){ + $catqry = " AND content_parent='".intval($cat)."' "; + } + if(!is_object($sql)){ $sql = new db; } + if(!$content_total = $sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon, content_parent", "content_refer = 'sa' ".$catqry." ")){ + $text .= "
    ".CONTENT_ADMIN_ITEM_LAN_50."
    "; + }else{ + $array = $aa -> getCategoryTree("", "", FALSE); + + $text = " +
    + ".$rs -> form_open("post", e_SELF, "submittedform","","", "")." + + + + + + + + + "; + while($row = $sql -> db_Fetch()){ + + if(array_key_exists($row['content_parent'], $array)){ + $mainparent = $array[$row['content_parent']][0]; + $mainparentheading = $array[$row['content_parent']][1]." [".$array[$row['content_parent']][count($array[$row['content_parent']])-1]."]"; + $content_pref = $aa -> getContentPref($mainparent); + $iconpath = ($content_pref["content_icon_path"] ? $content_pref["content_icon_path"] : "{e_PLUGIN}content/images/icon/" ); + $content_icon_path = $tp -> replaceConstants($iconpath); + $icon = $content_icon_path.$row['content_icon']; + } + $delete_heading = str_replace("'", "\'", $row['content_heading']); + $authordetails = $aa -> getAuthor($row['content_author']); + $delid = $row['content_id']; + + $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); + + $text .= " + + + + + + + + "; + } + $text .= "
    ".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_9."".CONTENT_ADMIN_ITEM_LAN_48."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_12."
    ".$delid." + ".($row['content_icon'] ? "" : " ")." + ".$mainparentheading." + ".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." + + ".$row['content_heading']." ".($row['content_subheading'] ? "
    [".$row['content_subheading']."]" : "")." +
    + ".CONTENT_ICON_EDIT." + toJS(CONTENT_ADMIN_JS_LAN_10."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$delid." : ".$delete_heading."]")."')\"/> +
    + ".$rs -> form_close()." +
    "; + } + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_49, $text); + } + + + function manage_cat(){ + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer, $eArrayStorage; + + $catarray = $aa -> getCategoryTree("", "", FALSE); + $array = array_keys($catarray); + + if(!is_array($array)){ + $text = "
    ".CONTENT_ADMIN_CAT_LAN_9."
    "; + }else{ + $text = " +
    + ".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")." + + + + + + + + "; + + if(!is_object($sql)){ $sql = new db; } + foreach($array as $catid){ + if(!$category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){ + $text .= "
    ".CONTENT_ADMIN_CAT_LAN_9."
    "; + }else{ + $row = $sql -> db_Fetch(); + + $content_pref = $aa -> getContentPref($catarray[$catid][0]); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $delete_heading = str_replace("'", "\'", $row['content_heading']); + $authordetails = $aa -> getAuthor($row['content_author']); + $caticon = $content_cat_icon_path_large.$row['content_icon']; + + $pre = ""; + if($row['content_parent'] == "0"){ //main parent level + $class = "forumheader"; + $mainparentid = $row['content_id']; + }else{ //sub level + $class = "forumheader3"; + for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ + $pre .= "_"; + } + } + + $options = "".CONTENT_ICON_EDIT." + toJS(CONTENT_ADMIN_JS_LAN_9."\\n\\n".CONTENT_ADMIN_JS_LAN_0."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$catid." : ".$delete_heading."]\\n\\n")."')\"/>"; + + $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); + + $text .= " + ".($row['content_parent'] == 0 ? "" : "")." + + + + + + + "; + } + } + $text .= " +
    ".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."
    ".$catid."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." + ".CONTENT_ICON_LINK." + ".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." + + ".$options." +
    + ".$rs -> form_close()." +
    "; + } + $ns -> tablerender(CONTENT_ADMIN_CAT_LAN_10, $text); + unset($row['content_id'], $row['content_heading'], $row['content_subheading'], $row['content_text'], $row['content_icon']); + } + + function manager(){ + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer, $eArrayStorage; + + $catarray = $aa -> getCategoryTree("", "", FALSE); + $array = array_keys($catarray); + + if(!is_array($array)){ + $text = "
    ".CONTENT_ADMIN_CAT_LAN_9."
    "; + }else{ + $text = " +
    + ".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")." + + + + + + "; + + if(!is_object($sql)){ $sql = new db; } + foreach($array as $catid){ + if(!$category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){ + $text .= "
    ".CONTENT_ADMIN_CAT_LAN_9."
    "; + }else{ + $row = $sql -> db_Fetch(); + + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $delete_heading = str_replace("'", "\'", $row['content_heading']); + $authordetails = $aa -> getAuthor($row['content_author']); + $caticon = $content_cat_icon_path_large.$row['content_icon']; + + $pre = ""; + if($row['content_parent'] == "0"){ //main parent level + $class = "forumheader3"; + $mainparentid = $row['content_id']; + }else{ //sub level + $class = "forumheader3"; + for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ + $pre .= "_"; + } + } + + //$pcmusers = ""; + $options = "".CONTENT_ICON_CONTENTMANAGER_SMALL.""; + /* + if(isset($row['content_pref'])){ + $pcmcontent_pref = $eArrayStorage->ReadArray($row['content_pref']); + } + if(isset($pcmcontent_pref["content_manager_allowed_{$catid}"])){ + $pcm = explode(",", $pcmcontent_pref["content_manager_allowed_{$catid}"]); + if($pcm[0]==""){ unset($pcm[0]); } + $pcmusers = count($pcm); + $options .= " ".($pcmusers ? "(".$pcmusers." ".($pcmusers == 1 ? CONTENT_ADMIN_CAT_LAN_54 : CONTENT_ADMIN_CAT_LAN_55).")" : ""); + } + */ + + $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); + + $text .= " + ".($row['content_parent'] == 0 ? "" : "")." + + + + + "; + } + } + $text .= " +
    ".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."
    ".$catid." + ".CONTENT_ICON_LINK." + ".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." + + ".$options." +
    + ".$rs -> form_close()." +
    "; + } + $ns -> tablerender(CONTENT_ADMIN_CAT_LAN_10, $text); + unset($row['content_id'], $row['content_heading'], $row['content_subheading'], $row['content_text'], $row['content_icon']); + } + + + function manager_category(){ + global $plugintable, $qs, $sql, $ns, $rs, $aa, $eArrayStorage; + + if(!getperms("0")){ js_location(e_SELF); } + if(!is_numeric($qs[1])){ js_location(e_SELF); } + + if(!is_object($sql)){ $sql = new db; } + if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_pref", "content_id='".intval($qs[1])."' ")){ + js_location(e_SELF."?manager"); + }else{ + $row = $sql -> db_Fetch(); + $caption = CONTENT_ADMIN_CAT_LAN_30." : ".$row['content_heading']; + } + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + $qs[1] = intval($qs[1]); + + $text = " +
    + ".$rs -> form_open("post", e_SELF."?".e_QUERY, "managerform", "", "enctype='multipart/form-data'")." + + + + + + + + + + + + + + + + +
    + ".CONTENT_ADMIN_MANAGER_LAN_0."
    ".CONTENT_ADMIN_MANAGER_LAN_1."
    +
    + ".r_userclass("content_manager_approve", $content_pref["content_manager_approve"], 'off', "public,guest,nobody,member,admin,classes")." +
    + ".CONTENT_ADMIN_MANAGER_LAN_2."
    ".CONTENT_ADMIN_MANAGER_LAN_3."
    +
    + ".r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "public,guest,nobody,member,admin,classes")." +
    + ".CONTENT_ADMIN_MANAGER_LAN_4."
    ".CONTENT_ADMIN_MANAGER_LAN_5."
    +
    + ".r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "public,guest,nobody,member,admin,classes")." +
    + ".$rs -> form_button("submit", "update_manager", LAN_SAVE)." + ".$rs -> form_hidden("options_type", $qs[1])." +
    + ".$rs -> form_close()." +
    "; + + $ns -> tablerender($caption, $text); + } + + function show_create_category(){ + global $qs, $plugintable, $plugindir, $sql, $ns, $rs, $aa, $fl, $pref, $tp; + global $message, $content_parent, $content_heading, $content_subheading, $content_text, $content_icon, $content_comment, $content_rate, $content_pe, $content_class; + global $stylespacer, $TOPIC_ROW_SPACER, $TOPIC_ROW, $TOPIC_ROW_NOEXPAND; + + $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); + + if(!is_object($sql)){ $sql = new db; } + $formurl = e_SELF."?".e_QUERY; + $array = $aa -> getCategoryTree("", "", FALSE); + $mainparent = $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") ) ); + $content_pref = $aa -> getContentPref($mainparent); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + + if( $qs[0] == "cat" && $qs[1] == "create" && isset($qs[2]) && is_numeric($qs[2]) ){ + if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){ + header("location:".e_SELF."?cat"); exit; + } + $formurl = e_SELF."?".e_QUERY; + } + if( $qs[0] == "cat" && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){ + if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){ + header("location:".e_SELF."?cat"); exit; + }else{ + $row = $sql -> db_Fetch(); + if(substr($row['content_parent'],0,1) != "0"){ + header("location:".e_SELF."?cat"); exit; + } + $menuheading = $row['content_heading']; + } + $formurl = e_SELF."?".e_QUERY; + } + + if(isset($_POST['preview_category'])){ + $formurl = e_SELF."?".e_QUERY; + $cat_heading = $tp -> post_toHTML($_POST['cat_heading']); + $cat_subheading = $tp -> post_toHTML($_POST['cat_subheading']); + //$cat_text = $tp -> post_toHTML($_POST['cat_text']); + if(e_WYSIWYG){ + $_POST['cat_text'] = $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc. + } + $cat_text = $tp->post_toHTML($_POST['cat_text'],TRUE); + + $text = " +
    + + + + + + + + + + + + + + +
    ".$cat_heading."
    ".$cat_subheading."
    ".$cat_text."
     
    ".CONTENT_ADMIN_DATE_LAN_15." + ".($_POST['ne_day'] != "none" ? $_POST['ne_day'] : "")." ".$months[($_POST['ne_month']-1)]." ".($_POST['ne_year'] != "none" ? $_POST['ne_year'] : "")." +
    ".CONTENT_ADMIN_DATE_LAN_16." + ".($_POST['end_day'] != "none" ? $_POST['end_day'] : "")." ".$months[($_POST['end_month']-1)]." ".($_POST['end_year'] != "none" ? $_POST['end_year'] : "")." +
    ".CONTENT_ADMIN_CAT_LAN_17."".r_userclass_name($_POST['cat_class'])."
    ".CONTENT_ADMIN_CAT_LAN_14."".($_POST['cat_comment'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."
    ".CONTENT_ADMIN_CAT_LAN_15."".($_POST['cat_rate'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."
    ".CONTENT_ADMIN_CAT_LAN_16."".($_POST['cat_pe'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."
    +
    "; + + $ns -> tablerender($cat_heading, $text); + } + + if( isset($_POST['preview_category']) || isset($message) || isset($_POST['uploadcaticon']) ){ + $row['content_heading'] = $tp -> post_toForm($_POST['cat_heading']); + $row['content_subheading'] = $tp -> post_toForm($_POST['cat_subheading']); + //$row['content_text'] = $tp -> post_toForm($_POST['cat_text']); + if(e_WYSIWYG){ + $_POST['cat_text'] = $tp->toHTML($_POST['cat_text'],$parseBB = TRUE); // parse the bbcodes to we can edit as html. + $_POST['cat_text'] = $tp->replaceConstants($_POST['cat_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images + } + $row['content_text'] = $tp -> post_toForm($_POST['cat_text']); + $ne_day = $_POST['ne_day']; + $ne_month = $_POST['ne_month']; + $ne_year = $_POST['ne_year']; + $end_day = $_POST['end_day']; + $end_month = $_POST['end_month']; + $end_year = $_POST['end_year']; + $row['content_icon'] = $_POST['cat_icon']; + $row['content_comment'] = $_POST['cat_comment']; + $row['content_rate'] = $_POST['cat_rate']; + $row['content_pe'] = $_POST['cat_pe']; + $row['content_class'] = $_POST['cat_class']; + }else{ + if(e_WYSIWYG){ + $row['content_text'] = $tp->replaceConstants($row['content_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images + } + } + + //check which areas should be visible (dependent on options in admin:create category) + $checksubheading = (isset($content_pref["content_admincat_subheading"]) ? $content_pref["content_admincat_subheading"] : (isset($content_pref["content_admincat_subheading"]) ? $content_pref["content_admincat_subheading"] : "")); + + $checkstartdate = (isset($content_pref["content_admincat_startdate"]) ? $content_pref["content_admincat_startdate"] : (isset($content_pref["content_admincat_startdate"]) ? $content_pref["content_admincat_startdate"] : "")); + + $checkenddate = (isset($content_pref["content_admincat_enddate"]) ? $content_pref["content_admincat_enddate"] : (isset($content_pref["content_admincat_enddate"]) ? $content_pref["content_admincat_enddate"] : "")); + + $checkuploadicon = (isset($content_pref["content_admincat_uploadicon"]) ? $content_pref["content_admincat_uploadicon"] : (isset($content_pref["content_admincat_uploadicon"]) ? $content_pref["content_admincat_uploadicon"] : "")); + + $checkselecticon = (isset($content_pref["content_admincat_selecticon"]) ? $content_pref["content_admincat_selecticon"] : (isset($content_pref["content_admincat_selecticon"]) ? $content_pref["content_admincat_selecticon"] : "")); + + $checkcomment = (isset($content_pref["content_admincat_comment"]) ? $content_pref["content_admincat_comment"] : (isset($content_pref["content_admincat_comment"]) ? $content_pref["content_admincat_comment"] : "")); + + $checkrating = (isset($content_pref["content_admincat_rating"]) ? $content_pref["content_admincat_rating"] : (isset($content_pref["content_admincat_rating"]) ? $content_pref["content_admincat_rating"] : "")); + + $checkpe = (isset($content_pref["content_admincat_pe"]) ? $content_pref["content_admincat_pe"] : (isset($content_pref["content_admincat_pe"]) ? $content_pref["content_admincat_pe"] : "")); + + $checkvisibility = (isset($content_pref["content_admincat_visibility"]) ? $content_pref["content_admincat_visibility"] : (isset($content_pref["content_admincat_visibility"]) ? $content_pref["content_admincat_visibility"] : "")); + + $text = " +
    + ".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")." + "; + + //category parent + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; + if($qs[1] == "create"){ + $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") ); + }elseif($qs[1] == "edit"){ + if(isset($qs[3]) && is_numeric($qs[3])){ + $parent = $qs[3]; + }else{ + $parent = ( strpos($row['content_parent'], ".") ? substr($row['content_parent'],2) : ""); + } + } + $TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", ""); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + $text .= $TOPIC_ROW_SPACER; + + $row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_2; + $TOPIC_FIELD = $rs -> form_text("cat_heading", 90, $row['content_heading'], 250); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + if($checksubheading){ + $row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_3; + $TOPIC_FIELD = $rs -> form_text("cat_subheading", 90, $row['content_subheading'], 250); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("cat_subheading", $row['content_subheading']); + } + + $row['content_text'] = (isset($row['content_text']) ? $row['content_text'] : ""); + require_once(e_HANDLER."ren_help.php"); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_4; + $insertjs = (!$pref['wysiwyg'] ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : ""); + $TOPIC_FIELD = $rs -> form_textarea("cat_text", 80, 20, $row['content_text'], $insertjs)."
    "; + if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."
    ". display_help("helpb"); } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0"){ + $startdate = getdate($row['content_datestamp']); + $ne_day = $startdate['mday']; + $ne_month = $startdate['mon']; + $ne_year = $startdate['year']; + }else{ + $ne_day = (isset($ne_day) ? $ne_day : ""); + $ne_month = (isset($ne_month) ? $ne_month : ""); + $ne_year = (isset($ne_year) ? $ne_year : ""); + } + if(isset($row['content_enddate']) && $row['content_enddate'] != "0"){ + $enddate = getdate($row['content_enddate']); + $end_day = $enddate['mday']; + $end_month = $enddate['mon']; + $end_year = $enddate['year']; + }else{ + $end_day = (isset($end_day) ? $end_day : ""); + $end_month = (isset($end_month) ? $end_month : ""); + $end_year = (isset($end_year) ? $end_year : ""); + } + + $smarray = getdate(); + $current_year = $smarray['year']; + + $text .= $TOPIC_ROW_SPACER; + + if($checkstartdate){ + $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73; + $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17; + $TOPIC_FIELD = " + ".$rs -> form_select_open("ne_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); + for($count=1; $count<=31; $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, ($ne_day == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); + for($count=1; $count<=12; $count++){ + $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], ($ne_month == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); + for($count=($current_year-5); $count<=$current_year; $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, ($ne_year == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("ne_day", $ne_day); + $hidden .= $rs -> form_hidden("ne_month", $ne_month); + $hidden .= $rs -> form_hidden("ne_year", $ne_year); + } + + if($checkenddate){ + $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16; + $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74; + $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18; + $TOPIC_FIELD = " + ".$rs -> form_select_open("end_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 1, "none"); + for($count=1; $count<=31; $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, ($end_day == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 1, "none"); + for($count=1; $count<=12; $count++){ + $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], ($end_month == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 1, "none"); + for($count=($current_year-5); $count<=$current_year; $count++){ + $TOPIC_FIELD .= $rs -> form_option($count, ($end_year == $count ? "1" : "0"), $count); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + }else{ + $hidden .= $rs -> form_hidden("end_day", $end_day); + $hidden .= $rs -> form_hidden("end_month", $end_month); + $hidden .= $rs -> form_hidden("end_year", $end_year); + } + + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*'); + $iconlist = $fl->get_files($content_cat_icon_path_large,"",$rejectlist); + + if($checkuploadicon){ + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_63; + $TOPIC_HEADING = CONTENT_ADMIN_CAT_LAN_61; + $TOPIC_HELP = ""; + $TOPIC_FIELD = ""; + if(!FILE_UPLOADS){ + $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_21.""; + }else{ + if(!is_writable($content_cat_icon_path_large)){ + $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_cat_icon_path_large." ".CONTENT_ADMIN_ITEM_LAN_23."
    "; + } + $TOPIC_FIELD .= CONTENT_ADMIN_CAT_LAN_62." + + + + "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + } + + if($checkselecticon){ + $row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_5; + $TOPIC_FIELD = " + ".$rs -> form_text("cat_icon", 60, $row['content_icon'], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_CAT_LAN_8, "onclick=\"expandit('divcaticon')\"")." + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("cat_icon", $row['content_icon']); + } + + if($checkcomment){ + $row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_14; + $TOPIC_FIELD = " + ".$rs -> form_radio("cat_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." + ".$rs -> form_radio("cat_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("cat_comment", $row['content_comment']); + } + + if($checkrating){ + $row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_15; + $TOPIC_FIELD = " + ".$rs -> form_radio("cat_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." + ".$rs -> form_radio("cat_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("cat_rate", $row['content_rate']); + } + + if($checkpe){ + $row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_16; + $TOPIC_FIELD = " + ".$rs -> form_radio("cat_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." + ".$rs -> form_radio("cat_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("cat_pe", $row['content_pe']); + } + + if($checkvisibility){ + $row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : ""); + $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_17; + $TOPIC_FIELD = r_userclass("cat_class",$row['content_class'], "CLASSES"); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + }else{ + $hidden .= $rs -> form_hidden("cat_class", $row['content_class']); + } + + $text .= $TOPIC_ROW_SPACER; + $text .= " + + + +
    ".$hidden; + if($qs[1] == "edit" && is_numeric($qs[2]) ){ + $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; + $text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); + $text .= $rs -> form_button("submit", "update_category", CONTENT_ADMIN_CAT_LAN_7, $js).$rs -> form_button("submit", "category_clear", CONTENT_ADMIN_CAT_LAN_21).$rs -> form_hidden("cat_id", $qs[2]).$rs -> form_hidden("id", $qs[2]).$rs -> form_hidden("menuheading", $menuheading); + + $caption = CONTENT_ADMIN_CAT_LAN_1; + }else{ + $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; + $text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); + $text .= $rs -> form_button("submit", "create_category", CONTENT_ADMIN_CAT_LAN_6, $js); + $caption = CONTENT_ADMIN_CAT_LAN_0; + } + $text .= " +
    + ".$rs -> form_close()." +
    "; + + $ns -> tablerender($caption, $text); + } + + + + function show_contentmanager($mode, $userid="", $username=""){ + global $content_shortcodes, $row, $tp, $sql, $ns, $rs, $plugintable, $plugindir, $aa, $eArrayStorage; + global $CONTENT_CONTENTMANAGER_CATEGORY, $CONTENT_CONTENTMANAGER_TABLE, $CONTENT_CONTENTMANAGER_TABLE_START, $CONTENT_CONTENTMANAGER_TABLE_END, $content_pref, $pref; + $personalmanagercheck = FALSE; + + if(!isset($CONTENT_CONTENTMANAGER_TABLE)){ + if(is_readable(e_THEME.$pref['sitetheme']."/content/content_manager_template.php")){ + require_once(e_THEME.$pref['sitetheme']."/content/content_manager_template.php"); + }else{ + require_once(e_PLUGIN."content/templates/content_manager_template.php"); + } + } + $array = $aa -> getCategoryTree("", "", TRUE); + $catarray = array_keys($array); + $content_contentmanager_table_string = ""; + foreach($catarray as $catid){ + if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($catid)."' ")){ + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ + $personalmanagercheck = TRUE; + $content_contentmanager_table_string .= $tp -> parseTemplate($CONTENT_CONTENTMANAGER_TABLE, FALSE, $content_shortcodes); + } + } + } + if($personalmanagercheck == TRUE){ + $text = $CONTENT_CONTENTMANAGER_TABLE_START.$content_contentmanager_table_string.$CONTENT_CONTENTMANAGER_TABLE_END; + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_56, $text); + }else{ + header("location:".$plugindir."content.php"); exit; + } + } + + + + function show_order(){ + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer; + + if(!getperms("0")){ header("location:".e_SELF); exit; } + + $catarray = $aa -> getCategoryTree("", "", FALSE); + $array = array_keys($catarray); + + //number of main parents + $mp = $sql -> db_Count($plugintable, "(*)", "WHERE content_parent='0' AND content_refer != 'sa' "); + + if(!is_array($array)){ + $text = "
    ".CONTENT_ADMIN_CAT_LAN_9."
    "; + }else{ + $text = " +
    + ".$rs -> form_open("post", e_SELF."?order", "orderform")." + + + + + + + + + + "; + + if(!is_object($sql)){ $sql = new db; } + foreach($array as $catid){ + if(!$category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){ + $text .= "
    ".CONTENT_ADMIN_CAT_LAN_9."
    "; + }else{ + $row = $sql -> db_Fetch(); + + $content_pref = $aa -> getContentPref($catarray[$catid][0]); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $authordetails = $aa -> getAuthor($row['content_author']); + $caticon = $content_cat_icon_path_large.$row['content_icon']; + + $pre = ""; + if($row['content_parent'] == "0"){ //main parent level + $class = "forumheader"; + }else{ //sub level + $class = "forumheader3"; + for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ + $pre .= "_"; + } + } + + //count subcategories for a main parent + if($row['content_parent'] == 0){ + $ordermax = $mp; + }else{ + $mainparent = $aa -> getMainParent($row['content_id']); + $subs = $aa -> getCategoryTree("", $mainparent, FALSE); + $ordermax = count($subs)-1; + } + + //count items in category + $ordercat = ""; + $ordercatall = ""; + $up = ""; + $down = ""; + $selectorder = ""; + + $sqlc = new db; + $n = $sqlc -> db_Count($plugintable, "(*)", "WHERE content_parent='".intval($catid)."' AND content_refer != 'sa' "); + if($n > 1){ + $ordercat = "".CONTENT_ICON_ORDERCAT.""; + $ordercatall = ($row['content_parent'] == 0 ? "".CONTENT_ICON_ORDERALL."" : ""); + } + $amount = "(".($n == 1 ? $n." ".CONTENT_ADMIN_CAT_LAN_56 : $n." ".CONTENT_ADMIN_CAT_LAN_57).")"; + + //if($ordermax > 1){ + //up arrow + if($row['content_order'] != 1 && $row['content_order'] != 0){ + $up = "".CONTENT_ICON_ORDER_UP." "; + }else{ + $up = "   "; + } + //down arrow + if($row['content_order'] != $ordermax){ + $down = "".CONTENT_ICON_ORDER_DOWN.""; + }else{ + $down = "   "; + } + //select box + //if($ordermax > 1){ + + $selectorder = " + "; + //} + //} + $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); + + $text .= " + ".($row['content_parent'] == 0 ? "" : "")." + + + + + + + + + "; + } + } + $text .= " + + + + + +
    ".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_ITEM_LAN_58."".CONTENT_ADMIN_ITEM_LAN_59."".CONTENT_ADMIN_ITEM_LAN_60."
    ".$catid."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." + ".CONTENT_ICON_LINK." + ".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." ".$amount." + + ".$ordercat." + ".$ordercatall." + + ".$up." + ".$down." + + ".$selectorder." +
      + ".$rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61)." +
    + ".$rs -> form_close()." +
    "; + } + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_62, $text); + } + + + + function show_content_order($mode){ + global $sql, $ns, $rs, $qs, $plugintable, $plugindir, $aa, $tp; + + $allcats = $aa -> getCategoryTree("", "", FALSE); + if($mode == "ci"){ + $formtarget = e_SELF."?order.".$qs[1].".".$qs[2]; + $qry = "content_parent = '".intval($qs[2])."' "; + $order = "SUBSTRING_INDEX(content_order, '.', 1)+0"; + + }elseif($mode == "ai"){ + $array = $aa -> getCategoryTree("", intval($qs[1]), FALSE); + $validparent = implode(",", array_keys($array)); + $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $formtarget = e_SELF."?order.".$qs[1]; + $order = "SUBSTRING_INDEX(content_order, '.', -1)+0"; + } + $content_pref = $aa -> getContentPref(intval($qs[1])); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + + $sqlo = new db; + if(!$content_total = $sqlo -> db_Select($plugintable, "content_id, content_heading, content_author, content_parent, content_order", "content_refer != 'sa' AND ".$qry." ORDER BY ".$order." ASC, content_heading DESC ")){ + $text = "
    ".CONTENT_ADMIN_ITEM_LAN_4."
    "; + }else{ + $text = " +
    + ".$rs -> form_open("post", $formtarget, "orderform")." + + + + + + + + + "; + + while($row = $sqlo -> db_Fetch()){ + $delete_heading = str_replace("'", "\'", $row['content_heading']); + $authordetails = $aa -> getAuthor($row['content_author']); + $caticon = (isset($row['content_icon']) ? $content_icon_path.$row['content_icon'] : ""); + $deleteicon = CONTENT_ICON_DELETE; + + $tmp = explode(".", $row['content_order']); + if(!$tmp[1]){ $tmp[1] = "0"; } + $row['content_order'] = $tmp[0]."-".$tmp[1]; + + if($mode == "ci"){ + $ordercheck = $tmp[0]; + $ordercheck2 = $tmp[1]; + $qrystring = "order.".$qs[1].".".$qs[2]; + }elseif($mode == "ai"){ + $ordercheck = $tmp[1]; + $ordercheck2 = $tmp[0]; + $qrystring = "order.".$qs[1]; + } + $cid = $row['content_id']; + $corder = $row['content_order']; + + if(array_key_exists($row['content_parent'], $allcats)){ + $mainparentid = $allcats[$row['content_parent']][0]; + } + //up arrow + if($ordercheck != 1 && $ordercheck != 0){ + $up = "".CONTENT_ICON_ORDER_UP." "; + }else{ + $up = "   "; + } + //down arrow + if($ordercheck != $content_total){ + $down = "".CONTENT_ICON_ORDER_DOWN.""; + }else{ + $down = "   "; + } + $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + + $text .= " + + + + + + + "; + } + $text .= " + + + + +
    ".CONTENT_ADMIN_MAIN_LAN_2."
    ".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_59."".CONTENT_ADMIN_ITEM_LAN_60."
    ".$cid." + ".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." + + ".CONTENT_ICON_LINK." + ".$row['content_heading']." (".$row['content_order'].") + ".$up." + ".$down." + + +
      + ".$rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61)." +
    + ".$rs -> form_close()." +
    "; + } + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_65, $text); + return; + } + + function show_options(){ + global $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer; + + $lan_file = $plugindir."languages/".e_LANGUAGE."/lan_content_options.php"; + include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English/lan_content_options.php"); + + $text = " +
    + ".$rs -> form_open("post", e_SELF."?option", "optionsform","","", "")." + + + + + + + + + "; + + $content_pref = $aa -> getContentPref(0); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + + $text .= " + + + + + + + + + + "; + + $sqlo = new db; + if($category_total = $sqlo -> db_Select($plugintable, "*", "content_parent='0' ")){ + while($row = $sqlo -> db_Fetch()){ + + $content_pref = $aa -> getContentPref($row['content_id']); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $authordetails = $aa -> getAuthor($row['content_author']); + $caticon = $content_cat_icon_path_large.$row['content_icon']; + + $text .= " + + + + + + + + "; + //".$rs -> form_checkbox("content_inherit[".$row['content_id']."]", 1, (isset($content_pref['content_inherit']) ? "1" : "0"))." + } + } + + $text .= " + + + + +
    ".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."".CONTENT_ADMIN_OPT_LAN_167."
    ".CONTENT_ADMIN_OPT_LAN_1." + ".CONTENT_ICON_OPTIONS." +
    ".$row['content_id']."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." + ".CONTENT_ICON_LINK." + ".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." + + ".CONTENT_ICON_OPTIONS." + + + +
    + +
    + ".$rs -> form_close()." +
    "; + + $ns -> tablerender(CONTENT_ADMIN_MENU_LAN_6, $text); + } + + + + function show_options_cat(){ + global $qs, $id, $sql, $ns, $rs, $aa, $content_pref, $pref, $content_cat_icon_path_large, $content_cat_icon_path_small, $plugintable, $plugindir; + global $fl, $stylespacer, $tp; + + if($qs[1] == "default"){ + $id = "0"; + $caption = CONTENT_ADMIN_OPT_LAN_0." : ".CONTENT_ADMIN_OPT_LAN_1; + }elseif(is_numeric($qs[1])){ + $id = $qs[1]; + $sqlo = new db; + if(!$sqlo -> db_Select($plugintable, "content_heading", "content_id='".intval($id)."' AND content_parent = '0' ")){ + header("location:".e_SELF."?option"); exit; + }else{ + while($rowo = $sqlo -> db_Fetch()){ + $caption = CONTENT_ADMIN_OPT_LAN_0." : ".$rowo['content_heading']; + } + } + }else{ + header("location:".e_SELF."?option"); exit; + } + //check prefs two times to insure they are shown, if none present, the first inserts them, the second retrieves them + //$content_pref = $aa -> getContentPref($id); + $content_pref = $aa -> getContentPref($id); + + //define some variables + $TOPIC_TABLE_END = $this->pref_submit().""; + $TOPIC_TITLE_ROW = "{TOPIC_CAPTION}"; + $TOPIC_TABLE_START = ""; + + $TOPIC_ROW_NOEXPAND = " + + {TOPIC_TOPIC} + {TOPIC_FIELD} + + "; + + $TOPIC_ROW = " + + {TOPIC_TOPIC} + + {TOPIC_HEADING} +
    +
    {TOPIC_HELP}

    + {TOPIC_FIELD} +
    + + "; + + $text = " + "; + + $text .= " +
    +
    \n + +
    + "; + + $TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_3; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW); + + //content_admin_sections + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1; + $TOPIC_FIELD = "
    + ".$rs -> form_checkbox("content_admin_subheading", 1, (isset($content_pref['content_admin_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."
    + ".$rs -> form_checkbox("content_admin_summary", 1, (isset($content_pref['content_admin_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."
    + ".$rs -> form_checkbox("content_admin_startdate", 1, (isset($content_pref['content_admin_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."
    + ".$rs -> form_checkbox("content_admin_enddate", 1, (isset($content_pref['content_admin_enddate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_34."
    + ".$rs -> form_checkbox("content_admin_icon", 1, (isset($content_pref['content_admin_icon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."
    + ".$rs -> form_checkbox("content_admin_attach", 1, (isset($content_pref['content_admin_attach']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."
    + ".$rs -> form_checkbox("content_admin_images", 1, (isset($content_pref['content_admin_images']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_3."
    + ".$rs -> form_checkbox("content_admin_comment", 1, (isset($content_pref['content_admin_comment']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."
    +
    + ".$rs -> form_checkbox("content_admin_rating", 1, (isset($content_pref['content_admin_rating']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."
    + ".$rs -> form_checkbox("content_admin_score", 1, (isset($content_pref['content_admin_score']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_6."
    + ".$rs -> form_checkbox("content_admin_pe", 1, (isset($content_pref['content_admin_pe']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."
    + ".$rs -> form_checkbox("content_admin_visibility", 1, (isset($content_pref['content_admin_visibility']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_7."
    + ".$rs -> form_checkbox("content_admin_meta", 1, (isset($content_pref['content_admin_meta']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_8."
    + ".$rs -> form_checkbox("content_admin_layout", 1, (isset($content_pref['content_admin_layout']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_9."
    + ".$rs -> form_checkbox("content_admin_customtags", 1, (isset($content_pref['content_admin_customtags']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_10."
    + ".$rs -> form_checkbox("content_admin_presettags", 1, (isset($content_pref['content_admin_presettags']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_11."
    +
    + "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + //content_admin_images_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_3; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_admin_images_number"); + $content_pref['content_admin_images_number'] = ($content_pref['content_admin_images_number'] ? $content_pref['content_admin_images_number'] : "10"); + for($i=1;$i<16;$i++){ + $k=$i*2; + $TOPIC_FIELD .= $rs -> form_option($k, ($content_pref['content_admin_images_number'] == $k ? "1" : "0"), $k); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + //content_admin_files_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_4; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_admin_files_number"); + $content_pref['content_admin_files_number'] = ($content_pref['content_admin_files_number'] ? $content_pref['content_admin_files_number'] : "1"); + for($i=1;$i<6;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($content_pref['content_admin_files_number'] == $i ? "1" : "0"), $i); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + //content_admin_custom_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_5; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_admin_custom_number"); + for($i=0;$i<11;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($content_pref['content_admin_custom_number'] == $i ? "1" : "0"), $i); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + + //content_admin_custom_preset_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_6; + $TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_7; + $TOPIC_HELP = ""; + $i=0; + $existing = 0; + $TOPIC_FIELD = " +
    "; + for($i=0;$i form_text("content_custom_preset_key[$existing]", 50, $content_pref['content_custom_preset_key'][$existing], 100)." + ".$rs -> form_button("button", "x", "x", "onclick=\"document.getElementById('content_custom_preset_key[$existing]').value='';\"", "", "")." + "; + $existing++; + } + } + $TOPIC_FIELD .= " +
    +
    +

    "; + + $url = e_PLUGIN."content/handlers/content_preset.php"; + $selectjs = "onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return window.open(this.options[this.selectedIndex].value, 'myWindow', 'status = 1, height = 400, width = 400, resizable = 1'); }\""; + $TOPIC_FIELD .= " +
    + ".$rs -> form_select_open("type", $selectjs)." + ".$rs -> form_option(CONTENT_PRESET_LAN_25, "1", "none", "")." + ".$rs -> form_option(CONTENT_PRESET_LAN_26, "", $url."?text", "")." + ".$rs -> form_option(CONTENT_PRESET_LAN_27, "", $url."?area", "")." + ".$rs -> form_option(CONTENT_PRESET_LAN_28, "", $url."?select", "")." + ".$rs -> form_option(CONTENT_PRESET_LAN_29, "", $url."?date", "")." + ".$rs -> form_option(CONTENT_PRESET_LAN_30, "", $url."?checkbox", "")." + ".$rs -> form_option(CONTENT_PRESET_LAN_31, "", $url."?radio", "")." + ".$rs -> form_select_close()." +

    "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $text .= $TOPIC_TABLE_END; + + + $text .= " + +

    +"; + +?> \ No newline at end of file diff --git a/e107_plugins/featurebox/templates/default.php b/e107_plugins/featurebox/templates/default.php new file mode 100644 index 000000000..32f460e61 --- /dev/null +++ b/e107_plugins/featurebox/templates/default.php @@ -0,0 +1,28 @@ +$fb_title
    +
    +$fb_text +"; + +?> \ No newline at end of file diff --git a/e107_plugins/forum/e_emailprint.php b/e107_plugins/forum/e_emailprint.php new file mode 100755 index 000000000..6c4d09bdf --- /dev/null +++ b/e107_plugins/forum/e_emailprint.php @@ -0,0 +1,57 @@ +thread_get($thread_id,0,999); + $thread_name = $tp -> toHTML($thread_info[0]['thread_name'], TRUE); + $text = "".$thread_name."
    + ".$thread_info[0]['user_name'].", ".$gen->convert_date($thread_info[0]['thread_datestamp'], "forum")."

    + ".$tp -> toHTML($thread_info[0]['thread_thread'], TRUE); + + + $count = 1; + + unset($thread_info[0], $thread_info['head']); + foreach($thread_info as $reply) + { + $text .= "

    Re: ".$thread_name."
    + ".$reply['user_name'].", ".$gen->convert_date($reply['thread_datestamp'], "forum")."

    + ".$tp -> toHTML($reply['thread_thread'], TRUE); + } + + +// return "
    ".print_r($thread_info,TRUE)."
    "; + return $text; +} + +function email_item($thread_id) +{ + global $tp; + $gen = new convert; + include_once(e_PLUGIN.'forum/forum_class.php'); + $forum = new e107forum; + $thread_info = $forum->thread_get($thread_id,0,999); + + $thread_name = $tp -> toHTML($thread_info[0]['thread_name'], TRUE); + $text = "".$thread_name."
    + ".$thread_info[0]['user_name'].", ".$gen->convert_date($thread_info[0]['thread_datestamp'], "forum")."

    + ".$tp -> toHTML($thread_info[0]['thread_thread'], TRUE); + + $count = 1; + + unset($thread_info[0], $thread_info['head']); + foreach($thread_info as $reply) + { + $text .= "

    Re: ".$thread_name."
    + ".$reply['user_name'].", ".$gen->convert_date($reply['thread_datestamp'], "forum")."

    + ".$tp -> toHTML($reply['thread_thread'], TRUE); + } + return $text; +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/e_frontpage.php b/e107_plugins/forum/e_frontpage.php new file mode 100644 index 000000000..dc29f1e40 --- /dev/null +++ b/e107_plugins/forum/e_frontpage.php @@ -0,0 +1,10 @@ + $PLUGINS_DIRECTORY.'forum/forum.php', 'title' => FOR_FP_1); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/e_latest.php b/e107_plugins/forum/e_latest.php new file mode 100644 index 000000000..b751b031c --- /dev/null +++ b/e107_plugins/forum/e_latest.php @@ -0,0 +1,15 @@ +db_Count('generic', '(*)', "WHERE gen_type='reported_post' OR gen_type='Reported Forum Post'"); +$text .= "
    + "; + +if ($reported_posts) { + $text .= "".ADLAN_LAT_6.": ".$reported_posts.""; +} else { + $text .= ADLAN_LAT_6.": ".$reported_posts; +} + +$text .= '
    '; +?> diff --git a/e107_plugins/forum/e_linkgen.php b/e107_plugins/forum/e_linkgen.php new file mode 100644 index 000000000..74de2650b --- /dev/null +++ b/e107_plugins/forum/e_linkgen.php @@ -0,0 +1,37 @@ + + diff --git a/e107_plugins/forum/e_list.php b/e107_plugins/forum/e_list.php new file mode 100644 index 000000000..c94e33b6d --- /dev/null +++ b/e107_plugins/forum/e_list.php @@ -0,0 +1,152 @@ + db_Select("plugin", "*", "plugin_path = 'forum' AND plugin_installflag = '1' ")) + { + return; + } + + $LIST_CAPTION = $arr[0]; + $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); + + $bullet = $this -> getBullet($arr[6], $mode); + + if($mode == "new_page" || $mode == "new_menu" ) + { + $lvisit = $this -> getlvisit(); + $qry = " + SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies + FROM #forum_t AS t + LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + LEFT JOIN #user AS u ON t.thread_user = u.user_id + LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id + WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."' + AND t.thread_datestamp > $lvisit + ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($arr[7]); + } + else + { + $qry = " + SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name + FROM #forum_t AS t + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + LEFT JOIN #user AS u ON t.thread_user = u.user_id + LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id + WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."' + ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($arr[7]); + + } + + if(!$results = $sql->db_Select_gen($qry)) + { + $LIST_DATA = LIST_FORUM_2; + } + else + { + $forumArray = $sql->db_getList(); + $path = e_PLUGIN."forum/"; + + foreach($forumArray as $forumInfo) + { + extract($forumInfo); + + //last user + $r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, ".")); + $r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1)); + if (strstr($thread_lastuser, chr(1))) { + $tmp = explode(chr(1), $thread_lastuser); + $r_name = $tmp[0]; + } + $thread_lastuser = $r_id; + + //user + $u_id = substr($thread_user, 0, strpos($thread_user, ".")); + $u_name = substr($thread_user, (strpos($thread_user, ".")+1)); + $thread_user = $u_id; + + if ($thread_anon) { + $tmp = explode(chr(1), $thread_anon); + $thread_user = $tmp[0]; + $thread_user_ip = $tmp[1]; + } + + $gen = new convert; + $r_datestamp = $gen->convert_date($thread_lastpost, "short"); + if($thread_total_replies) + { + $LASTPOST = ""; + if($lp_name) + { + $LASTPOST = "$lp_name"; + } + else + { + if($thread_lastuser{0} == "0") + { + $LASTPOST = substr($thread_lastuser, 2); + } + else + { + //$LASTPOST = NFPM_L16; + } + } + $LASTPOST .= " ".LIST_FORUM_6." $r_datestamp"; + } + else + { + $LASTPOST = " - "; + $LASTPOSTDATE = ""; + } + + if($parent_name == "") + { + $parent_name = $thread_name; + } + $rowheading = $this -> parse_heading($parent_name, $mode); + if($parent_id) + { + $lnk = $thread_id.".post"; + } + else + { + $lnk = $thread_id; + } + $HEADING = "".$rowheading.""; + $AUTHOR = ($arr[3] ? ($thread_anon ? $thread_user : "$user_name") : ""); + $CATEGORY = ($arr[4] ? "$forum_name" : ""); + $DATE = ($arr[5] ? $this -> getListDate($thread_datestamp, $mode) : ""); + $ICON = $bullet; + $VIEWS = $thread_views; + $REPLIES = $thread_total_replies; + if($thread_total_replies) + { + $INFO = "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]"; + } + else + { + $INFO = "[ ".LIST_FORUM_3." ".intval($tviews)." ]"; + } + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + + +?> \ No newline at end of file diff --git a/e107_plugins/forum/e_rss.php b/e107_plugins/forum/e_rss.php new file mode 100644 index 000000000..4ca1f0737 --- /dev/null +++ b/e107_plugins/forum/e_rss.php @@ -0,0 +1,276 @@ +$v){ + $eplug_rss_feed[] = $v; +} + +function get_forum_rss(){ + $rss = array(); + + //forum threads (old url) + $feed['name'] = "Forum / threads"; + $feed['url'] = '6'; + $feed['topic_id'] = ''; + $feed['path'] = 'forum|threads'; + $feed['text'] = 'this is the rss feed for the forum_threads entries'; + $feed['class'] = '1'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum threads (new url) + $feed['name'] = "Forum / threads"; + $feed['url'] = 'forumthreads'; + $feed['topic_id'] = ''; + $feed['path'] = 'forum|threads'; + $feed['text'] = 'this is the rss feed for the forum_threads entries'; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum posts (old url) + $feed['name'] = "Forum / posts"; + $feed['url'] = '7'; + $feed['topic_id'] = ''; + $feed['path'] = 'forum|posts'; + $feed['text'] = 'this is the rss feed for the forum_posts entries'; + $feed['class'] = '1'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum posts (new url) + $feed['name'] = "Forum / posts"; + $feed['url'] = 'forumposts'; + $feed['topic_id'] = ''; + $feed['path'] = 'forum|posts'; + $feed['text'] = 'this is the rss feed for the forum_posts entries'; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum topic (old url) + $feed['name'] = "Forum / topic"; + $feed['url'] = '8'; + $feed['topic_id'] = '*'; + $feed['path'] = 'forum|topic'; + $feed['text'] = 'this is the rss feed for the forum_topic entries'; + $feed['class'] = '1'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum topic (new url) + $feed['name'] = "Forum / topic"; + $feed['url'] = 'forumtopic'; + $feed['topic_id'] = '*'; + $feed['path'] = 'forum|topic'; + $feed['text'] = 'this is the rss feed for the forum_topic entries'; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum name (old url) + $feed['name'] = "Forum / name"; + $feed['url'] = '11'; + $feed['topic_id'] = '*'; + $feed['path'] = 'forum|name'; + $feed['text'] = 'this is the rss feed for the forum_name entries'; + $feed['class'] = '1'; + $feed['limit'] = '9'; + $rss[] = $feed; + + //forum name (new url) + $feed['name'] = "Forum / name"; + $feed['url'] = 'forumname'; + $feed['topic_id'] = '*'; + $feed['path'] = 'forum|name'; + $feed['text'] = 'this is the rss feed for the forum_name entries'; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $rss[] = $feed; + + return $rss; +} +//##### ------------------------------------------------------------------------------------ + + +//##### create rss data, return as array $eplug_rss_data ----------------------------------- +$sqlrss = new db; + +switch($this->parm){ + + case threads: + case 6: + $this -> rssQuery = + "SELECT t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, u.user_name, u.user_email FROM #forum_t AS t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + WHERE f.forum_class IN (0, 251, 252) AND t.thread_parent=0 + ORDER BY t.thread_datestamp DESC LIMIT 0,".$this -> limit; + $sqlrss->db_Select_gen($this -> rssQuery); + $tmp = $sqlrss->db_getList(); + + $rss = array(); + $i=0; + foreach($tmp as $value) { + + if($value['user_name']) { + $rss[$i]['author'] = $value['user_name']; + $rss[$i]['author_email'] = $value['user_email']; // must include an email address to be valid. + } else { + $tmp=explode(".", $value['thread_user'], 2); + list($rss[$i]['author'], $ip) = explode(chr(1), $tmp[1]); + } + + $rss[$i]['title'] = $value['thread_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id']; + $rss[$i]['description'] = $value['thread_thread']; + $rss[$i]['datestamp'] = $value['thread_datestamp']; + + $i++; + } + break; + + case posts: + case 7: + $this -> rssQuery = "SELECT tp.thread_name AS parent_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, u.user_email FROM #forum_t AS t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + WHERE f.forum_class IN (0, 251, 252) + ORDER BY t.thread_datestamp DESC LIMIT 0,".$this -> limit; + $sqlrss->db_Select_gen($this -> rssQuery); + $tmp = $sqlrss->db_getList(); + $rss = array(); + $i=0; + foreach($tmp as $value) { + + if($value['user_name']) { + $rss[$i]['author'] = $value['user_name']; + $rss[$i]['author_email'] = $value['user_email']; // must include an email address to be valid. + } else { + $tmp=explode(".", $value['thread_user'], 2); + list($rss[$i]['author'], $ip) = explode(chr(1), $tmp[1]); + } + + if($value['parent_name']) { + $rss[$i]['title'] = "Re: ".$value['parent_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_parent']; + } else { + $rss[$i]['title'] = $value['thread_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id']; + } + + $rss[$i]['description'] = $value['thread_thread']; + $rss[$i]['datestamp'] = $value['thread_datestamp']; + + $i++; + } + break; + + case topic: + case 8: + if(!$this -> topicid) { + return FALSE; + } + + /* get thread ... */ + $this -> rssQuery = "SELECT t.thread_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, f.forum_id, f.forum_name, f.forum_class, u.user_name + FROM #forum_t AS t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + WHERE f.forum_class IN (0, 251, 255) AND t.thread_id=".intval($this -> topicid); + $sqlrss->db_Select_gen($this -> rssQuery); + $topic = $sqlrss->db_Fetch(); + + /* get replies ... */ + $this -> rssQuery = "SELECT t.thread_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, f.forum_id, f.forum_name, f.forum_class, u.user_name, u.user_email + FROM #forum_t AS t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + WHERE f.forum_class IN (0, 251, 255) AND t.thread_parent=".intval($this -> topicid); + $sqlrss->db_Select_gen($this -> rssQuery); + $replies = $sqlrss->db_getList(); + + $rss = array(); + $i = 0; + + if($value['user_name']) { + $rss[$i]['author'] = $value['user_name'] . " ( ".$e107->base_path."user.php?id.".intval($value['thread_user'])." )"; + } else { + $tmp=explode(".", $value['thread_user'], 2); + list($rss[$i]['author'], $ip) = explode(chr(1), $tmp[1]); + } + + $rss[$i]['title'] = $topic['thread_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$topic['thread_id']; + $rss[$i]['description'] = $topic['thread_thread']; + $rss[$i]['datestamp'] = $topic['thread_datestamp']; + $i ++; + foreach($replies as $value) { + if($value['user_name']) { + $rss[$i]['author'] = $value['user_name']; + $rss[$i]['author_email'] = $value['user_email']; // must include an email address to be valid. + } else { + $tmp=explode(".", $value['thread_user'], 2); + list($rss[$i]['author'], $ip) = explode(chr(1), $tmp[1]); + } + $rss[$i]['title'] = "Re: ".$topic['thread_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$this -> topicid; + $rss[$i]['description'] = $value['thread_thread']; + $rss[$i]['datestamp'] = $value['thread_datestamp']; + $i++; + } + break; + + case name: + case 11: + if(!$this -> topicid) { + return FALSE; + } + + $this -> rssQuery = " + SELECT f.forum_id, f.forum_name, f.forum_class, tp.thread_name AS parent_name, t.*, u.user_name, u.user_email + FROM #forum_t as t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + WHERE t.thread_forum_id = ".intval($this->topicid)." AND f.forum_class IN (0, 251, 255) + ORDER BY t.thread_datestamp DESC LIMIT 0,".$this -> limit; + + $sqlrss->db_Select_gen($this -> rssQuery); + $tmp = $sqlrss->db_getList(); + $this -> contentType = $this -> contentType." : ".$tmp[1]['forum_name']; + $rss = array(); + $i=0; + foreach($tmp as $value) { + if($value['user_name']) { + $rss[$i]['author'] = $value['user_name']; + $rss[$i]['author_email'] = $value['user_email']; + } else { + $tmp=explode(".", $value['thread_user'], 2); + list($rss[$i]['author'], $ip) = explode(chr(1), $tmp[1]); + } + + if($value['parent_name']) { + $rss[$i]['title'] = "Re: ".$value['parent_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id'].".post"; + } else { + $rss[$i]['title'] = $value['thread_name']; + $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id']; + } + $rss[$i]['description'] = $value['thread_thread']; + $rss[$i]['datestamp'] = $value['thread_datestamp']; + $i++; + } + break; +} + +$eplug_rss_data[] = $rss; +//##### ------------------------------------------------------------------------------------ + +?> \ No newline at end of file diff --git a/e107_plugins/forum/e_search.php b/e107_plugins/forum/e_search.php new file mode 100644 index 000000000..3acc91332 --- /dev/null +++ b/e107_plugins/forum/e_search.php @@ -0,0 +1,17 @@ + e_PLUGIN.'forum/search/search_parser.php', + 'qtype' => FOR_SCH_LAN_1, + 'refpage' => 'forum', + 'advanced' => e_PLUGIN.'forum/search/search_advanced.php', + 'id' => 'forum' + ); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/e_status.php b/e107_plugins/forum/e_status.php new file mode 100644 index 000000000..a0c79087a --- /dev/null +++ b/e107_plugins/forum/e_status.php @@ -0,0 +1,6 @@ + db_Count("forum_t"); +$text .= "
    ".E_16_FORUM." ".ADLAN_113.": ".$forum_posts."
    "; +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php new file mode 100644 index 000000000..7d88d969c --- /dev/null +++ b/e107_plugins/forum/forum.php @@ -0,0 +1,525 @@ +db_Update("user", "user_realm='".$tp -> toDB($tmp, true)."' WHERE user_id='".USERID."' "); + header("location:".e_SELF."?track"); + exit; +} + +//Mark all threads as read +if (e_QUERY == "mark.all.as.read") +{ + $forum->forum_markasread('all'); + header("location:".e_SELF); + exit; +} + +//Mark all threads in specific forum as read +if (strstr(e_QUERY, 'mfar')) +{ + $tmp = explode(".", e_QUERY); + $forum_id = intval($tmp[1]); + $forum->forum_markasread($forum_id); + header("location:".e_SELF); + exit; +} + +if (e_QUERY == 'rules') +{ + include_once(HEADERF); + forum_rules('show'); + include_once(FOOTERF); + exit; +} + +$gen = new convert; + +$FORUMTITLE = LAN_46; +$THREADTITLE = LAN_47; +$REPLYTITLE = LAN_48; +$LASTPOSTITLE = LAN_49; +$INFOTITLE = LAN_191; +$LOGO = IMAGE_e; +$NEWTHREADTITLE = LAN_424; +$POSTEDTITLE = LAN_423; +$NEWIMAGE = IMAGE_new_small; +$TRACKTITLE = LAN_397; + +$rules_text = forum_rules('check'); +$USERINFO = "".LAN_429." | ".LAN_430.""; +if(USER) +{ + $USERINFO .= " | ".LAN_431." | ".LAN_432." | ".LAN_435.""; + if($pref['forum_attach'] && (check_class($pref['upload_class']) || getperms('0'))) + { + $USERINFO .= " | ".FORLAN_442.""; + } +} +if($rules_text != '') +{ + $USERINFO .= " | ".LAN_433.""; +} +$total_topics = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' "); +$total_replies = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' "); +$total_members = $sql->db_Count("user"); +$newest_member = $sql->db_Select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); +list($nuser_id, $nuser_name) = $sql->db_Fetch(); +if(!defined("e_TRACKING_DISABLED")) +{ + $member_users = $sql->db_Select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' "); + $guest_users = $sql->db_Select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' "); + $users = $member_users+$guest_users; + $USERLIST = LAN_426; + global $listuserson; + $c = 0; + if(is_array($listuserson)) + { + foreach($listuserson as $uinfo => $pinfo) + { + list($oid, $oname) = explode(".", $uinfo, 2); + $c ++; + $USERLIST .= "$oname".($c == MEMBERS_ONLINE ? "." :", "); + } + } + $USERLIST .= "
    ".LAN_427." ".LAN_436; +} +$STATLINK = "".LAN_441."\n"; +$ICONKEY = " +\n + + + + + + +\n
    ".IMAGE_new_small."".LAN_79."".IMAGE_nonew_small."".LAN_80."".IMAGE_closed_small."".LAN_394."
    \n"; + +$SEARCH = " +
    +

    + + + + +

    +
    \n"; + +$PERMS = (USER == TRUE || ANON == TRUE ? LAN_204." - ".LAN_206." - ".LAN_208 : LAN_205." - ".LAN_207." - ".LAN_209); + +$INFO = ""; +if (USER == TRUE) +{ + $total_new_threads = $sql->db_Count('forum_t', '(*)', "WHERE thread_datestamp>'".USERLV."' "); + if (USERVIEWED != "") + { + $tmp = explode("..", USERVIEWED); + $total_read_threads = count($tmp); + } + else + { + $total_read_threads = 0; + } + + $INFO = LAN_30." ".USERNAME."
    "; + $lastvisit_datestamp = $gen->convert_date(USERLV, 'long'); + $datestamp = $gen->convert_date(time(), "long"); + if (!$total_new_threads) + { + $INFO .= LAN_31; + } + elseif($total_new_threads == 1) + { + $INFO .= LAN_32; + } + else + { + $INFO .= LAN_33." ".$total_new_threads." ".LAN_34." "; + } + $INFO .= LAN_35; + if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) + { + $INFO .= LAN_198; + $allread = TRUE; + } + elseif($total_read_threads != 0) + { + $INFO .= " (".LAN_196.$total_read_threads.LAN_197.")"; + } + + $INFO .= "
    + ".LAN_36." ".$lastvisit_datestamp."
    + ".LAN_37." ".$datestamp; +} +else +{ + $INFO .= ""; + if (ANON == TRUE) + { + $INFO .= LAN_410."
    ".LAN_44." ".LAN_437." ".LAN_438; + } + elseif(USER == FALSE) + { + $INFO .= LAN_410."
    ".LAN_45." ".LAN_439." ".LAN_440; + } +} + +if (USER && $allread != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads) +{ + $INFO .= "
    ".LAN_199."".(e_QUERY != "new" ? ", ".LAN_421."" : ""); +} + +if (USER && USERREALM && e_QUERY != "track") +{ + $INFO .= "
    ".LAN_393.""; +} + +$FORUMINFO = LAN_192.($total_topics+$total_replies)." ".LAN_404." ($total_topics ".($total_topics == 1 ? LAN_411 : LAN_413).", $total_replies ".($total_replies == 1 ? LAN_412 : LAN_414).").".(!defined("e_TRACKING_DISABLED") ? "" : "
    ".$users." ".($users == 1 ? LAN_415 : LAN_416)." (".$member_users." ".($member_users == 1 ? LAN_417 : LAN_419).", ".$guest_users." ".($guest_users == 1 ? LAN_418 : LAN_420).")
    ".LAN_42.$total_members."
    ".LAN_41."".$nuser_name.".\n"); + +if (!isset($FORUM_MAIN_START)) +{ + if (file_exists(THEME."forum_template.php")) + { + include_once(THEME."forum_template.php"); + } +} +include(e_PLUGIN."forum/templates/forum_template.php"); +require_once(HEADERF); + +$parent_list = $forum->forum_getparents(); +$forum_list = $forum->forum_getforums(); +$sub_list = $forum->forum_getsubs(); +$newflag_list = $forum->forum_newflag_list(); + +if (!$parent_list) +{ + $ns->tablerender(PAGE_NAME, "
    ".LAN_51."
    ", array('forum', '51')); + require_once(FOOTERF); + exit; +} + +$forum_string = ""; +foreach ($parent_list as $parent) { + $status = parse_parent($parent); + $PARENTSTATUS = $status[0]; + if ($status[1]) { + $PARENTNAME = $parent['forum_name']; + $forum_string .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_PARENT); + // $forums = $forum->forum_getforums($parent['forum_id']); + if (!count($forum_list[$parent['forum_id']])) + { + $text .= "".LAN_52.""; + } + else + { + foreach($forum_list[$parent['forum_id']] as $f) + { + if ($f['forum_class'] == e_UC_ADMIN && ADMIN) + { + $forum_string .= parse_forum($f, LAN_406); + } + elseif($f['forum_class'] == e_UC_MEMBER && USER) + { + $forum_string .= parse_forum($f, LAN_407); + } + elseif($f['forum_class'] == e_UC_READONLY) + { + $forum_string .= parse_forum($f, LAN_408); + } + elseif($f['forum_class'] && check_class($f['forum_class'])) + { + $forum_string .= parse_forum($f, LAN_409); + } + elseif(!$f['forum_class']) + { + $forum_string .= parse_forum($f); + } + } + if (isset($FORUM_MAIN_PARENT_END)) + { + $forum_string .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_PARENT_END); + } + } + } +} + +function parse_parent($parent) +{ + if(check_class($parent['forum_class'])) + { + $status[0]=""; + $status[1] = TRUE; + if(!check_class($parent['forum_postclass'])) + { + $status[0] = "( ".LAN_405." )"; + } + } + else + { + $status[1] = FALSE; + } + return $status; +} + +function parse_forum($f, $restricted_string = "") +{ + global $FORUM_MAIN_FORUM, $gen, $forum, $tp, $newflag_list, $sub_list; + + if(USER && is_array($newflag_list) && in_array($f['forum_id'], $newflag_list)) + { + $NEWFLAG = "".IMAGE_new.""; + } + else + { + $NEWFLAG = IMAGE_nonew; + } + + if(substr($f['forum_name'], 0, 1) == "*") + { + $f['forum_name'] = substr($f['forum_name'], 1); + } + $f['forum_name'] = $tp -> toHTML($f['forum_name'], TRUE, "no_hook"); + $f['forum_description'] = $tp -> toHTML($f['forum_description'], TRUE, "no_hook"); + + $FORUMNAME = "{$f['forum_name']}"; + $FORUMDESCRIPTION = $f['forum_description'].($restricted_string ? "
    $restricted_string" : ""); + $THREADS = $f['forum_threads']; + $REPLIES = $f['forum_replies']; + $FORUMSUBFORUMS = ""; + + if(is_array($sub_list[$f['forum_parent']][$f['forum_id']])) + { + list($lastpost_datestamp, $lastpost_thread) = explode(".", $f['forum_lastpost_info']); + $ret = parse_subs($sub_list[$f['forum_parent']][$f['forum_id']], $lastpost_datestamp); + $FORUMSUBFORUMS = "
    ".FORLAN_444.": {$ret['text']}
    "; + $THREADS += $ret['threads']; + $REPLIES += $ret['replies']; + if(isset($ret['lastpost_info'])) + { + $f['forum_lastpost_info'] = $ret['lastpost_info']; + $f['user_name'] = $ret['user_name']; + } + } + + if ($f['forum_lastpost_user']) + { + list($lastpost_datestamp, $lastpost_thread) = explode(".", $f['forum_lastpost_info']); + $tmp = explode(".", $f['forum_lastpost_user'], 2); + if ($f['user_name']) + { + $lastpost_name = "{$f['user_name']}"; + } + else + { + if(!$tmp[1]) + { + $lastpost_name = FORLAN_443; + } + else + { + $lastpost_name = $tp->toHTML($tmp[1]); + } + } + $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); + $LASTPOST = $lastpost_datestamp.'
    '.$lastpost_name." ".IMAGE_post2.''; + } + else + { + $LASTPOST = "-"; + } + return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_FORUM)); +} + +function parse_subs($subList, $lastpost_datestamp) +{ + $ret = array(); + $ret['text'] = ""; + foreach($subList as $sub) + { + $ret['text'] .= ($ret['text'] ? ", " : ""); + $ret['text'] .= "{$sub['forum_name']}"; + $ret['threads'] += $sub['forum_threads']; + $ret['replies'] += $sub['forum_replies']; + $tmp = explode(".", $sub['forum_lastpost_info']); + if($tmp[0] > $lastpost_datestamp) + { + $ret['lastpost_info'] = $sub['forum_lastpost_info']; + $ret['user_name'] = $sub['user_name']; + $lastpost_datestamp = $tmp[0]; + } + } + return $ret; +} + +if (e_QUERY == "track") +{ + $sql2 = new db; + $tmp = explode("-", USERREALM); + foreach($tmp as $key => $value) + { + if ($value) + { + if($sql->db_Select("forum_t", "thread_id, thread_datestamp, thread_name", "thread_id='".intval($value)."' ")) + { + $row = $sql->db_Fetch(); + //extract($row); + $NEWIMAGE = IMAGE_nonew_small; + if ($row['thread_datestamp'] > USERLV && (strpos(USERVIEWED, ".".$row['thread_id'].".") === FALSE)) + { + $NEWIMAGE = IMAGE_new_small; + } + elseif($sql2->db_SELECT("forum_t", "thread_id", "thread_parent='{$row['thread_id']}' AND thread_datestamp > '".USERLV."' ")) + { + while ($xrow = $sql2->db_Fetch()) + { + if (strpos(USERVIEWED, ".".$xrow['thread_id'].".") === FALSE) + { + $NEWIMAGE = IMAGE_new_small; + } + } + } + $result = preg_split("/\]/", $row['thread_name']); + $TRACKPOSTNAME = (($result[1] && $row['thread_name']{0} == "[") ? $result[0]."] ".preg_replace("/\[.*\]/", "", $row['thread_name'])."" : "".$row['thread_name'].""); + $UNTRACK = "".LAN_392.""; + $forum_trackstring .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_MAIN); + } + } + } + + $forum_track_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_START); + $forum_track_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_END); + + if ($pref['forum_enclose']) + { + $ns->tablerender($pref['forum_title'], $forum_track_start.$forum_trackstring.$forum_track_end, array('forum', 'main1')); + } + else + { + echo $forum_track_start.$forum_trackstring.$forum_track_end; + } +} + +if (e_QUERY == "new") +{ + $newpostList = $forum->post_getnew(10); + foreach($newpostList as $post) + { + list($author_id, $author_info) = explode(".", $post['thread_user'], 2); + list($author_name, $tmp) = explode(chr(1), $author_info); + $datestamp = $gen->convert_date($post['thread_datestamp'], "forum"); + if($author_id == 0) + { + $STARTERTITLE = $author_name."
    ".$datestamp; + } + else + { + $STARTERTITLE = "$author_name
    ".$datestamp; + } + if($post['post_subject']) + { + $NEWSPOSTNAME = "".LAN_425.$tp->toHTML($post['post_subject'], TRUE, 'no_make_clickable, no_hook').""; + } + else + { + $NEWSPOSTNAME = "".$tp->toHTML($post['thread_name'], TRUE, 'no_make_clickable, no_hook').""; + } + + $forum_newstring .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_MAIN); + } + + if (!$newpostList) + { + $NEWSPOSTNAME = LAN_198; + $forum_newstring = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_MAIN); + } + $forum_new_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_START); + $forum_new_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_END); + + if ($pref['forum_enclose']) + { + $ns->tablerender($pref['forum_title'], $forum_new_start.$forum_newstring.$forum_new_end, array('forum', 'main2')); + } + else + { + echo $forum_new_start.$forum_newstring.$forum_new_end; + } +} + +$forum_main_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_START); +$forum_main_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_END); +if ($pref['forum_enclose']) +{ + $ns->tablerender($pref['forum_title'], $forum_main_start.$forum_string.$forum_main_end, array('forum', 'main3')); +} +else +{ + echo $forum_main_start.$forum_string.$forum_main_end; +} +require_once(FOOTERF); + +function forum_rules($action = 'check') +{ + global $tp, $sql, $ns; + if (ADMIN == TRUE) + { + $type = 'forum_rules_admin'; + } + elseif(USER == TRUE) + { + $type = 'forum_rules_member'; + } + else + { + $type = 'forum_rules_guest'; + } + $result = $sql->db_Select('generic', 'gen_chardata', "gen_type = '$type' AND gen_intdata = 1"); + if ($action == 'check') + { + if ($result) + { + return TRUE; + } + else + { + return FALSE; + } + } + if ($result) + { + $row = $sql->db_Fetch(); + $rules_text = $tp->toHTML($row['gen_chardata'], TRUE); + } + else + { + $rules_text = FORLAN_441; + } + $ns->tablerender(LAN_433, "
    {$rules_text}
    ", array('forum', 'forum_rules')); +} +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php new file mode 100644 index 000000000..c6f771842 --- /dev/null +++ b/e107_plugins/forum/forum_admin.php @@ -0,0 +1,1506 @@ +"); +define("IMAGE_sub", "".FORLAN_145.""); +define("IMAGE_nosub", "".FORLAN_145.""); + +$deltest = array_flip($_POST); +if (e_QUERY) +{ + $tmp = explode(".", e_QUERY); + $action = $tmp[0]; + $sub_action = $tmp[1]; + $id = $tmp[2]; + unset($tmp); +} + +if(isset($_POST['delete'])) +{ + $tmp = array_pop(array_flip($_POST['delete'])); + list($delete, $del_id) = explode("_", $tmp); +} + +if(isset($_POST['setMods'])) +{ + foreach($_POST['mods'] as $fid => $modid) + { + $sql->db_Update('forum',"forum_moderators = '{$modid}' WHERE forum_id = {$fid}"); + } + $forum->show_message(FORLAN_144); +} + +if(isset($_POST['tools'])) +{ + $msg = ""; + if(isset($_POST['forum_all'])) + { + $fList[]='all'; + } + else + { + foreach(array_keys($_POST['forumlist']) as $k) + { + $fList[] = $k; + } + } + foreach($fList as $fid) + { + if(isset($_POST['counts'])) + { + $for->forum_update_counts($fid, $_POST['counts_threads']); + $msg .= FORLAN_167.": $fid
    "; + } + if(isset($_POST['lastpost'])) + { + $with_threads = (isset($_POST['lastpost_nothread'])) ? FALSE : TRUE; + $for->update_lastpost('forum', $fid, $with_threads); + $msg .= FORLAN_168.": $fid
    "; + } + } + if(isset($_POST['userpostcounts'])) + { + $list = $for->get_user_counts(); + foreach($list as $uid => $cnt) + { + $sql->db_Update("user","user_forums = '{$cnt}' WHERE user_id = '{$uid}'"); + } + $msg .= FORLAN_169."
    "; + } + + $forum->show_message($msg); +} + +if(isset($_POST['create_sub'])) +{ + $fid = intval($sub_action); + $_name = $tp->toDB($_POST['subname_new']); + $_desc = $tp->toDB($_POST['subdesc_new']); + $_order = intval($_POST['suborder_new']); + if($_name != "" && $sql->db_Select('forum', '*', "forum_id = {$fid}")) + { + $row = $sql->db_Fetch(); + if($sql->db_Insert("forum", "0, '{$_name}', '{$_desc}', '{$row['forum_parent']}', '{$fid}', '".time()."', '{$row['forum_moderators']}', 0, 0, '', '', '{$row['forum_class']}', '{$_order}', '{$row['forum_postclass']}'")) + { + $forum->show_message(LAN_CREATED); + } + else + { + $forum->show_message(LAN_CREATED_FAILED); + } + } +} + +if(isset($_POST['update_subs'])) +{ + $msg = ""; + foreach(array_keys($_POST['subname']) as $id) + { + if($_POST['subname'][$id] == "") + { + if ($sql->db_Delete("forum", "forum_id='$id' ")) + { + $msg .= FORLAN_150." ".$id." ".LAN_DELETED."
    "; + $cnt = $sql->db_Delete("forum_t", "thread_forum_id = {$id}"); + $msg .= $cnt." ".FORLAN_152." ".LAN_DELETED."
    "; + } + } + else + { + $_name = $tp->toDB($_POST['subname'][$id]); + $_desc = $tp->toDB($_POST['subdesc'][$id]); + $_order = intval($_POST['suborder'][$id]); + if($sql->db_Update("forum", "forum_name='{$_name}', forum_description='{$_desc}', forum_order='{$_order}' WHERE forum_id = {$id}")) + { + $msg .= FORLAN_150." ".$id." ".LAN_UPDATED."
    "; + } + } + } + if($msg) + { + $forum->show_message($msg); + } +} + +if(isset($_POST['submit_parent'])) +{ + $_POST['forum_name'] = $tp->toDB($_POST['forum_name']); + $sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '', '0', '0', '".time()."', '', '0', '0', '', '', '".$_POST['forum_class']."', '0', '{$_POST['forum_postclass']}'"); + $forum->show_message(FORLAN_13); +} + +if(isset($_POST['update_parent'])) +{ + $_POST['forum_name'] = $tp->toDB($_POST['forum_name']); + $sql->db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_class='".$_POST['forum_class']."', forum_postclass='{$_POST['forum_postclass']}' WHERE forum_id=$id"); + $forum->show_message(FORLAN_14); + $action = "main"; +} + +if(isset($_POST['submit_forum'])) +{ + $mods = $_POST['forum_moderators']; + $_POST['forum_name'] = $tp->toDB($_POST['forum_name']); + $_POST['forum_description'] = $tp->toDB($_POST['forum_description']); + $sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$_POST['forum_parent']."', '0', '".time()."', '".$mods."', 0, 0, '', '', '".$_POST['forum_class']."', 0, '{$_POST['forum_postclass']}'"); + $forum->show_message(FORLAN_11); +} + +if(isset($_POST['update_forum'])) +{ + $mods = $_POST['forum_moderators']; + $_POST['forum_name'] = $tp->toDB($_POST['forum_name']); + $_POST['forum_description'] = $tp->toDB($_POST['forum_description']); + $forum_parent = $row['forum_id']; + $sql->db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_description='".$_POST['forum_description']."', forum_parent='".$_POST['forum_parent']."', forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."', forum_postclass='{$_POST['forum_postclass']}' WHERE forum_id=$id"); + $sql->db_Update("forum", "forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."', forum_postclass='{$_POST['forum_postclass']}' WHERE forum_sub=$id"); + $forum->show_message(FORLAN_12); + $action = "main"; +} + +if (isset($_POST['update_order'])) +{ + extract($_POST); + while (list($key, $id) = each($forum_order)) + { + $tmp = explode(".", $id); + $sql->db_Update("forum", "forum_order=".$tmp[1]." WHERE forum_id=".$tmp[0]); + } + $forum->show_message(FORLAN_73); +} + +if (isset($_POST['updateoptions'])) +{ + $pref['email_notify'] = $_POST['email_notify']; + $pref['email_notify_on'] = $_POST['email_notify_on']; + $pref['forum_poll'] = $_POST['forum_poll']; + $pref['forum_popular'] = $_POST['forum_popular']; + $pref['forum_track'] = $_POST['forum_track']; + $pref['forum_eprefix'] = $_POST['forum_eprefix']; + $pref['forum_enclose'] = $_POST['forum_enclose']; + $pref['forum_title'] = $_POST['forum_title']; + $pref['forum_postspage'] = $_POST['forum_postspage']; + $pref['html_post'] = $_POST['html_post']; + $pref['forum_attach'] = $_POST['forum_attach']; + $pref['forum_redirect'] = $_POST['forum_redirect']; + $pref['forum_user_customtitle'] = $_POST['forum_user_customtitle']; + $pref['reported_post_email'] = $_POST['reported_post_email']; + $pref['forum_tooltip'] = $_POST['forum_tooltip']; + $pref['forum_tiplength'] = $_POST['forum_tiplength']; + $pref['forum_hilightsticky'] = $_POST['forum_hilightsticky']; + $pref['forum_maxwidth'] = $_POST['forum_maxwidth']; + $pref['forum_linkimg'] = $_POST['forum_linkimg']; + save_prefs(); + $forum->show_message(FORLAN_10); +} + +if (isset($_POST['do_prune'])) +{ + $msg = $for->forum_prune($_POST['prune_type'], $_POST['prune_days'], $_POST['pruneForum']); + $forum->show_message($msg); + $action = "main"; +} + +if (isset($_POST['set_ranks'])) +{ + extract($_POST); + for($a = 0; $a <= 9; $a++) + { + $r_names .= $tp->toDB($rank_names[$a]).","; + $r_thresholds .= $tp->toDB($rank_thresholds[$a]).","; + $r_images .= $tp->toDB($rank_images[$a]).","; + } + $pref['rank_main_admin'] = $_POST['rank_main_admin']; + $pref['rank_main_admin_image'] = $_POST['rank_main_admin_image']; + $pref['rank_admin'] = $_POST['rank_admin']; + $pref['rank_admin_image'] = $_POST['rank_admin_image']; + $pref['rank_moderator'] = $_POST['rank_moderator']; + $pref['rank_moderator_image'] = $_POST['rank_moderator_image']; + $pref['forum_levels'] = $r_names; + $pref['forum_thresholds'] = $r_thresholds; + $pref['forum_images'] = $r_images; + save_prefs(); + $forum->show_message(FORLAN_95); +} + +if (isset($_POST['frsubmit'])) +{ + $guestrules = $tp->toDB($_POST['guestrules']); + $memberrules = $tp->toDB($_POST['memberrules']); + $adminrules = $tp->toDB($_POST['adminrules']); + if(!$sql->db_Update("generic", "gen_chardata ='$guestrules', gen_intdata='".$_POST['guest_active']."' WHERE gen_type='forum_rules_guest' ")) + { + $sql -> db_Insert("generic", "0, 'forum_rules_guest', '".time()."', 0, '', '".$_POST['guest_active']."', '$guestrules' "); + } + if(!$sql->db_Update("generic", "gen_chardata ='$memberrules', gen_intdata='".$_POST['member_active']."' WHERE gen_type='forum_rules_member' ")) + { + $sql -> db_Insert("generic", "0, 'forum_rules_member', '".time()."', 0, '', '".$_POST['member_active']."', '$memberrules' "); + } + if(!$sql->db_Update("generic", "gen_chardata ='$adminrules', gen_intdata='".$_POST['admin_active']."' WHERE gen_type='forum_rules_admin' ")) + { + $sql -> db_Insert("generic", "0, 'forum_rules_admin', '".time()."', 0, '', '".$_POST['admin_active']."', '$adminrules' "); + } +} + + +if ($delete == 'main') { + if ($sql->db_Delete("forum", "forum_id='$del_id' ")) { + $forum->show_message(FORLAN_96); + } +} + +if ($action == "create") +{ + if ($sql->db_Select("forum", "*", "forum_parent='0' ")) + { + $forum->create_forums($sub_action, $id); + } + else + { + header("location:".e_ADMIN."forum.php"); + exit; + } +} + +if ($delete == 'cat') +{ + if ($sql->db_Delete("forum", "forum_id='$del_id' ")) + { + $sql->db_Delete("forum", "forum_parent='$del_id' "); + $forum->show_message(FORLAN_97); + $action = "main"; + } +} + +if($action == "delete") +{ + $forum->delete_item(intval($sub_action)); +} + +if ($action == "cat") { + $forum->create_parents($sub_action, $id); +} + +if ($action == "order") { + $forum->show_existing_forums($sub_action, $id, TRUE); +} + +if ($action == "opt") +{ + $forum->show_prefs(); +} + +if ($action == "mods") +{ + $forum->show_mods(); +} + +if ($action == "tools") +{ + $forum->show_tools(); +} + +if ($action == "prune") +{ + $forum->show_prune(); +} + +if ($action == "rank") +{ + $forum->show_levels(); +} + +if ($action == "rules") +{ + $forum->show_rules(); +} + +if($action == 'subs') +{ + $forum->show_subs($sub_action); +} + +if ($delete == 'reported') +{ + $sql->db_Delete("generic", "gen_id='$del_id' "); + $forum->show_message(FORLAN_118); +} + + +if ($action == "sr") +{ + $forum->show_reported($sub_action); +} + +if (!e_QUERY || $action == "main") +{ + $forum->show_existing_forums($sub_action, $id); +} + +//$forum->show_options($action); +require_once(e_ADMIN."footer.php"); +function headerjs() +{ + global $tp; + // These functions need to be removed and replaced with the generic jsconfirm() function. + $headerjs = ""; + return $headerjs; +} + +class forum +{ + + function show_options($action) + { + global $sql; + if ($action == "") + { + $action = "main"; + } + // ##### Display options --------------------------------------------------------------------------------------------------------- + $var['main']['text'] = FORLAN_76; + $var['main']['link'] = e_SELF; + $var['cat']['text'] = FORLAN_83; + $var['cat']['link'] = e_SELF."?cat"; + if ($sql->db_Select("forum", "*", "forum_parent='0' ")) + { + $var['create']['text'] = FORLAN_77; + $var['create']['link'] = e_SELF."?create"; + } + $var['order']['text'] = FORLAN_78; + $var['order']['link'] = e_SELF."?order"; + $var['opt']['text'] = FORLAN_79; + $var['opt']['link'] = e_SELF."?opt"; + $var['prune']['text'] = FORLAN_59; + $var['prune']['link'] = e_SELF."?prune"; + $var['rank']['text'] = FORLAN_63; + $var['rank']['link'] = e_SELF."?rank"; + $var['rules']['text'] = FORLAN_123; + $var['rules']['link'] = e_SELF."?rules"; + $var['sr']['text'] = FORLAN_116; + $var['sr']['link'] = e_SELF."?sr"; + $var['mods']['text'] = FORLAN_33; + $var['mods']['link'] = e_SELF."?mods"; + $var['tools']['text'] = FORLAN_153; + $var['tools']['link'] = e_SELF."?tools"; + + show_admin_menu(FORLAN_7, $action, $var); + } + + function delete_item($id) + { + global $sql; + $id = intval($id); + $confirm = isset($_POST['confirm']) ? TRUE : FALSE; + + if($sql->db_Select('forum', '*', "forum_id = {$id}")) + { + $txt = ""; + $row = $sql->db_Fetch(); + if($row['forum_parent'] == 0) + { + $txt .= $this->delete_parent($id, $confirm); + } + elseif($row['forum_sub'] > 0) + { + $txt .= $this->delete_sub($id, $confirm); + } + else + { + $txt .= $this->delete_forum($id, $confirm); + } + if($confirm) + { + $this->show_message($txt); + } + else + { + $this->delete_show_confirm($txt); + } + } + } + + function delete_parent($id, $confirm = FALSE) + { + global $sql; + $ret = ""; + if($sql->db_Select("forum", "forum_id", "forum_parent = {$id} AND forum_sub = 0")) + { + $fList = $sql->db_getList(); + foreach($fList as $f) + { + $ret .= $this->delete_forum($f['forum_id'], $confirm); + } + } + if($confirm) + { + if($sql->db_Delete("forum", "forum_id = {$id}")) + { + $ret .= "Forum parent successfully deleted"; + } + else + { + $ret .= "Forum parent could not be deleted"; + } + return $ret; + } + return "The forum parent has the following info:
    ".$ret; + + } + + function delete_forum($id, $confirm = FALSE) + { + global $sql, $tp; + $ret = ""; + if($sql->db_Select("forum", "forum_id", "forum_sub = {$id}")) + { + $fList = $sql->db_getList(); + foreach($fList as $f) + { + $ret .= $this->delete_sub($f['forum_id'], $confirm); + } + } + if($confirm) + { + $cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}"); + $ret .= $cnt." forum {$id} thread(s) deleted
    "; + if($sql->db_Delete("forum", "forum_id = {$id}")) + { + $ret .= "Forum {$id} successfully deleted"; + } + else + { + $ret .= "Forum {$id} could not be deleted"; + } + return $ret; + } + + $sql->db_Select("forum", "*", "forum_id = {$id}"); + $row = $sql->db_Fetch(); + return "Forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies.
    ".$ret; + } + + function delete_sub($id, $confirm = FALSE) + { + global $sql, $tp; + if($confirm) + { + $cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}"); + $ret .= $cnt." Sub-forum {$id} thread(s) deleted
    "; + if($sql->db_Delete("forum", "forum_id = {$id}")) + { + $ret .= "Sub-forum {$id} successfully deleted"; + } + else + { + $ret .= "Sub-forum {$id} could not be deleted"; + } + return $ret; + } + + $sql->db_Select("forum", "*", "forum_id = {$id}"); + $row = $sql->db_Fetch(); + return "Sub-forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies.
    ".$ret; + } + + function delete_show_confirm($txt) + { + global $ns; + $this->show_message($txt); + $txt = " +
    +
    ".FORLAN_180."

    + +
    +
    + "; + $ns->tablerender(FORLAN_181, $txt); + } + + function show_subs($id) + { + global $sql, $tp, $ns; + $txt = " +
    + + + + + + + + + "; + if($sql->db_Select('forum', 'forum_id, forum_name, forum_description, forum_order', "forum_sub = {$id} ORDER by forum_order ASC")) + { + $subList = $sql->db_getList(); + foreach($subList as $sub) + { + $txt .= " + + + + + + + + "; + } + $txt .= " + + + + + + + "; + + } + else + { + $txt .= ""; + } + + $txt .= " + + + + + + + + + + + + + + + + + +
    ".FORLAN_151."".FORLAN_31."".FORLAN_32."".FORLAN_37."".FORLAN_20."
    {$sub['forum_id']} + ".ADMIN_DELETE_ICON." +
     
    ".FORLAN_146."
    ".FORLAN_151."".FORLAN_31."".FORLAN_32."".FORLAN_37." 
      
    +
    + "; + $ns->tablerender(FORLAN_149, $txt); + } + + function show_existing_forums($sub_action, $id, $mode = FALSE) + { + global $sql, $rs, $ns, $sql2, $sql3, $tp, $for; + + $subList = $for->forum_getsubs(); + if (!is_object($sql2)) + { + $sql2 = new db; + } + if (!is_object($sql3)) + { + $sql3 = new db; + } + if (!$mode) + { + $text = "
    "; + } else { + $text = "
    "; + } + $text .= " + + + + + "; + + if (!$parent_amount = $sql->db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC")) + { + $text .= ""; + } + else + { + $sql2 = new db; + $sql3 = new db; + while ($row = $sql->db_Fetch()) + { + extract($row); + $parent_id = $forum_id; + $text .= " + + "; + + $text .= ""; + + $forums = $sql2->db_Select("forum", "*", "forum_parent='".$forum_id."' AND forum_sub = 0 ORDER BY forum_order ASC"); + if (!$forums) + { + $text .= ""; + } + else + { + while ($row = $sql2->db_Fetch()) + { + extract($row); + + $text .= " + + \n + + \n"; + } + } + } + } + + if (!$mode) + { + $text .= "
    ".FORLAN_28."".FORLAN_80."
    ".FORLAN_29."
    ".$forum_name." +
    ".FORLAN_140.": ".r_userclass_name($forum_class)."  ".FORLAN_141.": ".r_userclass_name($forum_postclass)." +
    "; + + if ($mode) + { + $text .= ""; + } + else + { + $forum_heading = str_replace("'", "\'", $forum_name); + $text .= " + + "; + } + $text .= "
    ".FORLAN_29."
    ".IMAGE_new."".$forum_name."" ; + + $text .= " +
    ".$forum_description."  +
    ".FORLAN_140.": ".r_userclass_name($forum_class)."  ".FORLAN_141.": ".r_userclass_name($forum_postclass)." + +
    "; + + if ($mode) + { + $text .= ""; + } + else + { + $forum_heading = str_replace("'", "\'", $forum_name); + $sub_img = count($subList[$parent_id][$forum_id]) ? IMAGE_sub : IMAGE_nosub; + $text .= " + + "; + } + $text .= "
    "; + $ns->tablerender(FORLAN_30, $text); + } + else + { + $text .= "\n\n\n\n\n\n"; + $ns->tablerender(FORLAN_37, $text); + } + + } + + function create_parents($sub_action, $id) + { + global $sql, $ns; + + if ($sub_action == "edit" && !$_POST['update_parent']) + { + if ($sql->db_Select("forum", "*", "forum_id=$id")) + { + $row = $sql->db_Fetch(); + extract($row); + } + } + $text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + +
    ".FORLAN_31.": + +
    ".FORLAN_23.":
    (".FORLAN_24.")
    ".r_userclass("forum_class", $forum_class, 'off', 'nobody,public,member,admin,classes')."
    ".FORLAN_142.":
    (".FORLAN_143.")
    ".r_userclass("forum_postclass", $forum_postclass, 'off', 'nobody,public,member,admin,classes')."
    "; + + if ($sub_action == "edit") + { + $text .= ""; + } + else + { + $text .= ""; + } + + $text .= "
    +
    +
    "; + + $ns->tablerender(FORLAN_75, $text); + } + + function create_forums($sub_action, $id) + { + global $sql, $ns; + + if ($sub_action == "edit" && !$_POST['update_forum']) + { + if ($sql->db_Select("forum", "*", "forum_id=$id")) + { + $row = $sql->db_Fetch(); + extract($row); + } + } + + $text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".FORLAN_22.":"; + + $sql->db_Select("forum", "*", "forum_parent=0"); + $text .= " +
    ".FORLAN_31.": +
    ".FORLAN_179."
    +
    + +
    ".FORLAN_32.": + +
    ".FORLAN_33.":
    (".FORLAN_34.")
    "; + $text .= r_userclass("forum_moderators", $forum_moderators, 'off', 'admin,classes'); + + // $admin_no = $sql->db_Select("user", "*", "user_admin='1' AND user_perms REGEXP('A.') OR user_perms='0' "); + // while ($row = $sql->db_Fetch()) + // { + // extract($row); + // $text .= ""; + // } + + $text .= "
    ".FORLAN_23.":
    (".FORLAN_24.")
    ".r_userclass("forum_class", $forum_class, 'off', 'nobody,public,member,admin,classes')."
    ".FORLAN_142.":
    (".FORLAN_143.")
    ".r_userclass("forum_postclass", $forum_postclass, 'off', 'nobody,public,member,admin,classes')."
    "; + if ($sub_action == "edit") + { + $text .= ""; + } + else + { + $text .= ""; + } + $text .= "
    +
    +
    "; + $ns->tablerender(FORLAN_28, $text); + } + + function show_message($message) + { + global $ns; + $ns->tablerender("", "
    ".$message."
    "); + } + + function show_tools() + { + global $sql, $ns, $tp; + $txt = " +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".FORLAN_156."
    + "; + if($sql->db_Select("forum", "*", "1 ORDER BY forum_order")) + { + $fList = $sql->db_getList(); + foreach($fList as $f) + { + $txt .= " ".$tp->toHTML($f['forum_name'])."
    "; + } + $txt .= " ".FORLAN_157.""; + } + $txt .= " +
    ".FORLAN_158."
    + ".FORLAN_159."
         + ".FORLAN_160." +
    ".FORLAN_161."
    + ".FORLAN_162."
    +      ".FORLAN_182."
    ".FORLAN_183."

    +
    ".FORLAN_163."
    + ".FORLAN_164."
    +
    + +
    +
    + "; + $ns->tablerender(FORLAN_166, $txt); + } + + function show_prefs() + { + global $pref, $ns; + $text = "
    +
    \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".FORLAN_44."
    ".FORLAN_45."
    ".($pref['forum_enclose'] ? "" : "")."
    ".FORLAN_65."
    ".FORLAN_46."
    ".FORLAN_47."
    ".FORLAN_48."
    ".($pref['email_notify'] ? "" : "")."
    ".FORLAN_177."
    ".FORLAN_178."
    ".($pref['email_notify_on'] ? "" : "")."
    ".FORLAN_49."
    ".FORLAN_50."
    ".($pref['forum_poll'] ? "" : "")."
    ".FORLAN_70."
    ".FORLAN_71." ".FORLAN_130." ". FORLAN_131.""; + + if(!$pref['image_post']) + { + $text .= "
    ".FORLAN_139.""; + } + + $text .= "
    ".($pref['forum_attach'] ? "" : "")."
    ".FORLAN_134."
    ".FORLAN_135."
    ".FORLAN_136."
    ".FORLAN_137."
    ".($pref['forum_linkimg'] ? "" : "")."
    ".FORLAN_51."
    ".FORLAN_52."
    ".($pref['forum_track'] ? "" : "")."
    ".FORLAN_112."
    ".FORLAN_113."
    ".($pref['forum_redirect'] ? "" : "")."
    ".FORLAN_114."
    ".FORLAN_115."
    ".($pref['forum_user_customtitle'] ? "" : "")."
    ".FORLAN_116."
    ".FORLAN_122."
    ".($pref['reported_post_email'] ? "" : "")."
    ".FORLAN_126."
    ".FORLAN_127."
    ".($pref['forum_tooltip'] ? "" : "")."
    ".FORLAN_128."
    ".FORLAN_129."
    ".FORLAN_53."
    ".FORLAN_54."
    ".FORLAN_55."
    ".FORLAN_56."
    ".FORLAN_57."
    ".FORLAN_58."
    ".FORLAN_132."
    ".FORLAN_133."
    ".($pref['forum_hilightsticky'] ? "" : "")."
    + +
    +
    +
    "; + $ns->tablerender(FORLAN_62, $text); + } + + function show_reported ($sub_action, $id) + { + global $sql, $rs, $ns, $tp; + if ($sub_action) { + $sql -> db_Select("generic", "*", "gen_id='".$sub_action."'"); + $row = $sql -> db_Fetch(); + $sql -> db_Select("user", "*", "user_id='". $row['gen_user_id']."'"); + $user = $sql -> db_Fetch(); + $con = new convert; + $text = "
    + + + + + + + + + + + + + + + + + + + + + + + \n"; + $text .= "
    + ".FORLAN_171.": + + #".$row['gen_intdata']." +
    + ".FORLAN_173.": + + ".$row['gen_ip']." +
    + ".FORLAN_174.": + + ".$user['user_name']." +
    + ".FORLAN_175.": + + ".$con -> convert_date($row['gen_datestamp'], "long")." +
    + ".FORLAN_176.": + + ".$row['gen_chardata']." +
    + ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." + ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." + ".$rs->form_close()." +
    "; + $text .= "
    "; + $ns -> tablerender(FORLAN_116, $text); + } else { + $text = "
    "; + if ($reported_total = $sql->db_Select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'")) + { + $text .= " + + + + "; + while ($row = $sql->db_Fetch()) + { + $text .= " + + + \n"; + } + $text .= "
    ".FORLAN_170."".FORLAN_80."
    ".FORLAN_171." #".$row['gen_intdata']." + ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." + ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." + ".$rs->form_close()." +
    "; + } + else + { + $text .= "
    ".FORLAN_121."
    "; + } + $text .= "
    "; + $ns->tablerender(FORLAN_116, $text); + } + } + + function show_prune() + { + global $ns, $sql; + + // $sql -> db_Select("forum", "forum_id, forum_name", "forum_parent!=0 ORDER BY forum_order ASC"); + $qry = " + SELECT f.forum_id, f.forum_name, sp.forum_name AS sub_parent, fp.forum_name AS forum_parent + FROM #forum AS f + LEFT JOIN #forum AS sp ON sp.forum_id = f.forum_sub + LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent + WHERE f.forum_parent != 0 + ORDER BY f.forum_parent ASC, f.forum_sub, f.forum_order ASC + "; + $sql -> db_Select_gen($qry); + $forums = $sql -> db_getList(); + + $text = "
    +
    \n + + + + + + + + + + + + + + + + + +
    ".FORLAN_60."
    ".FORLAN_87." + +
    ".FORLAN_2."
    + ".FORLAN_89."     + ".FORLAN_90." +
    ".FORLAN_138.":
    "; + + foreach($forums as $forum) + { + $for_name = $forum['forum_parent']." -> "; + $for_name .= ($forum['sub_parent'] ? $forum['sub_parent']." -> " : ""); + $for_name .= $forum['forum_name']; + $text .= " ".$for_name."
    "; + } + + + $text .= "
    + +
    +
    +
    "; + $ns->tablerender(FORLAN_59, $text); + } + + function show_levels() + { + global $sql, $pref, $ns, $rs; + + $rank_names = explode(",", $pref['forum_levels']); + $rank_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600)); + $rank_images = ($pref['forum_images'] ? explode(",", $pref['forum_images']) : array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png")); + + $text = "
    +
    \n + + + + + + + + + + + + + "; + + $text .= " + + + + + + + + + + + + + + + + "; + + for($a = 0; $a <= 9; $a++) + { + $text .= " + + + + "; + } + + $text .= " + + +
    ".FORLAN_98."".FORLAN_102."
    ".FORLAN_104."
     ".FORLAN_99."".FORLAN_100."
     
     
     
    + +
    \n
    \n
    "; + $ns->tablerender("Ranks", $text); + } + + function show_mods() + { + global $sql, $ns, $for, $tp; + $forumList = $for->forum_getforums('all'); + $parentList = $for->forum_getparents('list'); + $subList = $for->forum_getsubs('bysub'); + + $txt = "
    "; + + foreach($parentList as $p) + { + $txt .= " + + + + "; + + foreach($forumList[$p['forum_id']] as $f) + { + $txt .= " + + + + + "; + foreach($subList[$f['forum_id']] as $s) + { + $txt .= " + + + + + "; + } + } + } + $txt .= " + + + + +
     
    ".$tp->toHTML($p['forum_name'])."
    {$f['forum_name']}".r_userclass("mods[{$f['forum_id']}]", $f['forum_moderators'], 'off', 'admin,classes')."
        {$s['forum_name']}".r_userclass("mods[{$s['forum_id']}]", $s['forum_moderators'], 'off', 'admin,classes')."
    + +
    "; + $ns->tablerender(FORLAN_33, $txt); + } + + function show_rules() + { + global $sql, $pref, $ns, $tp; + + $sql->db_Select("wmessage"); + list($null) = $sql->db_Fetch(); + list($null) = $sql->db_Fetch(); + list($null) = $sql->db_Fetch(); + list($id, $guestrules, $wm_active4) = $sql->db_Fetch(); + list($id, $memberrules, $wm_active5) = $sql->db_Fetch(); + list($id, $adminrules, $wm_active6) = $sql->db_Fetch(); + + if($sql->db_Select('generic','*',"gen_type='forum_rules_guest'")) + { + $guest_rules = $sql->db_Fetch(); + } + if($sql->db_Select('generic','*',"gen_type='forum_rules_member'")) + { + $member_rules = $sql->db_Fetch(); + } + if($sql->db_Select('generic','*',"gen_type='forum_rules_admin'")) + { + $admin_rules = $sql->db_Fetch(); + } + + $guesttext = $tp->toFORM($guest_rules['gen_chardata']); + $membertext = $tp->toFORM($member_rules['gen_chardata']); + $admintext = $tp->toFORM($admin_rules['gen_chardata']); + + $text = " +
    +
    + + "; + + $text .= " + + + + + + + + + + + + + + + + + + + +
    ".WMGLAN_1.":
    + ".WMGLAN_6.":"; + if ($guest_rules['gen_intdata']) + { + $text .= ""; + } + else + { + $text .= ""; + } + $text .= "
    + +
    + +
    + ".display_help('helpb', 1, 'addtext1', 'help1')." +
    ".WMGLAN_2.":
    + ".WMGLAN_6.":"; + if ($member_rules['gen_intdata']) + { + $text .= ""; + } + else + { + $text .= ""; + } + $text .= "
    + +
    + +
    + ".display_help('helpb', 1, 'addtext2', 'help2')." +
    ".WMGLAN_3.":
    + ".WMGLAN_6.": "; + + if ($admin_rules['gen_intdata']) + { + $text .= ""; + } + else + { + $text .= ""; + } + + $text .= "
    + +
    + +
    + ".display_help('helpb', 1, 'addtext3', 'help3')." +
      + +
    +
    +
    "; + + $ns->tablerender(WMGLAN_5, $text); + + echo " + + "; + + } + } + + function forum_admin_adminmenu() + { + global $forum; + global $action; + $forum->show_options($action); + } + ?> diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php new file mode 100644 index 000000000..7faa1c92d --- /dev/null +++ b/e107_plugins/forum/forum_class.php @@ -0,0 +1,1032 @@ +db_Select_gen($query)) + { + $row = $sql->db_Fetch(); + $ret['parent'] = $row['parent']; + } + return $ret; + } + + function update_lastpost($type, $id, $update_threads = FALSE) + { + global $sql, $tp; + $sql2 = new db; + if ($type == 'thread') + { + $id = intval($id); + $thread_info = $this->thread_get_lastpost($id); + list($uid, $uname) = explode(".", $thread_info['thread_user'], 2); + if ($thread_info) + { + if($thread_user['user_name'] != "") + { + $thread_lastuser = $uid.".".$thread_info['user_name']; + } + else + { + $tmp = explode(chr(1), $thread_info['thread_user']); + $thread_lastuser = $tmp[0]; + } + $sql->db_Update('forum_t', "thread_lastpost = ".intval($thread_info['thread_datestamp']).", thread_lastuser = '".$tp -> toDB($thread_lastuser, true)."' WHERE thread_id = ".intval($id)); + } + return $thread_info; + } + if ($type == 'forum') { + if ($id == 'all') + { + if ($sql->db_Select('forum', 'forum_id', 'forum_parent != 0')) + { + while ($row = $sql->db_Fetch()) + { + $parentList[] = $row['forum_id']; + } + foreach($parentList as $id) + { + // echo "Updating forum #{$id}
    "; + $this->update_lastpost('forum', $id, $update_threads); + } + } + } + else + { + $id = intval($id); + $forum_lp_user = ''; + $forum_lp_info = ''; + if($update_threads == TRUE) + { + if ($sql2->db_Select('forum_t', 'thread_id', "thread_forum_id = $id AND thread_parent = 0")) + { + while ($row = $sql2->db_Fetch()) + { + $this->update_lastpost('thread', $row['thread_id']); + } + } + } + if ($sql->db_Select("forum_t", "*", "thread_forum_id='$id' ORDER BY thread_datestamp DESC LIMIT 0,1")) + { + $row = $sql->db_Fetch(); + $tmp = explode(chr(1), $row['thread_user']); + $forum_lp_user = $tmp[0]; + $last_id = $row['thread_parent'] ? $row['thread_parent'] : $row['thread_id']; + $forum_lp_info = $row['thread_datestamp'].".".$last_id; + } + $sql->db_Update('forum', "forum_lastpost_user = '{$forum_lp_user}', forum_lastpost_info = '{$forum_lp_info}' WHERE forum_id={$id}"); + } + } + } + + function forum_markasread($forum_id) { + global $sql; + if ($forum_id != 'all') { + $forum_id = intval($forum_id); + $extra = " AND thread_forum_id='$forum_id' "; + } + $qry = "thread_lastpost > ".USERLV." AND thread_parent = 0 {$extra} "; + if ($sql->db_Select('forum_t', 'thread_id', $qry)) { + while ($row = $sql->db_Fetch()) { + $u_new .= ".".$row['thread_id']."."; + } + $u_new .= USERVIEWED; + $sql->db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' "); + header("location:".e_SELF); + exit; + } + } + + function thread_markasread($thread_id) + { + global $sql; + $thread_id = intval($thread_id); + $u_new = USERVIEWED.".$thread_id"; + return $sql->db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' "); + } + + function forum_getparents() + { + global $sql; + if ($sql->db_Select('forum', '*', "forum_parent='0' ORDER BY forum_order ASC")) + { + while ($row = $sql->db_Fetch()) { + $ret[] = $row; + } + return $ret; + } + return FALSE; + } + + function forum_getmods($uclass = e_UC_ADMIN) + { + global $sql; + if($uclass == e_UC_ADMIN || trim($uclass) == '') + { + $sql->db_Select('user', 'user_id, user_name',"user_admin = 1"); + } + else + { + $regex = "(^|,)(".str_replace(",", "|", $uclass).")(,|$)"; + $sql->db_Select("user", "user_id, user_name", "user_class REGEXP '{$regex}'"); + } + while($row = $sql->db_Fetch()) + { + $ret[$row['user_id']] = $row['user_name']; + } + return $ret; + } + + function forum_getforums($type = 'all') + { + global $sql; + $qry = " + SELECT f.*, u.user_name FROM #forum AS f + LEFT JOIN #user AS u ON SUBSTRING_INDEX(f.forum_lastpost_user,'.',1) = u.user_id + WHERE forum_parent != 0 AND forum_sub = 0 + ORDER BY f.forum_order ASC + "; + if ($sql->db_Select_gen($qry)) + { + while ($row = $sql->db_Fetch()) + { + if($type == 'all') + { + $ret[$row['forum_parent']][] = $row; + } + else + { + $ret[] = $row; + } + } + return $ret; + } + return FALSE; + } + + function forum_getsubs($forum_id = "") + { + global $sql; + $where = ($forum_id != "" && $forum_id != 'bysub' ? "AND forum_sub = ".intval($forum_id) : ""); + $qry = " + SELECT f.*, u.user_name FROM #forum AS f + LEFT JOIN #user AS u ON SUBSTRING_INDEX(f.forum_lastpost_user,'.',1) = u.user_id + WHERE forum_sub != 0 {$where} + ORDER BY f.forum_order ASC + "; + if ($sql->db_Select_gen($qry)) + { + while ($row = $sql->db_Fetch()) + { + if($forum_id == "") + { + $ret[$row['forum_parent']][$row['forum_sub']][] = $row; + } + elseif($forum_id == 'bysub') + { + $ret[$row['forum_sub']][] = $row; + } + else + { + $ret[] = $row; + } + } + return $ret; + } + return FALSE; + } + + + function forum_newflag_list() + { + global $sql; + $viewed = ""; + if(USERVIEWED) + { + $viewed = preg_replace("#\.+#", ".", USERVIEWED); + $viewed = preg_replace("#^\.#", "", $viewed); + $viewed = preg_replace("#\.$#", "", $viewed); + $viewed = str_replace(".", ",", $viewed); + } + if($viewed != "") + { + $viewed = " AND thread_id NOT IN (".$viewed.")"; + } + + $_newqry = " + SELECT DISTINCT ff.forum_sub, ft.thread_forum_id FROM #forum_t AS ft + LEFT JOIN #forum AS ff ON ft.thread_forum_id = ff.forum_id + WHERE thread_parent = 0 AND thread_lastpost > '".USERLV."' {$viewed} + "; + if($sql->db_Select_gen($_newqry)) + { + while($row = $sql->db_Fetch()) + { + $ret[] = $row['thread_forum_id']; + if($row['forum_sub']) + { + $ret[] = $row['forum_sub']; + } + } + return $ret; + } + else + { + return FALSE; + } + } + + function thread_user($post_info) + { + if($post_info['user_name']) + { + return $post_info['user_name']; + } + else + { + $tmp = explode(".", $post_info['thread_user'], 2); + return $tmp[1]; + } + } + + function untrack($thread_id, $from) + { + $thread_id = intval($thread_id); + global $sql; + $tmp = str_replace("-".$thread_id."-", "", USERREALM); + return $sql->db_Update("user", "user_realm='$tmp' WHERE user_id='".USERID."' "); + } + + function track($thread_id, $from) + { + $thread_id = intval($thread_id); + global $sql; + return $sql->db_Update("user", "user_realm='".USERREALM."-".$thread_id."-' WHERE user_id='".USERID."' "); + } + + function forum_get($forum_id) + { + $forum_id = intval($forum_id); + $qry = " + SELECT f.*, fp.forum_class as parent_class, fp.forum_name as parent_name, fp.forum_id as parent_id, fp.forum_postclass as parent_postclass, sp.forum_name AS sub_parent FROM #forum AS f + LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent + LEFT JOIN #forum AS sp ON f.forum_sub = sp.forum_id AND f.forum_sub > 0 + WHERE f.forum_id = {$forum_id} + "; + global $sql; + if ($sql->db_Select_gen($qry)) + { + return $sql->db_Fetch(); + } + return FALSE; + } + + function forum_get_allowed() + { + global $sql; + $qry = " + SELECT f.forum_id, f.forum_name FROM #forum AS f + LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent + WHERE f.forum_parent != 0 + AND fp.forum_class IN (".USERCLASS_LIST.") + AND f.forum_class IN (".USERCLASS_LIST.") + "; + if ($sql->db_Select_gen($qry)) + { + while($row = $sql->db_Fetch()) + { + $ret[$row['forum_id']] = $row['forum_name']; + } + + } + return $ret; + } + + function thread_update($thread_id, $newvals) + { + global $sql, $tp; + foreach($newvals as $var => $val) + { + $var = $tp -> toDB($var); + $val = $tp -> toDB($val); + $newvalArray[] = "{$var} = '{$val}'"; + } + $newString = implode(', ', $newvalArray)." WHERE thread_id=".intval($thread_id); + return $sql->db_Update('forum_t', $newString); + } + + function forum_get_topics($forum_id, $from, $view) + { + $forum_id = intval($forum_id); + global $sql; + $qry = " + SELECT t.*, u.user_name, lpu.user_name AS lastpost_username from #forum_t as t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #user AS lpu ON SUBSTRING_INDEX(t.thread_lastuser,'.',1) = lpu.user_id + WHERE t.thread_forum_id = $forum_id AND t.thread_parent = 0 + ORDER BY + t.thread_s DESC, + t.thread_lastpost DESC, + t.thread_datestamp DESC + LIMIT ".intval($from).",".intval($view)." + "; + $ret = array(); + if ($sql->db_Select_gen($qry)) + { + while ($row = $sql->db_Fetch()) + { + $ret[] = $row; + } + } + return $ret; + } + + function thread_get_lastpost($forum_id) + { + $forum_id = intval($forum_id); + global $sql; + if ($sql->db_Count('forum_t', '(*)', "WHERE thread_parent = {$forum_id} ")) + { + $where = "WHERE t.thread_parent = $forum_id "; + } + else + { + $where = "WHERE t.thread_id = $forum_id "; + } + $qry = " + SELECT t.thread_user, t.thread_datestamp, u.user_name FROM #forum_t AS t + LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + {$where} + ORDER BY t.thread_datestamp DESC LIMIT 0,1 + "; + if ($sql->db_Select_gen($qry)) + { + return $sql->db_Fetch(); + } + return FALSE; + } + + function forum_get_topic_count($forum_id) + { + global $sql; + return $sql->db_Count("forum_t", "(*)", " WHERE thread_forum_id='".intval($forum_id)."' AND thread_parent='0' "); + } + + function thread_getnext($thread_id, $forum_id, $from = 0, $limit = 100) + { + global $sql; + $forum_id = intval($forum_id); + global $sql; + $ftab = MPREFIX.'forum_t'; + while (!$found) + { + $qry = " + SELECT t.thread_id from #forum_t AS t + WHERE t.thread_forum_id = $forum_id + AND t.thread_parent = 0 + ORDER BY + t.thread_s DESC, + t.thread_lastpost DESC, + t.thread_datestamp DESC + LIMIT ".intval($from).",".intval($limit); + if ($sql->db_Select_gen($qry)) + { + $i = 0; + while ($row = $sql->db_Fetch()) + { + $threadList[$i++] = $row['thread_id']; + } + + if (($id = array_search($thread_id, $threadList)) !== FALSE) + { + if ($id != 99) + { + return $threadList[$id+1]; + } + else + { + return $this->thread_getnext($thread_id, $forum_id, $from+99, 2); + } + } + } + else + { + return FALSE; + } + $from += 100; + } + } + + function thread_getprev($thread_id, $forum_id, $from = 0, $limit = 100) + { + global $sql; + $forum_id = intval($forum_id); + global $sql; + $ftab = MPREFIX.'forum_t'; + while (!$found) + { + $qry = " + SELECT t.thread_id from #forum_t AS t + WHERE t.thread_forum_id = $forum_id + AND t.thread_parent = 0 + ORDER BY + t.thread_s DESC, + t.thread_lastpost DESC, + t.thread_datestamp DESC + LIMIT ".intval($from).",".intval($limit); + if ($sql->db_Select_gen($qry)) + { + $i = 0; + while ($row = $sql->db_Fetch()) + { + $threadList[$i++] = $row['thread_id']; + } + + if (($id = array_search($thread_id, $threadList)) !== FALSE) + { + if ($id != 0) + { + return $threadList[$id-1]; + } + else + { + if ($from == 0) + { + return FALSE; + } + return $this->thread_getprev($thread_id, $forum_id, $from-1, 2); + } + } + } + else + { + return FALSE; + } + $from += 100; + } + } + + function thread_get($thread_id, $start = 0, $limit = 10) + { + $thread_id = intval($thread_id); + global $sql; + $ftab = MPREFIX.'forum_t'; + $utab = MPREFIX.'user'; + + if ($start === "last") + { + $tcount = $this->thread_count($thread_id); + $start = max(0, $tcount-$limit); + } + $start = max(0, $start); + if ($start != 0) + { + $array_start = 0; + } + else + { + $limit--; + $array_start = 1; + } + $sortdir = "ASC"; + + $qry = " + SELECT t.*, u.*, ue.* FROM #forum_t as t + LEFT JOIN #user AS u + ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #user_extended AS ue + ON SUBSTRING_INDEX(t.thread_user,'.',1) = ue.user_extended_id + WHERE t.thread_parent = $thread_id + ORDER by t.thread_datestamp {$sortdir} + LIMIT ".intval($start).",".intval($limit); + $ret = array(); + if ($sql->db_Select_gen($qry)) + { + $i = $array_start; + while ($row = $sql->db_Fetch()) + { + $ret[$i] = $row; + $i++; + } + } + $qry = " + SELECT t.*,u.*,ue.* from #forum_t AS t + LEFT JOIN #user AS u + ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #user_extended AS ue + ON SUBSTRING_INDEX(t.thread_user,'.',1) = ue.user_extended_id + WHERE t.thread_id = $thread_id + LIMIT 0,1 + "; + if ($sql->db_Select_gen($qry)) + { + $row = $sql->db_Fetch(); + $ret['head'] = $row; + if (!array_key_exists(0, $ret)) + { + $ret[0] = $row; + } + } + return $ret; + } + + function thread_count($thread_id) + { + $thread_id = intval($thread_id); + global $sql; + return $sql->db_Count('forum_t', '(*)', "WHERE thread_parent = $thread_id")+1; + } + + function thread_count_list($thread_list) + { + global $sql, $tp; + $qry = " + SELECT t.thread_parent, t.COUNT(*) as thread_replies + FROM #forum_t AS t + WHERE t.thread_parent + IN ".$tp -> toDB($thread_list, true)." + GROUP BY t.thread_parent + "; + if ($sql->db_Select_gen($qry)) + { + while ($row = $sql->db_Fetch()) + { + $ret[$row['thread_parent']] = $row['thread_replies']; + } + } + return $ret; + } + + function thread_incview($thread_id) + { + $thread_id = intval($thread_id); + global $sql; + return $sql->db_Update("forum_t", "thread_views=thread_views+1 WHERE thread_id='$thread_id' "); + } + + + function thread_get_postinfo($thread_id, $head = FALSE) + { + $thread_id = intval($thread_id); + global $sql; + $ret = array(); + $qry = " + SELECT t.*, u.user_name, u.user_id, u.user_email from #forum_t AS t + LEFT JOIN #user AS u + ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + WHERE t.thread_id = $thread_id + LIMIT 0,1 + "; + if ($sql->db_Select_gen($qry)) + { + $ret[0] = $sql->db_Fetch(); + } + else + { + return FALSE; + } + if ($head == FALSE) + { + return $ret; + } + $parent_id = $ret[0]['thread_parent']; + if ($parent_id == 0) + { + $ret['head'] = $ret[0]; + } + else + { + $qry = " + SELECT t.*, u.user_name, u.user_id from #forum_t AS t + LEFT JOIN #user AS u + ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + WHERE t.thread_id = ".intval($parent_id)." + LIMIT 0,1 + "; + if ($sql->db_Select_gen($qry)) + { + $row = $sql->db_Fetch(); + $ret['head'] = $row; + } + } + return $ret; + } + + + function _forum_lp_update($lp_type, $lp_user, $lp_info, $lp_forum_id, $lp_forum_sub) + { + global $sql; + $sql->db_Update('forum', "{$lp_type}={$lp_type}+1, forum_lastpost_user='{$lp_user}', forum_lastpost_info = '{$lp_info}' WHERE forum_id='".intval($lp_forum_id)."' "); + if($lp_forum_sub) + { + $sql->db_Update('forum', "forum_lastpost_user = '{$lp_user}', forum_lastpost_info = '{$lp_info}' WHERE forum_id='".intval($lp_forum_sub)."' "); + } + } + + function thread_insert($thread_name, $thread_thread, $thread_forum_id, $thread_parent, $thread_poster, $thread_active, $thread_s, $forum_sub) + { + $post_time = time(); + global $sql, $tp, $pref, $e107; + $forum_sub = intval($forum_sub); + $ip = $e107->getip(); + //Check for duplicate post + if ($sql->db_Count('forum_t', '(*)', "WHERE thread_thread='$thread_thread' and thread_datestamp > ".($post_time - 180))) + { + return -1; + } + + $post_user = $thread_poster['post_userid'].".".$thread_poster['post_user_name']; + $thread_post_user = $post_user; + if($thread_poster['post_userid'] == 0) + { + $thread_post_user = $post_user.chr(1).$ip; + } + + $post_last_user = ($thread_parent ? "" : $post_user); + $vals = "'0', '{$thread_name}', '{$thread_thread}', '".intval($thread_forum_id)."', '".intval($post_time)."', '".intval($thread_parent)."', '{$thread_post_user}', '0', '".intval($thread_active)."', '$post_time', '$thread_s', '0', '{$post_last_user}', '0'"; + $newthread_id = $sql->db_Insert('forum_t', $vals); + if(!$newthread_id) + { + echo "thread creation failed!
    + Values sent were: ".htmlentities($vals)."

    Please save these values for dev team for troubleshooting."; + exit; + } + + // Increment user thread count and set user as viewed this thread + if (USER) + { + $new_userviewed = USERVIEWED.".".($thread_parent ? intval($thread_parent) : $newthread_id); + $sql->db_Update('user', "user_forums=user_forums+1, user_viewed='{$new_userviewed}' WHERE user_id='".USERID."' "); + } + + //If post is a reply + if ($thread_parent) + { + $forum_lp_info = $post_time.".".intval($thread_parent); + $gen = new convert; + // Update main forum with last post info and increment reply count + $this->_forum_lp_update("forum_replies", $post_user, $forum_lp_info, $thread_forum_id, $forum_sub); + + // Update head post with last post info and increment reply count + $sql->db_Update('forum_t', "thread_lastpost={$post_time}, thread_lastuser='{$post_user}', thread_total_replies=thread_total_replies+1 WHERE thread_id = ".intval($thread_parent)); + + $parent_thread = $this->thread_get_postinfo($thread_parent); + global $PLUGINS_DIRECTORY; + $thread_name = $tp->toText($parent_thread[0]['thread_name']); + $datestamp = $gen->convert_date($post_time, "long"); + $email_post = $tp->toHTML($thread_thread, TRUE); + $mail_link = "".SITEURL.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$thread_parent.".last"; + if(!isset($pref['forum_eprefix'])) + { + $pref['forum_eprefix'] = "[forum]"; + } + // Send email to orinator of flagged + if ($parent_thread[0]['thread_active'] == 99 && $parent_thread[0]['user_id'] != USERID) + { + $gen = new convert; + $email_name = $parent_thread[0]['user_name']; + $message = LAN_384.SITENAME.".

    ". LAN_382.$datestamp."
    ". LAN_94.": ".$thread_poster['post_user_name']."

    ". LAN_385.$email_post."

    ". LAN_383."

    ".$mail_link; + include_once(e_HANDLER."mail.php"); + sendemail($parent_thread[0]['user_email'], $pref['forum_eprefix']." '".$thread_name."', ".LAN_381.SITENAME, $message); + } + + // Send email to all users tracking thread + if ($sql->db_Select("user", "*", "user_realm REGEXP('-".intval($thread_parent)."-') ")) + { + include_once(e_HANDLER.'mail.php'); + $message = LAN_385.SITENAME.".

    ". LAN_382.$datestamp."
    ". LAN_94.": ".$thread_poster['post_user_name']."

    ". LAN_385.$email_post."

    ". LAN_383."

    ".$mail_link; + while ($row = $sql->db_Fetch()) + { + if ($row['user_email']) + { + sendemail($row['user_email'], $pref['forum_eprefix']." '".$thread_name."', ".LAN_381.SITENAME, $message); + } + } + } + } + else + { + //post is a new thread + $forum_lp_info = $post_time.".".$newthread_id; + $this->_forum_lp_update("forum_threads", $post_user, $forum_lp_info, $thread_forum_id, $forum_sub); + } + return $newthread_id; + } + + function post_getnew($count = 50, $userviewed = USERVIEWED) + { + global $sql; + $viewed = ""; + if($userviewed) + { + $viewed = preg_replace("#\.+#", ".", $userviewed); + $viewed = preg_replace("#^\.#", "", $viewed); + $viewed = preg_replace("#\.$#", "", $viewed); + $viewed = str_replace(".", ",", $viewed); + } + if($viewed != "") + { + $viewed = " AND ft.thread_id NOT IN (".$viewed.")"; + } + + $qry = " + SELECT ft.*, fp.thread_name as post_subject, fp.thread_total_replies as replies, u.user_id, u.user_name, f.forum_class + FROM #forum_t AS ft + LEFT JOIN #forum_t as fp ON fp.thread_id = ft.thread_parent + LEFT JOIN #user as u ON u.user_id = SUBSTRING_INDEX(ft.thread_user,'.',1) + LEFT JOIN #forum as f ON f.forum_id = ft.thread_forum_id + WHERE ft.thread_datestamp > ".USERLV. " + AND f.forum_class IN (".USERCLASS_LIST.") + {$viewed} + ORDER BY ft.thread_datestamp DESC LIMIT 0, ".intval($count); + if($sql->db_Select_gen($qry)) + { + $ret = $sql->db_getList(); + } + return $ret; + } + + function forum_prune($type, $days, $forumArray) + { + global $sql; + $prunedate = time() - (intval($days) * 86400); + $forumList = implode(",", $forumArray); + + if($type == 'delete') + { + //Get list of threads to prune + if ($sql->db_Select("forum_t", "thread_id", "thread_lastpost < $prunedate AND thread_parent=0 AND thread_s != 1 AND thread_forum_id IN ({$forumList})")) + { + $threadList = $sql->db_getList(); + foreach($threadList as $thread) + { + //Delete all replies + $reply_count += $sql->db_Delete("forum_t", "thread_parent='".intval($thread['thread_id'])."'"); + //Delete thread + $thread_count += $sql->db_Delete("forum_t", "thread_id = '".intval($thread['thread_id'])."'"); + //Delete poll if there is one + $sql->db_Delete("poll", "poll_datestamp='".intval($thread['thread_id']).""); + } + foreach($forumArray as $fid) + { + $this->update_lastpost('forum', $fid); + $this->forum_update_counts($fid); + } + return FORLAN_8." ( ".$thread_count." ".FORLAN_92.", ".$reply_count." ".FORLAN_93." )"; + } + else + { + return FORLAN_9; + } + } + else + { + $pruned = $sql->db_Update("forum_t", "thread_active=0 WHERE thread_lastpost < $prunedate AND thread_parent=0 AND thread_forum_id IN ({$forumList})"); + return FORLAN_8." ".$pruned." ".FORLAN_91; + } + } + + function forum_update_counts($forumID, $recalc_threads = false) + { + global $sql; + if($forumID == 'all') + { + $sql->db_Select('forum', 'forum_id', 'forum_parent != 0'); + $flist = $sql->db_getList(); + foreach($flist as $f) + { + $this->forum_update_counts($f['forum_id']); + } + return; + } + $forumID = intval($forumID); + $threads = $sql->db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forumID AND thread_parent = 0"); + $replies = $sql->db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forumID AND thread_parent != 0"); + $sql->db_Update("forum", "forum_threads='$threads', forum_replies='$replies' WHERE forum_id='$forumID'"); + if($recalc_threads == true) + { + $sql->db_Select("forum_t", "thread_parent, count(*) as replies", "thread_forum_id = $forumID GROUP BY thread_parent"); + $tlist = $sql->db_getList(); + foreach($tlist as $t) + { + $tid = $t['thread_parent']; + $replies = intval($t['replies']); + $sql->db_Update("forum_t", "thread_total_replies='$replies' WHERE thread_id='$tid'"); + } + } + } + + function get_user_counts() + { + global $sql; + $qry = " + SELECT u.user_id AS uid, count(t.thread_user) AS cnt FROM #forum_t AS t + LEFT JOIN #user AS u on SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + WHERE u.user_id > 0 + GROUP BY uid + "; + + if($sql->db_Select_gen($qry)) + { + $ret = array(); + while($row = $sql->db_Fetch()) + { + $ret[$row['uid']] = $row['cnt']; + } + return $ret; + } + return FALSE; + } + + /* + * set bread crumb + * $forum_href override ONLY applies when template is missing FORUM_CRUMB + * $thread_title is needed for post-related breadcrumbs + */ + function set_crumb($forum_href=FALSE,$thread_title="") + { + global $FORUM_CRUMB,$forum_info,$thread_info,$tp; + global $BREADCRUMB,$BACKLINK; // Eventually we should deprecate BACKLINK + + if(is_array($FORUM_CRUMB)) + { + $search = array("{SITENAME}", "{SITENAME_HREF}"); + $replace = array(SITENAME, "href='".e_BASE."index.php'"); + $FORUM_CRUMB['sitename']['value'] = str_replace($search, $replace, $FORUM_CRUMB['sitename']['value']); + + $search = array("{FORUMS_TITLE}", "{FORUMS_HREF}"); + $replace = array(LAN_01, "href='".e_PLUGIN."forum/forum.php'"); + $FORUM_CRUMB['forums']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forums']['value']); + + $search = "{PARENT_TITLE}"; + $replace = $tp->toHTML($forum_info['parent_name']); + $FORUM_CRUMB['parent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['parent']['value']); + + if($forum_info['sub_parent']) + { + $search = array("{SUBPARENT_TITLE}", "{SUBPARENT_HREF}"); + $forum_sub_parent = (substr($forum_info['sub_parent'], 0, 1) == "*" ? substr($forum_info['sub_parent'], 1) : $forum_info['sub_parent']); + $replace = array($forum_sub_parent, "href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_sub']}'"); + $FORUM_CRUMB['subparent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['subparent']['value']); + } + else + { + $FORUM_CRUMB['subparent']['value'] = ""; + } + + $search = array("{FORUM_TITLE}", "{FORUM_HREF}"); + $tmpFname = $forum_info['forum_name']; + if(substr($tmpFname, 0, 1) == "*") { $tmpFname = substr($tmpFname, 1); } + $replace = array($tmpFname,"href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_id']}'"); + $FORUM_CRUMB['forum']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forum']['value']); + + if(strlen($thread_title)) + { + $search = array("{THREAD_TITLE}"); + $replace = array($thread_title); + $FORUM_CRUMB['thread']['value'] = str_replace($search, $replace, $FORUM_CRUMB['thread']['value']); + } + else + { + $FORUM_CRUMB['thread']['value'] = ""; + } + + $FORUM_CRUMB['fieldlist'] = "sitename,forums,parent,subparent,forum,thread"; + $BREADCRUMB = $tp->parseTemplate("{BREADCRUMB=FORUM_CRUMB}", true); + + } + else + { + $dfltsep = " :: "; + $BREADCRUMB = "".SITENAME."".$dfltsep."".LAN_01."".$dfltsep; + if($forum_info['sub_parent']) + { + $forum_sub_parent = (substr($forum_info['sub_parent'], 0, 1) == "*" ? substr($forum_info['sub_parent'], 1) : $forum_info['sub_parent']); + $BREADCRUMB .= "{$forum_sub_parent}".$dfltsep; + } + + $tmpFname = $forum_info['forum_name']; + if(substr($tmpFname, 0, 1) == "*") { $tmpFname = substr($tmpFname, 1); } + if ($forum_href) + { + $BREADCRUMB .= "".$tp->toHTML($tmpFname, TRUE, 'no_hook,emotes_off').""; + } else + { + $BREADCRUMB .= $tmpFname; + } + + if(strlen($thread_title)) + { + $BREADCRUMB .= $dfltsep.$thread_title; + } + } + $BACKLINK = $BREADCRUMB; + } +} + + +/** +* @return string path to and filename of forum icon image +* +* @param string $filename filename of forum image +* @param string $eMLANG_folder if specified, indicates its a multilanguage image being processed and +* gives the subfolder of the image path to the eMLANG_path() function, +* default = FALSE +* @param string $eMLANG_pref if specified, indicates that $filename may be overridden by the +* $pref with $eMLANG_pref as its key if that pref is TRUE, default = FALSE +* +* @desc checks for the existence of a forum icon image in the themes forum folder and if it is found +* returns the path and filename of that file, otherwise it returns the path and filename of the +* default forum icon image in e_IMAGES. The additional $eMLANG args if specfied switch the process +* to the sister multi-language function eMLANG_path(). +* +* @access public +*/ +function img_path($filename) +{ + global $pref; + + $multilang = array("reply.png","newthread.png","moderator.png","main_admin.png","admin.png"); + $ML = (in_array($filename,$multilang)) ? TRUE : FALSE; + + if(file_exists(THEME.'forum/'.$filename) || is_readable(THEME.'forum/'.e_LANGUAGE."_".$filename)) + { + $image = ($ML && is_readable(THEME.'forum/'.e_LANGUAGE."_".$filename)) ? THEME.'forum/'.e_LANGUAGE."_".$filename : THEME.'forum/'.$filename; + } + else + { + if(defined("IMODE")) + { + if($ML) + { + $image = (is_readable(e_PLUGIN."forum/images/".IMODE."/".e_LANGUAGE."_".$filename)) ? e_PLUGIN."forum/images/".IMODE."/".e_LANGUAGE."_".$filename : e_PLUGIN."forum/images/".IMODE."/English_".$filename; + } + else + { + $image = e_PLUGIN."forum/images/".IMODE."/".$filename; + } + } + else + { + if($ML) + { + $image = (is_readable(e_PLUGIN."forum/images/lite/".e_LANGUAGE."_".$filename)) ? e_PLUGIN."forum/images/lite/".e_LANGUAGE."_".$filename : e_PLUGIN."forum/images/lite/English_".$filename; + } + else + { + $image = e_PLUGIN."forum/images/lite/".$filename; + } + + } + } + + return $image; +} + + + + +if (file_exists(THEME.'forum/forum_icons_template.php')) +{ + require_once(THEME.'forum/forum_icons_template.php'); +} +else if (file_exists(THEME.'forum_icons_template.php')) +{ + require_once(THEME.'forum_icons_template.php'); +} +else +{ + require_once(e_PLUGIN.'forum/templates/forum_icons_template.php'); +} +?> diff --git a/e107_plugins/forum/forum_conf.php b/e107_plugins/forum/forum_conf.php new file mode 100644 index 000000000..519b13a58 --- /dev/null +++ b/e107_plugins/forum/forum_conf.php @@ -0,0 +1,191 @@ +db_Select_gen($qry)) +{ + $info=$sql->db_Fetch(); + if(!check_class($info['forum_moderators'])) + { + header("location:".e_BASE."index.php"); + exit; + } +} +else +{ + header("location:".e_BASE."index.php"); + exit; +} + +require_once(HEADERF); + +if (isset($_POST['deletepollconfirm'])) { + $sql->db_Delete("poll", "poll_id='".intval($thread_parent)."' "); + $sql->db_Select("forum_t", "*", "thread_id='".$thread_id."' "); + $row = $sql->db_Fetch(); + extract($row); + $thread_name = str_replace("[poll] ", "", $thread_name); + $sql->db_Update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' "); + $message = FORLAN_5; + $url = e_PLUGIN."forum/forum_viewtopic.php?".$forum_id.".".$thread_id; +} + +if (isset($_POST['move'])) +{ + require_once(e_PLUGIN."forum/forum_class.php"); + $forum = new e107forum; + $new_forum = intval($_POST['forum_move']); + $replies = $sql->db_Select("forum_t", "*", "thread_parent='$thread_id' "); + $sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_id ='".$thread_id."' "); + $row = $sql->db_Fetch(); + $old_forum = $row['thread_forum_id']; + $new_thread_name = $row['thread_name']; + + if($_POST['rename_thread'] == 'add') + { + $new_thread_name = "[".FORLAN_27."] ".$new_thread_name; + } + elseif($_POST['rename_thread'] == 'rename' && trim($_POST['newtitle']) != "") + { + $new_thread_name = $tp->toDB($_POST['newtitle']); + } + + $sql->db_Update("forum_t", "thread_forum_id='$new_forum', thread_name='{$new_thread_name}' WHERE thread_id='$thread_id' "); + $sql->db_Update("forum_t", "thread_forum_id='$new_forum' WHERE thread_parent='$thread_id' "); + $sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$replies WHERE forum_id='$old_forum' "); + $sql->db_Update("forum", "forum_threads=forum_threads+1, forum_replies=forum_replies+$replies WHERE forum_id='$new_forum' "); + + // update lastposts + + $forum->update_lastpost('forum', $old_forum, FALSE); + $forum->update_lastpost('forum', $new_forum, FALSE); + + $message = FORLAN_9; + $url = e_PLUGIN."forum/forum_viewforum.php?".$new_forum; +} + +if (isset($_POST['movecancel'])) +{ + $message = FORLAN_10; + $url = e_PLUGIN."forum/forum_viewforum.php?".$info['forum_id']; +} + +if ($message) +{ + $text = "
    ".$message." +
    + ".FORLAN_11." +
    "; + $ns->tablerender(FORLAN_12, $text); + require_once(FOOTERF); + exit; +} + +if ($action == "delete_poll") +{ + $text = "
    + ".FORLAN_13." +

    +
    + + +
    +
    "; + $ns->tablerender(FORLAN_16, $text); + require_once("footer.php"); + exit; +} + +if ($action == "move") +{ + $text = " +
    +
    + + + + + + + + + + + +
    ".FORLAN_24.": + +

    + ".FORLAN_32."
    + ".FORLAN_28."
    + ".FORLAN_29." [".FORLAN_27."] ".FORLAN_30."
    + ".FORLAN_31." +

    + + +
    +
    +

    "; + $text = $ns->tablerender($tp->toHTML($info['thread_name']), $tp->toHTML($info['thread_thread']), '', TRUE).$ns->tablerender("", $text, '', true); + $ns->tablerender(FORLAN_25, $text); + +} +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_mod.php b/e107_plugins/forum/forum_mod.php new file mode 100644 index 000000000..f19f997b4 --- /dev/null +++ b/e107_plugins/forum/forum_mod.php @@ -0,0 +1,142 @@ + $val) { + if (preg_match("#(.*?)_(\d+)_x#", $key, $matches)) + { + $act = $matches[1]; + $id = intval($matches[2]); + + switch($act) + { + case 'lock' : + $sql->db_Update("forum_t", "thread_active='0' WHERE thread_id='$id' "); + return FORLAN_CLOSE; + break; + + case 'unlock' : + $sql->db_Update("forum_t", "thread_active='1' WHERE thread_id='$id' "); + return FORLAN_OPEN; + break; + + case 'stick' : + $sql->db_Update("forum_t", "thread_s='1' WHERE thread_id='$id' "); + return FORLAN_STICK; + break; + + case 'unstick' : + $sql->db_Update("forum_t", "thread_s='0' WHERE thread_id='$id' "); + return FORLAN_UNSTICK; + break; + + case 'delete' : + return forum_delete_thread($id); + break; + + } + } + } +} + +function forum_delete_thread($thread_id) +{ + global $sql; + @require_once(e_PLUGIN.'forum/forum_class.php'); + $f =& new e107forum; + $sql->db_Select("forum_t", "*", "thread_id='".intval($thread_id)."' "); + $row = $sql->db_Fetch(); + + if ($row['thread_parent']) + { + // post is a reply? + $sql->db_Delete("forum_t", "thread_id='".intval($thread_id)."' "); + // dec forum reply count by 1 + $sql->db_Update("forum", "forum_replies=forum_replies-1 WHERE forum_id='".$row['thread_forum_id']."'"); + // dec thread reply count by 1 + $sql->db_Update("forum_t", "thread_total_replies=thread_total_replies-1 WHERE thread_id='".$row['thread_parent']."'"); + // dec user forum post count by 1 + $tmp = explode(".", $row['thread_user']); + $uid = intval($tmp[0]); + if($uid > 0) + { + $sql->db_Update("user", "user_forums=user_forums-1 WHERE user_id='".$uid."'"); + } + // update lastpost info + $f->update_lastpost('thread', $row['thread_parent']); + $f->update_lastpost('forum', $row['thread_forum_id']); + return FORLAN_154; + } + else + { + // post is thread + // delete poll if there is one + $sql->db_Delete("poll", "poll_datestamp='".intval($thread_id)."'"); + //decrement user post counts + forum_userpost_count("WHERE thread_id = '".intval($thread_id)."' OR thread_parent = '".intval($thread_id)."'", "dec"); + // delete replies and grab how many there were + $count = $sql->db_Delete("forum_t", "thread_parent='".intval($thread_id)."'"); + // delete the post itself + $sql->db_Delete("forum_t", "thread_id='".intval($thread_id)."'"); + // update thread/reply counts + $sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$count WHERE forum_id='".$row['thread_forum_id']."'"); + // update lastpost info + $f->update_lastpost('forum', $row['thread_forum_id']); + return FORLAN_6.($count ? ", ".$count." ".FORLAN_7."." : "."); + } +} + +function forum_userpost_count($where = "", $type = "dec") +{ + global $sql; + + $qry = " + SELECT thread_user, count(thread_user) AS cnt FROM #forum_t + {$where} + GROUP BY thread_user + "; + + if($sql->db_Select_gen($qry)) + { + $uList = $sql->db_getList(); + foreach($uList as $u) + { + $tmp = explode(".", $u['thread_user']); + $uid = intval($tmp[0]); + if($uid > 0) + { + if("set" == $type) + { + $sql->db_Update("user", "user_forums={$u['cnt']} WHERE user_id='".$uid."'"); + } + else + { + $sql->db_Update("user", "user_forums=user_forums-{$u['cnt']} WHERE user_id='".$uid."'"); + } + } + } + } +} +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php new file mode 100644 index 000000000..6d8d84213 --- /dev/null +++ b/e107_plugins/forum/forum_post.php @@ -0,0 +1,653 @@ +thread_get($id, 'last', 11); + $forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']); +} +elseif ($action == 'nt') +{ + // New post + $forum_info = $forum->forum_get($id); +} +elseif ($action == 'quote' || $action == 'edit') +{ + $thread_info = $forum->thread_get_postinfo($id, TRUE); + $forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']); + if($action == 'quote') + { + $id = $thread_info['head']['thread_id']; + } +} + +if (!check_class($forum_info['forum_postclass']) || !check_class($forum_info['parent_postclass'])) { + require_once(HEADERF); + $ns->tablerender(LAN_20, "
    ".LAN_399."
    "); + require_once(FOOTERF); + exit; +} +define("MODERATOR", check_class($forum_info['forum_moderators'])); +//require_once(e_HANDLER.'forum_include.php'); +require_once(e_PLUGIN."forum/forum_post_shortcodes.php"); +require_once(e_PLUGIN."forum/forum_shortcodes.php"); +require_once(e_HANDLER."ren_help.php"); +$gen = new convert; +$fp = new floodprotect; +global $tp; + +if ($sql->db_Select("tmp", "*", "tmp_ip='$ip' ")) { + $row = $sql->db_Fetch(); + $tmp = explode("^", $row['tmp_info']); + $action = $tmp[0]; + $anonname = $tmp[1]; + $subject = $tmp[2]; + $post = $tmp[3]; + $sql->db_Delete("tmp", "tmp_ip='$ip' "); +} + +//Check to see if user had post rights +if (!check_class($forum_info['forum_postclass'])) +{ + require_once(HEADERF); + $text .= "
    ".LAN_399."
    "; + $ns->tablerender(LAN_20, $text); + require_once(FOOTERF); + exit; +} + +//if thread is not active and not new thread, show warning +if ($action != "nt" && !$thread_info['head']['thread_active'] && !MODERATOR) +{ + require_once(HEADERF); + $ns->tablerender(LAN_20, "
    ".LAN_397."
    "); + require_once(FOOTERF); + exit; +} + +$forum_info['forum_name'] = $tp -> toHTML($forum_info['forum_name'], TRUE); + +define("e_PAGETITLE", LAN_01." / ".$forum_info['forum_name']." / ".($action == "rp" ? LAN_02.$forum_info['thread_name'] : LAN_03)); + +// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +if (is_readable(e_ADMIN.'filetypes.php')) { + $a_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php')); + $a_filetypes = explode(',', $a_filetypes); + foreach ($a_filetypes as $ftype) { + $sa_filetypes[] = '.'.trim(str_replace('.', '', $ftype)); + } + $allowed_filetypes = implode(' | ', $sa_filetypes); +} + +if (isset($_POST['submitpoll'])) +{ + require_once(e_PLUGIN."poll/poll_class.php"); + $poll = new poll; + + require_once(HEADERF); + if (!$FORUMPOST) + { + if (file_exists(THEME."forum_posted_template.php")) + { + require_once(THEME."forum_posted_template.php"); + } + else + { + require_once(e_PLUGIN."forum/templates/forum_posted_template.php"); + } + } + echo $FORUMPOLLPOSTED; + require_once(FOOTERF); + exit; +} + +if (isset($_POST['fpreview'])) +{ + process_upload(); + require_once(HEADERF); + if (USER) + { + $poster = USERNAME; + } + else + { + $poster = ($_POST['anonname']) ? $_POST['anonname'] : LAN_311; + } + $postdate = $gen->convert_date(time(), "forum"); + $tsubject = $tp->post_toHTML($_POST['subject'], true); + $tpost = $tp->post_toHTML($_POST['post'], true); + + if ($_POST['poll_title'] != "" && $pref['forum_poll']) + { + require_once(e_PLUGIN."poll/poll_class.php"); + $poll = new poll; + $poll->render_poll($_POST, "forum", "notvoted"); + } + + if (!$FORUM_PREVIEW) + { + if (file_exists(THEME."forum_preview_template.php")) + { + require_once(THEME."forum_preview_template.php"); + } + else + { + require_once(e_PLUGIN."forum/templates/forum_preview_template.php"); + } + } + + $text = $FORUM_PREVIEW; + + if ($poll_text) + { + $ns->tablerender($_POST['poll_title'], $poll_text); + } + $ns->tablerender(LAN_323, $text); + $anonname = $tp->post_toHTML($_POST['anonname'], FALSE); + + $post = $tp->post_toForm($_POST['post']); + $subject = $tp->post_toHTML($_POST['subject'], false); + + if ($action == "edit") + { + if ($_POST['subject']) + { + $action = "edit"; + } + else + { + $action = "reply"; + } + $eaction = TRUE; + } + else if($action == "quote") + { + $action = "reply"; + $eaction = FALSE; + } +} + +if (isset($_POST['newthread']) || isset($_POST['reply'])) +{ + $poster = array(); + if ((isset($_POST['newthread']) && trim($_POST['subject']) == "") || trim($_POST['post']) == "") + { + message_handler("ALERT", 5); + } + else + { + if ($fp->flood("forum_t", "thread_datestamp") == FALSE && !ADMIN) + { + echo "\n"; + } + if (USER) + { + $poster['post_userid'] = USERID; + $poster['post_user_name'] = USERNAME; + } + else + { + $poster = getuser($_POST['anonname']); + if ($poster == -1) + { + require_once(HEADERF); + $ns->tablerender(LAN_20, LAN_310); + if (isset($_POST['reply'])) + { + $tmpdata = "reply.".$tp -> toDB($_POST['anonname']).".".$tp -> toDB($_POST['subject']).".".$tp -> toDB($_POST['post']); + } + else + { + $tmpdata = "newthread^".$tp -> toDB($_POST['anonname'])."^".$tp -> toDB($_POST['subject'])."^".$tp -> toDB($_POST['post']); + } + $sql->db_Insert("tmp", "'$ip', '".time()."', '$tmpdata' "); + loginf(); + require_once(FOOTERF); + exit; + } + } + process_upload(); + + $post = $tp->toDB($_POST['post']); + $subject = $tp->toDB($_POST['subject']); + $email_notify = ($_POST['email_notify'] ? 99 : 1); + if ($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != "") + { + $subject = "[".LAN_402."] ".$subject; + } + + $threadtype = (MODERATOR ? intval($_POST['threadtype']) : 0); + if (isset($_POST['reply'])) + { + $parent = $id; + $forum_id = $thread_info['head']['thread_forum_id']; + } + else + { + $parent = 0; + $forum_id = $id; + } + + $iid = $forum->thread_insert($subject, $post, $forum_id, $parent, $poster, $email_notify, $threadtype, $forum_info['forum_sub']); + if($iid === -1) + { + require_once(HEADERF); + $ns->tablerender("", LAN_FORUM_2); + require_once(FOOTERF); + exit; + } + if (isset($_POST['reply'])) { + $iid = $parent; + } + + if ($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != "" && isset($_POST['newthread'])) { + require_once(e_PLUGIN."poll/poll_class.php"); + $_POST['iid'] = $iid; + $poll = new poll; + $poll -> submit_poll(2); + } + + if ($pref['forum_redirect']) + { + redirect(e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last"); + } + else + { + require_once(HEADERF); + if (!$FORUMPOST) + { + if (file_exists(THEME."forum_posted_template.php")) + { + require_once(THEME."forum_posted_template.php"); + } + else + { + require_once(e_PLUGIN."forum/templates/forum_posted_template.php"); + } + } + + echo (isset($_POST['newthread']) ? $FORUMTHREADPOSTED : $FORUMREPLYPOSTED); + $e107cache->clear("newforumposts"); + require_once(FOOTERF); + exit; + } + } +} +require_once(HEADERF); + +if (isset($_POST['update_thread'])) +{ + if (!$_POST['subject'] || !$_POST['post']) + { + $error = "
    ".LAN_27."
    "; + } + else + { + if (!isAuthor()) + { + $ns->tablerender(LAN_95, "
    ".LAN_96."
    "); + require_once(FOOTERF); + exit; + } + + $newvals['thread_edit_datestamp'] = time(); + $newvals['thread_thread'] = $_POST['post']; + $newvals['thread_name'] = $_POST['subject']; + if(isset($_POST['email_notify'])) + { + $newvals['thread_active'] = '99'; + } + if (isset($_POST['threadtype']) && MODERATOR) + { + $newvals['thread_s'] = $_POST['threadtype']; + } + $forum->thread_update($id, $newvals); + $e107cache->clear("newforumposts"); + $url = e_PLUGIN."forum/forum_viewtopic.php?{$thread_info['head']['thread_id']}.0"; + echo "\n"; + } +} + +if (isset($_POST['update_reply'])) +{ + if (!$_POST['post']) + { + $error = "
    ".LAN_27."
    "; + } + else + { + if (!isAuthor()) + { + $ns->tablerender(LAN_95, "
    ".LAN_96."
    "); + require_once(FOOTERF); + exit; + } + $url = e_PLUGIN."forum/forum_viewtopic.php?{$id}.post"; + echo "\n"; + $newvals['thread_edit_datestamp'] = time(); + $newvals['thread_thread'] = $_POST['post']; + $forum->thread_update($id, $newvals); + $e107cache->clear("newforumposts"); + $url = e_PLUGIN."forum/forum_viewtopic.php?{$id}.post"; + echo "\n"; + } +} + +if ($error) +{ + $ns->tablerender(LAN_20, $error); +} + + +if ($action == 'edit' || $action == 'quote') +{ + if ($action == "edit") + { + if (!isAuthor()) + { + $ns->tablerender(LAN_95, "
    ".LAN_96."
    "); + require_once(FOOTERF); + exit; + } + } + + if(!is_array($thread_info[0])) + { + $ns -> tablerender(LAN_20, "
    ".LAN_96."
    "); + require_once(FOOTERF); + exit; + } + + $thread_info[0]['user_name'] = $forum->thread_user($thread_info[0]); + if (!isset($_POST['fpreview'])) + { + $subject = $thread_info['0']['thread_name']; + $post = $tp->toForm($thread_info[0]['thread_thread']); + } + $post = preg_replace("/<span class='smallblacktext'.*\span\>/", "", $post); + + if ($action == 'quote') { + $post = preg_replace("#\[hide].*?\[/hide]#s", "", $post); + $tmp = explode(chr(1), $thread_info[0]['user_name']); + $timeStamp = time(); + $post = "[quote{$timeStamp}={$tmp[0]}]\n".$post."\n[/quote{$timeStamp}]\n"; + $eaction = FALSE; + $action = 'reply'; + } else { + $eaction = TRUE; + if ($thread_info['0']['thread_parent']) { + $action = "reply"; + } else { + $action = "nt"; + $sact = "canc"; // added to override the bugtracker query below + } + } +} + +// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +//Load forumpost template + +if (!$FORUMPOST) { + if (is_readable(THEME."forum_post_template.php")) { + include_once(THEME."forum_post_template.php"); + } +} +include_once(e_PLUGIN."forum/templates/forum_post_template.php"); + +/* check post access (bugtracker #1424) */ + +if($action == "rp" && !$sql -> db_Select("forum_t", "*", "thread_id='$id'")) +{ + $ns -> tablerender(LAN_20, "
    ".LAN_399."
    "); + require_once(FOOTERF); + exit; +} +else if($action == "nt" && !$sact && !$sql -> db_Select("forum", "*", "forum_id='$id'")) +{ + $ns -> tablerender(LAN_20, "
    ".LAN_399."
    "); + require_once(FOOTERF); + exit; +} +else +{ + $fpr = $sql -> db_Fetch(); + if(!check_class($fpr['forum_postclass'])) + { + $ns -> tablerender(LAN_20, "
    ".LAN_399."
    "); + require_once(FOOTERF); + exit; + } +} + +if($action == 'rp') +{ + $FORUMPOST = $FORUMPOST_REPLY; +} +$text = $tp->parseTemplate($FORUMPOST, FALSE, $forum_post_shortcodes); + +// ------------------------------------------------------------------------------------------------------------------------------------------------------------- + +if ($pref['forum_enclose']) +{ + $ns->tablerender($pref['forum_title'], $text); +} +else +{ + echo $text; +} + +function isAuthor() +{ + global $thread_info; + $tmp = explode(".", $thread_info[0]['thread_user'], 2); + return ($tmp[0] == USERID || MODERATOR); +} + +function getuser($name) +{ + global $tp, $sql, $e107; + $ret = array(); + $ip = $e107->getip(); + $name = str_replace("'", "", $name); + if (!$name) + { + // anonymous guest +// $name = "0.".LAN_311.chr(1).$ip; + $ret['post_userid'] = "0"; + $ret['post_user_name'] = LAN_311; + return $ret; + } + else + { + if ($sql->db_Select("user", "user_id, user_ip", "user_name='".$tp -> toDB($name)."'")) + { + $row = $sql->db_Fetch(); + if ($row['user_ip'] == $ip) + { + $ret['post_userid'] = $row['user_id']; + $ret['post_user_name'] = $name; + } + else + { + return -1; + } + } + else + { +// $name = "0.".substr($tp->toDB($name), 0, 20).chr(1).$ip; + $ret['post_userid'] = "0"; + $ret['post_user_name'] = $tp->toDB($name); + } + } + return $ret; +} + +function loginf() { + $text .= "
    +

    + ".LAN_16."
    + \n +
    + ".LAN_17." +
    + \n +
    + \n +
    + ".LAN_11." +

    + [ ".LAN_174." ]
    [ ".LAN_212." ] +

    +
    +
    "; + $ns = new e107table; + $ns->tablerender(LAN_175, $text); +} + +function forumjump() +{ + global $forum; + $jumpList = $forum->forum_get_allowed(); + $text = "

    ".LAN_401.":

    "; + return $text; +} + +function redirect($url) +{ + echo "\n"; +} + +function process_upload() +{ + global $pref, $forum_info, $thread_info; + + if(isset($thread_info['head']['thread_id'])) + { + $tid = $thread_info['head']['thread_id']; + } + else + { + $tid = 0; + } + + if (isset($_FILES['file_userfile']['error']) && $_FILES['file_userfile']['error'] != 4) + { + require_once(e_HANDLER."upload_handler.php"); + if ($uploaded = file_upload('/'.e_FILE."public/", "attachment", "FT{$tid}_")) + { + foreach($uploaded as $upload) + { + if(strstr($upload['type'], "image")) + { + if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0) + { + require_once(e_HANDLER."resize_handler.php"); + $orig_file = $upload['name']; + $p = strrpos($orig_file,'.'); + $new_file = substr($orig_file, 0 , $p)."_".substr($orig_file, $p); + $fpath = e_FILE."public/"; + if(resize_image($fpath.$orig_file, $fpath.$new_file, $pref['forum_maxwidth'])) + { + if($pref['forum_linkimg']) + { + $parms = image_getsize($fpath.$new_file); + $_POST['post'] .= "[br][link=".$fpath.$orig_file."][img{$parms}]".$fpath.$new_file."[/img][/link][br]"; + //show resized, link to fullsize + } + else + { + @unlink($fpath.$orig_file); + //show resized + $parms = image_getsize($fpath.$new_file); + $_POST['post'] .= "[br][img{$parms}]".$fpath.$new_file."[/img][br]"; + } + } + else + { + //resize failed, show original + $parms = image_getsize(e_FILE."public/".$upload['name']); + $_POST['post'] .= "[br][img{$parms}]".e_FILE."public/".$upload['name']."[/img]"; + } + } + else + { + $parms = image_getsize(e_FILE."public/".$upload['name']); + //resizing disabled, show original + $_POST['post'] .= "[br]
    [img{$parms}]".e_FILE."public/".$upload['name']."[/img]
    \n"; + } + } + else + { + //upload was not an image, link to file + //echo "
    "; print_r($upload); echo "
    "; + $_POST['post'] .= "[br][file=".e_FILE."public/".$upload['name']."]".$upload['name']."[/file]"; + } + + } + } + } +} + +function image_getsize($fname) +{ + if($imginfo = getimagesize($fname)) + { + return ":width={$imginfo[0]}&height={$imginfo[1]}"; + } + else + { + return ""; + } +} + + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_post_shortcodes.php b/e107_plugins/forum/forum_post_shortcodes.php new file mode 100644 index 000000000..43fb00e90 --- /dev/null +++ b/e107_plugins/forum/forum_post_shortcodes.php @@ -0,0 +1,152 @@ + e_sc -> parse_scbatch(__FILE__); + +/* +SC_BEGIN LATESTPOSTS +global $thread_info, $action, $gen, $tp, $forum_shortcodes, $post_info; +global $LATESTPOSTS_START, $LATESTPOSTS_END, $LATESTPOSTS_POST; +$txt = $tp->parseTemplate($LATESTPOSTS_START, TRUE, $forum_shortcodes); +for($i = count($thread_info)-2; $i>0; $i--) +{ + $post_info = $thread_info[$i]; + $txt .= $tp->parseTemplate($LATESTPOSTS_POST, TRUE, $forum_shortcodes); +} +$txt .= $tp->parseTemplate($LATESTPOSTS_END, TRUE, $forum_shortcodes); +return $txt; +SC_END + +SC_BEGIN THREADTOPIC +global $thread_info, $action, $gen, $tp, $post_info, $forum_shortcodes, $THREADTOPIC_REPLY; +$post_info = $thread_info['head']; +return $tp->parseTemplate($THREADTOPIC_REPLY, TRUE, $forum_shortcodes); +SC_END + +SC_BEGIN FORMSTART +return "
    "; +SC_END + +SC_BEGIN FORMEND +return "
    "; +SC_END + +SC_BEGIN FORUMJUMP +return forumjump(); +SC_END + +SC_BEGIN USERBOX +global $userbox; +return (USER == FALSE ? $userbox : ""); +SC_END + +SC_BEGIN SUBJECTBOX +global $subjectbox, $action; +return ($action == "nt" ? $subjectbox : ""); +SC_END + +SC_BEGIN POSTTYPE +global $action; +return ($action == "nt" ? LAN_63 : LAN_73); +SC_END + +SC_BEGIN POSTBOX +global $post, $pref; +$rows = (e_WYSIWYG) ? 15 : 10; +$ret = "\n
    \n"; +if(!e_WYSIWYG) +{ + $ret .= display_help('helpb', 'forum'); +} +return $ret; +SC_END + +SC_BEGIN BUTTONS +global $action, $eaction; +$ret = " "; +if ($action != "nt") +{ + $ret .= ($eaction ? "" : ""); +} +else +{ + $ret .= ($eaction ? "" : ""); +} +return $ret; +SC_END + +SC_BEGIN FILEATTACH +global $pref, $fileattach, $fileattach_alert; + +if ($pref['forum_attach'] && strpos(e_QUERY, "edit") === FALSE && (check_class($pref['upload_class']) || getperms('0'))) +{ + if (is_writable(e_FILE."public")) + { + return $fileattach; + } + else + { + $FILEATTACH = ""; + if(ADMIN) + { + if(!$fileattach_alert) + { + $fileattach_alert = "".($pref['image_post'] ? LAN_390 : LAN_416)."".LAN_FORUM_1."\n"; + } + return $fileattach_alert; + } + } +} +SC_END + +SC_BEGIN POSTTHREADAS +global $action, $thread_info; +if (MODERATOR && $action == "nt") +{ + $thread_s = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_s']); + return "
    ".LAN_400."".LAN_1." ".LAN_2." ".LAN_3.""; +} +return ""; +SC_END + +SC_BEGIN BACKLINK +global $forum, $thread_info,$eaction, $action,$BREADCRUMB; +$forum->set_crumb(TRUE,($action == "nt" ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406." ".$thread_info['head']['thread_name']))); +return $BREADCRUMB; +SC_END + +SC_BEGIN EMAILNOTIFY +global $pref, $thread_info, $action; +if ($pref['email_notify'] && $action == "nt") +{ + if(isset($_POST['fpreview'])) + { + $chk = ($_POST['email_notify'] ? "checked = 'checked'" : ""); + } + else + { + if(isset($thread_info)) + { + $chk = ($thread_info['head']['thread_active'] == 99 ? "checked='checked'" : ""); + } + else + { + $chk = ($pref['email_notify_on'] ? "checked='checked'" : ""); + } + } + return "".LAN_380.""; +} +return ""; +SC_END + +SC_BEGIN POLL +global $poll_form, $action, $pref; +if ($action == "nt" && $pref['forum_poll'] && strpos(e_QUERY, "edit") === FALSE) +{ + return $poll_form; +} +return ""; +SC_END + +*/ +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_shortcodes.php b/e107_plugins/forum/forum_shortcodes.php new file mode 100644 index 000000000..463ad1829 --- /dev/null +++ b/e107_plugins/forum/forum_shortcodes.php @@ -0,0 +1,255 @@ + e_sc -> parse_scbatch(__FILE__); +/* +SC_BEGIN TOP +return "".LAN_10.""; +SC_END + +SC_BEGIN JOINED +global $post_info, $gen; +if ($post_info['user_id']) { +return LAN_06.': '.$gen->convert_date($post_info['user_join'], 'forum').'
    '; +} +SC_END + +SC_BEGIN THREADDATESTAMP +global $post_info, $gen, $thread_id; +return "".IMAGE_post." ".$gen->convert_date($post_info['thread_datestamp'], "forum"); +SC_END + +SC_BEGIN POST +global $post_info, $tp, $iphost; +$ret = ""; +$ret = $tp->toHTML($post_info["thread_thread"], TRUE, "", 'class:'.$post_info["user_class"]); +if (ADMIN && $iphost) { +$ret .= "
    ".$iphost; +} +return $ret; +SC_END + +SC_BEGIN PRIVMESSAGE +global $post_info, $tp; +if($post_info['user_id'] > 0){ + return $tp->parseTemplate("{SENDPM={$post_info['user_id']}}"); +} +SC_END + +SC_BEGIN AVATAR +global $post_info; +if ($post_info['user_id']) { +if ($post_info["user_image"]) { +require_once(e_HANDLER."avatar_handler.php"); +return "

    "; +} else { +return ""; +} +} else { +return "".LAN_194.""; +} +SC_END + +SC_BEGIN ANON_IP +global $post_info; +//die($post_info['thread_user']); +$x = explode(chr(1), $post_info['thread_user']); +if($x[1] && ADMIN) +{ + return $x[1]; +} +SC_END + +SC_BEGIN POSTER +global $post_info, $tp; +if($post_info['user_name']) +{ + return "".$post_info['user_name'].""; +} +else +{ + $x = explode(chr(1), $post_info['thread_user']); + $tmp = explode(".", $x[0], 2); + if(!$tmp[1]) + { + return FORLAN_103; + } + else + { + return "".$tp->toHTML($tmp[1]).""; + } +} +SC_END + +SC_BEGIN EMAILIMG +global $post_info, $tp; +if($post_info['user_id']) +{ + return (!$post_info['user_hideemail'] ? $tp->parseTemplate("{EMAILTO={$post_info['user_email']}}") : ""); +} +return ""; +SC_END + +SC_BEGIN EMAILITEM +global $post_info, $tp; +if($post_info['thread_parent'] == 0) +{ + return $tp->parseTemplate("{EMAIL_ITEM=".FORLAN_101."^plugin:forum.{$post_info['thread_id']}}"); +} +SC_END + +SC_BEGIN PRINTITEM +global $post_info, $tp; +if($post_info['thread_parent'] == 0) +{ + return $tp->parseTemplate("{PRINT_ITEM=".FORLAN_102."^plugin:forum.{$post_info['thread_id']}}"); +} +SC_END + +SC_BEGIN SIGNATURE +global $post_info, $tp; +return ($post_info['user_signature'] ? "

    ".$tp->toHTML($post_info['user_signature'],TRUE)."" : ""); +SC_END + +SC_BEGIN PROFILEIMG +global $post_info, $tp; +if (USER && $post_info['user_id']) { +return $tp->parseTemplate("{PROFILE={$post_info['user_id']}}"); +} else { +return ""; +} +SC_END + +SC_BEGIN POSTS +global $post_info; +if ($post_info['user_id']) { +return LAN_67.": ".$post_info['user_forums']."
    "; +} +SC_END + +SC_BEGIN VISITS +global $post_info; +if ($post_info['user_id']) { +return LAN_09.": ".$post_info['user_visits']."
    "; +} +SC_END + +SC_BEGIN EDITIMG +global $post_info, $thread_info, $thread_id; +if ($post_info['user_id'] != '0' && $post_info['user_name'] === USERNAME && $thread_info['head']['thread_active']) { +return "".IMAGE_edit." "; +} else { +return ""; +} +SC_END + +SC_BEGIN CUSTOMTITLE +global $post_info, $tp; +if ($post_info['user_customtitle']) { +return $tp->toHTML($post_info['user_customtitle'])."
    "; +} +SC_END + +SC_BEGIN WEBSITE +global $post_info, $tp; +if ($post_info['user_homepage']) { +return LAN_08.": ".$post_info['user_homepage']."
    "; +} +SC_END + +SC_BEGIN WEBSITEIMG +global $post_info; +if ($post_info['user_homepage'] && $post_info['user_homepage'] != "http://") { +return "".IMAGE_website.""; +} +SC_END + +SC_BEGIN QUOTEIMG +global $thread_info, $post_info, $forum_info; +if (check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass']) && $thread_info["head"]["thread_active"]) { +return "".IMAGE_quote.""; +} +SC_END + +SC_BEGIN REPORTIMG +global $post_info, $from; +if (USER) { +return "".IMAGE_report." "; +} +SC_END + +SC_BEGIN RPG +global $post_info; +return rpg($post_info['user_join'],$post_info['user_forums']); +SC_END + +SC_BEGIN MEMBERID +global $post_info, $ldata, $pref, $forum_info; +if ($post_info['anon']) { +return ""; +} + +$fmod = ($post_info['user_class'] != "" && check_class($forum_info['forum_moderators'], $post_info['user_class'], TRUE)); +if(!$fmod && $forum_info['forum_moderators'] == e_UC_ADMIN) +{ + $fmod = $post_info['user_admin']; +} +if (!array_key_exists($post_info['user_id'],$ldata)) { + $ldata[$post_info['user_id']] = get_level($post_info['user_id'], $post_info['user_forums'], $post_info['user_comments'], $post_info['user_chats'], $post_info['user_visits'], $post_info['user_join'], $post_info['user_admin'], $post_info['user_perms'], $pref, $fmod); +} +return $ldata[$post_info['user_id']][0]; +SC_END + +SC_BEGIN LEVEL +global $post_info, $ldata, $pref, $forum_info; +if ($post_info['anon']) { +return ""; +} +$fmod = ($post_info['user_class'] != "" && check_class($forum_info['forum_moderators'], $post_info['user_class'], TRUE)); +if(!$fmod && $forum_info['forum_moderators'] == e_UC_ADMIN) +{ + $fmod = $post_info['user_admin']; +} +if (!array_key_exists($post_info['user_id'],$ldata)) { +$ldata[$post_info['user_id']] = get_level($post_info['user_id'], $post_info['user_forums'], $post_info['user_comments'], $post_info['user_chats'], $post_info['user_visits'], $post_info['user_join'], $post_info['user_admin'], $post_info['user_perms'], $pref, $fmod); +} +if($parm == 'pic') +{ +return $ldata[$post_info['user_id']]['pic']; +} +if($parm == 'name') +{ +return $ldata[$post_info['user_id']]['name']; +} +if($parm == 'special') +{ +return $ldata[$post_info['user_id']]['special']; +} +if($parm == 'userid') +{ +return $ldata[$post_info['user_id']]['userid']; +} +return $ldata[$post_info['user_id']][1]; +SC_END + +SC_BEGIN MODOPTIONS +if (MODERATOR) { +return showmodoptions(); +} +SC_END + +SC_BEGIN LASTEDIT +global $post_info, $gen; +if ($post_info['thread_edit_datestamp']) { +return $gen->convert_date($post_info['thread_edit_datestamp'],'forum'); +} +return ""; +SC_END + +SC_BEGIN POLL +global $pollstr; +return $pollstr; +SC_END + +*/ +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_sql.php b/e107_plugins/forum/forum_sql.php new file mode 100644 index 000000000..702477c5d --- /dev/null +++ b/e107_plugins/forum/forum_sql.php @@ -0,0 +1,39 @@ +CREATE TABLE forum ( + forum_id int(10) unsigned NOT NULL auto_increment, + forum_name varchar(250) NOT NULL default '', + forum_description text NOT NULL, + forum_parent int(10) unsigned NOT NULL default '0', + forum_sub int(10) unsigned NOT NULL default '0', + forum_datestamp int(10) unsigned NOT NULL default '0', + forum_moderators text NOT NULL, + forum_threads int(10) unsigned NOT NULL default '0', + forum_replies int(10) unsigned NOT NULL default '0', + forum_lastpost_user varchar(200) NOT NULL default '', + forum_lastpost_info varchar(40) NOT NULL default '', + forum_class varchar(100) NOT NULL default '', + forum_order int(10) unsigned NOT NULL default '0', + forum_postclass tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (forum_id) + ) TYPE=MyISAM AUTO_INCREMENT=1 + +CREATE TABLE forum_t ( + thread_id int(10) unsigned NOT NULL auto_increment, + thread_name varchar(250) NOT NULL default '', + thread_thread text NOT NULL, + thread_forum_id int(10) unsigned NOT NULL default '0', + thread_datestamp int(10) unsigned NOT NULL default '0', + thread_parent int(10) unsigned NOT NULL default '0', + thread_user varchar(250) NOT NULL default '', + thread_views int(10) unsigned NOT NULL default '0', + thread_active tinyint(3) unsigned NOT NULL default '0', + thread_lastpost int(10) unsigned NOT NULL default '0', + thread_s tinyint(1) unsigned NOT NULL default '0', + thread_edit_datestamp int(10) unsigned NOT NULL default '0', + thread_lastuser varchar(30) NOT NULL default '', + thread_total_replies int(10) unsigned NOT NULL default '0', + PRIMARY KEY (thread_id), + KEY thread_parent (thread_parent), + KEY thread_datestamp (thread_datestamp), + KEY thread_forum_id (thread_forum_id) + ) TYPE=MyISAM AUTO_INCREMENT=1; + diff --git a/e107_plugins/forum/forum_stats.php b/e107_plugins/forum/forum_stats.php new file mode 100644 index 000000000..e459aaf4a --- /dev/null +++ b/e107_plugins/forum/forum_stats.php @@ -0,0 +1,371 @@ + db_Count("forum_t"); +$total_topics = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent=0"); +$total_replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent!=0"); +$total_views = $sql->db_Count("SELECT sum(thread_views) FROM ".MPREFIX."forum_t", "generic"); + +$firstpost = $sql -> db_Select("forum_t", "thread_datestamp", "thread_datestamp > 0 ORDER BY thread_datestamp ASC LIMIT 0,1"); +$fp = $sql -> db_Fetch(); + +$open_ds = $fp['thread_datestamp']; +$open_date = $gen->convert_date($open_ds, "long"); +$open_since = $gen -> computeLapse($open_ds); +$open_days = floor((time()-$open_ds) / 86400); +$postsperday = ($open_days < 1 ? $total_posts : round($total_posts / $open_days)); + +$query = "SHOW TABLE STATUS FROM $mySQLdefaultdb"; +$sql -> db_Select_gen($query); +$array = $sql -> db_getList(); +foreach($array as $table) +{ + if($table['Name'] == MPREFIX."forum_t") + { + $db_size = parsesize($table['Data_length']); + $avg_row_len = parsesize($table['Avg_row_length']); + break; + } +} + + +$query = " +SELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_class, u.user_name FROM #forum_t as ft +LEFT JOIN #user AS u ON ft.thread_user = u.user_id +LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id +WHERE ft.thread_parent = 0 +AND ft.thread_active != 0 +AND f.forum_class IN (".USERCLASS_LIST.") +ORDER BY thread_total_replies DESC LIMIT 0,10"; +$sql -> db_Select_gen($query); +$most_activeArray = $sql -> db_getList(); + +$query = " +SELECT ft.*, f.forum_class, user_name FROM #forum_t as ft +LEFT JOIN #user AS u ON ft.thread_user = u.user_id +LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id +WHERE ft.thread_parent=0 +AND f.forum_class IN (".USERCLASS_LIST.") +ORDER BY thread_views DESC LIMIT 0,10"; + +$sql -> db_Select_gen($query); +$most_viewedArray = $sql -> db_getList(); + +$sql->db_Select("user", "user_id, user_name, user_forums", "ORDER BY user_forums DESC LIMIT 0, 10", "no_where"); +$posters = $sql -> db_getList(); +$top_posters = array(); +foreach($posters as $poster) +{ + $percen = round(($poster['user_forums'] / $total_posts) * 100, 2); + $top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['user_forums'], "percentage" => $percen); +} + +$query = " +SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft +LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id +WHERE ft.thread_parent=0 +GROUP BY t_user +ORDER BY ucount DESC +LIMIT 0,10"; +$sql -> db_Select_gen($query); +$posters = $sql -> db_getList(); +$top_topic_starters = array(); +foreach($posters as $poster) +{ + $percen = round(($poster['ucount'] / $total_topics) * 100, 2); + $top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen); +} + +$query = " +SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft +LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id +WHERE ft.thread_parent!=0 +GROUP BY t_user +ORDER BY ucount DESC +LIMIT 0,10"; +$sql -> db_Select_gen($query); +$posters = $sql -> db_getList(); + +$top_repliers = array(); +foreach($posters as $poster) +{ + $percen = round(($poster['ucount'] / $total_replies) * 100, 2); + $top_repliers[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen); +} + + + +$text = " +
    + + + + + + + + +
    ".FSLAN_1."
    + + + + + + + + + + + + +
    ".FSLAN_2.":  $open_date
    ".FSLAN_3.":  $open_since
    ".FSLAN_4.":  $total_posts
    ".FSLAN_5.":  $total_topics
    ".FSLAN_6.":  $total_replies
    ".FSLAN_7.":  $total_views
    ".FSLAN_24.":  $postsperday
    ".FSLAN_8.":  $db_size
    ".FSLAN_9.":  $avg_row_len
    +
    +
    + +
    + + + + + + + + + + + +"; + +$count=1; +foreach($most_activeArray as $ma) +{ + if($ma['user_name']) + { + $uinfo = "{$ma['user_name']}"; + } + else + { + $tmp = explode(chr(1), $ma['thread_anon']); + $uinfo = $tp->toHTML($tmp[0]); + } + + $text .= " + + + + + + + "; + $count++; +} +$text .= "
    ".FSLAN_10."
    ".FSLAN_11."".FSLAN_12."".FSLAN_13."".FSLAN_14."".FSLAN_15."
    $count{$ma['thread_name']}{$ma['thread_total_replies']}{$uinfo}".$gen->convert_date($ma['thread_datestamp'], "forum")."
    +
    + +
    + + + + + + + + + + + +"; + +$count=1; +foreach($most_viewedArray as $ma) +{ + extract($ma); + $text .= " + + + + + + + "; + $count++; +} +$text .= "
    ".FSLAN_16."
    ".FSLAN_11."".FSLAN_12."".FSLAN_17."".FSLAN_14."".FSLAN_15."
    $count$thread_name$thread_views$user_name".$gen->convert_date($thread_datestamp, "forum")."
    +
    + +
    + + + + + + + + + + + +"; + +$count=1; +foreach($top_posters as $ma) +{ + extract($ma); + $text .= " + + + + + + + "; + $count++; +} +$text .= " +
    ".FSLAN_18."
    ".FSLAN_11."".FSLAN_19."".FSLAN_20."% 
    $count$user_name$user_forums$percentage% + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + +"; + +$count=1; +foreach($top_topic_starters as $ma) +{ + extract($ma); + $text .= " + + + + + + + "; + $count++; +} +$text .= "
    ".FSLAN_21."
    ".FSLAN_11."".FSLAN_19."".FSLAN_20."% 
    $count$user_name$user_forums$percentage% + +
    +
    +
    + +
    +
    + + +
    + + + + + + + + + + + +"; + +$count=1; +foreach($top_repliers as $ma) +{ + extract($ma); + $text .= " + + + + + + + "; + $count++; +} +$text .= "
    ".FSLAN_22."
    ".FSLAN_11."".FSLAN_19."".FSLAN_20."% 
    $count$user_name$user_forums$percentage% + +
    +
    +
    + +
    +
    +"; + + +$ns -> tablerender(FSLAN_23, $text); + + +require_once(FOOTERF); + +function parsesize($size) { + $kb = 1024; + $mb = 1024 * $kb; + $gb = 1024 * $mb; + $tb = 1024 * $gb; + if(!$size) + { + return '0'; + } + if ($size < $kb) { + return $size." b"; + } + else if($size < $mb) { + return round($size/$kb, 2)." kb"; + } + else if($size < $gb) { + return round($size/$mb, 2)." mb"; + } + else if($size < $tb) { + return round($size/$gb, 2)." gb"; + } else { + return round($size/$tb, 2)." tb"; + } +} + + +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_test.php b/e107_plugins/forum/forum_test.php new file mode 100644 index 000000000..5db440de2 --- /dev/null +++ b/e107_plugins/forum/forum_test.php @@ -0,0 +1,21 @@ +update_lastpost('thread',$i); +//} + +set_time_limit(240); +$forum->update_lastpost('forum', 'all'); +//$x = $forum->update_lastpost('forum',16); + + +$timeend = microtime(); +$diff = number_format(((substr($timeend, 0, 9)) + (substr($timeend, -10)) - (substr($timestart, 0, 9)) - (substr($timestart, -10))), 4); +echo "
    script generation took $diff s"; + +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_update.php b/e107_plugins/forum/forum_update.php new file mode 100644 index 000000000..bfea2f6e4 --- /dev/null +++ b/e107_plugins/forum/forum_update.php @@ -0,0 +1,173 @@ +db_Select("plugin", "plugin_version", "plugin_name = 'Forum'")) +{ + $row = $sql->db_Fetch(); + $forum_version = $row['plugin_version']; +} + + +$forum_subs = FALSE; +$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."forum"); +$columns = mysql_num_fields($fields); +for ($i = 0; $i < $columns; $i++) +{ + if("forum_sub" == mysql_field_name($fields, $i)) + { + $forum_subs = TRUE; + } +} + +$text = ""; +if(!$forum_subs) +{ + $text .= forum_stage1(); + $text .= forum_stage2(); + $text .= forum_stage3(); + $text .= forum_stage4(); + $text .= forum_stage5(); + $text .= forum_stage6(); +} + +if($forum_version < 1.2) +{ + $text .= mods_to_userclass(); +} +$text .= set_forum_version(); + +$timeend = microtime(); +$diff = number_format(((substr($timeend, 0, 9)) + (substr($timeend, -10)) - (substr($timestart, 0, 9)) - (substr($timestart, -10))), 4); +$text .= "
    script generation took $diff s"; + +if ($pref['developer']) { + $ns->tablerender('forum upgrade',$text); +} + +function forum_stage1() +{ + global $sql; + $ttab = MPREFIX.'forum_t'; + $sql->db_Select_gen("ALTER TABLE #forum_t ADD thread_edit_datestamp int(10) unsigned NOT NULL default '0'"); + $sql->db_Select_gen("ALTER TABLE #forum_t ADD thread_lastuser varchar(30) NOT NULL default ''"); + $sql->db_Select_gen("ALTER TABLE #forum_t ADD thread_total_replies int(10) unsigned NOT NULL default '0'"); + $sql->db_Select_gen("ALTER TABLE #forum ADD forum_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;"); + $sql->db_Select_gen("ALTER TABLE #forum ADD `forum_sub` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `forum_parent` ;"); + return "Updated table structure
    "; +} + +function forum_stage2() +{ + global $sql; + $ttab = MPREFIX.'forum_t'; +// $numrows = $sql->db_Update('forum_t', "thread_anon = SUBSTRING(thread_user,3) WHERE thread_user LIKE '0.%'"); + $numrows = $sql->db_Update('forum_t', "thread_user = CAT('0.', thread_anon) WHERE thread_user = '0'"); + return $ret."Updated anonymous post info ... $numrows rows updated
    "; +} + +function forum_stage3() +{ + global $sql; + $sql->db_Select_gen("ALTER TABLE #forum_t CHANGE thread_user thread_user varchar(250) NOT NULL default ''"); + $sql->db_Select_gen("ALTER TABLE #forum_t DROP thread_anon"); + return "Updated thread_user & forum_anon field
    "; +} + +function forum_stage4() +{ + global $sql, $forum; + $sql->db_Select_gen("SELECT thread_parent AS id, COUNT(*) AS amount FROM #forum_t WHERE thread_parent !=0 GROUP BY thread_parent"); + $threadArray = $sql->db_getList('ALL', FALSE, 0); + foreach($threadArray as $threads) + { + extract($threads); + $sql->db_Update("forum_t", "thread_total_replies=$amount WHERE thread_id=$id"); + } + + $ret = "Updated thread reply info...".count($threadArray). " threads updated.
    "; + $forum = new e107forum; + $forum->forum_update_counts('all'); + return $ret."Updated forum thread count info.
    "; +} + +function forum_stage5() +{ + global $sql, $forum; + $sql->db_Select_gen("ALTER TABLE #forum CHANGE forum_lastpost forum_lastpost_user varchar(200) NOT NULL default ''"); + $sql->db_Select_gen("ALTER TABLE #forum ADD forum_lastpost_info varchar(40) NOT NULL default '' AFTER forum_lastpost_user"); + set_time_limit(180); + $forum->update_lastpost('forum', 'all', TRUE); + return "Updated lastpost info
    "; +} + +function forum_stage6() +{ + global $sql; + global $PLUGINS_DIRECTORY; + if(!$sql->db_Count('plugin','(*)',"WHERE plugin_name = 'Forum'")) + { + $sql->db_Insert('plugin',"0,'Forum','1.1','forum',1"); + return "Forum entry added to plugin table, set as installed.
    "; + } + else + { + $sql->db_Update('plugin',"plugin_installflag = 1 WHERE plugin_name='Forum'"); + } + $sql->db_Update('links',"link_url='{$PLUGINS_DIRECTORY}forum/forum.php' WHERE link_name='Forum'"); + +} + +function mods_to_userclass() +{ + global $sql; + require_once(e_HANDLER."userclass_class.php"); + $_uc = new e_userclass; + if($sql->db_Select("forum", "forum_id, forum_moderators","forum_parent != 0")) + { + $fList = $sql->db_getList(); + foreach($fList as $row) + { + if(!is_numeric($row['forum_moderators'])) + { + $newclass = $_uc->class_create($row['forum_moderators'], "FORUM_MODS_"); + $sql->db_Update("forum", "forum_moderators = '{$newclass}' WHERE forum_id = '{$row['forum_id']}'"); + } + } + } + return "Forum moderators converted to userclasses
    "; +} + +function set_forum_version() +{ + global $sql; + $new_version = "1.2"; + $sql->db_Update('plugin',"plugin_version = '{$new_version}' WHERE plugin_name='Forum'"); + return "Forum Version updated to version: $new_version
    "; +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_update_check.php b/e107_plugins/forum/forum_update_check.php new file mode 100644 index 000000000..490a05ce0 --- /dev/null +++ b/e107_plugins/forum/forum_update_check.php @@ -0,0 +1,73 @@ +db_Select("plugin", "plugin_version", "plugin_name = 'Forum'")) + { + $row = $sql->db_Fetch(); + if($row['plugin_version'] < 1.2) + { + return FALSE; + } + } + $fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."forum"); + if(!$fields) + { + return TRUE; + } + $columns = mysql_num_fields($fields); + for ($i = 0; $i < $columns; $i++) + { + if ("forum_lastpost_info" == mysql_field_name($fields, $i)) + { + $flist = mysql_list_fields($mySQLdefaultdb, MPREFIX."forum_t"); + $cols = mysql_num_fields($flist); + for ($x = 0; $x < $cols; $x++) + { + if("thread_anon" == mysql_field_name($flist, $x)) + { + return FALSE; //needed + } + } + } + if("forum_sub" == mysql_field_name($fields, $i)) + { + return TRUE; //not needed + } + } + return FALSE; //needed + } +} + +?> + \ No newline at end of file diff --git a/e107_plugins/forum/forum_uploads.php b/e107_plugins/forum/forum_uploads.php new file mode 100644 index 000000000..05f43f353 --- /dev/null +++ b/e107_plugins/forum/forum_uploads.php @@ -0,0 +1,121 @@ +tablerender(FRMUP_4, $msg); +} + +$fi = new e_file; +$mask = ".*_".USERID."_FT.*"; +$fileList = $fi->get_files(e_FILE."public", $mask); +if($sql->db_Select('forum_t','thread_id, thread_thread, thread_parent', "thread_thread REGEXP '.*_".USERID."_FT.*'")) +{ + $threadList = $sql->db_getList(); +} + +$filecount = 0; +if(is_array($fileList)) +{ + $txt = " +
    + + + + + "; + foreach($fileList as $finfo) + { + if($finfo['fname']) + { + $filecount++; + $txt .= ""; + $found = FALSE; + if(is_array($threadList)) + { + foreach($threadList as $tinfo) + { + if(strpos($tinfo['thread_thread'], $finfo['fname']) != FALSE) + { + $found = $tinfo; + break; + } + } + } + if($found != FALSE) + { + if($tinfo['thread_parent']) + { + $txt .= ""; + } + else + { + $txt .= ""; + } + + } + else + { + $txt .= ""; + } + $txt .= ""; + } + } + $txt .= "
    ".FRMUP_5."".FRMUP_6."
    {$finfo['fname']}".FRMUP_7.": {$tinfo['thread_parent']}".FRMUP_7.": {$tinfo['thread_id']}".FRMUP_8."
    "; +} +if(!$filecount) { + $ns->tablerender(FRMUP_1,FRMUP_9); + include_once(FOOTERF); + exit; +} + +$ns->tablerender(FRMUP_1, $txt); +include_once(FOOTERF); + diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php new file mode 100644 index 000000000..a3096287f --- /dev/null +++ b/e107_plugins/forum/forum_viewforum.php @@ -0,0 +1,521 @@ +forum_get($forum_id); + +if (!check_class($forum_info['forum_class']) || !check_class($forum_info['parent_class']) || !$forum_info['forum_parent']) +{ + header("Location:".e_PLUGIN."forum/forum.php"); + exit; +} + +if (!$FORUM_VIEW_START) { + if (file_exists(THEME."forum_viewforum_template.php")) + { + require_once(THEME."forum_viewforum_template.php"); + } + else if (file_exists(THEME."forum_template.php")) + { + require_once(THEME."forum_template.php"); + } + else + { + require_once(e_PLUGIN."forum/templates/forum_viewforum_template.php"); + } +} + + +$forum_info['forum_name'] = $tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook, emotes_off'); +$forum_info['forum_description'] = $tp->toHTML($forum_info['forum_description'], TRUE, 'no_hook'); + +$_forum_name = (substr($forum_info['forum_name'], 0, 1) == "*" ? substr($forum_info['forum_name'], 1) : $forum_info['forum_name']); +define("e_PAGETITLE", LAN_01." / ".$_forum_name); +define("MODERATOR", $forum_info['forum_moderators'] != "" && check_class($forum_info['forum_moderators'])); +$modArray = $forum->forum_getmods($forum_info['forum_moderators']); +$message = ""; +if (MODERATOR) +{ + if ($_POST) + { + require_once(e_PLUGIN."forum/forum_mod.php"); + $message = forum_thread_moderate($_POST); + } +} + +$member_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id!='0' "); +$guest_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id='0' "); +$users = $member_users+$guest_users; + +require_once(HEADERF); +$text=''; +if ($message) +{ + $ns->tablerender("", $message, array('forum_viewforum', 'msg')); +} + +$topics = $forum->forum_get_topic_count($forum_id); + +if ($topics > $view) +{ + $pages = ceil($topics/$view); +} +else +{ + $pages = FALSE; +} + +if ($pages) +{ + if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== FALSE || strpos($FORUM_VIEW_END, 'THREADPAGES') !== FALSE) + { + $parms = "{$topics},{$view},{$thread_from},".e_SELF.'?'.$forum_id.'.[FROM],off'; + $THREADPAGES = LAN_316." ".$tp->parseTemplate("{NEXTPREV={$parms}}"); + } +} + +if (check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass'])) +{ + $NEWTHREADBUTTON = "".IMAGE_newthread.""; +} + +if(substr($forum_info['forum_name'], 0, 1) == "*") +{ + $forum_info['forum_name'] = substr($forum_info['forum_name'], 1); + $container_only = true; +} +else +{ + $container_only = false; +} + +if(substr($forum_info['sub_parent'], 0, 1) == "*") +{ + $forum_info['sub_parent'] = substr($forum_info['sub_parent'], 1); +} + +$forum->set_crumb(); // set $BREADCRUMB (and $BACKLINK) + +$FORUMTITLE = $forum_info['forum_name']; +//$MODERATORS = LAN_404.": ".$forum_info['forum_moderators']; +$MODERATORS = LAN_404.": ".implode(", ", $modArray); +$BROWSERS = $users." ".($users == 1 ? LAN_405 : LAN_406)." (".$member_users." ".($member_users == 1 ? LAN_407 : LAN_409).", ".$guest_users." ".($guest_users == 1 ? LAN_408 : LAN_410).")"; + +$ICONKEY = " + + + + + + + + + + + + + + + + + + + + + +
    ".IMAGE_new_small."".LAN_79."".IMAGE_nonew_small."".LAN_80."".IMAGE_sticky_small."".LAN_202."".IMAGE_announce_small."".LAN_396."
    ".IMAGE_new_popular_small."".LAN_79." ".LAN_395."".IMAGE_nonew_popular_small."".LAN_80." ".LAN_395."".IMAGE_stickyclosed_small."".LAN_203."".IMAGE_closed_small."".LAN_81."
    "; + +$SEARCH = " + +

    + + + + +

    +
    "; + +if(check_class($forum_info['forum_postclass'])) +{ + $PERMS = LAN_204." - ".LAN_206." - ".LAN_208; +} +else +{ + $PERMS = LAN_205." - ".LAN_207." - ".LAN_209; +} + +$sticky_threads = 0; +$stuck = FALSE; +$reg_threads = 0; +$unstuck = FALSE; + +$thread_list = $forum->forum_get_topics($forum_id, $thread_from, $view); +$sub_list = $forum->forum_getsubs($forum_id); +//print_a($sub_list); +$gen = new convert; + +$SUBFORUMS = ""; +if(is_array($sub_list)) +{ + $newflag_list = $forum->forum_newflag_list(); + $sub_info = ""; + foreach($sub_list as $sub) + { + $sub_info .= parse_sub($sub); + } + $SUBFORUMS = $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END; +} + + +if (count($thread_list) ) +{ + foreach($thread_list as $thread_info) { + $idArray[] = $thread_info['thread_id']; + } + $inList = '('.implode(',', $idArray).')'; + foreach($thread_list as $thread_info) { + if ($thread_info['thread_s']) { + $sticky_threads ++; + } + if ($sticky_threads > 0 && !$stuck && $pref['forum_hilightsticky']) + { + if($FORUM_IMPORTANT_ROW) + { + $forum_view_forum .= $FORUM_IMPORTANT_ROW; + } + else + { + $forum_view_forum .= " ".LAN_411.""; + } + $stuck = TRUE; + } + if (!$thread_info['thread_s']) + { + $reg_threads ++; + } + if ($reg_threads == "1" && !$unstuck && $stuck) + { + if($FORUM_NORMAL_ROW) + { + $forum_view_forum .= $FORUM_NORMAL_ROW; + } + else + { + $forum_view_forum .= " ".LAN_412.""; + } + $unstuck = TRUE; + } + $forum_view_forum .= parse_thread($thread_info); + } +} +else +{ + $forum_view_forum .= "".LAN_58.""; +} + +$sql->db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' "); +$FORUMJUMP = forumjump(); +$TOPLINK = "".LAN_02.""; + +if($container_only) +{ + $FORUM_VIEW_START = ($FORUM_VIEW_START_CONTAINER ? $FORUM_VIEW_START_CONTAINER : $FORUM_VIEW_START); + $FORUM_VIEW_END = ($FORUM_VIEW_END_CONTAINER ? $FORUM_VIEW_END_CONTAINER : $FORUM_VIEW_END); + $forum_view_forum = ""; +} + +$forum_view_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_START); +$forum_view_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_END); + + +if ($pref['forum_enclose']) +{ + $ns->tablerender($pref['forum_title'], $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1')); +} +else +{ + echo $forum_view_start.$forum_view_forum.$forum_view_end; +} + +echo ""; + +require_once(FOOTERF); + + +function parse_thread($thread_info) +{ + global $forum, $tp, $FORUM_VIEW_FORUM, $gen, $pref, $forum_id, $menu_pref; + $text = ""; + $VIEWS = $thread_info['thread_views']; + $REPLIES = $thread_info['thread_total_replies']; + + + if ($REPLIES) + { + $lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum'); + $tmp = explode(".", $thread_info['thread_lastuser'], 2); + if($thread_info['lastpost_username']) + { + $LASTPOST = "".$thread_info['lastpost_username'].""; + } + else + { + if($tmp[1]) + { + $LASTPOST = $tp->toHTML($tmp[1]); + } + else + { + $LASTPOST = FORLAN_19; + } + } + $LASTPOST .= "
    ".$lastpost_datestamp; + } + else + { + $REPLIES = LAN_317; + $LASTPOST = " - "; + } + + $newflag = FALSE; + if (USER) + { + if ($thread_info['thread_lastpost'] > USERLV && !preg_match("#\b".$thread_info['thread_id']."\b#", USERVIEWED)) + { + $newflag = TRUE; + } + } + + $THREADDATE = $gen->convert_date($thread_info['thread_datestamp'], 'forum'); + $ICON = ($newflag ? IMAGE_new : IMAGE_nonew); + if ($REPLIES >= $pref['forum_popular'] && $REPLIES != "None") { + $ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular); + } + + $THREADTYPE = ''; + if ($thread_info['thread_s'] == 1) + { + $ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed); + $THREADTYPE = '['.LAN_202.']
    '; + } + elseif($thread_info['thread_s'] == 2) + { + $ICON = IMAGE_announce; + $THREADTYPE = '['.LAN_396.']
    '; + } + elseif(!$thread_info['thread_active']) + { + $ICON = IMAGE_closed; + } + + $thread_name = strip_tags($tp->toHTML($thread_info['thread_name'], false, 'no_hook, emotes_off')); + if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE)))) { + $thread_name = substr($thread_name, strlen($THREADTYPE)); + } + if ($pref['forum_tooltip']) { + $thread_thread = strip_tags($tp->toHTML($thread_info['thread_thread'], true, 'no_hook')); + $tip_length = ($pref['forum_tiplength'] ? $pref['forum_tiplength'] : 400); + if (strlen($thread_thread) > $tip_length) { + $thread_thread = substr($thread_thread, 0, $tip_length)." ".$menu_pref['newforumposts_postfix']; + } + $thread_thread = str_replace("'", "'", $thread_thread); + $title = "title='".$thread_thread."'"; + } else { + $title = ""; + } + $THREADNAME = "{$thread_name}"; + + $pages = ceil(($REPLIES+1)/$pref['forum_postspage']); + if ($pages > 1) + { + if($pages > 6) + { + for($a = 0; $a <= 2; $a++) + { + $PAGES .= $PAGES ? " " : ""; + $PAGES .= "".($a+1).""; + } + $PAGES .= " ... "; + for($a = $pages-3; $a <= $pages-1; $a++) + { + $PAGES .= $PAGES ? " " : ""; + $PAGES .= "".($a+1).""; + } + } + else + { + for($a = 0; $a <= ($pages-1); $a++) + { + $PAGES .= $PAGES ? " " : ""; + $PAGES .= "".($a+1).""; + } + } + $PAGES = LAN_316." [ ".$PAGES." ]"; + } + else + { + $PAGES = ""; + } + + if (MODERATOR) + { + $thread_id = $thread_info['thread_id']; + $ADMIN_ICONS = " +
    + "; + + $ADMIN_ICONS .= " \n"; + + $ADMIN_ICONS .= ($thread_info['thread_s'] == 1) ? " " : + " "; + $ADMIN_ICONS .= ($thread_info['thread_active']) ? " " : + " "; + $ADMIN_ICONS .= "".IMAGE_admin_move.""; + $ADMIN_ICONS .= " +
    + "; + } + + $text .= " + ".$THREADDATE."
    + "; + $tmp = explode(".", $thread_info['thread_user'], 2); + if($thread_info['user_name']) + { + $POSTER = "".$thread_info['user_name'].""; + } + else + { + if($tmp[1]) + { + $x = explode(chr(1), $tmp[1]); + $POSTER = $tp->toHTML($x[0]); + } + else + { + $POSTER = FORLAN_19; + } + } + + if ($thread_info['thread_s'] == 1 && $FORUM_VIEW_FORUM_STICKY) + { + return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_STICKY)); + } + + if ($thread_info['thread_s'] == 2 && $FORUM_VIEW_FORUM_ANNOUNCE) + { + return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_ANNOUNCE)); + } + + return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM)); +} + +function parse_sub($subInfo) +{ + global $FORUM_VIEW_SUB, $gen, $tp, $newflag_list; + $SUB_FORUMTITLE = "{$subInfo['forum_name']}"; + $SUB_DESCRIPTION = $tp->toHTML($subInfo['forum_description'], false, 'no_hook'); + $SUB_THREADS = $subInfo['forum_threads']; + $SUB_REPLIES = $subInfo['forum_replies']; + if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list)) + { + $NEWFLAG = "".IMAGE_new.""; + } + else + { + $NEWFLAG = IMAGE_nonew; + } + + if($subInfo['forum_lastpost_info']) + { + $tmp = explode(".", $subInfo['forum_lastpost_info']); + $lp_thread = "".IMAGE_post2.""; + $lp_date = $gen->convert_date($tmp[0], 'forum'); + $tmp = explode(".", $subInfo['forum_lastpost_user']); + if($subInfo['user_name']) + { + $lp_name = "{$subInfo['user_name']}"; + } + else + { + $lp_name = $tmp[1]; + } + $SUB_LASTPOST = $lp_date."
    ".$lp_name." ".$lp_thread; + } + else + { + $SUB_LASTPOST = "-"; + } + return (preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_SUB)); +} + +function forumjump() +{ + global $forum; + $jumpList = $forum->forum_get_allowed(); + $text = "

    ".LAN_403.":     ".LAN_02."

    "; + return $text; +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php new file mode 100644 index 000000000..25f399164 --- /dev/null +++ b/e107_plugins/forum/forum_viewtopic.php @@ -0,0 +1,512 @@ +thread_postnum($thread_id); + $pages = ceil(($post_num['post_num']+1)/$pref['forum_postspage']); + $topic_from = ($pages-1) * $pref['forum_postspage']; + if($post_num['parent'] != $thread_id) + { + header("location: ".e_SELF."?{$post_num['parent']}.{$topic_from}#post_{$thread_id}"); + exit; + } + } + else + { + header("Location:".e_PLUGIN."forum/forum.php"); + exit; + } +} + +require_once(e_PLUGIN.'forum/forum_shortcodes.php'); + +if ($action == "track" && USER) +{ + $forum->track($thread_id); + header("location:".e_SELF."?{$thread_id}.{$topic_from}"); + exit; +} + +if ($action == "untrack" && USER) +{ + $forum->untrack($thread_id); + header("location:".e_SELF."?{$thread_id}.{$topic_from}"); + exit; +} + +if ($action == "next") +{ + $next = $forum->thread_getnext($thread_id, $topic_from); + if ($next) + { + header("location:".e_SELF."?{$next}"); + exit; + } + else + { + require_once(HEADERF); + $ns->tablerender('', LAN_405, array('forum_viewtopic', '405')); + require_once(FOOTERF); + exit; + } +} + +if ($action == "prev") { + $prev = $forum->thread_getprev($thread_id, $topic_from); + if ($prev) { + header("location:".e_SELF."?{$prev}"); + exit; + } else { + require_once(HEADERF); + $ns->tablerender('', LAN_404, array('forum_viewtopic', '404')); + require_once(FOOTERF); + exit; + } + +} + +if ($action == "report") { + $thread_info = $forum->thread_get_postinfo($thread_id, TRUE); + + if (isset($_POST['report_thread'])) { + $report_add = $tp -> toDB($_POST['report_add']); + if ($pref['reported_post_email']) { + require_once(e_HANDLER."mail.php"); + $report = LAN_422.SITENAME." : ".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/").$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$thread_id.".post\n".LAN_425.USERNAME."\n".$report_add; + $subject = LAN_421." ".SITENAME; + sendemail(SITEADMINEMAIL, $subject, $report); + } + $sql->db_Insert('generic', "0, 'reported_post', ".time().", '".USERID."', '{$thread_info['head']['thread_name']}', ".intval($thread_id).", '{$report_add}'"); + define("e_PAGETITLE", LAN_01." / ".LAN_428); + require_once(HEADERF); + $text = LAN_424."

    ".LAN_429."tablerender(LAN_414, $text, array('forum_viewtopic', 'report')); + } else { + $thread_name = $tp -> toHTML($thread_info['head']['thread_name'], TRUE, 'no_hook, emotes_off'); + define("e_PAGETITLE", LAN_01." / ".LAN_426." ".$thread_name); + require_once(HEADERF); + $text = "
    + + + + + + + + + + + +
    + ".LAN_415.": ".$thread_name." ".LAN_420." + + +
    ".LAN_417."
    ".LAN_418." +
    + +

    + +
    "; + $ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report2')); + } + require_once(FOOTERF); + exit; +} +$pm_installed = ($pref['pm_title'] ? TRUE : FALSE); + +$replies = $forum->thread_count($thread_id)-1; +if ($topic_from === 'last') { + $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10); + $pages = ceil(($replies+1)/$pref['forum_postspage']); + $topic_from = ($pages-1) * $pref['forum_postspage']; +} +$gen = new convert; +$thread_info = $forum->thread_get($thread_id, $topic_from-1, $pref['forum_postspage']); + +if(intval($thread_info['head']['thread_forum_id']) == 0) +{ + require_once(HEADERF); + $ns->tablerender(LAN_01, FORLAN_104, array('forum_viewtopic', '104')); + require_once(FOOTERF); + exit; +} +$forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']); + + +if (!check_class($forum_info['forum_class']) || !check_class($forum_info['parent_class'])) { + header("Location:".e_PLUGIN."forum/forum.php"); + exit; +} + +$forum->thread_incview($thread_id); + +define("e_PAGETITLE", LAN_01." / ".$tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook, emotes_off')." / ".$tp->toHTML($thread_info['head']['thread_name'], TRUE, 'no_hook, emotes_off')); +//define("MODERATOR", (preg_match("/".preg_quote(ADMINNAME)."/", $forum_info['forum_moderators']) && getperms('A') ? TRUE : FALSE)); +define("MODERATOR", $forum_info['forum_moderators'] != "" && check_class($forum_info['forum_moderators'])); +$modArray = $forum->forum_getmods($forum_info['forum_moderators']); + +$message = ''; +if (MODERATOR) +{ + if ($_POST) + { + require_once(e_PLUGIN.'forum/forum_mod.php'); + $message = forum_thread_moderate($_POST); + $thread_info = $forum->thread_get($thread_id, $topic_from-1, $pref['forum_postspage']); + } +} + +require_once(HEADERF); +require_once(e_HANDLER."level_handler.php"); +if ($message) +{ + $ns->tablerender("", $message, array('forum_viewtopic', 'msg')); +} + +if (stristr($thread_info['head']['thread_name'], "[".LAN_430."]")) +{ + if(!defined("POLLCLASS")) + { + require(e_PLUGIN."poll/poll_class.php"); + } + $_qry = "SELECT * FROM #polls WHERE `poll_datestamp` = '{$thread_info['head']['thread_id']}'"; + $poll = new poll; + $pollstr = "
    ".$poll->render_poll($_qry, "forum", "query", TRUE)."
    "; +} +//Load forum templates + +if (!$FORUMSTART) { + if (file_exists(THEME."forum_viewtopic_template.php")) + { + require_once(THEME."forum_viewtopic_template.php"); + } + else if (file_exists(THEME."forum_template.php")) + { + require_once(THEME."forum_template.php"); + } + else + { + require_once(e_PLUGIN."forum/templates/forum_viewtopic_template.php"); + } +} + +$forum_info['forum_name'] = $tp -> toHTML($forum_info['forum_name'], TRUE,'no_hook,emotes_off'); + +// get info for main thread ------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +$forum->set_crumb(TRUE); // Set $BREADCRUMB (and BACKLINK) +$THREADNAME = $tp->toHTML($thread_info['head']['thread_name'], TRUE, 'no_hook, emotes_off'); +$NEXTPREV = "<<
    ".LAN_389.""; +$NEXTPREV .= " | "; +$NEXTPREV .= "".LAN_390." >>"; + +if ($pref['forum_track'] && USER) +{ + $TRACK = (strpos(USERREALM, "-".$thread_id."-") !== FALSE ? "".LAN_392."" : "".LAN_391.""); +} + +$MODERATORS = LAN_321.implode(", ", $modArray); + +$THREADSTATUS = (!$thread_info['head']['thread_active'] ? LAN_66 : ""); + +$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10); +$pages = ceil(($replies+1)/$pref['forum_postspage']); +if ($pages > 1) +{ + $parms = ($replies+1).",{$pref['forum_postspage']},{$topic_from},".e_SELF.'?'.$thread_id.'.[FROM],off'; + $GOTOPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}"); +} + +if ((check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass'])) || MODERATOR) +{ + if ($thread_info['head']['thread_active']) + { + $BUTTONS = "".IMAGE_reply.""; + } + $BUTTONS .= "".IMAGE_newthread.""; +} + +$POLL = $pollstr; + +$FORUMJUMP = forumjump(); + +$forstr = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMSTART); + +unset($forrep); +if (!$FORUMREPLYSTYLE) $FORUMREPLYSTYLE = $FORUMTHREADSTYLE; +$alt = FALSE; +for($i = 0; $i < count($thread_info)-1; $i++) +{ + unset($post_info); + $post_info = $thread_info[$i]; + $loop_uid = intval($post_info['user_id']); + if (!$post_info['thread_user']) + { + // guest + $tmp = explode(chr(1), $post_info['thread_anon']); + $ip = $tmp[1]; + $host = $e107->get_host_name($ip); + $post_info['iphost'] = ""; + $post_info['anon'] = TRUE; + } + else + { + $post_info['anon'] = FALSE; + } + $e_hide_query = "SELECT thread_id FROM #forum_t WHERE (`thread_parent` = {$thread_id} OR `thread_id` = {$thread_id}) AND SUBSTRING_INDEX(thread_user,'.',1) = ".USERID; + $e_hide_hidden = FORLAN_HIDDEN; + $e_hide_allowed = USER; + + if($post_info['thread_parent']) + { + $alt = !$alt; + if(isset($FORUMREPLYSTYLE_ALT) && $alt) + { + $forrep .= $tp->parseTemplate($FORUMREPLYSTYLE_ALT, TRUE, $forum_shortcodes)."\n"; + } + else + { + $forrep .= $tp->parseTemplate($FORUMREPLYSTYLE, TRUE, $forum_shortcodes)."\n"; + } + } + else + { + $forthr = $tp->parseTemplate($FORUMTHREADSTYLE, TRUE, $forum_shortcodes)."\n"; + } +} +unset($loop_uid); + +if (((check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass'])) || MODERATOR) && $thread_info['head']['thread_active'] ) +{ + if (!$forum_quickreply) + { + $QUICKREPLY = "\n

    \n".LAN_393.":

     \n\n\n

    \n
    "; + } + else + { + $QUICKREPLY = $forum_quickreply; + } +} + +$forend = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMEND); +$forumstring = $forstr.$forthr.$forrep.$forend; + + +if ($thread_info['head']['thread_lastpost'] > USERLV && (strpos(USERVIEWED, ".{$thread_info['head']['thread_id']}.") === FALSE)) { + $tst = $forum->thread_markasread($thread_info['head']['thread_id']); +} + +if ($pref['forum_enclose']) { + $ns->tablerender(LAN_01, $forumstring, array('forum_viewtopic', 'main')); +} else { + echo $forumstring; +} + + +// end ------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +echo ""; +require_once(FOOTERF); + +function showmodoptions() +{ + global $thread_id; + global $thread_info; + global $forum_info; + global $post_info; + $forum_id = $forum_info['forum_id']; + if ($post_info['thread_parent'] == FALSE) + { + $type = 'thread'; + $ret = "
    "; + } + else + { + $type = 'reply'; + $ret = ""; + } + + $ret .= " +
    + ".IMAGE_admin_edit." + + "; + if ($type == 'thread') + { + $ret .= "".IMAGE_admin_move2.""; + } + $ret .= " +
    +
    "; + return $ret; +} + +function forumjump() +{ + + global $forum; + $jumpList = $forum->forum_get_allowed(); + $text = "

    ".LAN_65.":     ".LAN_10."

    "; + return $text; +} + +function rpg($user_join, $user_forums) +{ + global $FORUMTHREADSTYLE; + if (strpos($FORUMTHREADSTYLE, '{RPG}') == FALSE) + { + return ''; + } + // rpg mod by Ikari ( kilokan1@yahoo.it | http://artemanga.altervista.org ) + + $lvl_post_mp_cost = 2.5; + $lvl_mp_regen_per_day = 4; + $lvl_avg_ppd = 5; + $lvl_bonus_redux = 5; + $lvl_user_days = max(1, round((time() - $user_join ) / 86400 )); + $lvl_ppd = $user_forums / $lvl_user_days; + if ($user_forums < 1) { + $lvl_level = 0; + } else { + $lvl_level = floor(pow(log10($user_forums ), 3 ) ) + 1; + } + if ($lvl_level < 1) { + $lvl_hp = "0 / 0"; + $lvl_hp_percent = 0; + } else { + $lvl_max_hp = floor((pow($lvl_level, (1/4) ) ) * (pow(10, pow($lvl_level+2, (1/3) ) ) ) / (1.5) ); + + if ($lvl_ppd >= $lvl_avg_ppd) { + $lvl_hp_percent = floor((.5 + (($lvl_ppd - $lvl_avg_ppd) / ($lvl_bonus_redux * 2)) ) * 100); + } else { + $lvl_hp_percent = floor($lvl_ppd / ($lvl_avg_ppd / 50) ); + } + if ($lvl_hp_percent > 100) { + $lvl_max_hp += floor(($lvl_hp_percent - 100) * pi() ); + $lvl_hp_percent = 100; + } else { + $lvl_hp_percent = max(0, $lvl_hp_percent); + } + $lvl_cur_hp = floor($lvl_max_hp * ($lvl_hp_percent / 100) ); + $lvl_cur_hp = max(0, $lvl_cur_hp); + $lvl_cur_hp = min($lvl_max_hp, $lvl_cur_hp); + $lvl_hp = $lvl_cur_hp . '/' . $lvl_max_hp; + } + if ($lvl_level < 1) { + $lvl_mp = '0 / 0'; + $lvl_mp_percent = 0; + } else { + $lvl_max_mp = floor((pow($lvl_level, (1/4) ) ) * (pow(10, pow($lvl_level+2, (1/3) ) ) ) / (pi()) ); + $lvl_mp_cost = $user_forums * $lvl_post_mp_cost; + $lvl_mp_regen = max(1, $lvl_user_days * $lvl_mp_regen_per_day); + $lvl_cur_mp = floor($lvl_max_mp - $lvl_mp_cost + $lvl_mp_regen); + $lvl_cur_mp = max(0, $lvl_cur_mp); + $lvl_cur_mp = min($lvl_max_mp, $lvl_cur_mp); + $lvl_mp = $lvl_cur_mp . '/' . $lvl_max_mp; + $lvl_mp_percent = floor($lvl_cur_mp / $lvl_max_mp * 100 ); + } + if ($lvl_level < 1) { + $lvl_exp = "0 / 0"; + $lvl_exp_percent = 100; + } else { + $lvl_posts_for_next = floor(pow(10, pow($lvl_level, (1/3) ) ) ); + if ($lvl_level == 1) { + $lvl_posts_for_this = max(1, floor(pow (10, (($lvl_level - 1) ) ) ) ); + } else { + $lvl_posts_for_this = max(1, floor(pow (10, pow(($lvl_level - 1), (1/3) ) ) ) ); + } + $lvl_exp = ($user_forums - $lvl_posts_for_this) . "/" . ($lvl_posts_for_next - $lvl_posts_for_this); + $lvl_exp_percent = floor((($user_forums - $lvl_posts_for_this) / max(1, ($lvl_posts_for_next - $lvl_posts_for_this ) ) ) * 100); + } + + $bar_image = THEME."images/bar.jpg"; + if(!is_readable($bar_image)) + { + $bar_image = e_PLUGIN."forum/images/".IMODE."/bar.jpg"; + } + + $rpg_info .= "
    "; + $rpg_info .= "Level = ".$lvl_level."
    "; + $rpg_info .= "HP = ".$lvl_hp."

    "; + $rpg_info .= "EXP = ".$lvl_exp."

    "; + $rpg_info .= "MP = ".$lvl_mp."

    "; + $rpg_info .= "
    "; + return $rpg_info; +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/images/dark/English_admin.png b/e107_plugins/forum/images/dark/English_admin.png new file mode 100644 index 000000000..747b9d038 Binary files /dev/null and b/e107_plugins/forum/images/dark/English_admin.png differ diff --git a/e107_plugins/forum/images/dark/English_main_admin.png b/e107_plugins/forum/images/dark/English_main_admin.png new file mode 100644 index 000000000..181454ed2 Binary files /dev/null and b/e107_plugins/forum/images/dark/English_main_admin.png differ diff --git a/e107_plugins/forum/images/dark/English_moderator.png b/e107_plugins/forum/images/dark/English_moderator.png new file mode 100644 index 000000000..4895bb439 Binary files /dev/null and b/e107_plugins/forum/images/dark/English_moderator.png differ diff --git a/e107_plugins/forum/images/dark/English_newthread.png b/e107_plugins/forum/images/dark/English_newthread.png new file mode 100644 index 000000000..e0fd47050 Binary files /dev/null and b/e107_plugins/forum/images/dark/English_newthread.png differ diff --git a/e107_plugins/forum/images/dark/English_reply.png b/e107_plugins/forum/images/dark/English_reply.png new file mode 100644 index 000000000..58f2f534d Binary files /dev/null and b/e107_plugins/forum/images/dark/English_reply.png differ diff --git a/e107_plugins/forum/images/dark/admin.png b/e107_plugins/forum/images/dark/admin.png new file mode 100644 index 000000000..747b9d038 Binary files /dev/null and b/e107_plugins/forum/images/dark/admin.png differ diff --git a/e107_plugins/forum/images/dark/admin_block.png b/e107_plugins/forum/images/dark/admin_block.png new file mode 100644 index 000000000..8b35d9809 Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_block.png differ diff --git a/e107_plugins/forum/images/dark/admin_delete.png b/e107_plugins/forum/images/dark/admin_delete.png new file mode 100644 index 000000000..e81c6883c Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_delete.png differ diff --git a/e107_plugins/forum/images/dark/admin_edit.png b/e107_plugins/forum/images/dark/admin_edit.png new file mode 100644 index 000000000..acfd11fdc Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_edit.png differ diff --git a/e107_plugins/forum/images/dark/admin_lock.png b/e107_plugins/forum/images/dark/admin_lock.png new file mode 100644 index 000000000..6b44ed40b Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_lock.png differ diff --git a/e107_plugins/forum/images/dark/admin_move.png b/e107_plugins/forum/images/dark/admin_move.png new file mode 100644 index 000000000..c1b760d79 Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_move.png differ diff --git a/e107_plugins/forum/images/dark/admin_stick.png b/e107_plugins/forum/images/dark/admin_stick.png new file mode 100644 index 000000000..360292d25 Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_stick.png differ diff --git a/e107_plugins/forum/images/dark/admin_unlock.png b/e107_plugins/forum/images/dark/admin_unlock.png new file mode 100644 index 000000000..9c07df146 Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_unlock.png differ diff --git a/e107_plugins/forum/images/dark/admin_unstick.png b/e107_plugins/forum/images/dark/admin_unstick.png new file mode 100644 index 000000000..a7d9a41df Binary files /dev/null and b/e107_plugins/forum/images/dark/admin_unstick.png differ diff --git a/e107_plugins/forum/images/dark/aim.png b/e107_plugins/forum/images/dark/aim.png new file mode 100644 index 000000000..848498326 Binary files /dev/null and b/e107_plugins/forum/images/dark/aim.png differ diff --git a/e107_plugins/forum/images/dark/announce.png b/e107_plugins/forum/images/dark/announce.png new file mode 100644 index 000000000..2997504ac Binary files /dev/null and b/e107_plugins/forum/images/dark/announce.png differ diff --git a/e107_plugins/forum/images/dark/announce_small.png b/e107_plugins/forum/images/dark/announce_small.png new file mode 100644 index 000000000..ee73a46f1 Binary files /dev/null and b/e107_plugins/forum/images/dark/announce_small.png differ diff --git a/e107_plugins/forum/images/dark/bar.jpg b/e107_plugins/forum/images/dark/bar.jpg new file mode 100644 index 000000000..09b4da58f Binary files /dev/null and b/e107_plugins/forum/images/dark/bar.jpg differ diff --git a/e107_plugins/forum/images/dark/closed.png b/e107_plugins/forum/images/dark/closed.png new file mode 100644 index 000000000..b750d3d26 Binary files /dev/null and b/e107_plugins/forum/images/dark/closed.png differ diff --git a/e107_plugins/forum/images/dark/closed_small.png b/e107_plugins/forum/images/dark/closed_small.png new file mode 100644 index 000000000..bc320a115 Binary files /dev/null and b/e107_plugins/forum/images/dark/closed_small.png differ diff --git a/e107_plugins/forum/images/dark/delete.png b/e107_plugins/forum/images/dark/delete.png new file mode 100644 index 000000000..b1cfb5adb Binary files /dev/null and b/e107_plugins/forum/images/dark/delete.png differ diff --git a/e107_plugins/forum/images/dark/e.png b/e107_plugins/forum/images/dark/e.png new file mode 100644 index 000000000..d8a246a67 Binary files /dev/null and b/e107_plugins/forum/images/dark/e.png differ diff --git a/e107_plugins/forum/images/dark/edit.png b/e107_plugins/forum/images/dark/edit.png new file mode 100644 index 000000000..d04b87652 Binary files /dev/null and b/e107_plugins/forum/images/dark/edit.png differ diff --git a/e107_plugins/forum/images/dark/email.png b/e107_plugins/forum/images/dark/email.png new file mode 100644 index 000000000..a889eadbb Binary files /dev/null and b/e107_plugins/forum/images/dark/email.png differ diff --git a/e107_plugins/forum/images/dark/icq.png b/e107_plugins/forum/images/dark/icq.png new file mode 100644 index 000000000..e01cd15ed Binary files /dev/null and b/e107_plugins/forum/images/dark/icq.png differ diff --git a/e107_plugins/forum/images/dark/main_admin.png b/e107_plugins/forum/images/dark/main_admin.png new file mode 100644 index 000000000..181454ed2 Binary files /dev/null and b/e107_plugins/forum/images/dark/main_admin.png differ diff --git a/e107_plugins/forum/images/dark/moderator.png b/e107_plugins/forum/images/dark/moderator.png new file mode 100644 index 000000000..4895bb439 Binary files /dev/null and b/e107_plugins/forum/images/dark/moderator.png differ diff --git a/e107_plugins/forum/images/dark/msn.png b/e107_plugins/forum/images/dark/msn.png new file mode 100644 index 000000000..3876e791c Binary files /dev/null and b/e107_plugins/forum/images/dark/msn.png differ diff --git a/e107_plugins/forum/images/dark/new.png b/e107_plugins/forum/images/dark/new.png new file mode 100644 index 000000000..e743d0098 Binary files /dev/null and b/e107_plugins/forum/images/dark/new.png differ diff --git a/e107_plugins/forum/images/dark/new_popular.png b/e107_plugins/forum/images/dark/new_popular.png new file mode 100644 index 000000000..89b45746b Binary files /dev/null and b/e107_plugins/forum/images/dark/new_popular.png differ diff --git a/e107_plugins/forum/images/dark/new_popular_small.png b/e107_plugins/forum/images/dark/new_popular_small.png new file mode 100644 index 000000000..eab6e59a7 Binary files /dev/null and b/e107_plugins/forum/images/dark/new_popular_small.png differ diff --git a/e107_plugins/forum/images/dark/new_small.png b/e107_plugins/forum/images/dark/new_small.png new file mode 100644 index 000000000..398910494 Binary files /dev/null and b/e107_plugins/forum/images/dark/new_small.png differ diff --git a/e107_plugins/forum/images/dark/newthread.png b/e107_plugins/forum/images/dark/newthread.png new file mode 100644 index 000000000..e0fd47050 Binary files /dev/null and b/e107_plugins/forum/images/dark/newthread.png differ diff --git a/e107_plugins/forum/images/dark/nonew.png b/e107_plugins/forum/images/dark/nonew.png new file mode 100644 index 000000000..fee8fb9a4 Binary files /dev/null and b/e107_plugins/forum/images/dark/nonew.png differ diff --git a/e107_plugins/forum/images/dark/nonew_popular.png b/e107_plugins/forum/images/dark/nonew_popular.png new file mode 100644 index 000000000..3a9dc9b74 Binary files /dev/null and b/e107_plugins/forum/images/dark/nonew_popular.png differ diff --git a/e107_plugins/forum/images/dark/nonew_popular_small.png b/e107_plugins/forum/images/dark/nonew_popular_small.png new file mode 100644 index 000000000..6bd2a81c5 Binary files /dev/null and b/e107_plugins/forum/images/dark/nonew_popular_small.png differ diff --git a/e107_plugins/forum/images/dark/nonew_small.png b/e107_plugins/forum/images/dark/nonew_small.png new file mode 100644 index 000000000..05757918c Binary files /dev/null and b/e107_plugins/forum/images/dark/nonew_small.png differ diff --git a/e107_plugins/forum/images/dark/pm.png b/e107_plugins/forum/images/dark/pm.png new file mode 100644 index 000000000..3ababb147 Binary files /dev/null and b/e107_plugins/forum/images/dark/pm.png differ diff --git a/e107_plugins/forum/images/dark/post.png b/e107_plugins/forum/images/dark/post.png new file mode 100644 index 000000000..470e0c1b8 Binary files /dev/null and b/e107_plugins/forum/images/dark/post.png differ diff --git a/e107_plugins/forum/images/dark/post2.png b/e107_plugins/forum/images/dark/post2.png new file mode 100644 index 000000000..3332eeed9 Binary files /dev/null and b/e107_plugins/forum/images/dark/post2.png differ diff --git a/e107_plugins/forum/images/dark/profile.png b/e107_plugins/forum/images/dark/profile.png new file mode 100644 index 000000000..48a2b85f7 Binary files /dev/null and b/e107_plugins/forum/images/dark/profile.png differ diff --git a/e107_plugins/forum/images/dark/quote.png b/e107_plugins/forum/images/dark/quote.png new file mode 100644 index 000000000..a74de8266 Binary files /dev/null and b/e107_plugins/forum/images/dark/quote.png differ diff --git a/e107_plugins/forum/images/dark/reply.png b/e107_plugins/forum/images/dark/reply.png new file mode 100644 index 000000000..58f2f534d Binary files /dev/null and b/e107_plugins/forum/images/dark/reply.png differ diff --git a/e107_plugins/forum/images/dark/report.png b/e107_plugins/forum/images/dark/report.png new file mode 100644 index 000000000..f3781d730 Binary files /dev/null and b/e107_plugins/forum/images/dark/report.png differ diff --git a/e107_plugins/forum/images/dark/sticky.png b/e107_plugins/forum/images/dark/sticky.png new file mode 100644 index 000000000..e4364d895 Binary files /dev/null and b/e107_plugins/forum/images/dark/sticky.png differ diff --git a/e107_plugins/forum/images/dark/sticky_closed.png b/e107_plugins/forum/images/dark/sticky_closed.png new file mode 100644 index 000000000..883d118ec Binary files /dev/null and b/e107_plugins/forum/images/dark/sticky_closed.png differ diff --git a/e107_plugins/forum/images/dark/sticky_closed_small.png b/e107_plugins/forum/images/dark/sticky_closed_small.png new file mode 100644 index 000000000..d68f79107 Binary files /dev/null and b/e107_plugins/forum/images/dark/sticky_closed_small.png differ diff --git a/e107_plugins/forum/images/dark/sticky_small.png b/e107_plugins/forum/images/dark/sticky_small.png new file mode 100644 index 000000000..9d34f9fea Binary files /dev/null and b/e107_plugins/forum/images/dark/sticky_small.png differ diff --git a/e107_plugins/forum/images/dark/website.png b/e107_plugins/forum/images/dark/website.png new file mode 100644 index 000000000..694ba9c6d Binary files /dev/null and b/e107_plugins/forum/images/dark/website.png differ diff --git a/e107_plugins/forum/images/fcap.png b/e107_plugins/forum/images/fcap.png new file mode 100644 index 000000000..9bbdffda6 Binary files /dev/null and b/e107_plugins/forum/images/fcap.png differ diff --git a/e107_plugins/forum/images/fcap2.png b/e107_plugins/forum/images/fcap2.png new file mode 100644 index 000000000..3d82038b1 Binary files /dev/null and b/e107_plugins/forum/images/fcap2.png differ diff --git a/e107_plugins/forum/images/finfobar.png b/e107_plugins/forum/images/finfobar.png new file mode 100644 index 000000000..292688b66 Binary files /dev/null and b/e107_plugins/forum/images/finfobar.png differ diff --git a/e107_plugins/forum/images/forums_16.png b/e107_plugins/forum/images/forums_16.png new file mode 100644 index 000000000..8777fd92c Binary files /dev/null and b/e107_plugins/forum/images/forums_16.png differ diff --git a/e107_plugins/forum/images/forums_32.png b/e107_plugins/forum/images/forums_32.png new file mode 100644 index 000000000..01f4b37ad Binary files /dev/null and b/e107_plugins/forum/images/forums_32.png differ diff --git a/e107_plugins/forum/images/lite/English_admin.png b/e107_plugins/forum/images/lite/English_admin.png new file mode 100644 index 000000000..747b9d038 Binary files /dev/null and b/e107_plugins/forum/images/lite/English_admin.png differ diff --git a/e107_plugins/forum/images/lite/English_main_admin.png b/e107_plugins/forum/images/lite/English_main_admin.png new file mode 100644 index 000000000..181454ed2 Binary files /dev/null and b/e107_plugins/forum/images/lite/English_main_admin.png differ diff --git a/e107_plugins/forum/images/lite/English_moderator.png b/e107_plugins/forum/images/lite/English_moderator.png new file mode 100644 index 000000000..4895bb439 Binary files /dev/null and b/e107_plugins/forum/images/lite/English_moderator.png differ diff --git a/e107_plugins/forum/images/lite/English_newthread.png b/e107_plugins/forum/images/lite/English_newthread.png new file mode 100644 index 000000000..fe2d21a02 Binary files /dev/null and b/e107_plugins/forum/images/lite/English_newthread.png differ diff --git a/e107_plugins/forum/images/lite/English_reply.png b/e107_plugins/forum/images/lite/English_reply.png new file mode 100644 index 000000000..1f11bab15 Binary files /dev/null and b/e107_plugins/forum/images/lite/English_reply.png differ diff --git a/e107_plugins/forum/images/lite/admin.png b/e107_plugins/forum/images/lite/admin.png new file mode 100644 index 000000000..747b9d038 Binary files /dev/null and b/e107_plugins/forum/images/lite/admin.png differ diff --git a/e107_plugins/forum/images/lite/admin_block.png b/e107_plugins/forum/images/lite/admin_block.png new file mode 100644 index 000000000..04027be1a Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_block.png differ diff --git a/e107_plugins/forum/images/lite/admin_delete.png b/e107_plugins/forum/images/lite/admin_delete.png new file mode 100644 index 000000000..f4985d4a3 Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_delete.png differ diff --git a/e107_plugins/forum/images/lite/admin_edit.png b/e107_plugins/forum/images/lite/admin_edit.png new file mode 100644 index 000000000..ef248775f Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_edit.png differ diff --git a/e107_plugins/forum/images/lite/admin_lock.png b/e107_plugins/forum/images/lite/admin_lock.png new file mode 100644 index 000000000..c486fe4e4 Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_lock.png differ diff --git a/e107_plugins/forum/images/lite/admin_move.png b/e107_plugins/forum/images/lite/admin_move.png new file mode 100644 index 000000000..1c14e1acc Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_move.png differ diff --git a/e107_plugins/forum/images/lite/admin_stick.png b/e107_plugins/forum/images/lite/admin_stick.png new file mode 100644 index 000000000..360292d25 Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_stick.png differ diff --git a/e107_plugins/forum/images/lite/admin_unlock.png b/e107_plugins/forum/images/lite/admin_unlock.png new file mode 100644 index 000000000..75b178fd5 Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_unlock.png differ diff --git a/e107_plugins/forum/images/lite/admin_unstick.png b/e107_plugins/forum/images/lite/admin_unstick.png new file mode 100644 index 000000000..a8b375db3 Binary files /dev/null and b/e107_plugins/forum/images/lite/admin_unstick.png differ diff --git a/e107_plugins/forum/images/lite/aim.png b/e107_plugins/forum/images/lite/aim.png new file mode 100644 index 000000000..848498326 Binary files /dev/null and b/e107_plugins/forum/images/lite/aim.png differ diff --git a/e107_plugins/forum/images/lite/announce.png b/e107_plugins/forum/images/lite/announce.png new file mode 100644 index 000000000..2978abbab Binary files /dev/null and b/e107_plugins/forum/images/lite/announce.png differ diff --git a/e107_plugins/forum/images/lite/announce_small.png b/e107_plugins/forum/images/lite/announce_small.png new file mode 100644 index 000000000..84e978c5f Binary files /dev/null and b/e107_plugins/forum/images/lite/announce_small.png differ diff --git a/e107_plugins/forum/images/lite/bar.jpg b/e107_plugins/forum/images/lite/bar.jpg new file mode 100644 index 000000000..09b4da58f Binary files /dev/null and b/e107_plugins/forum/images/lite/bar.jpg differ diff --git a/e107_plugins/forum/images/lite/closed.png b/e107_plugins/forum/images/lite/closed.png new file mode 100644 index 000000000..86bc69e7f Binary files /dev/null and b/e107_plugins/forum/images/lite/closed.png differ diff --git a/e107_plugins/forum/images/lite/closed_small.png b/e107_plugins/forum/images/lite/closed_small.png new file mode 100644 index 000000000..ce22db5c0 Binary files /dev/null and b/e107_plugins/forum/images/lite/closed_small.png differ diff --git a/e107_plugins/forum/images/lite/delete.png b/e107_plugins/forum/images/lite/delete.png new file mode 100644 index 000000000..b1cfb5adb Binary files /dev/null and b/e107_plugins/forum/images/lite/delete.png differ diff --git a/e107_plugins/forum/images/lite/e.png b/e107_plugins/forum/images/lite/e.png new file mode 100644 index 000000000..09385ef0a Binary files /dev/null and b/e107_plugins/forum/images/lite/e.png differ diff --git a/e107_plugins/forum/images/lite/edit.png b/e107_plugins/forum/images/lite/edit.png new file mode 100644 index 000000000..9ee326d9e Binary files /dev/null and b/e107_plugins/forum/images/lite/edit.png differ diff --git a/e107_plugins/forum/images/lite/email.png b/e107_plugins/forum/images/lite/email.png new file mode 100644 index 000000000..ead28a756 Binary files /dev/null and b/e107_plugins/forum/images/lite/email.png differ diff --git a/e107_plugins/forum/images/lite/icq.png b/e107_plugins/forum/images/lite/icq.png new file mode 100644 index 000000000..e01cd15ed Binary files /dev/null and b/e107_plugins/forum/images/lite/icq.png differ diff --git a/e107_plugins/forum/images/lite/main_admin.png b/e107_plugins/forum/images/lite/main_admin.png new file mode 100644 index 000000000..181454ed2 Binary files /dev/null and b/e107_plugins/forum/images/lite/main_admin.png differ diff --git a/e107_plugins/forum/images/lite/moderator.png b/e107_plugins/forum/images/lite/moderator.png new file mode 100644 index 000000000..4895bb439 Binary files /dev/null and b/e107_plugins/forum/images/lite/moderator.png differ diff --git a/e107_plugins/forum/images/lite/msn.png b/e107_plugins/forum/images/lite/msn.png new file mode 100644 index 000000000..3876e791c Binary files /dev/null and b/e107_plugins/forum/images/lite/msn.png differ diff --git a/e107_plugins/forum/images/lite/new.png b/e107_plugins/forum/images/lite/new.png new file mode 100644 index 000000000..70527ed60 Binary files /dev/null and b/e107_plugins/forum/images/lite/new.png differ diff --git a/e107_plugins/forum/images/lite/new_popular.png b/e107_plugins/forum/images/lite/new_popular.png new file mode 100644 index 000000000..49bee908c Binary files /dev/null and b/e107_plugins/forum/images/lite/new_popular.png differ diff --git a/e107_plugins/forum/images/lite/new_popular_small.png b/e107_plugins/forum/images/lite/new_popular_small.png new file mode 100644 index 000000000..eb394104c Binary files /dev/null and b/e107_plugins/forum/images/lite/new_popular_small.png differ diff --git a/e107_plugins/forum/images/lite/new_small.png b/e107_plugins/forum/images/lite/new_small.png new file mode 100644 index 000000000..4ddf34500 Binary files /dev/null and b/e107_plugins/forum/images/lite/new_small.png differ diff --git a/e107_plugins/forum/images/lite/newthread.png b/e107_plugins/forum/images/lite/newthread.png new file mode 100644 index 000000000..fe2d21a02 Binary files /dev/null and b/e107_plugins/forum/images/lite/newthread.png differ diff --git a/e107_plugins/forum/images/lite/nonew.png b/e107_plugins/forum/images/lite/nonew.png new file mode 100644 index 000000000..1d123fc31 Binary files /dev/null and b/e107_plugins/forum/images/lite/nonew.png differ diff --git a/e107_plugins/forum/images/lite/nonew_popular.png b/e107_plugins/forum/images/lite/nonew_popular.png new file mode 100644 index 000000000..336e9fd98 Binary files /dev/null and b/e107_plugins/forum/images/lite/nonew_popular.png differ diff --git a/e107_plugins/forum/images/lite/nonew_popular_small.png b/e107_plugins/forum/images/lite/nonew_popular_small.png new file mode 100644 index 000000000..82f0bf7d1 Binary files /dev/null and b/e107_plugins/forum/images/lite/nonew_popular_small.png differ diff --git a/e107_plugins/forum/images/lite/nonew_small.png b/e107_plugins/forum/images/lite/nonew_small.png new file mode 100644 index 000000000..c7e627b49 Binary files /dev/null and b/e107_plugins/forum/images/lite/nonew_small.png differ diff --git a/e107_plugins/forum/images/lite/pm.png b/e107_plugins/forum/images/lite/pm.png new file mode 100644 index 000000000..3ababb147 Binary files /dev/null and b/e107_plugins/forum/images/lite/pm.png differ diff --git a/e107_plugins/forum/images/lite/post.png b/e107_plugins/forum/images/lite/post.png new file mode 100644 index 000000000..470e0c1b8 Binary files /dev/null and b/e107_plugins/forum/images/lite/post.png differ diff --git a/e107_plugins/forum/images/lite/post2.png b/e107_plugins/forum/images/lite/post2.png new file mode 100644 index 000000000..0663738f4 Binary files /dev/null and b/e107_plugins/forum/images/lite/post2.png differ diff --git a/e107_plugins/forum/images/lite/profile.png b/e107_plugins/forum/images/lite/profile.png new file mode 100644 index 000000000..badf5139e Binary files /dev/null and b/e107_plugins/forum/images/lite/profile.png differ diff --git a/e107_plugins/forum/images/lite/quote.png b/e107_plugins/forum/images/lite/quote.png new file mode 100644 index 000000000..3db9afd18 Binary files /dev/null and b/e107_plugins/forum/images/lite/quote.png differ diff --git a/e107_plugins/forum/images/lite/reply.png b/e107_plugins/forum/images/lite/reply.png new file mode 100644 index 000000000..1f11bab15 Binary files /dev/null and b/e107_plugins/forum/images/lite/reply.png differ diff --git a/e107_plugins/forum/images/lite/report.png b/e107_plugins/forum/images/lite/report.png new file mode 100644 index 000000000..0bdac66a7 Binary files /dev/null and b/e107_plugins/forum/images/lite/report.png differ diff --git a/e107_plugins/forum/images/lite/sticky.png b/e107_plugins/forum/images/lite/sticky.png new file mode 100644 index 000000000..d0e1c33de Binary files /dev/null and b/e107_plugins/forum/images/lite/sticky.png differ diff --git a/e107_plugins/forum/images/lite/sticky_closed.png b/e107_plugins/forum/images/lite/sticky_closed.png new file mode 100644 index 000000000..34d75ab70 Binary files /dev/null and b/e107_plugins/forum/images/lite/sticky_closed.png differ diff --git a/e107_plugins/forum/images/lite/sticky_closed_small.png b/e107_plugins/forum/images/lite/sticky_closed_small.png new file mode 100644 index 000000000..904d07e9d Binary files /dev/null and b/e107_plugins/forum/images/lite/sticky_closed_small.png differ diff --git a/e107_plugins/forum/images/lite/sticky_small.png b/e107_plugins/forum/images/lite/sticky_small.png new file mode 100644 index 000000000..bdb94e64b Binary files /dev/null and b/e107_plugins/forum/images/lite/sticky_small.png differ diff --git a/e107_plugins/forum/images/lite/website.png b/e107_plugins/forum/images/lite/website.png new file mode 100644 index 000000000..6da992b2d Binary files /dev/null and b/e107_plugins/forum/images/lite/website.png differ diff --git a/e107_plugins/forum/images/sub_forums_16.png b/e107_plugins/forum/images/sub_forums_16.png new file mode 100755 index 000000000..0c8dc9c5e Binary files /dev/null and b/e107_plugins/forum/images/sub_forums_16.png differ diff --git a/e107_plugins/forum/index.php b/e107_plugins/forum/index.php new file mode 100644 index 000000000..28e7c1aef --- /dev/null +++ b/e107_plugins/forum/index.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum.php b/e107_plugins/forum/languages/English/lan_forum.php new file mode 100644 index 000000000..9dd83cfcf --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum.php @@ -0,0 +1,114 @@ +To access the full features of this forum you will need to"); +define("LAN_45", "These forums can only be posted to by registered and logged in members, please click"); +define("LAN_46", "Forum"); +define("LAN_47", "Threads"); +define("LAN_48", "Replies"); +define("LAN_49", "Last Post"); +define("LAN_51", "No forums yet, please check back soon."); +define("LAN_52", "No forums in this section yet, please check back soon."); +define("LAN_79", "New posts"); +define("LAN_80", " No new posts"); +define("LAN_81", "Closed thread"); +define("LAN_100", "articles"); +define("LAN_180", "Search"); +define("LAN_191", "Information"); +define("LAN_192", "The users of this forum have made a total of "); +define("LAN_196", "You have read "); +define("LAN_197", " of these posts."); +define("LAN_198", " All new posts have been read."); +define("LAN_199", "Mark all posts as read"); +define("LAN_204", "You can start new threads"); +define("LAN_205", "You cannot start new threads"); +define("LAN_206", "You can post replies"); +define("LAN_207", "You cannot post replies"); +define("LAN_208", "You can edit your posts"); +define("LAN_209", "You cannot edit your posts"); +define("LAN_392", "stop tracking this thread"); +define("LAN_393", "List tracked threads"); +define("LAN_394", "Closed forum"); +define("LAN_397", "Tracked threads"); +define("LAN_398", "Closed"); +define("LAN_399", "Restricted"); +define("LAN_400", "This forum can only be browsed by registered members"); +define("LAN_401", "Members only"); + +define("LAN_402", "This forum is read only"); + +define("LAN_403", "No posts yet"); +define("LAN_404", "posts"); +define("LAN_405", "Read Only"); + +define("LAN_406", "This forum is restricted to administrators only"); +define("LAN_407", "This forum is restricted to members only"); +define("LAN_408", "This is a read-only forum"); +define("LAN_409", "This is a class restricted forum"); +define("LAN_410", "Welcome guest"); + +define("LAN_411", "thread"); +define("LAN_412", "reply"); +define("LAN_413", "threads"); +define("LAN_414", "replies"); +define("LAN_415", "user is browsing the forums at the moment"); +define("LAN_416", "users are browsing the forums at the moment"); + +define("LAN_417", "member"); +define("LAN_418", "guest"); +define("LAN_419", "members"); +define("LAN_420", "guests"); + +define("LAN_421", "Show new posts"); +define("LAN_422", "New posts since your last visit"); +define("LAN_423", "Posted by"); +define("LAN_424", "New threads"); +define("LAN_425", "Re:"); + +//v.616 +define("LAN_426", "Who's Online: "); +define("LAN_427", "View detailed list."); +define("LAN_428", "Re:"); +define("LAN_429", "Top Posters"); +define("LAN_430", "Most Active Threads"); +define("LAN_431", "My Posts"); +define("LAN_432", "My Settings"); +define("LAN_433", "Forum Rules"); +define("LAN_434", "Return to forums"); +define("LAN_435", "My Profile"); +define("LAN_436", " (Will open a new window.)"); + +define("LAN_437", "register"); +define("LAN_438", "and login."); +define("LAN_439", "here"); +define("LAN_440", "to go to the registration page."); + +define("LAN_441", "View forum statistics"); + +define('FORLAN_441', 'No rules defined.'); +define('FORLAN_442', 'My Uploads'); +define('FORLAN_443', '[user deleted]'); +define('FORLAN_444', 'sub-forums'); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_admin.php b/e107_plugins/forum/languages/English/lan_forum_admin.php new file mode 100644 index 000000000..7b2e2cbdc --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_admin.php @@ -0,0 +1,208 @@ +Please be careful using this function!"); +define("FORLAN_61", "Update Options"); +define("FORLAN_62", "Forum Options"); +define("FORLAN_63", "Ranks"); +define("FORLAN_64", "Enter your levels here, if left blank generic stars will be used to denote level. Separate levels with comma. Maximum of 10 levels, lowest first."); +define("FORLAN_65", "Forum Title"); + +define("FORLAN_70", "Enable file / image attachments"); +define("FORLAN_71", "Allow users to upload file or image with their forum post,"); +define("FORLAN_72", "Update Order"); +define("FORLAN_73", "Order Updated"); + +define("FORLAN_75", "Parents"); +define("FORLAN_76", "Forums Front Page"); +define("FORLAN_77", "Create Forums"); +define("FORLAN_78", "Forum Order"); +define("FORLAN_79", "Preferences"); +define("FORLAN_80", "Options"); +define("FORLAN_81", "Are you sure you want to delete this parent? - forums of this parent will also be deleted"); +define("FORLAN_82", "Are you sure you want to delete this forum?"); +define("FORLAN_83", "Create Parents"); +define("FORLAN_84", "Members Only"); +define("FORLAN_85", "Read Only"); +define("FORLAN_86", "Admin Only"); +define("FORLAN_87", "Prune topics with no replies in this many days:"); + +define("FORLAN_88", "Prune topics with no replies in this many days:"); + +define("FORLAN_89", "Delete posts completely"); +define("FORLAN_90", "Make posts inactive"); + +define("FORLAN_91", "post(s) made inactive"); +define("FORLAN_92", "thread(s) deleted"); +define("FORLAN_93", "reply (replies) deleted"); + +define("FORLAN_94", "Set Ranks"); +define("FORLAN_95", "Ranks saved"); +define("FORLAN_96", "Forum deleted"); +define("FORLAN_97", "Parent deleted"); + +define("FORLAN_98", "Rank Name"); +define("FORLAN_99", "number of points before level change"); +define("FORLAN_100", "upload images to e107_themes/Your_Theme/forum/"); +define("FORLAN_101", "Main Site Admin"); +define("FORLAN_102", "Threshold"); +define("FORLAN_103", "Site Admin"); +define("FORLAN_104", "Rank Image"); +define("FORLAN_105", "Forum Moderator"); + + +define("FORLAN_106", "Prune Type:"); +define("FORLAN_107", "Forum"); +define("FORLAN_108", " deleted"); +define("FORLAN_109", "days:"); +define("FORLAN_110", "Prune"); +define("FORLAN_111", "deactivate"); + +define("FORLAN_112", "Enable Redirect"); +define("FORLAN_113", "Tick this to make browser redirect to forum page after replying"); +define("FORLAN_114", "User Custom Title"); +define("FORLAN_115", "Tick this to allow users to change their Custom Title"); +define("FORLAN_116", "Reported Posts"); +define("FORLAN_117", "This will delete the record of the reported post. Not the post itself."); +define("FORLAN_118", "Reported post deleted"); +// define("FORLAN_119", "Clicking links will open forum in a new window."); +define("FORLAN_120", "Tick this to allow users to change their Custom Title"); +define("FORLAN_121", "No reported posts"); +define("FORLAN_122", "Click here to email admin when someone reports a forum post"); +define("FORLAN_123", "Forum Rules"); +define("WMGLAN_1", "Rules for Guests"); +define("WMGLAN_2", "Rules for Members"); +define("WMGLAN_3", "Rules for Administrators"); +define("WMGLAN_4", "Submit"); +define("WMGLAN_5", "Set Forum Rules"); +define("WMGLAN_6", "Activate?"); +define("FORLAN_126", "Show Tooltips"); +define("FORLAN_127", "Tick here to show a tooltip containing the first post of the thread when mouse hovers over thread name. "); +define("FORLAN_128", "Length of tooltip"); +define("FORLAN_129", "This will determine the number of characters to display in the tooltip. "); +define("FORLAN_130", "click here"); +define("FORLAN_131", "to set max file size, allowed types etc"); +define("FORLAN_132", "Emphasize Sticky Threads"); +define("FORLAN_133", "Give extra emphasis to sticky threads (separate thread sections and headers)"); +define("FORLAN_134", "Maximum width of uploaded image"); +define("FORLAN_135", "Leave blank to disable auto resizing of images"); +define("FORLAN_136", "Create link to full size image"); +define("FORLAN_137", "Enabling this will resize larger images and also create a link to the original full size image. If disabled, original image will be discarded"); +define("FORLAN_138", "Prune these forums"); +define("FORLAN_139", "To use this setting you also need to tick 'Enable image posting' on the images page"); +define("FORLAN_140", "View"); +define("FORLAN_141", "Post"); +define("FORLAN_142", "Post permission"); +define("FORLAN_143", "Indicates who can post to the forum"); +define("FORLAN_144", "Moderators set"); +define("FORLAN_145", "Configure sub-forums"); +define("FORLAN_146", "No sub-forums yet"); +define("FORLAN_147", "Update sub-forums"); +define("FORLAN_148", "Create sub-forums"); +define("FORLAN_149", "sub-forums"); +define("FORLAN_150", "sub-forum"); +define("FORLAN_151", "ID"); +define("FORLAN_152", "posts"); +define("FORLAN_153", "Tools"); +define("FORLAN_154", "Reply Deleted"); +define("FORLAN_155", "Forum Categories"); + +define("FORLAN_156", "Select forum(s) to perform action on"); +define("FORLAN_157", "All Forums"); +define("FORLAN_158", "Recalculate forum lastpost info"); +define("FORLAN_159", "Select to recalculate lastpost info"); +define("FORLAN_160", "Select to perform this on forums only, not threads"); +define("FORLAN_161", "Recalculate post / reply counts"); +define("FORLAN_162", "Select to recalculate forum thread/reply counts"); +define("FORLAN_163", "Recalculate user forum posts counts"); +define("FORLAN_164", "Select to recalculate user forum counts"); +define("FORLAN_165", "Execute functions"); +define("FORLAN_166", "Forum Tools"); +define("FORLAN_167", "Counts updated for forum"); +define("FORLAN_168", "Lastpost info updated for forum"); +define("FORLAN_169", "User forum counts updated"); +define("FORLAN_170", "Reports"); +define("FORLAN_171", "Report on forum post"); +define("FORLAN_172", "Delete This Report"); +define("FORLAN_173", "Thread title"); +define("FORLAN_174", "Reported by user"); +define("FORLAN_175", "Report submitted"); +define("FORLAN_176", "Report"); + +define("FORLAN_177", "email notification ON by default"); +define("FORLAN_178", "Tick this to allow make the email notification checkbox be on by default"); + +define("FORLAN_179", "(Adding a * to the beginning of the forum name will make this forum a container for sub-forums only. The forum theme must support this option also.)"); +define("FORLAN_180", "Confirm delete operation"); +define("FORLAN_181", "Confirm Delete"); +define("FORLAN_182", "also recalculate replies for all threads in selected forum"); +define("FORLAN_183", "(this function is not allowed when selecting 'all forums' due to the number of queries it will generate)"); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_conf.php b/e107_plugins/forum/languages/English/lan_forum_conf.php new file mode 100644 index 000000000..f835678c4 --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_conf.php @@ -0,0 +1,44 @@ +Once deleted it cannot be retrieved."); +define("FORLAN_14", "Cancel"); +define("FORLAN_15", "Confirm Delete Forum Post"); +define("FORLAN_16", "Confirm Delete Poll"); +define("FORLAN_17", "posted by"); +define("FORLAN_18", "Are you absolutely certain you want to delete this forum"); +define("FORLAN_19", "thread and it's related posts?"); +define("FORLAN_20", "the poll will also be deleted"); +define("FORLAN_21", "Once deleted they"); +define("FORLAN_22", "post?
    Once deleted it"); +define("FORLAN_23", "cannot be retrieved"); +define("FORLAN_24", "Move thread to forum"); +define("FORLAN_25", "Move Thread"); +define("FORLAN_26", "Reply deleted"); + +define("FORLAN_27", "moved"); + +define("FORLAN_28", "Do not rename thread title"); +define("FORLAN_29", "Add"); +define("FORLAN_30", "to title"); +define("FORLAN_31", "Rename to:"); +define("FORLAN_32", "Rename thread options:"); + + +?> \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_frontpage.php b/e107_plugins/forum/languages/English/lan_forum_frontpage.php new file mode 100644 index 000000000..c12a8eaf1 --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_frontpage.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_post.php b/e107_plugins/forum/languages/English/lan_forum_post.php new file mode 100644 index 000000000..c2b6713f8 --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_post.php @@ -0,0 +1,115 @@ +Please note
    Allowed file types:"); +define("LAN_394", "Any other file types uploaded will be instantly deleted."); +define("LAN_395", "Maximum file size"); +define("LAN_396", "bytes"); +define("LAN_397", "This thread is locked."); +define("LAN_398", "This forum is read only"); +define("LAN_399", "You are not authorized to post to this forum."); +define("LAN_400", "post thread as"); +define("LAN_401", "Jump"); + +define("LAN_402", "poll"); +define("LAN_403", "announcement"); +define("LAN_404", "sticky"); +define("LAN_405", "Forums"); +define("LAN_406", "Re:"); + +//v.616 +define("LAN_407", "Redirect"); +define("LAN_408", "If your browser does not support meta redirection please click"); +define("LAN_409", "HERE"); +define("LAN_410", "to be redirected"); +define("LAN_411", "here"); +define("LAN_412", "to go to the registration page."); + +define("LAN_413", "Your poll has been successfully posted."); +define("LAN_414", "Click Here to view your poll"); +define("LAN_415", "Your reply has been successfully posted."); + +define("LAN_416", "Attach file"); +define("LAN_417", "Add another attachment"); + +define("POLL_506", "Allow multiple choices?"); +define("POLL_507", "yes"); +define("POLL_508", "no"); + +define("LAN_FORUM_1", "Uploads disabled: ".e_FILE."public directory is not writable"); +define("LAN_FORUM_2", "Duplicate post"); + + +?> \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_search.php b/e107_plugins/forum/languages/English/lan_forum_search.php new file mode 100644 index 000000000..db8298207 --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_search.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_stats.php b/e107_plugins/forum/languages/English/lan_forum_stats.php new file mode 100644 index 000000000..8be76923d --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_stats.php @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_uploads.php b/e107_plugins/forum/languages/English/lan_forum_uploads.php new file mode 100644 index 000000000..52c18e2ee --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_uploads.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_viewforum.php b/e107_plugins/forum/languages/English/lan_forum_viewforum.php new file mode 100644 index 000000000..74cd72f8c --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_viewforum.php @@ -0,0 +1,94 @@ +can start new threads"); +define("LAN_205", "You cannot start new threads"); +define("LAN_206", "You can post replies"); +define("LAN_207", "You cannot post replies"); +define("LAN_208", "You can edit your posts"); +define("LAN_209", "You cannot edit your posts"); +define("LAN_316", "Goto page: "); +define("LAN_317", "None"); +define("LAN_321", "Moderators: "); +define("LAN_395", "[popular]"); +define("LAN_396", "Announcement"); + +define("LAN_397", "This forum is read only"); + +define("LAN_398", "Unstick thread"); +define("LAN_399", "Lock thread"); +define("LAN_400", "Unlock thread"); +define("LAN_401", "Stick thread"); +define("LAN_402", "Move thread"); +define("LAN_403", "Jump to forum"); +define("LAN_404", "This forum is moderated by"); + +define("LAN_405", "user is browsing this forum at the moment"); +define("LAN_406", "users are browsing this forum at the moment"); +define("LAN_407", "member"); +define("LAN_408", "guest"); +define("LAN_409", "members"); +define("LAN_410", "guests"); + +//v.616 +define("LAN_411", "Important Threads"); +define("LAN_412", "Forum Threads"); +define("LAN_431", "Syndicate this forum: rss 0.92"); +define("LAN_432", "Syndicate this forum: rss 2.0"); +define("LAN_433", "Syndicate this forum: RDF"); + +define("LAN_434", "Are you sure you want to delete this thread and any replies?"); +define("LAN_435", "Delete thread"); + +//v.617 +define("FORLAN_CLOSE", "Thread closed."); +define("FORLAN_OPEN", "Thread reopened."); +define("FORLAN_STICK", "Thread made sticky."); +define("FORLAN_UNSTICK", "Thread unstuck."); +define("FORLAN_6", "Thread deleted"); +define("FORLAN_7", "replies deleted"); +define("FORLAN_8", "here"); +define("FORLAN_9", "to sign up or login from the login menu."); + +define("FORLAN_10", "Begin New Thread"); +define("FORLAN_11", "New Posts"); +define("FORLAN_12", "No New Posts"); +define("FORLAN_13", "New Posts on Popular Thread"); +define("FORLAN_14", "No New Posts on Popular Thread"); +define("FORLAN_15", "Sticky Thread"); +define("FORLAN_16", "Closed Sticky Thread"); +define("FORLAN_17", "Announcement Thread"); +define("FORLAN_18", "Closed Thread"); +define('FORLAN_19', '[user deleted]'); +define('FORLAN_20', 'Sub-forum'); +define('FORLAN_21', 'Threads'); +define('FORLAN_22', 'Last Post'); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/languages/English/lan_forum_viewtopic.php b/e107_plugins/forum/languages/English/lan_forum_viewtopic.php new file mode 100644 index 000000000..5a808746b --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_forum_viewtopic.php @@ -0,0 +1,89 @@ +Do not use this form to contact the admin for any other reason."); +define("LAN_419", "Send Report"); +define("LAN_420", "Click to view post"); +define("LAN_421", "Forum thread report from"); +define("LAN_422", "This post has been reported from site "); +define("LAN_423", "Message could not be sent. "); +define("LAN_424", "Post has been reported to moderator.
    Thank You."); +define("LAN_425", "Message from: "); +define("LAN_426", "Reporting post in topic: "); +define("LAN_427", "Error sending mail"); +define("LAN_428", "Post has been reported"); +define("LAN_429", "Click here to return to forum"); +define("LAN_430", "poll"); +define("FORLAN_26", "Reply deleted"); +define("FORLAN_10", "Begin New Thread"); +define("LAN_29", "Edited"); + +define("LAN_431", "Syndicate this thread: rss 0.92"); +define("LAN_432", "Syndicate this thread: rss 2.0"); +define("LAN_433", "Syndicate this thread: RDF"); + +define("FORLAN_101", "Email Thread"); +define("FORLAN_102", "Print View"); +define('FORLAN_103', '[user deleted]'); +define('FORLAN_104', 'Thread not found'); +define("FORLAN_HIDDEN", "HIDDEN - LOGIN AND REPLY TO REVEAL"); +?> diff --git a/e107_plugins/forum/languages/English/lan_newforumposts_menu.php b/e107_plugins/forum/languages/English/lan_newforumposts_menu.php new file mode 100755 index 000000000..75d1d3645 --- /dev/null +++ b/e107_plugins/forum/languages/English/lan_newforumposts_menu.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php new file mode 100755 index 000000000..18d51f649 --- /dev/null +++ b/e107_plugins/forum/newforumposts_menu.php @@ -0,0 +1,99 @@ +db_Select_gen($query2); + +if(!$results) +{ + // no posts yet .. + $text = NFP_2; +} +else +{ + $text = ""; + $forumArray = $sql->db_getList(); + foreach($forumArray as $fi) + { + $datestamp = $gen->convert_date($fi['thread_datestamp'], "short"); + $topic = ($fi['parent_name'] ? "Re: {$fi['parent_name']}" : "{$fi['thread_name']}"); + $topic = strip_tags($tp->toHTML($topic, TRUE, "emotes_off, no_make_clickable, parse_bb", "", $pref['menu_wordwrap'])); + $id = $fi['thread_id']; + + if($fi['user_name']) + { + $poster = $fi['user_name']; + } + else + { + $x = explode(chr(1), $fi['thread_user']); + $tmp = explode(".", $x[0], 2); + if($tmp[1]) + { + $poster = $tmp[1]; + } + else + { + $poster = "[deleted]"; + } + } + + $fi['thread_thread'] = strip_tags($tp->toHTML($fi['thread_thread'], TRUE, "emotes_off, no_make_clickable", "", $pref['menu_wordwrap'])); + + if (strlen($fi['thread_thread']) > $menu_pref['newforumposts_characters']) + { + $fi['thread_thread'] = substr($fi['thread_thread'], 0, $menu_pref['newforumposts_characters']).$menu_pref['newforumposts_postfix']; + } + + if ($menu_pref['newforumposts_title']) + { + $text .= " ".$topic."
    ".$fi['thread_thread']."
    ".NFP_11." ".$poster."
    ".$datestamp."

    "; + } + else + { + $text .= " ".NFP_11." ".$poster."
    ".$fi['thread_thread']."
    ".$datestamp."

    "; + } + } +} + +$ns->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu'); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/newforumposts_menu_config.php b/e107_plugins/forum/newforumposts_menu_config.php new file mode 100755 index 000000000..443ae9efb --- /dev/null +++ b/e107_plugins/forum/newforumposts_menu_config.php @@ -0,0 +1,99 @@ +db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); + $ns->tablerender("", "
    ".NFP_3."
    "); +} + +$text = "
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".NFP_4.": + +
    ".NFP_5.": + + +
    ".NFP_6.": + +
    ".NFP_7.": + + +
    ".NFP_8.": + + + +
    +
    +
    "; +$ns->tablerender(NFP_10, $text); +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/forum/plugin.php b/e107_plugins/forum/plugin.php new file mode 100644 index 000000000..81e368b41 --- /dev/null +++ b/e107_plugins/forum/plugin.php @@ -0,0 +1,138 @@ + "1", + "forum_postfix" => "[more...]", + 'forum_poll' => '0', + 'forum_popular' => '10', + 'forum_track' => '0', + 'forum_eprefix' => '[forum]', + 'forum_enclose' => '1', + 'forum_title' => 'Forums', + 'forum_postspage' => '10', + 'forum_hilightsticky' => '1' + ); + +// List of table names ----------------------------------------------------------------------------------------------- +$eplug_table_names = array( +"forum", + "forum_t" ); + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = array( +"CREATE TABLE ".MPREFIX."forum ( + forum_id int(10) unsigned NOT NULL auto_increment, + forum_name varchar(250) NOT NULL default '', + forum_description text NOT NULL, + forum_parent int(10) unsigned NOT NULL default '0', + forum_sub int(10) unsigned NOT NULL default '0', + forum_datestamp int(10) unsigned NOT NULL default '0', + forum_moderators text NOT NULL, + forum_threads int(10) unsigned NOT NULL default '0', + forum_replies int(10) unsigned NOT NULL default '0', + forum_lastpost_user varchar(200) NOT NULL default '', + forum_lastpost_info varchar(40) NOT NULL default '', + forum_class varchar(100) NOT NULL default '', + forum_order int(10) unsigned NOT NULL default '0', + forum_postclass tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (forum_id) + ) TYPE=MyISAM AUTO_INCREMENT=1;", + "CREATE TABLE ".MPREFIX."forum_t ( + thread_id int(10) unsigned NOT NULL auto_increment, + thread_name varchar(250) NOT NULL default '', + thread_thread text NOT NULL, + thread_forum_id int(10) unsigned NOT NULL default '0', + thread_datestamp int(10) unsigned NOT NULL default '0', + thread_parent int(10) unsigned NOT NULL default '0', + thread_user varchar(250) NOT NULL default '', + thread_views int(10) unsigned NOT NULL default '0', + thread_active tinyint(3) unsigned NOT NULL default '0', + thread_lastpost int(10) unsigned NOT NULL default '0', + thread_s tinyint(1) unsigned NOT NULL default '0', + thread_edit_datestamp int(10) unsigned NOT NULL default '0', + thread_lastuser varchar(30) NOT NULL default '', + thread_total_replies int(10) unsigned NOT NULL default '0', + PRIMARY KEY (thread_id), + KEY thread_parent (thread_parent), + KEY thread_datestamp (thread_datestamp), + KEY thread_forum_id (thread_forum_id) + ) TYPE=MyISAM AUTO_INCREMENT=1;"); + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$eplug_link = TRUE; +$eplug_link_name = "Forum"; +$eplug_link_url = e_PLUGIN.'forum/forum.php'; + +// Text to display after plugin successfully installed ------------------------------------------------------------------ +$eplug_done = 'Your forum is now installed'; + +$eplug_upgrade_done = 'Forum successfully upgraded, now using version: '.$eplug_version; + +$upgrade_alter_tables = array( +"ALTER TABLE ".MPREFIX."forum ADD forum_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;" +); + +if (!function_exists('forum_uninstall')) { + function forum_uninstall() { + global $sql; + $sql -> db_Update("user", "user_forums='0'"); + } +} + +if (!function_exists('forum_install')) { + function forum_install() { + global $sql; + $sql -> db_Update("user", "user_forums='0'"); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/search/search_advanced.php b/e107_plugins/forum/search/search_advanced.php new file mode 100644 index 000000000..6c43269a0 --- /dev/null +++ b/e107_plugins/forum/search/search_advanced.php @@ -0,0 +1,47 @@ + 'all', 'title' => FOR_SCH_LAN_3); + +$advanced_caption['id'] = 'forum'; +$advanced_caption['title']['all'] = FOR_SCH_LAN_3; + +if ($sql -> db_Select_gen("SELECT f.forum_id, f.forum_name FROM #forum AS f LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent WHERE f.forum_parent != 0 AND fp.forum_class IN (".USERCLASS_LIST.") AND f.forum_class IN (".USERCLASS_LIST.")")) { + while ($row = $sql -> db_Fetch()) { + $advanced['forum']['list'][] = array('id' => $row['forum_id'], 'title' => $row['forum_name']); + $advanced_caption['title'][$row['forum_id']] = FOR_SCH_LAN_1.' -> '.$row['forum_name']; + } +} + +$advanced['date']['type'] = 'date'; +$advanced['date']['text'] = LAN_SEARCH_50.':'; + +$advanced['author']['type'] = 'author'; +$advanced['author']['text'] = LAN_SEARCH_61.':'; + +$advanced['match']['type'] = 'dropdown'; +$advanced['match']['text'] = LAN_SEARCH_52.':'; +$advanced['match']['list'][] = array('id' => 0, 'title' => FOR_SCH_LAN_4); +$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/search/search_parser.php b/e107_plugins/forum/search/search_parser.php new file mode 100644 index 000000000..5333305fa --- /dev/null +++ b/e107_plugins/forum/search/search_parser.php @@ -0,0 +1,78 @@ +=' : '<=')." '".(time() - $_GET['time'])."' AND"; +} + +if (isset($_GET['author']) && $_GET['author'] != '') { + $advanced_where .= " (u.user_id = '".$tp -> toDB($_GET['author'])."' OR u.user_name = '".$tp -> toDB($_GET['author'])."') AND"; +} + +if (isset($_GET['match']) && $_GET['match']) { + $search_fields = array('t.thread_name'); +} else { + $search_fields = array('t.thread_name', 't.thread_thread'); +} + +// basic +$return_fields = 'tp.thread_name AS parent_name, t.thread_id, t.thread_name, t.thread_thread, t.thread_forum_id, t.thread_parent, t.thread_datestamp, t.thread_user, u.user_id, u.user_name, f.forum_class, f.forum_id, f.forum_name'; +$weights = array('1.2', '0.6'); +$no_results = LAN_198; + +$where = "f.forum_class REGEXP '".e_CLASS_REGEXP."' AND fp.forum_class REGEXP '".e_CLASS_REGEXP."' AND".$advanced_where; +$order = array('thread_datestamp' => DESC); +$table = "forum_t AS t LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id + LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id + LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id + LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id"; + +$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_forum', $no_results, $where, $order); +$text .= $ps['text']; +$results = $ps['results']; + +function search_forum($row) { + global $con; + $datestamp = $con -> convert_date($row['thread_datestamp'], "long"); + if ($row['thread_parent']) { + $title = $row['parent_name']; + } else { + $title = $row['thread_name']; + } + + $link_id = $row['thread_id']; + + $res['link'] = e_PLUGIN."forum/forum_viewtopic.php?".$link_id.".post"; + $res['pre_title'] = $title ? FOR_SCH_LAN_5.": " : ""; + $res['title'] = $title ? $title : LAN_SEARCH_9; + $res['pre_summary'] = ""; + $res['summary'] = $row['thread_thread']; + $res['detail'] = LAN_SEARCH_7."".$row['user_name']."".LAN_SEARCH_8.$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_icons_template.php b/e107_plugins/forum/templates/forum_icons_template.php new file mode 100644 index 000000000..80bdefdce --- /dev/null +++ b/e107_plugins/forum/templates/forum_icons_template.php @@ -0,0 +1,71 @@ +"); +define("IMAGE_new", "".LAN_199.""); +define("IMAGE_nonew", ""); +define("IMAGE_new_small", "".FORLAN_11.""); +define("IMAGE_nonew_small", "".FORLAN_12.""); +define("IMAGE_new_popular", "".FORLAN_13.""); +define("IMAGE_nonew_popular", "".FORLAN_14.""); +define("IMAGE_new_popular_small", "".FORLAN_13.""); +define("IMAGE_nonew_popular_small", "".FORLAN_14.""); +define("IMAGE_sticky", "".FORLAN_15.""); +define("IMAGE_stickyclosed", "".FORLAN_16.""); +define("IMAGE_sticky_small", "".FORLAN_16.""); +define("IMAGE_stickyclosed_small", "".FORLAN_16.""); +define("IMAGE_announce", "".FORLAN_17.""); +define("IMAGE_announce_small", "".FORLAN_17.""); +define("IMAGE_closed_small", "".FORLAN_18.""); +define("IMAGE_closed", "".FORLAN_18.""); +define("IMAGE_profile", "".LAN_398.""); +define("IMAGE_email", "".LAN_397.""); +define("IMAGE_pm", "".LAN_399.""); +define("IMAGE_website", "".LAN_396.""); +define("IMAGE_edit", "".LAN_400.""); +define("IMAGE_quote", "".LAN_401.""); +define("IMAGE_admin_edit", "".LAN_406.""); +define("IMAGE_admin_move", "".LAN_402.""); +define("IMAGE_admin_move2", "".LAN_408.""); +define("IMAGE_post", ""); +define("IMAGE_post2", ""); +define("IMAGE_report", "".LAN_413.""); + +// Admin Icons + +define("IMAGE_admin_delete", "src='".img_path('admin_delete.png')."' alt='".LAN_435."' title='".LAN_435."' style='border:0' "); +define("IMAGE_admin_unstick", "src='".img_path('admin_unstick.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' "); +define("IMAGE_admin_stick", "src='".img_path('sticky_small.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' "); +define("IMAGE_admin_lock", "src='".img_path('admin_lock.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' "); +define("IMAGE_admin_unlock", "src='".img_path('admin_unlock.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' "); + +// Multi Language Images + +define("IMAGE_newthread", "".FORLAN_10.""); +define("IMAGE_reply", ""); +define("IMAGE_rank_moderator_image", ""); +define("IMAGE_rank_main_admin_image", ""); +define("IMAGE_rank_admin_image", ""); + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_post_template.php b/e107_plugins/forum/templates/forum_post_template.php new file mode 100644 index 000000000..8802830f1 --- /dev/null +++ b/e107_plugins/forum/templates/forum_post_template.php @@ -0,0 +1,246 @@ + +".LAN_61." + + + +"; +} + +if(!$subjectbox) +{ +$subjectbox = " +".LAN_62." + + + +"; +} + +// the poll is optional, be careful when changing the values here, only change if you know what you're doing ... +if(!$poll_form) +{ + if(is_readable(e_PLUGIN."poll/poll_class.php")) { + require_once(e_PLUGIN."poll/poll_class.php"); + $pollo = new poll; + $poll_form = $pollo -> renderPollForm("forum"); + } +} + +// finally, file attach is optional, again only change this if you know what you're doing ... +if(!$fileattach) +{ +$fileattach = " + + ".($pref['image_post'] ? LAN_390 : LAN_416)." + + + ".LAN_392." + ".LAN_393." | ".$allowed_filetypes." |
    ".LAN_394."
    ".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))." +
    +
    + + + +
    + + + +"; +// +// +} +// If the upload directory is not writable, we need to alert the user about this. +if(!$fileattach_alert) +{ + $fileattach_alert = " + + ".($pref['image_post'] ? LAN_390 : LAN_416)." + + + ".LAN_FORUM_1." + \n"; +} +// ------------ + +if(!$FORUMPOST) +{ +$FORUMPOST = " +
    +
    +{FORMSTART} + + + + +{USERBOX} +{SUBJECTBOX} + + + + + +{POLL} + +{FILEATTACH} + + + + +
    {BACKLINK} +
    {POSTTYPE} +{POSTBOX}
    {EMAILNOTIFY}
    {POSTTHREADAS} +
    +{BUTTONS} +
    +{FORMEND} + + + + + +
    +{FORUMJUMP} +
    +
    +"; +} + +if(!$FORUMPOST_REPLY) +{ +$FORUMPOST_REPLY = " +
    +
    +{FORMSTART} + + + + +{USERBOX} +{SUBJECTBOX} + + + + + +{POLL} + +{FILEATTACH} + + + + +
    {BACKLINK} +
    {POSTTYPE} +{POSTBOX}
    {EMAILNOTIFY}
    {POSTTHREADAS} +
    +{BUTTONS} +
    +{FORMEND} + + + + + +
    +{FORUMJUMP} +
    +
    +
    +{THREADTOPIC} +{LATESTPOSTS} +
    +"; +} + +if(!$LATESTPOSTS_START) +{ +$LATESTPOSTS_START = " + + + +"; +} + +if(!$LATESTPOSTS_POST) +{ +$LATESTPOSTS_POST = " + + + + +"; +} + +if(!$LATESTPOSTS_END) +{ +$LATESTPOSTS_END = " +
    ". +LAN_101."{LATESTPOSTSCOUNT}".LAN_102." +
    {POSTER} +
    ".IMAGE_post2." ".LAN_322."{THREADDATESTAMP}
    + {POST} +
    +"; +} + +if(!$THREADTOPIC_REPLY) +{ +$THREADTOPIC_REPLY = " + + + + + + + + +
    ".LAN_100."
    {POSTER} +
    ".IMAGE_post2." ".LAN_322."{THREADDATESTAMP}
    {POST} +
    +"; +} + +$FORUM_CRUMB['sitename']['value'] = "{SITENAME}"; +$FORUM_CRUMB['sitename']['sep'] = " :: "; + +$FORUM_CRUMB['forums']['value'] = "{FORUMS_TITLE}"; +$FORUM_CRUMB['forums']['sep'] = " :: "; + +$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}"; +$FORUM_CRUMB['parent']['sep'] = " :: "; + +$FORUM_CRUMB['subparent']['value'] = "{SUBPARENT_TITLE}"; +$FORUM_CRUMB['subparent']['sep'] = " :: "; + +$FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}"; +$FORUM_CRUMB['forum']['sep'] = " :: "; + +$FORUM_CRUMB['thread']['value'] = "{THREAD_TITLE}"; + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_posted_template.php b/e107_plugins/forum/templates/forum_posted_template.php new file mode 100644 index 000000000..64990c533 --- /dev/null +++ b/e107_plugins/forum/templates/forum_posted_template.php @@ -0,0 +1,58 @@ + + +".LAN_133." + +".IMAGE_e."  + +
    ".LAN_413."
    +".LAN_414."
    +".LAN_326."


    +"; + +$FORUMTHREADPOSTED = " + + + + + +
    ".LAN_133."
    ".IMAGE_e."  +
    ".LAN_324."
    +".(defined("F_MESSAGE") ? F_MESSAGE."
    " : "")." +".LAN_325."
    +".LAN_326."


    +
    "; + + +$FORUMREPLYPOSTED = " + + + + + +
    ".LAN_133."
    ".IMAGE_e."  +
    ".LAN_415."
    +".(defined("F_MESSAGE") ? F_MESSAGE."
    " : "")." +".LAN_325."
    +".LAN_326."


    +
    "; + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_preview_template.php b/e107_plugins/forum/templates/forum_preview_template.php new file mode 100644 index 000000000..d00bb171e --- /dev/null +++ b/e107_plugins/forum/templates/forum_preview_template.php @@ -0,0 +1,36 @@ + + + +" : " ( ".LAN_62.$tsubject." )")." + + + + +
    ".LAN_323. +($action != "nt" ? "
    ".$poster." +
    ".IMAGE_post2." ".LAN_322.$postdate."
    ".$tpost."
    +
    "; + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_template.php b/e107_plugins/forum/templates/forum_template.php new file mode 100644 index 000000000..c3eb9a583 --- /dev/null +++ b/e107_plugins/forum/templates/forum_template.php @@ -0,0 +1,73 @@ +\n
    \n\n\n\n\n\n\n"; +} +if (!isset($FORUM_MAIN_PARENT)) +{ + $FORUM_MAIN_PARENT = " \n\n"; +} +if (!isset($FORUM_MAIN_FORUM)) +{ + $FORUM_MAIN_FORUM = "\n\n\n\n\n\n"; +} +if (!isset($FORUM_MAIN_END)) +{ + $FORUM_MAIN_END = "
    {FORUMTITLE}{THREADTITLE}{REPLYTITLE}{LASTPOSTITLE}
    {PARENTNAME} {PARENTSTATUS}
    {NEWFLAG}{FORUMNAME}
    {FORUMDESCRIPTION}{FORUMSUBFORUMS}
    {THREADS}{REPLIES}{LASTPOST}
    \n
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    {INFOTITLE}
    {LOGO}{USERINFO}
    {INFO}
    {FORUMINFO}
    {USERLIST}
    {STATLINK}
    \n
    \n
    \n\n\n\n\n\n\n
    {ICONKEY}{SEARCH}{PERMS}\n
    \n
    \n"; +} + +if (!isset($FORUM_NEWPOSTS_START)) +{ + $FORUM_NEWPOSTS_START = "
    \n
    \n\n\n\n\n\n"; +} + +if (!isset($FORUM_NEWPOSTS_MAIN)) +{ + $FORUM_NEWPOSTS_MAIN = "\n\n\n\n"; +} + +if (!isset($FORUM_NEWPOSTS_END)) +{ + $FORUM_NEWPOSTS_END = "
     {NEWTHREADTITLE}{POSTEDTITLE}
    {NEWIMAGE}{NEWSPOSTNAME}{STARTERTITLE}
    "; +} + +if (!isset($FORUM_TRACK_START)) +{ + $FORUM_TRACK_START = "
    \n
    \n\n\n\n\n"; + + if (!isset($FORUM_TRACK_MAIN)) + { + $FORUM_TRACK_MAIN = " + + + + "; + } +} + +if (!isset($FORUM_TRACK_END)) +{ + $FORUM_TRACK_END = "
    {TRACKTITLE}
    {NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
    \n
    \n
    "; +} + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_viewforum_template.php b/e107_plugins/forum/templates/forum_viewforum_template.php new file mode 100644 index 000000000..7d15257f7 --- /dev/null +++ b/e107_plugins/forum/templates/forum_viewforum_template.php @@ -0,0 +1,271 @@ + +
    + + + + + {SUBFORUMS} + + + +
    {BREADCRUMB}
    + {FORUMTITLE}
    +
    + + + + + + +
    + {THREADPAGES} + + {NEWTHREADBUTTON} +
    + +
    + + + + + + + + + "; +} + +if(!$FORUM_VIEW_START_CONTAINER) +{ + $FORUM_VIEW_START_CONTAINER = " +
    +
    +
     {THREADTITLE}{STARTERTITLE}{REPLYTITLE}{VIEWTITLE}{LASTPOSTITLE}
    + + + + {SUBFORUMS} +
    {BREADCRUMB}
    +
    + "; +} + + +if (!$FORUM_VIEW_FORUM) { + $FORUM_VIEW_FORUM = " + + {ICON} + + + + + + + +
    {THREADTYPE}{THREADNAME}
    {PAGES}
    {ADMIN_ICONS}
    + + + + {POSTER}
    {THREADDATE} + {REPLIES} + {VIEWS} + {LASTPOST} + "; +} + +if (!$FORUM_VIEW_FORUM_STICKY) { + $FORUM_VIEW_FORUM_STICKY = " + + {ICON} + + + + + + + +
    {THREADTYPE}{THREADNAME} {PAGES}{ADMIN_ICONS}
    + + + + {POSTER}
    {THREADDATE} + {REPLIES} + {VIEWS} + {LASTPOST} + "; +} + +if (!$FORUM_VIEW_FORUM_ANNOUNCE) { + $FORUM_VIEW_FORUM_ANNOUNCE = " + + {ICON} + + + + + + + +
    {THREADTYPE}{THREADNAME} {PAGES}{ADMIN_ICONS}
    + + + + {POSTER}
    {THREADDATE} + {REPLIES} + {VIEWS} + {LASTPOST} + "; +} + +if (!$FORUM_VIEW_END) { + $FORUM_VIEW_END = " + + + + + + + + + + + +
    {THREADPAGES} + + {NEWTHREADBUTTON} +
    + {FORUMJUMP} +
    + +
    + + + + + +
    {MODERATORS}{BROWSERS}
    +
    + +
    + + + + + +
    {ICONKEY}{PERMS}

    {SEARCH} +
    +
    + +
    +
    + ".LAN_431." + ".LAN_432." + ".LAN_433." +
    +
    Powered by e107 Forum System
    +"; +} + + +if(!$FORUM_VIEW_END_CONTAINER) +{ + $FORUM_VIEW_END_CONTAINER = " + + + + +
    + {FORUMJUMP} +
    +
    Powered by e107 Forum System
    +"; +} + + +if (!$FORUM_VIEW_SUB_START) + { + $FORUM_VIEW_SUB_START = " + + +
    +
    + + + + + + + + + "; +} + +if (!$FORUM_VIEW_SUB) { + $FORUM_VIEW_SUB = " + + + + + + + + "; +} + +if (!$FORUM_VIEW_SUB_END) { + $FORUM_VIEW_SUB_END = " +
     ".FORLAN_20."".FORLAN_21."".LAN_55."".FORLAN_22."
    {NEWFLAG}{SUB_FORUMTITLE}
    {SUB_DESCRIPTION}
    {SUB_THREADS}{SUB_REPLIES}{SUB_LASTPOST}


    +
    + + + "; +} + +if (!$FORUM_IMPORTANT_ROW) { + $FORUM_IMPORTANT_ROW = " ".LAN_411.""; +} + +if (!$FORUM_NORMAL_ROW) { + $FORUM_NORMAL_ROW = " ".LAN_412.""; +} + +$FORUM_CRUMB['sitename']['value'] = "{SITENAME}"; +$FORUM_CRUMB['sitename']['sep'] = " :: "; + +$FORUM_CRUMB['forums']['value'] = "{FORUMS_TITLE}"; +$FORUM_CRUMB['forums']['sep'] = " :: "; + +$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}"; +$FORUM_CRUMB['parent']['sep'] = " :: "; + +$FORUM_CRUMB['subparent']['value'] = "{SUBPARENT_TITLE}"; +$FORUM_CRUMB['subparent']['sep'] = " :: "; + +$FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}"; + +?> \ No newline at end of file diff --git a/e107_plugins/forum/templates/forum_viewtopic_template.php b/e107_plugins/forum/templates/forum_viewtopic_template.php new file mode 100644 index 000000000..758e5ae63 --- /dev/null +++ b/e107_plugins/forum/templates/forum_viewtopic_template.php @@ -0,0 +1,257 @@ +
    [ ".LAN_29." "; +$sc_style['LASTEDIT']['post'] = " ]"; + +$sc_style['LEVEL']['pre'] = "
    "; +$sc_style['LEVEL']['post'] = "
    "; + +$sc_style['ANON_IP']['pre'] = "
    "; +$sc_style['ANON_IP']['post'] = "
    "; + +$location_tpl = (array_key_exists('user_location', $currentUser) ? "{USER_EXTENDED=location.text}: {USER_EXTENDED=location.value}" : ""); + +$FORUMSTART = "
    +
    + + + + + + + + + +
    + {BACKLINK} + +
      + {TRACK} +
    +
    + + {NEXTPREV} + +
    + {THREADNAME} +
    +
    + + + + + + + + + + +
    + {GOTOPAGES} + + {BUTTONS} +
    +
    + {MODERATORS} +
    +
    + {THREADSTATUS} +
    + +
    + + + + + "; + +$FORUMTHREADSTYLE = " + + + + + + + + + + + + + + "; + +$FORUMEND = "
    + ".LAN_402." + + ".LAN_403." +
    + {NEWFLAG} + {POSTER} + {ANON_IP} + + + + + + +
    + {THREADDATESTAMP} + + {REPORTIMG}{EDITIMG}{QUOTEIMG} +
    +
    + {CUSTOMTITLE} + {AVATAR} +
    + {LEVEL=special} + {LEVEL=pic} + {LEVEL=userid} + {JOINED} + {$location_tpl}
    + {POSTS} +
    +
    {POLL} + {POST} + {LASTEDIT} + {SIGNATURE} +
    + + {TOP} + + + + + + + +
    + {PROFILEIMG} + {EMAILIMG} + {WEBSITEIMG} + {PRIVMESSAGE} + + {MODOPTIONS} +
    +
    +
    {QUICKREPLY}
    + + + + + + + + + +
    {GOTOPAGES}  + + {BUTTONS} +
    + {FORUMJUMP} +
    +
    + +
    + ".LAN_431." ".LAN_432." ".LAN_433."
    Powered by e107 Forum System
    "; + +$FORUMREPLYSTYLE = " + + {NEWFLAG} + {POSTER} + {ANON_IP} + + + + + + + +
    + {THREADDATESTAMP} + + {REPORTIMG}{EDITIMG}{QUOTEIMG} +
    + + + + + {CUSTOMTITLE} + {AVATAR} +
    + {LEVEL=special} + {LEVEL=pic} + {LEVEL=userid} + {JOINED} + {$location_tpl}
    + {POSTS} +
    + + {POST} + {LASTEDIT} + {SIGNATURE} + + + + + + {TOP} + + + + + + + + +
    + {PROFILEIMG} + {EMAILIMG} + {WEBSITEIMG} + {PRIVMESSAGE} + + {MODOPTIONS} +
    + + + + + + "; + +$FORUM_CRUMB['sitename']['value'] = "{SITENAME}"; +$FORUM_CRUMB['sitename']['sep'] = " :: "; + +$FORUM_CRUMB['forums']['value'] = "{FORUMS_TITLE}"; +$FORUM_CRUMB['forums']['sep'] = " :: "; + +$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}"; +$FORUM_CRUMB['parent']['sep'] = " :: "; + +$FORUM_CRUMB['subparent']['value'] = "{SUBPARENT_TITLE}"; +$FORUM_CRUMB['subparent']['sep'] = " :: "; + +$FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}"; + +?> \ No newline at end of file diff --git a/e107_plugins/gsitemap/admin_config.php b/e107_plugins/gsitemap/admin_config.php new file mode 100644 index 000000000..d7528edad --- /dev/null +++ b/e107_plugins/gsitemap/admin_config.php @@ -0,0 +1,506 @@ +freq_list = array + ( + "always" => GSLAN_11, + "hourly" => GSLAN_12, + "daily" => GSLAN_13, + "weekly" => GSLAN_14, + "monthly" => GSLAN_15, + "yearly" => GSLAN_16, + "never" => GSLAN_17 + ); + + if(isset($_POST['edit'])) + { + $this -> editSme(); + } + + if(isset($_POST['delete'])) + { + $this -> deleteSme(); + } + + if(isset($_POST['add_link'])) + { + $this -> addLink(); + } + + if(isset($_POST['import_links'])) + { + $this -> importLink(); + } + + + if($this -> message) + { + echo "
    ".$this -> message."

    "; + } + + + if(e_QUERY == "new") + { + $this -> doForm(); + } + else if(e_QUERY == "import") + { + $this -> importSme(); + } + else if(e_QUERY == "instructions") + { + $this -> instructions(); + } + else if(!$_POST['edit']) + { + $this -> showList(); + } + } + +/*+----------------------#######################################################################################---------------------+*/ + + function showList() + { + global $sql,$ns,$tp; + $gen = new convert; + $count = $sql -> db_Select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_order ASC"); + + $text = "
    + + "; + + if (!$count) + { + $text .= " +
    + ".GSLAN_39." + +
    "; + $ns -> tablerender("
    ".GSLAN_40."
    ", $text); + require_once(e_ADMIN."footer.php"); + exit; + } + else + { + $text .= " + +
    + + + + + + + + + + + + "; + + $glArray = $sql -> db_getList(); + foreach($glArray as $row2) + { + $datestamp = $gen->convert_date($row2['gsitemap_lastmod'], "short"); + + $text .= " + + + + + + + + + + "; + } + } + + $text .= "
    Id".GSLAN_25."".GSLAN_26."".GSLAN_27."".GSLAN_28."".GSLAN_9."".LAN_OPTIONS."
    ".$row2['gsitemap_id'] ."".$tp->toHTML($row2['gsitemap_name'],"","defs")."".$row2['gsitemap_url']."".$datestamp."".$this->freq_list[($row2['gsitemap_freq'])]."".$row2['gsitemap_priority'] ." +
    + + toJS(LAN_CONFIRMDEL." [".$row2['gsitemap_name']."]")."') \" src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' /> +
    +
    \n



    "; + $ns -> tablerender("
    ".GSLAN_24."
    ", $text); + } + +/*+----------------------#######################################################################################---------------------+*/ + + function editSme() + { + global $sql, $tp; + $e_idt = array_keys($_POST['edit']); + + if($sql -> db_Select("gsitemap", "*", "gsitemap_id='".$e_idt[0]."' ")) + { + $foo = $sql -> db_Fetch(); + $foo['gsitemap_name'] = $tp -> toFORM($foo['gsitemap_name']); + $foo['gsitemap_url'] = $tp -> toFORM($foo['gsitemap_url']); + + $this -> doForm($foo); + } + } + +/*+----------------------#######################################################################################---------------------+*/ + + function doForm($editArray=FALSE) + { + global $sql,$ns; + $count = $sql -> db_Select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_id ASC"); + $text = " +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ".GSLAN_25." +   + +
    ".GSLAN_26." +   + + +
    ".GSLAN_10." +   + +
    ".GSLAN_9."
    +  
    +
    ".GSLAN_30." +
    ".GSLAN_31.""; + $text .= r_userclass("gsitemap_active", $editArray['gsitemap_active'], "nobody,public,guest,member,admin,classes,language"); + $text .=" +
    "; + if(is_array($editArray)) + { + $text .= " + "; + } + else + { + $text .= ""; + } + + $text .= "
    +
    + "; + + $ns -> tablerender("
    ".GSLAN_29."
    ", $text); + + + } + +/*+----------------------#######################################################################################---------------------+*/ + + function addLink() + { + global $sql, $tp; + $gsitemap_name = $tp -> toDB($_POST['gsitemap_name']); + $gsitemap_url = $tp -> toDB($_POST['gsitemap_url']); + + if(isset($_POST['gsitemap_id'])) + { + $this -> message = $sql -> db_Update("gsitemap", "gsitemap_name='$gsitemap_name', gsitemap_url='$gsitemap_url', gsitemap_priority='".$_POST['gsitemap_priority']."', gsitemap_lastmod='".$_POST['gsitemap_lastmod']."', gsitemap_freq= '".$_POST['gsitemap_freq']."', gsitemap_order='".$_POST['gsitemap_order']."', gsitemap_active='".$_POST['gsitemap_active']."' WHERE gsitemap_id='".$_POST['gsitemap_id']."' ") ? LAN_UPDATED : LAN_UPDATED_FAILED; + } + else + { + $this -> message = ($sql -> db_Insert("gsitemap", "0, '".$_POST['gsitemap_name']."', '".$gsitemap_url."', '".$_POST['gsitemap_lastmod']."', '".$_POST['gsitemap_freq']."', '".$_POST['gsitemap_priority']."', '".$_POST['gsitemap_cat']."', '".$_POST['gsitemap_order']."', '".$_POST['gsitemap_img']."', '".$_POST['gsitemap_active']."' ")) ? LAN_CREATED : LAN_CREATED_FAILED; + } + } + +/*+----------------------#######################################################################################---------------------+*/ + + function deleteSme() + { + global $sql; + $d_idt = array_keys($_POST['delete']); + $this -> message = ($sql -> db_Delete("gsitemap", "gsitemap_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED; + } + +/*+----------------------#######################################################################################---------------------+*/ + + function importSme() + { + global $sql, $sql2, $PLUGINS_DIRECTORY, $ns; + $importArray = array(); + + /* sitelinks ... */ + $sql -> db_Select("links", "*", "ORDER BY link_order ASC", "no-where"); + $nfArray = $sql -> db_getList(); + foreach($nfArray as $row) + { + if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row['link_name']."' ")) + { + $importArray[] = array('name' => $row['link_name'], 'url' => $row['link_url'], 'type' => GSLAN_1); + } + } + + /* custom pages ... */ + $sql -> db_Select("page", "*", "ORDER BY page_datestamp ASC", "no-where"); + $nfArray = $sql -> db_getList(); + foreach($nfArray as $row) + { + if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row['page_title']."' ")) + { + $importArray[] = array('name' => $row['page_title'], 'url' => "page.php?".$row['page_id'],'type' => "Custom Page"); + } + } + + + + /* forums ... */ + $sql -> db_Select("forum", "*", "forum_parent!='0' ORDER BY forum_order ASC"); + $nfArray = $sql -> db_getList(); + foreach($nfArray as $row) + { + if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row['forum_name']."' ")) + { + $importArray[] = array('name' => $row['forum_name'], 'url' => $PLUGINS_DIRECTORY."forum/forum_viewforum.php?".$row['forum_id'], 'type' => "Forum"); + } + } + + + /* content pages ... */ + $sql -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1) = '0' ORDER BY content_heading"); + $nfArray = $sql -> db_getList(); + foreach($nfArray as $row) + { + $sql2 -> db_Select("pcontent", "content_id, content_heading", "content_parent = '".$row['content_id']."' AND content_refer != 'sa' ORDER BY content_heading"); + $nfArray2 = $sql2 -> db_getList(); + foreach($nfArray2 as $row2) + { + if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row2['content_heading']."' ")) + { + $importArray[] = array('name' => $row2['content_heading'], 'url' => $PLUGINS_DIRECTORY."content/content.php?content.".$row2['content_id'], 'type' => $row['content_heading']); + } + } + + } + + + /* end */ + + + + $text = " +
    + + + + + + + + + + + + + "; + + foreach($importArray as $ia) + { + $text .= " + + + + + + + "; + } + + + + + + + $text .= " + + + +
    ".GSLAN_6."
    ".GSLAN_2."".GSLAN_3."".GSLAN_4."".GSLAN_5."
    ".$ia['type']."".$ia['name']."".str_replace(SITEURL,"",$ia['url'])."
    +
    ".GSLAN_8."   ".GSLAN_9." :    ".GSLAN_10." + + +

    + + +
    + +
    +
    + "; + + $ns -> tablerender("
    ".GSLAN_7."
    ", $text); + } + +/*+----------------------#######################################################################################---------------------+*/ + + function importLink() + { + global $sql, $tp; + foreach($_POST['importid'] as $import) + { + list($name, $url, $type) = explode("^", $import); + $name = $tp -> toDB($name); + $url = $tp -> toDB($url); + $sql -> db_Insert("gsitemap", "0, '$name', '$url', '".time()."', '".$_POST['import_freq']."', '".$_POST['import_priority']."', '$type', '0', '', '0' "); + } + $this -> message = count($_POST['importid'])." link(s) imported."; + } + +/*+----------------------#######################################################################################---------------------+*/ + + function instructions() + { + global $ns, $PLUGINS_DIRECTORY; + + $text = "".GSLAN_33."

    +
      +
    • ".GSLAN_34."
    • +
    • ".GSLAN_35."
    • +
    • ".GSLAN_36."
    • +
    • ".GSLAN_37."
    • +
    • ".GSLAN_38."
    • +
        + "; + + $ns -> tablerender("
        ".GSLAN_32."
        ", $text); + + } + +/*+----------------------#######################################################################################---------------------+*/ + +} + + +require_once(e_ADMIN."footer.php"); + + +function admin_config_adminmenu() { + $action = (e_QUERY) ? e_QUERY : "list"; + $var['list']['text'] = GSLAN_20; + $var['list']['link'] = e_SELF; + $var['list']['perm'] = "7"; + $var['instructions']['text'] = GSLAN_21 ; + $var['instructions']['link'] = e_SELF."?instructions"; + $var['instructions']['perm'] = "7"; + $var['new']['text'] = GSLAN_22 ; + $var['new']['link'] = e_SELF."?new"; + $var['new']['perm'] = "7"; + $var['import']['text'] = GSLAN_23; + $var['import']['link'] = e_SELF."?import"; + $var['import']['perm'] = "0"; + show_admin_menu(GSLAN_19, $action, $var); +} + +?> diff --git a/e107_plugins/gsitemap/gsitemap_sql.php b/e107_plugins/gsitemap/gsitemap_sql.php new file mode 100644 index 000000000..efbbacc73 --- /dev/null +++ b/e107_plugins/gsitemap/gsitemap_sql.php @@ -0,0 +1,13 @@ +CREATE TABLE gsitemap ( + gsitemap_id int(11) unsigned NOT NULL auto_increment, + gsitemap_name varchar(200) NOT NULL default '', + gsitemap_url varchar(200) NOT NULL default '', + gsitemap_lastmod varchar(15) NOT NULL default '', + gsitemap_freq varchar(10) NOT NULL default '', + gsitemap_priority char(3) NOT NULL default '', + gsitemap_cat varchar(100) NOT NULL default '', + gsitemap_order int(3) NOT NULL default '0', + gsitemap_img varchar(50) NOT NULL default '', + gsitemap_active int(3) NOT NULL default '0', + PRIMARY KEY (gsitemap_id) +) TYPE=MyISAM; \ No newline at end of file diff --git a/e107_plugins/gsitemap/images/icon.png b/e107_plugins/gsitemap/images/icon.png new file mode 100644 index 000000000..86ea229cf Binary files /dev/null and b/e107_plugins/gsitemap/images/icon.png differ diff --git a/e107_plugins/gsitemap/images/icon_16.png b/e107_plugins/gsitemap/images/icon_16.png new file mode 100644 index 000000000..a93612f17 Binary files /dev/null and b/e107_plugins/gsitemap/images/icon_16.png differ diff --git a/e107_plugins/gsitemap/languages/gsitemap_English.php b/e107_plugins/gsitemap/languages/gsitemap_English.php new file mode 100644 index 000000000..7315b8ff0 --- /dev/null +++ b/e107_plugins/gsitemap/languages/gsitemap_English.php @@ -0,0 +1,61 @@ +https://www.google.com/webmasters/sitemaps/stats and enter the following URL -> ".SITEURL."gsitemap.php - if this url doesn't look right to you, please make sure your site url is correct in admin -> preferences"); +define("GSLAN_38", "For more information on Google Sitemap protocol, go to http://www.google.com/webmasters/sitemaps/docs/en/protocol.html."); +define("GSLAN_39", "No links in sitemap - import sitelinks?"); +define("GSLAN_40", "Google Sitemap Entries"); + +?> \ No newline at end of file diff --git a/e107_plugins/gsitemap/plugin.php b/e107_plugins/gsitemap/plugin.php new file mode 100644 index 000000000..3a568634a --- /dev/null +++ b/e107_plugins/gsitemap/plugin.php @@ -0,0 +1,98 @@ +http://www.google.com/webmasters/sitemaps/docs/en/protocol.html"; +$eplug_compatible = "e107 v0.7"; +$eplug_readme = ""; // leave blank if no readme file + +// Name of the plugin's folder ------------------------------------------------------------------------------------- +$eplug_folder = "gsitemap"; + +// Mane of menu item for plugin ---------------------------------------------------------------------------------- + $eplug_menu_name = ""; + +// Name of the admin configuration file -------------------------------------------------------------------------- +$eplug_conffile = "admin_config.php"; + +// Icon image and caption text ------------------------------------------------------------------------------------ +$eplug_icon = $eplug_folder."/images/icon.png"; +$eplug_icon_small = $eplug_folder."/images/icon_16.png"; +$eplug_logo = $eplug_folder."/images/icon.png"; + +$eplug_caption = "Configure Sitemap"; + +// List of preferences ----------------------------------------------------------------------------------------------- +$eplug_prefs = ""; +$eplug_module = TRUE; +$eplug_table_names = array("gsitemap"); + + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = array(" +CREATE TABLE ".MPREFIX."gsitemap ( + gsitemap_id int(11) unsigned NOT NULL auto_increment, + gsitemap_name varchar(200) NOT NULL default '', + gsitemap_url varchar(200) NOT NULL default '', + gsitemap_lastmod varchar(15) NOT NULL default '', + gsitemap_freq varchar(10) NOT NULL default '', + gsitemap_priority char(3) NOT NULL default '', + gsitemap_cat varchar(100) NOT NULL default '', + gsitemap_order int(3) NOT NULL default '0', + gsitemap_img varchar(50) NOT NULL default '', + gsitemap_active int(3) NOT NULL default '0', + PRIMARY KEY (gsitemap_id) +) TYPE=MyISAM;" +); + + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$eplug_link = TRUE; +$eplug_link_name = "Sitemap"; +$eplug_link_url = "gsitemap.php?show"; + + +// Text to display after plugin successfully installed ------------------------------------------------------------------ +$eplug_done = "Installation Successful.."; + +$eplug_uninstall_done = "You should delete gsitemap.php from your root directory."; + +// upgrading ... // + +$upgrade_add_prefs = ""; + +$upgrade_remove_prefs = ""; + +$upgrade_alter_tables = ""; + +$eplug_upgrade_done = ""; + + + + + + +?> \ No newline at end of file diff --git a/e107_plugins/index.html b/e107_plugins/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/integrity_check/admin_integrity_check.php b/e107_plugins/integrity_check/admin_integrity_check.php new file mode 100644 index 000000000..4b2ad1819 --- /dev/null +++ b/e107_plugins/integrity_check/admin_integrity_check.php @@ -0,0 +1,521 @@ + 1) { + $dh_crc = (file_exists($o_path."log_crc.txt") ? @fopen($o_path."log_crc.txt", "a") : FALSE); + $dh_miss = (file_exists($o_path."log_miss.txt") ? @fopen($o_path."log_miss.txt", "a") : FALSE); + } + if (strpos($filename, ".gz") == strlen($filename)-3) { + $p = 1; + } else { + $p = 0; + } + $dh = ($p == 0 ? @fopen($filename, "r") : @gzopen($filename, "rb")); + $end = ($p == 0 ? feof($dh) : gzeof($dh)); + while (!$end && $counts >= $_counter) { + if ($from == 0) { + $line = ($p == 0 ? fgets($dh, 4096) : $line = gzgets($dh, 4096)); + ++$_counter; + } else { + if ($p == 0) { + fseek($dh, $from); + } else { + gzseek($dh, $from); + } + $line = ($p == 0 ? fgets($dh, 4096) : gzgets($dh, 4096)); + ++$_counter; + $from = 0; + } + $a = substr($line, 0, strpos($line, "<-:sfv:->")); + if ($a) { + $b = substr($line, (strpos($line, "<-:sfv:->")+9)); + $a = str_replace($dirs_2, $dirs_1, $a); + if (file_exists(e_BASE.$a)) { + if (trim($b) != trim(generate_sfv_checksum(e_BASE.$a))) { + if ($_log[4] == 1) { + $_log['crc'] .= "
      • ".$a."
      • "; + } else { + if (!$dh_crc) { + $dh_crc = @fopen($o_path."log_crc.txt", "w"); + } + @fwrite($dh_crc, "
      • ".$a."
      • \n"); + } + } + } elseif ($a != "install.php" && $a != "upgrade.php" && (strpos($a, "e107_themes/") !== 0 || !$check || strpos($a, "templates/") != 0)) { + if ($_log[4] == 1) { + $_log['miss'] .= "
      • ".$a."
      • "; + } else { + if (!$dh_miss) { + $dh_miss = @fopen($o_path."log_miss.txt", "w"); + } + @fwrite($dh_miss, "
      • ".$a."
      • \n"); + } + } + } + $end = ($p == 0 ? feof($dh) : gzeof($dh)); + } + if ($end) { + $the_end = 0; + } + if ($p == 0) { + $_log[5] = ftell($dh); + fclose($dh); + } else { + $_log[5] = gztell($dh); + gzclose($dh); + } + if ($_log[4] > 1) { + if ($dh_crc) { + fclose($dh_crc); + } + if ($dh_miss) { + fclose($dh_miss); + } + } + return $the_end; +} +//Generating Checksum for File +function generate_sfv_checksum($filename) { + return strtoupper(dechex(crc32(str_replace(chr(13).chr(10), chr(10) , file_get_contents(str_replace(" ", "%20", $filename)))))); +} + +//Get Files for doing a crc-file +function hex_getfiles($dir, $root, $m = "") { + global $t_array; + $dh = opendir($dir); + while ($file = readdir($dh)) { + if ($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt") { + if (is_file($dir.$file)) { + if ((is_array($m) && strpos($file, "core_".$m['e107_version']."b".$m['e107_build'].".crc") === 0) || ($m == "" && strpos($file, "core_") !== 0 && (strpos($file, ".crc") === strlen($file)-4 || strpos($file, ".crc.gz") === strlen($file)-7))) { + $t_array[] = $dir.$file; + } + } else { + hex_getfiles($dir.$file."/", $root, $m); + } + } + } + closedir($dh); + return $t_array; +} + +//Load e107-Files ($s = 1) or e107-File-Tree ($s = 2) +function hex_getdirs($dir, $root, $s = "1", $path = e_BASE) { + global $t_array, $_arr; + $dh = opendir($dir); + $search = array("../", $path); + $replace = array("", ""); + while ($file = readdir($dh)) { + if ($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt" && !in_array($file, $root) && !in_array(str_replace($search, $replace, $dir.$file), $root)) { + if (is_file($dir.$file)) { + if ($s == "1") { + $t_array[] = str_replace($search, $replace, $dir.$file); + } + } elseif (!in_array($file, $_arr) && !in_array(str_replace($search, $replace, $dir.$file), $_arr)) { + if ($s == "2" || $s == "3") { + $t_array[] = str_replace($search, $replace, $dir.$file); + } + if ($s != "3") { + hex_getdirs($dir.$file."/", $root, $s); + } + } + } + } + closedir($dh); + return $t_array; +} + + +require_once("../../class2.php"); + +//Output-Path +$o_path = "crc/"; + +if (!getperms("P")) { + header("location:".e_BASE."index.php"); + exit; +} + +if (e_QUERY) { + $query = explode(".", e_QUERY); +} + +//Language-definitions +@include_once((file_exists("languages/".e_LANGUAGE.".php") ? "languages/".e_LANGUAGE.".php" : "languages/English.php")); + +if (file_exists($o_path."log.txt")) { + $_log = explode(".-.", stripslashes(file_get_contents($o_path."log.txt"))); + $steps = intval($_log[2] / $_log[4])+1; +} else { + if (file_exists($o_path."log_crc.txt")) { + $err_1 = @unlink($o_path."log_crc.txt"); + } + if (file_exists($o_path."log_miss.txt")) { + $err_2 = @unlink($o_path."log_miss.txt"); + } + +} + +require_once(e_ADMIN."auth.php"); + +function headerjs() { + global $o_path, $_log, $steps; + if ((file_exists($o_path."log.txt") && $_log[3] > $steps) || ($_POST['steps'] > 1 && file_exists($_POST['input_files']))) { + echo "\n"; + } +} + + +//check Version you are using +if (file_exists(e_ADMIN."ver.php")) { + include(e_ADMIN."ver.php"); +} + +//Arrays for replacing Directorys (if non-standard) +$dirs_1 = array($ADMIN_DIRECTORY, $FILES_DIRECTORY, $IMAGES_DIRECTORY, $THEMES_DIRECTORY, $PLUGINS_DIRECTORY, $HANDLERS_DIRECTORY, $LANGUAGES_DIRECTORY, $HELP_DIRECTORY); +$dirs_2 = array("e107_admin/", "e107_files/", "e107_images/", "e107_themes/", "e107_plugins/", "e107_handlers/", "e107_languages/", "e107_docs/help/"); + +//Files / Dirs never coming into core-sfv +$exclude = array($FILES_DIRECTORY."backend", $FILES_DIRECTORY."downloadimages", $FILES_DIRECTORY."downloads", $FILES_DIRECTORY."downloadthumbs", $FILES_DIRECTORY."images", $FILES_DIRECTORY."misc", $FILES_DIRECTORY."public" , substr($IMAGES_DIRECTORY, 0, strlen($IMAGES_DIRECTORY)-1), $PLUGINS_DIRECTORY."custom", "e107_config.php", "CVS", $PLUGINS_DIRECTORY."integrity_check/crc"); + +unset($message); + +//for core-crc-files: merging arrays together +if (isset($_POST['activate'])) { + if (isset($_POST['Arr'])) { + $_arr = array_merge($_POST['Arr'], array($_POST['activate'])); + } else { + $_arr = array($_POST['activate']); + } +} else { + $_arr = array(); +} + + +if (file_exists("do_core_file.php")) { + require_once("do_core_file.php"); + if (!function_exists('docorefile')) { + $message = "
        ".Integ_39."
        "; + } +} + + +//Make a new plugin-crc-file +if (isset($_POST['doplugfile']) && $_POST['save_plug_name'] != "") { + $file_array = hex_getdirs($_POST['plug_activate']."/", array() , "1", e_PLUGIN."/"); + sort($file_array); + unset($t_array); + reset($file_array); + $data = ""; + foreach($file_array as $v) { + $data .= str_replace($dirs_1, $dirs_2, $v)."<-:sfv:->".generate_sfv_checksum(e_BASE."/".$v)."\n"; + } + if (!isset($_POST['gz_plug'])) { + $dh = @fopen($o_path.$_POST['save_plug_name'], "w"); + if (@fwrite($dh, $data)) { + $message = "
        ".Integ_01."
        "; + } else { + $message = "
        ".Integ_02."
        "; + } + fclose($dh); + } else { + $dh = @gzopen($o_path.$_POST['save_plug_name'].".gz", "wb"); + if (@gzwrite($dh, $data)) { + $message = "
        ".Integ_01."
        "; + } else { + $message = "
        ".Integ_02."
        "; + } + gzclose($dh); + } +} + +//Check existing sfv-File START +if (isset($_POST['docheck']) && $_POST['input_files'] != "") { + if (file_exists($_POST['input_files'])) { + $_log = array(); + $_log[2] = lines($_POST['input_files']); + $steps = intval($_log[2] / $_POST['steps'])+1; + $_log[3] = $_log[2]-$steps; + $_log[4] = $_POST['steps']; + $the_end = check_sfv_file($_POST['input_files'], $_POST['theme_folders'], 0, $steps); + if ($_log[3] > 0) { + $text = "
        ".str_replace("{counts}", $_log[3], Integ_38)."
        ". Integ_36."
        ".Integ_37." +
        "; + $ns->tablerender("", "".$text.""); + } + if ($the_end != 0) { + $_log[0] = $_POST['input_files']; + $_log[1] = $_POST['theme_folders']; + $tmp = addslashes($_log[0].".-.".$_log[1].".-.".$_log[2].".-.".$_log[3].".-.".$_log[4].".-.".$_log[5]); + $handle = @fopen($o_path."log.txt", "w"); + @fwrite($handle, $tmp); + @fclose($handle); + exit; + } elseif ($_log['crc'] || $_log['miss']) { + $message = ""; + if ($_log['crc']) { + $message .= "
        +
        ".Integ_04."*

          ". $_log['crc']."
        "; + } + if ($_log['miss']) { + $message .= "
        +
        ".Integ_03."

          ". $_log['miss']."
        "; + } + if ($_log['crc']) { + $message .= Integ_29; + } + } else { + $message = "
        ".Integ_15; + } + } else { + $message = Integ_05; + } +} +if (file_exists($o_path."log.txt")) { + $the_end = check_sfv_file($_log[0], $_log[1], $_log[5], $steps); + $_log[3] = $_log[3] - $steps; + if ($_log[3] > 0) { + $text = "
        ".str_replace("{counts}", $_log[3], Integ_38)."
        ". Integ_36."
        ".Integ_37." +
        "; + $ns->tablerender("", "".$text.""); + } + if ($the_end != 0 && $_log[3] > 0) { + $tmp = addslashes($_log[0].".-.".$_log[1].".-.".$_log[2].".-.".$_log[3].".-.".$_log[4].".-.".$_log[5]); + $handle = @fopen($o_path."log.txt", "w"); + @fwrite($handle, $tmp); + @fclose($handle); + exit; + } elseif (file_exists($o_path."log_crc.txt") || file_exists($o_path."log_miss.txt")) { + $message = ""; + if (file_exists($o_path."log_crc.txt")) { + $message .= "
        +
        ".Integ_04."*

          ". file_get_contents($o_path."log_crc.txt")."
        "; + } + if (file_exists($o_path."log_miss.txt")) { + $message .= "
        +
        ".Integ_03."

          ". file_get_contents($o_path."log_miss.txt")."
        "; + @unlink($o_path."log_miss.txt"); + } + if (file_exists($o_path."log_crc.txt")) { + $message .= Integ_29; + @unlink($o_path."log_crc.txt"); + } + + } else { + $message = "
        ".Integ_15; + } + @unlink($o_path."log.txt"); +} + +//Message-Output +if (isset($message)) { + $ns->tablerender("", "".$message.""); +} + + +//Load existing core-sfv-Files matching your Version +unset($file_array); +$t_array = array(); +$core_array = hex_getfiles($o_path, $PLUGINS_DIRECTORY, $e107info); +$t_array = array(); + +//Search plugin-crc-files +if ($file_array = hex_getfiles(e_PLUGIN, $PLUGINS_DIRECTORY)) { + sort($file_array); +} +unset($t_array); + + +//Start output here +$text = "
        +
        + + + + + + + + + + + "; + +if (is_writable($o_path)) { + + //do_core_file.php only available 4 dev-team sorry guys... + if (function_exists('docorefile')) { + $text .= docorefile(); + } + $text .= " + + + + + + + + + + + + +

        ".Integ_27."

        +
        ".Integ_06." +
        "; +if ($core_array[0]) { + $text .= "".Integ_19.":
        "; + reset($core_array); + foreach($core_array as $v) { + $text .= "".str_replace(array(e_BASE, e_PLUGIN, $o_path), array("", "", ""), $v)."
        "; + } +} else { + $text .= "".Integ_16."
        "; +} +if ($file_array[0]) { + $text .= "
        ".Integ_20.":
        "; + reset($file_array); + foreach($file_array as $v) { + $text .= "".str_replace(array(e_BASE, e_PLUGIN, $PLUGINS_DIRECTORY), array("", "", ""), $v)."
        "; + } +} else { + $text .= "".Integ_17."
        "; +} +if ($core_array[0]) { + $text .= "

        + ".Integ_23."
        "; +} +if ($err_1 || $err_2 || !is_writeable($o_path)) { + $err_m = Integ_35."
        "; + if ($err_1) { + $err_m .= Integ_32."
        "; + } + if ($err_2) { + $err_m .= Integ_33."
        "; + } + if (!is_writeable($o_path)) { + $err_m .= Integ_34."
        "; + } +} else { + $err_m = ""; +} + +$text .= "
        ".Integ_30."
        ".($err_m != "" ? $err_m."
        " : "")."
        ".Integ_31." +
        + +
        ".Integ_18." +
        + + + ".Integ_21." +
        ".Integ_11."  + + + ".Integ_22." +
        +
        + +
        +
        "; +} else { + $text .= " + ".str_replace("{output}", $o_path, Integ_14)." + + "; +} +$text .= "


        ".Integ_26."
        "; + + +$ns->tablerender(Integ_13, $text); + +require_once(e_ADMIN.'footer.php'); +?> + + \ No newline at end of file diff --git a/e107_plugins/integrity_check/images/integ.gif b/e107_plugins/integrity_check/images/integ.gif new file mode 100644 index 000000000..01bad3c59 Binary files /dev/null and b/e107_plugins/integrity_check/images/integ.gif differ diff --git a/e107_plugins/integrity_check/images/integrity_16.png b/e107_plugins/integrity_check/images/integrity_16.png new file mode 100644 index 000000000..2f3b08024 Binary files /dev/null and b/e107_plugins/integrity_check/images/integrity_16.png differ diff --git a/e107_plugins/integrity_check/images/integrity_32.png b/e107_plugins/integrity_check/images/integrity_32.png new file mode 100644 index 000000000..c453288b4 Binary files /dev/null and b/e107_plugins/integrity_check/images/integrity_32.png differ diff --git a/e107_plugins/integrity_check/languages/English.php b/e107_plugins/integrity_check/languages/English.php new file mode 100644 index 000000000..0ba011390 --- /dev/null +++ b/e107_plugins/integrity_check/languages/English.php @@ -0,0 +1,55 @@ +not be saved within the crc-file."); +define("Integ_11", "Filename:"); +define("Integ_12", "Create sfv file"); +define("Integ_13", "Integrity-checking"); +define("Integ_14", "SFV-Creation not possible, because the folder ".e_PLUGIN."integrity_check/{output} is not writable. Please chmod this folder to 777!"); +define("Integ_15", "All files have been checked and are o.k.!"); +define("Integ_16", "No core-crc-file available"); +define("Integ_17", "No plugin-crc-files available"); +define("Integ_18", "Create Plugin-CRC-File"); +define("Integ_19", "Core-Checksum-Files"); +define("Integ_20", "Plugin-Checksum-Files"); +define("Integ_21", "Select the plugin you want to create a crc-file for."); +define("Integ_22", "Use gzip"); +define("Integ_23", "Only check installed themes"); +define("Integ_24", "Admin Front Page"); +define("Integ_25", "Leave Admin Area"); +define("Integ_26", "Load Site with normal header"); +define("Integ_27", "USE THE FILE INSPECTOR FOR CHECKING CORE FILES"); + +// define("Integ_29", "

        *CRC-ERRORS:
        These are checksum errors and there are two possible reasons for this:
        -You changed something within the mentioned file, so it isn't longer the same as the original.
        -The mentioned file is corrupt, you should re-upload it!"); +// language file should contain NO html. + +define("Integ_30", "For less cpu-usage , you can do the checking in 1 - 10 steps."); +define("Integ_31", "Steps: "); +define("Integ_32", "There is a file named log_crc.txt in your crc-folder. Please delete! (Or try refreshing)"); +define("Integ_33", "There is a file named log_miss.txt in your crc-folder. Please delete! (Or try refreshing)"); +define("Integ_34", "Your Crc-folder is not writable!"); +define("Integ_35", "Because of the following reason(s) you are only allowed to select one step:"); +define("Integ_36", "Click here, if you don't want to wait 5 Seconds till the next step:"); +define("Integ_37", "Click me"); +define("Integ_38", "Another {counts} lines to do..."); +define("Integ_39", "Please delete the file:
        ".e_PLUGIN."integrity_check/do_core_file.php!
        It is outdated and never meant for public release..."); + +?> \ No newline at end of file diff --git a/e107_plugins/integrity_check/plugin.php b/e107_plugins/integrity_check/plugin.php new file mode 100644 index 000000000..d6d7e6745 --- /dev/null +++ b/e107_plugins/integrity_check/plugin.php @@ -0,0 +1,73 @@ + \ No newline at end of file diff --git a/e107_plugins/lastseen/languages/English.php b/e107_plugins/lastseen/languages/English.php new file mode 100644 index 000000000..fd3c0678a --- /dev/null +++ b/e107_plugins/lastseen/languages/English.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/e107_plugins/lastseen/lastseen_menu.php b/e107_plugins/lastseen/lastseen_menu.php new file mode 100644 index 000000000..dd06ab5d9 --- /dev/null +++ b/e107_plugins/lastseen/lastseen_menu.php @@ -0,0 +1,46 @@ + db_Select("user", "user_id, user_name, user_currentvisit", "ORDER BY user_currentvisit DESC LIMIT 0,10", "nowhere"); +$userArray = $sql -> db_getList(); + +$gen = new convert; +$text = "
          "; +foreach($userArray as $user) +{ +// extract($user); + $seen_ago = $gen -> computeLapse($user['user_currentvisit'], false, false, true, 'short'); + $lastseen = ($seen_ago ? $seen_ago : "1 ".LANDT_09)." ".LANDT_AGO; +$text .= "
        • ".$user['user_name']."
          [ ".$lastseen." ]
        • "; +} +$text .= "
        "; + +$ns->tablerender(LSP_LAN_1, $text, 'lastseen'); +?> \ No newline at end of file diff --git a/e107_plugins/links_page/admin_linkspage_config.php b/e107_plugins/links_page/admin_linkspage_config.php new file mode 100644 index 000000000..9a73c9bec --- /dev/null +++ b/e107_plugins/links_page/admin_linkspage_config.php @@ -0,0 +1,250 @@ + getLinksPagePref(); + +$deltest = array_flip($_POST); + +//if (e_QUERY) { +// $qs = explode(".", e_QUERY); +//} +if(e_QUERY){ + $qs = explode(".", e_QUERY); + + if(is_numeric($qs[0])){ + $from = array_shift($qs); + }else{ + $from = "0"; + } +} +if(isset($_POST['delete'])){ + $tmp = array_pop($tmp = array_flip($_POST['delete'])); + list($delete, $del_id) = explode("_", $tmp); +} +if (isset($_POST['create_category'])) { + $lc -> dbCategoryCreate(); +} +if (isset($_POST['update_category'])) { + $lc -> dbCategoryUpdate(); +} +if (isset($_POST['updateoptions'])) { + $linkspage_pref = $lc -> UpdateLinksPagePref(); + $lc -> show_message(LCLAN_ADMIN_6); +} +if (isset($_POST['add_link'])) { + $lc -> dbLinkCreate(); +} +//upload link icon +if(isset($_POST['uploadlinkicon'])){ + $lc -> uploadLinkIcon(); +} +//upload category icon +if(isset($_POST['uploadcatlinkicon'])){ + $lc -> uploadCatLinkIcon(); +} +//update link order +if (isset($_POST['update_order'])) { + $lc -> dbOrderUpdate($_POST['link_order']); +} +//update link category order +if (isset($_POST['update_category_order'])) { + $lc -> dbOrderCatUpdate($_POST['link_category_order']); +} +if (isset($_POST['inc'])) { + $lc -> dbOrderUpdateInc($_POST['inc']); +} +if (isset($_POST['dec'])) { + $lc -> dbOrderUpdateDec($_POST['dec']); +} +//delete link +if (isset($delete) && $delete == 'main') { + $sql->db_Select("links_page", "link_order", "link_id='".$del_id."'"); + $row = $sql->db_Fetch(); + $sql2 = new db; + $sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".$id."'"); + while ($row = $sql->db_Fetch()) { + $sql2->db_Update("links_page", "link_order=link_order-1 WHERE link_id='".$row['link_id']."'"); + } + if ($sql->db_Delete("links_page", "link_id='".$del_id."'")) { + $lc->show_message(LCLAN_ADMIN_10." #".$del_id." ".LCLAN_ADMIN_11); + } +} +//delete category +if (isset($delete) && $delete == 'category') { + //check if links are present for this category + if($sql->db_Select("links_page", "*", "link_category='$del_id' ")) { + $lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LAN_DELETED_FAILED."
        ".LCLAN_ADMIN_15); + //no? then we can safely remove this category + }else{ + if ($sql->db_Delete("links_page_cat", "link_category_id='$del_id' ")) { + $lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LCLAN_ADMIN_11); + unset($id); + } + } +} +//delete submitted link +if (isset($delete) && $delete == 'sn') { + if ($sql->db_Delete("tmp", "tmp_time='$del_id' ")) { + $lc->show_message(LCLAN_ADMIN_13); + } +} + + +//show link categories (cat edit) +if (!e_QUERY) { + $lc->show_categories("cat"); +} + +//show cat edit form +if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2])) { + $lc->show_cat_create(); +} + +//show cat create form +if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) ) { + $lc->show_cat_create(); +} + +if (isset($qs[0]) && $qs[0] == 'link') { + //view categories (link select cat) + if (!isset($qs[1])){ + $lc->show_categories("link"); + + //view links in cat + }elseif (isset($qs[1]) && $qs[1] == 'view' && isset($qs[2]) && (is_numeric($qs[2]) || $qs[2] == "all") ) { + $lc->show_links(); + + //edit link + }elseif (isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2])) { + $lc->show_link_create(); + + //create link + }elseif (isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) ) { + $lc->show_link_create(); + + //post submitted + }elseif (isset($qs[1]) && $qs[1] == 'sn' && isset($qs[2]) && is_numeric($qs[2]) ) { + $lc->show_link_create(); + } +} + +//view submitted links +if (isset($qs[0]) && $qs[0] == 'sn') { + $lc->show_submitted(); +} + +//options +if (isset($qs[0]) && $qs[0] == 'opt') { + $lc->show_pref_options(); +} + +// ##### Display options -------------------------------------------------------------------------- +function admin_linkspage_config_adminmenu(){ + global $qs, $sql; + if ($qs[0] == "") { + $act = "cat"; + }else{ + $act = $qs[0]; + if(isset($qs[1])){ + if($qs[1] == "create"){ + $act .= ".create"; + } + if($qs[1] == "edit"){ + $act .= ""; + } + if($qs[1] == "view"){ + $act .= ""; + } + } + } + + $var['cat']['text'] = LCLAN_ADMINMENU_2; + $var['cat']['link'] = e_SELF; + + $var['cat.create']['text'] = LCLAN_ADMINMENU_3; + $var['cat.create']['link'] = e_SELF."?cat.create"; + + $var['link']['text'] = LCLAN_ADMINMENU_4; + $var['link']['link'] = e_SELF."?link"; + + $var['link.create']['text'] = LCLAN_ADMINMENU_5; + $var['link.create']['link'] = e_SELF."?link.create"; + + if ($tot = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ")) { + $var['sn']['text'] = LCLAN_ADMINMENU_7." (".$tot.")"; + $var['sn']['link'] = e_SELF."?sn"; + } + + $var['opt']['text'] = LCLAN_ADMINMENU_6; + $var['opt']['link'] = e_SELF."?opt"; + + show_admin_menu(LCLAN_ADMINMENU_1, $act, $var); + + if($qs[0] != "opt"){ + unset($var); + $var=array(); + if ($sql->db_Select("links_page_cat", "*")) { + while ($row = $sql->db_Fetch()) { + $var[$row['link_category_id']]['text'] = $row['link_category_name']; + $var[$row['link_category_id']]['link'] = e_SELF."?link.view.".$row['link_category_id']; + } + $active = ($qs[0] == 'link') ? $id : FALSE; + show_admin_menu(LCLAN_ADMINMENU_8, $active, $var); + } + } + if(isset($qs[0]) && $qs[0] == "opt"){ + unset($var); + $var=array(); + $var['optgeneral']['text'] = LCLAN_OPT_MENU_1; + $var['optmanager']['text'] = LCLAN_OPT_MENU_2; + $var['optcategory']['text'] = LCLAN_OPT_MENU_3; + $var['optlinks']['text'] = LCLAN_OPT_MENU_4; + $var['optrefer']['text'] = LCLAN_OPT_MENU_5; + $var['optrating']['text'] = LCLAN_OPT_MENU_6; + $var['optmenu']['text'] = LCLAN_OPT_MENU_7; + show_admin_menu(LCLAN_ADMINMENU_6, $qs[0], $var, TRUE); + } +} + +require_once(e_ADMIN.'footer.php'); +exit; + +// End --------------------------------------------------------------------------------------------------------- + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/cat_images/linkspage_16.png b/e107_plugins/links_page/cat_images/linkspage_16.png new file mode 100644 index 000000000..0523758d9 Binary files /dev/null and b/e107_plugins/links_page/cat_images/linkspage_16.png differ diff --git a/e107_plugins/links_page/e_comment.php b/e107_plugins/links_page/e_comment.php new file mode 100644 index 000000000..bb50c2ae0 --- /dev/null +++ b/e107_plugins/links_page/e_comment.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/e107_plugins/links_page/e_frontpage.php b/e107_plugins/links_page/e_frontpage.php new file mode 100644 index 000000000..3c666e29e --- /dev/null +++ b/e107_plugins/links_page/e_frontpage.php @@ -0,0 +1,29 @@ + $PLUGINS_DIRECTORY.'links_page/links.php', 'title' => LCLAN_PLUGIN_LAN_1); + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/e_latest.php b/e107_plugins/links_page/e_latest.php new file mode 100644 index 000000000..637effb3d --- /dev/null +++ b/e107_plugins/links_page/e_latest.php @@ -0,0 +1,6 @@ +db_Select("tmp", "*", "tmp_ip='submitted_link' "); +$text .= "
        ".($submitted_links ? " ".ADLAN_LAT_5.": $submitted_links" : " ".ADLAN_LAT_5.": ".$submitted_links)."
        "; +?> \ No newline at end of file diff --git a/e107_plugins/links_page/e_list.php b/e107_plugins/links_page/e_list.php new file mode 100644 index 000000000..1edceb448 --- /dev/null +++ b/e107_plugins/links_page/e_list.php @@ -0,0 +1,46 @@ + db_Select("plugin", "*", "plugin_path = 'links_page' AND plugin_installflag = '1' ")){ + return; + } + + $LIST_CAPTION = $arr[0]; + $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); + + if($mode == "new_page" || $mode == "new_menu" ){ + $lvisit = $this -> getlvisit(); + $qry = " l.link_datestamp>".$lvisit." AND "; + }else{ + $qry = ""; + } + + $bullet = $this -> getBullet($arr[6], $mode); + + $qry = " + SELECT l.*, c.link_category_id, c.link_category_name + FROM #links_page AS l + LEFT JOIN #links_page_cat AS c ON c.link_category_id = l.link_category + WHERE ".$qry." l.link_class REGEXP '".e_CLASS_REGEXP."' AND c.link_category_class REGEXP '".e_CLASS_REGEXP."' + ORDER BY l.link_datestamp DESC LIMIT 0,".intval($arr[7])." + "; + + if(!$sql -> db_Select_gen($qry)){ + $LIST_DATA = LIST_LINKS_2; + }else{ + while($row = $sql -> db_Fetch()){ + + $rowheading = $this -> parse_heading($row['link_name'], $mode); + $ICON = $bullet; + $HEADING = "".$rowheading.""; + $AUTHOR = ""; + $CATEGORY = ($arr[4] ? "".$row['link_category_name']."" : ""); + $DATE = ($arr[5] ? ($row['link_datestamp'] > 0 ? $this -> getListDate($row['link_datestamp'], $mode) : "") : ""); + $INFO = ""; + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + + } + } + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/e_notify.php b/e107_plugins/links_page/e_notify.php new file mode 100644 index 000000000..6673cd4d8 --- /dev/null +++ b/e107_plugins/links_page/e_notify.php @@ -0,0 +1,44 @@ + NT_LAN_LP_2); +} + + +if (!function_exists('notify_linksub')) +{ + function notify_linksub($data) + { + global $nt, $_lanfile; + include_lan(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php"); + foreach ($data as $key => $value) + { + $message .= $key.': '.$value.'
        '; + } + $nt -> send('linksub', NT_LAN_LP_3, $message); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/e_rss.php b/e107_plugins/links_page/e_rss.php new file mode 100644 index 000000000..9fdfcf087 --- /dev/null +++ b/e107_plugins/links_page/e_rss.php @@ -0,0 +1,50 @@ +limit; + +$rss = array(); +$sqlrss = new db; +if($items = $sqlrss->db_Select_gen($qry)){ + $i=0; + while($rowrss = $sqlrss -> db_Fetch()){ + $tmp = ''; + $rss[$i]['author'] = $tmp[1]; + $rss[$i]['author_email'] = $tmp[2]; + $rss[$i]['link'] = $rowrss['link_url']; + $rss[$i]['linkid'] = $rowrss['link_id']; + $rss[$i]['title'] = $rowrss['link_name']; + $rss[$i]['description'] = ''; + $rss[$i]['category_name'] = $rowrss['link_category_name']; + $rss[$i]['category_link'] = $e107->base_path.$PLUGINS_DIRECTORY."links_page/links.php?cat.".$rowrss['link_category_id']; + $rss[$i]['datestamp'] = $rowrss['link_datestamp']; + $rss[$i]['enc_url'] = ""; + $rss[$i]['enc_leng'] = ""; + $rss[$i]['enc_type'] = ""; + $i++; + } +} + +//##### ------------------------------------------------------------------------------------ +$eplug_rss_data[] = $rss; +$eplug_rss_feed[] = $feed; +?> \ No newline at end of file diff --git a/e107_plugins/links_page/e_search.php b/e107_plugins/links_page/e_search.php new file mode 100644 index 000000000..d580cca49 --- /dev/null +++ b/e107_plugins/links_page/e_search.php @@ -0,0 +1,11 @@ + e_PLUGIN.'links_page/search/search_parser.php', 'qtype' => LCLAN_ADMIN_14, 'refpage' => 'links.php', 'advanced' => e_PLUGIN.'links_page/search/search_advanced.php'); + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/e_status.php b/e107_plugins/links_page/e_status.php new file mode 100644 index 000000000..dc53df370 --- /dev/null +++ b/e107_plugins/links_page/e_status.php @@ -0,0 +1,7 @@ + db_Count("links_page", "(*)"); +$text .= "
        ".LCLAN_ADMIN_14.": ".$count."
        "; +?> \ No newline at end of file diff --git a/e107_plugins/links_page/help.php b/e107_plugins/links_page/help.php new file mode 100644 index 000000000..c08ac6ca8 --- /dev/null +++ b/e107_plugins/links_page/help.php @@ -0,0 +1,54 @@ + tablerender(LAN_ADMIN_HELP_0, $text); + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/images/blank.gif b/e107_plugins/links_page/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_plugins/links_page/images/blank.gif differ diff --git a/e107_plugins/links_page/images/generic.png b/e107_plugins/links_page/images/generic.png new file mode 100644 index 000000000..e2f17fc7b Binary files /dev/null and b/e107_plugins/links_page/images/generic.png differ diff --git a/e107_plugins/links_page/images/linkspage_16.png b/e107_plugins/links_page/images/linkspage_16.png new file mode 100644 index 000000000..0523758d9 Binary files /dev/null and b/e107_plugins/links_page/images/linkspage_16.png differ diff --git a/e107_plugins/links_page/images/linkspage_32.png b/e107_plugins/links_page/images/linkspage_32.png new file mode 100644 index 000000000..bfd1a8624 Binary files /dev/null and b/e107_plugins/links_page/images/linkspage_32.png differ diff --git a/e107_plugins/links_page/languages/English.php b/e107_plugins/links_page/languages/English.php new file mode 100644 index 000000000..f3abb4459 --- /dev/null +++ b/e107_plugins/links_page/languages/English.php @@ -0,0 +1,361 @@ +the manage link categories page shows all categories present.

        detailed list
        You see a list of all categories with their icon, name and description, options, and sorting options.

        explanation of icons
        +".LINK_ICON_LINK." : link to the category

        +".LINK_ICON_EDIT." : edit the category

        +".LINK_ICON_DELETE." : delete the category

        +".LINK_ICON_ORDER_UP." : the up button allows you to move the category item one up in order.

        +".LINK_ICON_ORDER_DOWN." : the down button allows you to move the category item one down in order.
        +
        +order
        here you can manually set the order of all the categories. You need to change the values in the select boxes to the order of your kind and press the reorder button below to save the new order.
        "); + +define("LAN_ADMIN_HELP_2", "the create link category page allows you to add new categories

        You can upload a new icon, and after uploading assign the icon to the category."); +define("LAN_ADMIN_HELP_3", "the manage links page first show all categories.

        ".LINK_ICON_LINK." : link to the category

        ".LINK_ICON_EDIT." : click the icon to view all links in this category
        "); +define("LAN_ADMIN_HELP_4", "the create link page allows you to add a new link

        You can upload a new icon, and after uploading assign the icon to the link.

        the open type allows you to define how the link will be opened when a user clicks on it."); +define("LAN_ADMIN_HELP_5", "the submitted links page shows all links that are submitted by users

        detailed list
        You see the link url, the name of the user who submitted the link and options.

        explanation of icons
        +".LINK_ICON_EDIT." : post the submitted link to the link create form

        +".LINK_ICON_DELETE." : delete the submitted link
        +"); +define("LAN_ADMIN_HELP_6", "the options page allows you to change the behaviour of the links_page plugin

        +general options
        +these options are generally used throughout the link pages.

        +personal link managers
        +the personal link managers are privileged users who can manage their own personally added links.

        +category page
        +here you can change options for the category page.

        +links page
        +These options are used on the link pages.

        +refer page
        +These options are used on the top refer links page.

        +rating page
        +These options are used on the top rated links page.
        +"); + +define("LAN_ADMIN_HELP_7", "the edit link category page allows you to edit an existing category

        You can upload a new icon, and after uploading assign the icon to the category.
        You can update the timestamp of the link by checking the box."); + +define("LAN_ADMIN_HELP_8", "this page shows all existing links in the selected category.

        detailed list
        You see a list of the links with their image, name, options, and sorting options.

        explanation of icons
        +".LINK_ICON_LINK." : link to the website

        +".LINK_ICON_EDIT." : edit the link

        +".LINK_ICON_DELETE." : delete the link

        +".LINK_ICON_ORDER_UP." : the up button allows you to move the link one up in order.

        +".LINK_ICON_ORDER_DOWN." : the down button allows you to move the link one down in order.
        +
        +order
        here you can manually set the order of all the links. You need to change the values in the select boxes to the order of your kind and press the reorder button below to save the new order.
        "); + +define("LAN_ADMIN_HELP_9", "the edit link page allows you to edit an existing link

        You can upload a new icon, and after uploading assign the icon to the link.

        the open type allows you to define how the link will be opened when a user clicks on it."); +define("LAN_ADMIN_HELP_10", "the post submitted link page allows you to add a submitted link to the existing links

        A small submitted text is added into the description field.

        You can upload a new icon, and after uploading assign the icon to the link.

        the open type allows you to define how the link will be opened when a user clicks on it."); +?> \ No newline at end of file diff --git a/e107_plugins/links_page/link_class.php b/e107_plugins/links_page/link_class.php new file mode 100644 index 000000000..987913e42 --- /dev/null +++ b/e107_plugins/links_page/link_class.php @@ -0,0 +1,1428 @@ + db_Select("core", "*", "e107_name='links_page' "); + if ($num_rows == 0) { + $linkspage_pref = $this->LinkPageDefaultPrefs(); + $tmp = $eArrayStorage->WriteArray($linkspage_pref); + $sql -> db_Insert("core", "'links_page', '{$tmp}' "); + $sql -> db_Select("core", "*", "e107_name='links_page' "); + } + $row = $sql -> db_Fetch(); + $linkspage_pref = $eArrayStorage->ReadArray($row['e107_value']); + + return $linkspage_pref; + } + + function UpdateLinksPagePref(){ + global $sql, $eArrayStorage, $tp; + + $num_rows = $sql -> db_Select("core", "*", "e107_name='links_page' "); + if ($num_rows == 0) { + $sql -> db_Insert("core", "'links_page', '' "); + }else{ + $row = $sql -> db_Fetch(); + + //assign new preferences + foreach($_POST as $k => $v){ + if(strpos($k, "link_") === 0){ + $linkspage_pref[$k] = $tp->toDB($v); + } + } + + //create new array of preferences + $tmp = $eArrayStorage->WriteArray($linkspage_pref); + + $sql -> db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'links_page' "); + } + return $linkspage_pref; + } + + function ShowNextPrev($from='0', $number, $total){ + global $linkspage_pref, $qs, $tp, $link_shortcodes, $LINK_NEXTPREV, $LINK_NP_TABLE, $pref; + + $number = (e_PAGE == 'admin_linkspage_config.php' ? '20' : $number); + if($total<=$number){ + return; + } + if(e_PAGE == 'admin_linkspage_config.php' || (isset($linkspage_pref["link_nextprev"]) && $linkspage_pref["link_nextprev"])){ + $np_querystring = e_SELF."?[FROM]".(isset($qs[0]) ? ".".$qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : ""); + $parms = $total.",".$number.",".$from.",".$np_querystring.""; + $LINK_NEXTPREV = $tp->parseTemplate("{NEXTPREV={$parms}}"); + + if(!isset($LINK_NP_TABLE)){ + $template = (e_PAGE == 'admin_linkspage_config.php' ? e_THEME.$pref['sitetheme']."/" : THEME)."links_template.php"; + if(is_readable($template)){ + require_once($template); + }else{ + require_once(e_PLUGIN."links_page/links_template.php"); + } + } + echo $tp -> parseTemplate($LINK_NP_TABLE, FALSE, $link_shortcodes); + } + } + + function setPageTitle(){ + global $sql, $qs, $linkspage_pref; + + //show all categories + if(!isset($qs[0]) && $linkspage_pref['link_page_categories']){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_2; + } + //show all categories + if(isset($qs[0]) && $qs[0] == "cat" && !isset($qs[1]) ){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_2; + } + //show all links in all categories + if( (!isset($qs[0]) && !$linkspage_pref['link_page_categories']) || (isset($qs[0]) && $qs[0] == "all") ){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_3; + } + //show all links in one categories + if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && is_numeric($qs[1])){ + $sql -> db_Select("links_page_cat", "link_category_name", "link_category_id='".$qs[1]."' "); + $row2 = $sql -> db_Fetch(); + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_4." / ".$row2['link_category_name']; + } + //view top rated + if(isset($qs[0]) && $qs[0] == "rated"){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_5; + } + //view top refer + if(isset($qs[0]) && $qs[0] == "top"){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_6; + } + //personal link managers + if (isset($qs[0]) && $qs[0] == "manage"){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_7; + } + //comments on links + if (isset($qs[0]) && $qs[0] == "comment" && isset($qs[1]) && is_numeric($qs[1]) ){ + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_8; + } + //submit link + if (isset($qs[0]) && $qs[0] == "submit" && check_class($linkspage_pref['link_submit_class'])) { + $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_9; + } + //define("e_PAGETITLE", strtolower($page)); + define("e_PAGETITLE", $page); + } + + + + + function parse_link_append($rowl){ + + global $tp; + + global $linkspage_pref, $rowl; + if($linkspage_pref['link_open_all'] && $linkspage_pref['link_open_all'] == "5"){ + $link_open_type = $rowl['link_open']; + }else{ + $link_open_type = $linkspage_pref['link_open_all']; + } + + switch ($link_open_type) { + case 1: + $lappend = ""; // Googlebot won't see it any other way. + break; + case 2: + $lappend = ""; // Googlebot won't see it any other way. + break; + case 3: + $lappend = ""; // Googlebot won't see it any other way. + break; + case 4: + $lappend = ""; // Googlebot won't see it any other way. + break; + default: + $lappend = ""; // Googlebot won't see it any other way. + } + return $lappend; + } + + + + + + function showLinkSort($mode=''){ + global $rs, $ns, $qs, $linkspage_pref; + + $check = ""; + if($qs){ + for($i=0;$i form_open("post", e_SELF, "linkorder", "", "enctype='multipart/form-data'")." + ".LAN_LINKS_15." + ".$rs -> form_select_open("link_sort"); + if($mode == "cat"){ + $sotext .= " + ".$rs -> form_option(LAN_LINKS_4, ($checks == "heading" ? "1" : "0"), "heading", "")." + ".$rs -> form_option(LAN_LINKS_44, ($checks == "id" ? "1" : "0"), "id", "")." + ".$rs -> form_option(LAN_LINKS_6, ($checks == "order" ? "1" : "0"), "order", ""); + }else{ + $sotext .= " + ".$rs -> form_option(LAN_LINKS_4, ($checks == "heading" ? "1" : "0"), "heading", "")." + ".$rs -> form_option(LAN_LINKS_5, ($checks == "url" ? "1" : "0"), "url", "")." + ".$rs -> form_option(LAN_LINKS_6, ($checks == "order" ? "1" : "0"), "order", "")." + ".$rs -> form_option(LAN_LINKS_7, ($checks == "refer" ? "1" : "0"), "refer", "")." + ".$rs -> form_option(LAN_LINKS_38, ($checks == "date" ? "1" : "0"), "date", ""); + } + $sotext .= " + ".$rs -> form_select_close()." + ".LAN_LINKS_6." + ".$rs -> form_select_open("link_order")." + ".$rs -> form_option(LAN_LINKS_8, ($checko == "a" ? "1" : "0"), $baseurl."?".($qry ? $qry."." : "")."ordera", "")." + ".$rs -> form_option(LAN_LINKS_9, ($checko == "d" ? "1" : "0"), $baseurl."?".($qry ? $qry."." : "")."orderd", "")." + ".$rs -> form_select_close()." + ".$rs -> form_button("button", "submit", LCLAN_ITEM_36, "style='width:25px;' onclick=\"document.location=link_order.options[link_order.selectedIndex].value+link_sort.options[link_sort.selectedIndex].value;\"", "", "")." + ".$rs -> form_close(); + + return $sotext; + } + + function parseOrderCat($orderstring){ + if(substr($orderstring,6) == "heading"){ + $orderby = "link_category_name"; + $orderby2 = ""; + }elseif(substr($orderstring,6) == "id"){ + $orderby = "link_category_id"; + $orderby2 = ", link_category_name ASC"; + }elseif(substr($orderstring,6) == "order"){ + $orderby = "link_category_order"; + $orderby2 = ", link_category_name ASC"; + }else{ + $orderstring = "orderdheading"; + $orderby = "link_category_name"; + $orderby2 = ", link_category_name ASC"; + } + return $orderby." ".(substr($orderstring,5,1) == "a" ? "ASC" : "DESC")." ".$orderby2; + } + + function parseOrderLink($orderstring){ + if(substr($orderstring,6) == "heading"){ + $orderby = "link_name"; + $orderby2 = ""; + }elseif(substr($orderstring,6) == "url"){ + $orderby = "link_url"; + $orderby2 = ", link_name ASC"; + }elseif(substr($orderstring,6) == "refer"){ + $orderby = "link_refer"; + $orderby2 = ", link_name ASC"; + }elseif(substr($orderstring,6) == "date"){ + $orderby = "link_datestamp"; + $orderby2 = ", link_name ASC"; + }elseif(substr($orderstring,6) == "order"){ + $orderby = "link_order"; + $orderby2 = ", link_name ASC"; + }else{ + $orderstring = "orderaorder"; + $orderby = "link_order"; + $orderby2 = ", link_name ASC"; + } + return $orderby." ".(substr($orderstring,5,1) == "a" ? "ASC" : "DESC")." ".$orderby2; + } + + function getOrder($mode=''){ + global $qs, $linkspage_pref; + + if(isset($qs[0]) && substr($qs[0],0,5) == "order"){ + $orderstring = $qs[0]; + }elseif(isset($qs[1]) && substr($qs[1],0,5) == "order"){ + $orderstring = $qs[1]; + }elseif(isset($qs[2]) && substr($qs[2],0,5) == "order"){ + $orderstring = $qs[2]; + }elseif(isset($qs[3]) && substr($qs[3],0,5) == "order"){ + $orderstring = $qs[3]; + }else{ + if($mode == "cat"){ + $orderstring = "order".($linkspage_pref["link_cat_order"] == "ASC" ? "a" : "d" ).($linkspage_pref["link_cat_sort"] ? $linkspage_pref["link_cat_sort"] : "date" ); + }else{ + $orderstringcat = "order".($linkspage_pref["link_cat_order"] == "ASC" ? "a" : "d" ).($linkspage_pref["link_cat_sort"] ? $linkspage_pref["link_cat_sort"] : "date" ); + + $orderstring = "order".($linkspage_pref["link_order"] == "ASC" ? "a" : "d" ).($linkspage_pref["link_sort"] ? $linkspage_pref["link_sort"] : "date" ); + } + } + + if($mode == "cat"){ + $str = $this -> parseOrderCat($orderstring); + }else{ + if(isset($orderstringcat)){ + $str = $this -> parseOrderCat($orderstringcat); + $str .= ", ".$this -> parseOrderLink($orderstring); + }else{ + $str = $this -> parseOrderLink($orderstring); + } + } + + $order = " ORDER BY ".$str; + return $order; + } + + function show_message($message, $caption='') { + global $ns; + $ns->tablerender($caption, "
        ".$message."
        "); + } + + function uploadLinkIcon(){ + global $ns, $pref; + $pref['upload_storagetype'] = "1"; + require_once(e_HANDLER."upload_handler.php"); + $pathicon = e_PLUGIN."links_page/link_images/"; + $uploaded = file_upload($pathicon); + + $icon = ""; + if($uploaded) { + $icon = $uploaded[0]['name']; + if($_POST['link_resize_value']){ + require_once(e_HANDLER."resize_handler.php"); + resize_image($pathicon.$icon, $pathicon.$icon, $_POST['link_resize_value'], "nocopy"); + } + } + $msg = ($icon ? LCLAN_ADMIN_7 : LCLAN_ADMIN_8); + $this -> show_message($msg); + } + + function uploadCatLinkIcon(){ + global $ns, $pref; + $pref['upload_storagetype'] = "1"; + require_once(e_HANDLER."upload_handler.php"); + $pathicon = e_PLUGIN."links_page/cat_images/"; + $uploaded = file_upload($pathicon); + + $icon = ""; + if($uploaded) { + $icon = $uploaded[0]['name']; + if($_POST['link_cat_resize_value']){ + require_once(e_HANDLER."resize_handler.php"); + resize_image($pathicon.$icon, $pathicon.$icon, $_POST['link_cat_resize_value'], "nocopy"); + } + } + $msg = ($icon ? LCLAN_ADMIN_7 : LCLAN_ADMIN_8); + $this -> show_message($msg); + } + + function dbCategoryCreate() { + global $sql, $tp; + $link_t = $sql->db_Count("links_page_cat", "(*)"); + $sql->db_Insert("links_page_cat", " '0', '".$tp -> toDB($_POST['link_category_name'])."', '".$tp -> toDB($_POST['link_category_description'])."', '".$tp -> toDB($_POST['link_category_icon'])."', '".($link_t+1)."', '".$tp -> toDB($_POST['link_category_class'])."', '".time()."' "); + $this->show_message(LCLAN_ADMIN_4); + } + function dbCategoryUpdate() { + global $sql, $tp; + $time = ($_POST['update_datestamp'] ? time() : ($_POST['link_category_datestamp'] != "0" ? $_POST['link_category_datestamp'] : time()) ); + $sql->db_Update("links_page_cat", "link_category_name ='".$tp -> toDB($_POST['link_category_name'])."', link_category_description='".$tp -> toDB($_POST['link_category_description'])."', link_category_icon='".$tp -> toDB($_POST['link_category_icon'])."', link_category_order='".$tp -> toDB($_POST['link_category_order'])."', link_category_class='".$tp -> toDB($_POST['link_category_class'])."', link_category_datestamp='".intval($time)."' WHERE link_category_id='".intval($_POST['link_category_id'])."'"); + $this->show_message(LCLAN_ADMIN_5); + } + + function dbOrderUpdate($order) { + global $sql; + foreach ($order as $order_id) { + $tmp = explode(".", $order_id); + $sql->db_Update("links_page", "link_order=".intval($tmp[1])." WHERE link_id=".intval($tmp[0])); + } + $this->show_message(LCLAN_ADMIN_9); + } + + function dbOrderCatUpdate($order) { + global $sql; + foreach ($order as $order_id) { + $tmp = explode(".", $order_id); + $sql->db_Update("links_page_cat", "link_category_order=".intval($tmp[1])." WHERE link_category_id=".intval($tmp[0])); + } + $this->show_message(LCLAN_ADMIN_9); + } + + function dbOrderUpdateInc($inc) { + global $sql; + $tmp = explode(".", $inc); + $linkid = intval($tmp[0]); + $link_order = intval($tmp[1]); + $location = $tmp[2]; + if(isset($location)){ + $location = intval($location); + $sql->db_Update("links_page", "link_order=link_order+1 WHERE link_order='".($link_order-1)."' AND link_category='$location'"); + $sql->db_Update("links_page", "link_order=link_order-1 WHERE link_id='$linkid' AND link_category='$location'"); + }else{ + $sql->db_Update("links_page_cat", "link_category_order=link_category_order+1 WHERE link_category_order='".($link_order-1)."' "); + $sql->db_Update("links_page_cat", "link_category_order=link_category_order-1 WHERE link_category_id='$linkid' "); + } + } + + function dbOrderUpdateDec($dec) { + global $sql; + $tmp = explode(".", $dec); + $linkid = intval($tmp[0]); + $link_order = intval($tmp[1]); + $location = $tmp[2]; + if(isset($location)){ + $location = intval($location); + $sql->db_Update("links_page", "link_order=link_order-1 WHERE link_order='".($link_order+1)."' AND link_category='$location'"); + $sql->db_Update("links_page", "link_order=link_order+1 WHERE link_id='$linkid' AND link_category='$location'"); + }else{ + $sql->db_Update("links_page_cat", "link_category_order=link_category_order-1 WHERE link_category_order='".($link_order+1)."' "); + $sql->db_Update("links_page_cat", "link_category_order=link_category_order+1 WHERE link_category_id='$linkid' "); + } + } + + function dbLinkCreate($mode='') { + global $ns, $tp, $qs, $sql, $e107cache, $e_event, $linkspage_pref; + + $link_name = $tp->toDB($_POST['link_name']); + $link_url = $tp->toDB($_POST['link_url']); + $link_description = $tp->toDB($_POST['link_description']); + $link_button = $tp->toDB($_POST['link_but']); + + if (!strstr($link_url, "http")) { + $link_url = "http://".$link_url; + } + + //create link, submit area, tmp table + if(isset($mode) && $mode == "submit"){ + if (!$_POST['link_name'] || !$_POST['link_url'] || !$_POST['link_description']) { + message_handler("ALERT", 5); + } else { + $username = (defined('USERNAME')) ? USERNAME : LAN_LINKS_3; + + $submitted_link = intval($_POST['cat_id'])."^".$link_name."^".$link_url."^".$link_description."^".$link_button."^".$username; + $sql->db_Insert("tmp", "'submitted_link', '".time()."', '$submitted_link' "); + + $edata_ls = array("link_category" => $_POST['cat_id'], "link_name" => $link_name, "link_url" => $link_url, "link_description" => $link_description, "link_button" => $link_button, "username" => $username, "submitted_link" => $submitted_link); + $e_event->trigger("linksub", $edata_ls); + //header("location:".e_SELF."?s"); + js_location(e_SELF."?s"); + } + }else{ + $link_t = $sql->db_Count("links_page", "(*)", "WHERE link_category='".intval($_POST['cat_id'])."'"); + $time = ($_POST['update_datestamp'] ? time() : ($_POST['link_datestamp'] != "0" ? $_POST['link_datestamp'] : time()) ); + + //update link + if (is_numeric($qs[2]) && $qs[1] != "sn") { + $link_class = $_POST['link_class']; + if($qs[1] == "manage"){ + $link_author = USERID; + }else{ + $link_author = ($_POST['link_author'] && $_POST['link_author']!='' ? $tp -> toDB($_POST['link_author']) : USERID); + } + + $sql->db_Update("links_page", "link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".intval($_POST['cat_id'])."', link_open='".intval($_POST['linkopentype'])."', link_class='".intval($link_class)."', link_datestamp='".intval($time)."', link_author='".$link_author."' WHERE link_id='".intval($qs[2])."'"); + $e107cache->clear("sitelinks"); + $this->show_message(LCLAN_ADMIN_3); + //create link + } else { + + $sql->db_Insert("links_page", "0, '$link_name', '$link_url', '$link_description', '$link_button', '".intval($_POST['cat_id'])."', '".($link_t+1)."', '0', '".intval($_POST['linkopentype'])."', '".intval($_POST['link_class'])."', '".time()."', '".USERID."' "); + $e107cache->clear("sitelinks"); + $this->show_message(LCLAN_ADMIN_2); + } + //delete from tmp table after approval + if (is_numeric($qs[2]) && $qs[1] == "sn") { + $sql->db_Delete("tmp", "tmp_time='".intval($qs[2])."' "); + } + } + } + + function show_link_create() { + global $sql, $rs, $qs, $ns, $fl, $linkspage_pref; + + $row['link_category'] = ""; + $row['link_name'] = ""; + $row['link_url'] = ""; + $row['link_description'] = ""; + $row['link_button'] = ""; + $row['link_open'] = ""; + $row['link_class'] = ""; + $link_resize_value = (isset($linkspage_pref['link_resize_value']) && $linkspage_pref['link_resize_value'] ? $linkspage_pref['link_resize_value'] : "100"); + + if (isset($qs[1]) && $qs[1] == 'edit' && !isset($_POST['submit'])) { + if ($sql->db_Select("links_page", "*", "link_id='".intval($qs[2])."' ")) { + $row = $sql->db_Fetch(); + } + } + + if (isset($qs[1]) && $qs[1] == 'sn') { + if ($sql->db_Select("tmp", "*", "tmp_time='".intval($qs[2])."'")) { + $row = $sql->db_Fetch(); + $submitted = explode("^", $row['tmp_info']); + $row['link_category'] = $submitted[0]; + $row['link_name'] = $submitted[1]; + $row['link_url'] = $submitted[2]; + $row['link_description'] = $submitted[3]."\n[i]".LCLAN_ITEM_1." ".$submitted[5]."[/i]"; + $row['link_button'] = $submitted[4]; + + } + } + + if(isset($_POST['uploadlinkicon'])){ + $row['link_category'] = $_POST['cat_id']; + $row['link_name'] = $_POST['link_name']; + $row['link_url'] = $_POST['link_url']; + $row['link_description'] = $_POST['link_description']; + $row['link_button'] = $_POST['link_but']; + $row['link_open'] = $_POST['linkopentype']; + $row['link_class'] = $_POST['link_class']; + $link_resize_value = (isset($_POST['link_resize_value']) && $_POST['link_resize_value'] ? $_POST['link_resize_value'] : $link_resize_value); + } + $width = (e_PAGE == "admin_linkspage_config.php" ? ADMIN_WIDTH : "width:100%;"); + $text = " +
        + ".$rs -> form_open("post", e_SELF."?".e_QUERY, "linkform", "", "enctype='multipart/form-data'", "")." + + + + + + + + + + + + + + + + + + + + + "; + + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'blank*'); + $iconpath = e_PLUGIN."links_page/link_images/"; + $iconlist = $fl->get_files($iconpath,"",$rejectlist); + + $text .= " + + + + "; + + //0=same window, 1=_blank, 2=_parent, 3=_top, 4=miniwindow + $text .= " + + + + + + + + + + + +
        ".LCLAN_ITEM_2.""; + + if (!$link_cats = $sql->db_Select("links_page_cat")) { + $text .= LCLAN_ITEM_3."
        "; + } else { + $text .= $rs -> form_select_open("cat_id", ""); + while (list($cat_id, $cat_name, $cat_description) = $sql->db_Fetch()) { + if ( (isset($row['link_category']) && $row['link_category'] == $cat_id) || (isset($row['linkid']) && $cat_id == $row['linkid'] && $action == "add") ) { + $text .= $rs -> form_option($cat_name, "1", $cat_id, ""); + } else { + $text .= $rs -> form_option($cat_name, "0", $cat_id, ""); + } + } + $text .= $rs -> form_select_close(); + } + $text .= " +
        ".LCLAN_ITEM_4." + ".$rs -> form_text("link_name", 60, $row['link_name'], 100)." +
        ".LCLAN_ITEM_5." + ".$rs -> form_text("link_url", 60, $row['link_url'], 200)." +
        ".LCLAN_ITEM_6." + ".$rs -> form_textarea("link_description", '59', '3', $row['link_description'], "", "", "", "", "")." +
        ".LCLAN_ITEM_7.""; + if(!FILE_UPLOADS){ + $text .= "".LCLAN_ITEM_9.""; + }else{ + if(!is_writable(e_PLUGIN."links_page/link_images/")){ + $text .= "".LCLAN_ITEM_10." ".e_PLUGIN."links_page/link_images/ ".LCLAN_ITEM_11."
        "; + } + $text .= " +
        + ".LCLAN_ITEM_8." ".$rs -> form_text("link_resize_value", 3, $link_resize_value, 3)." ".LCLAN_ITEM_12." + ".$rs -> form_button("submit", "uploadlinkicon", LCLAN_ITEM_13, "", "", ""); + } + $text .= " +
        ".LCLAN_ITEM_14." + +
        "; + $selectjs = " onchange=\"document.getElementById('link_but').value=this.options[this.selectedIndex].value; if(this.options[this.selectedIndex].value!=''){document.getElementById('iconview').src='".$iconpath."'+this.options[this.selectedIndex].value; document.getElementById('iconview').style.display='block';}else{document.getElementById('iconview').src='';document.getElementById('iconview').style.display='none';}\""; + $text .= $rs -> form_select_open("link_button", $selectjs); + $text .= $rs -> form_option(LCLAN_ITEM_34, ($row['link_button'] ? "0" : "1"), ""); + foreach($iconlist as $icon){ + $text .= $rs -> form_option($icon['fname'], ($icon['fname'] == $row['link_button'] ? "1" : "0"), $icon['fname'] ); + } + $text .= $rs -> form_select_close(); + if(isset($row['link_button']) && $row['link_button']){ + $img = $iconpath.$row['link_button']; + }else{ + $blank_display = 'display: none'; + $img = e_PLUGIN."links_page/images/blank.gif"; + } + $text .= "

        "; + $text .= "
        +
        ".LCLAN_ITEM_16." + ".$rs -> form_select_open("linkopentype")." + ".$rs -> form_option(LCLAN_ITEM_17, ($row['link_open'] == "0" ? "1" : "0"), "0", "")." + ".$rs -> form_option(LCLAN_ITEM_18, ($row['link_open'] == "1" ? "1" : "0"), "1", "")." + ".$rs -> form_option(LCLAN_ITEM_19, ($row['link_open'] == "4" ? "1" : "0"), "4", "")." + ".$rs -> form_select_close()." +
        ".LCLAN_ITEM_20." + ".r_userclass("link_class", $row['link_class'], "off", "public,guest,nobody,member,admin,classes")." +
        "; + if (isset($qs[2]) && $qs[2] && $qs[1] == "edit") { + $text .= $rs -> form_hidden("link_datestamp", $row['link_datestamp']); + $text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".LCLAN_ITEM_21."

        "; + $text .= $rs -> form_button("submit", "add_link", LCLAN_ITEM_22, "", "", "").$rs -> form_hidden("link_id", $row['link_id']).$rs -> form_hidden("link_author", $row['link_author']); + + } else { + $text .= $rs -> form_button("submit", "add_link", LCLAN_ITEM_23, "", "", ""); + } + $text .= "
        + ".$rs -> form_close()." +
        "; + + $ns->tablerender(LCLAN_ITEM_24, $text); + } + + function show_links() { + global $sql, $qs, $rs, $ns, $tp, $from; + $number = "20"; + + if($qs[2] == "all"){ + $caption = LCLAN_ITEM_38; + $qry = " link_id != '' ORDER BY link_category ASC, link_order ASC"; + }else{ + if ($sql->db_Select("links_page_cat", "link_category_name", "link_category_id='".intval($qs[2])."' " )) { + $row = $sql->db_Fetch(); + $caption = LCLAN_ITEM_2." ".$row['link_category_name']; + } + $qry = " link_category=".intval($qs[2])." ORDER BY link_order, link_id ASC"; + } + + $link_total = $sql->db_Select("links_page", "*", " ".$qry." "); + if (!$sql->db_Select("links_page", "*", " ".$qry." LIMIT ".intval($from).",".intval($number)." ")) { + js_location(e_SELF."?link"); + }else{ + $text = $rs->form_open("post", e_SELF.(e_QUERY ? "?".e_QUERY : ""), "myform_{$row['link_id']}", "", ""); + $text .= "
        + + + + + + + + "; + while ($row = $sql->db_Fetch()) { + $linkid = $row['link_id']; + $img = ""; + if ($row['link_button']) { + if (strpos($row['link_button'], "http://") !== FALSE) { + $img = "".$LINK_CAT_NAME.""; + } else { + if(strstr($row['link_button'], "/")){ + $img = "".$LINK_CAT_NAME.""; + }else{ + $img = "".$LINK_CAT_NAME.""; + } + } + } + if($row['link_order'] == "1"){ + $up = "   "; + }else{ + $up = ""; + } + if($row['link_order'] == $link_total){ + $down = "   "; + }else{ + $down = ""; + } + $text .= " + + + + + + + "; + } + $text .= " + + + + +
        ".LCLAN_ITEM_25."".LCLAN_ITEM_26."".LCLAN_ITEM_27."".LCLAN_ITEM_28."".LCLAN_ITEM_29."
        ".$img." + ".LINK_ICON_LINK." ".$row['link_name']." + + ".LINK_ICON_EDIT." + toJS(LCLAN_ITEM_33." [ ".$row['link_name']." ]")."')\" /> + + ".$up." + ".$down." + +
          + ".$rs->form_button("submit", "update_order", LCLAN_ITEM_30)." +
        + ".$rs->form_close(); + } + $ns->tablerender($caption, $text); + $this->ShowNextPrev($from, $number, $link_total); + } + + function show_cat_create() { + global $qs, $sql, $rs, $ns, $tp, $fl; + + $row['link_category_name'] = ""; + $row['link_category_description'] = ""; + $row['link_category_icon'] = ""; + $link_cat_resize_value = (isset($linkspage_pref['link_cat_resize_value']) && $linkspage_pref['link_cat_resize_value'] ? $linkspage_pref['link_cat_resize_value'] : "50"); + + if(isset($_POST['uploadcatlinkicon'])){ + $row['link_category_name'] = $_POST['link_category_name']; + $row['link_category_description'] = $_POST['link_category_description']; + $row['link_category_icon'] = $_POST['link_category_icon']; + $link_cat_resize_value = (isset($_POST['link_cat_resize_value']) && $_POST['link_cat_resize_value'] ? $_POST['link_cat_resize_value'] : $link_cat_resize_value); + } + if ($qs[1] == "edit") { + if ($sql->db_Select("links_page_cat", "*", "link_category_id='".intval($qs[2])."' ")) { + $row = $sql->db_Fetch(); + } + } + if(isset($_POST['category_clear'])){ + $row['link_category_name'] = ""; + $row['link_category_description'] = ""; + $row['link_category_icon'] = ""; + } + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*'); + $iconlist = $fl->get_files(e_PLUGIN."links_page/cat_images/","",$rejectlist); + + $text = "
        + ".$rs->form_open("post", e_SELF.(e_QUERY ? "?".e_QUERY : ""), "linkform", "", "enctype='multipart/form-data'", "")." + + + + + + + + + + + + + + + + + + + + + +
        ".LCLAN_CAT_13."".$rs->form_text("link_category_name", 50, $row['link_category_name'], 200)."
        ".LCLAN_CAT_14."".$rs->form_text("link_category_description", 60, $row['link_category_description'], 200)."
        ".LCLAN_CAT_15.""; + if(!FILE_UPLOADS){ + $text .= "".LCLAN_CAT_17.""; + }else{ + if(!is_writable(e_PLUGIN."links_page/cat_images/")){ + $text .= "".LCLAN_CAT_18." ".e_PLUGIN."links_page/cat_images/ ".LCLAN_CAT_19."
        "; + } + $text .= " +
        + ".LCLAN_CAT_16." ".$rs -> form_text("link_cat_resize_value", 3, $link_cat_resize_value, 3)." ".LCLAN_CAT_20." + ".$rs -> form_button("submit", "uploadcatlinkicon", LCLAN_CAT_21, "", "", ""); + } + $text .= " +
        ".LCLAN_CAT_22." + ".$rs -> form_text("link_category_icon", 60, $row['link_category_icon'], 100)." + ".$rs -> form_button("button", '', LCLAN_CAT_23, "onclick=\"expandit('catico')\"")." + +
        ".LCLAN_CAT_24." + ".r_userclass("link_category_class", $row['link_category_class'], "off", "public,guest,nobody,member,admin,classes")." +
        "; + if (is_numeric($qs[2])) { + $text .= $rs -> form_hidden("link_category_order", $row['link_category_order']); + $text .= $rs -> form_hidden("link_category_datestamp", $row['link_category_datestamp']); + $text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".LCLAN_CAT_25."

        "; + $text .= $rs -> form_button("submit", "update_category", LCLAN_CAT_26, "", "", ""); + $text .= $rs -> form_button("submit", "category_clear", LCLAN_CAT_27). $rs->form_hidden("link_category_id", $qs[2]); + + } else { + $text .= $rs -> form_button("submit", "create_category", LCLAN_CAT_28, "", "", ""); + } + $text .= "
        + ".$rs->form_close()." +
        "; + + $ns->tablerender(LCLAN_CAT_29, $text); + unset($row['link_category_name'], $row['link_category_description'], $row['link_category_icon']); + } + + function show_categories($mode) { + global $sql, $rs, $ns, $tp, $fl; + + if ($category_total = $sql->db_Select("links_page_cat", "*", "ORDER BY link_category_order ASC", "mode=no_where")) { + $text = " +
        + ".$rs->form_open("post", e_SELF.(e_QUERY ? "?".e_QUERY : ""), "", "", "")." + + + + + "; + if($mode == "cat"){ + $text .= " + + "; + } + $text .= " + "; + while ($row = $sql->db_Fetch()) { + $linkcatid = $row['link_category_id']; + if ($row['link_category_icon']) { + $img = (strstr($row['link_category_icon'], "/") ? "" : ""); + } else { + $img = " "; + } + $text .= " + + + "; + if($mode == "cat"){ + if($row['link_category_order'] == "1"){ + $up = "   "; + }else{ + $up = ""; + } + if($row['link_category_order'] == $category_total){ + $down = "   "; + }else{ + $down = ""; + } + $text .= " + + + "; + }else{ + $text .= ""; + } + $text .= " + \n"; + } + if($mode == "cat"){ + $text .= " + + + + "; + }else{ + $text .= " + + + + "; + } + $text .= " +
        ".LCLAN_CAT_1."".LCLAN_CAT_2."".LCLAN_CAT_3."".LCLAN_CAT_4."".LCLAN_CAT_5."
        ".$img." + ".LINK_ICON_LINK." + ".$row['link_category_name']."
        ".$row['link_category_description']." +
        + ".LINK_ICON_EDIT." + toJS(LCLAN_CAT_8." [ ".$row['link_category_name']." ]")."')\"/> + + ".$up." + ".$down." + + + ".LINK_ICON_EDIT."
          + ".$rs->form_button("submit", "update_category_order", LCLAN_CAT_10)." +
         ".$rs->form_button("button", "viewalllinks", LCLAN_ITEM_37, "onclick=\"document.location='".e_SELF."?link.view.all';\"")." +
        + ".$rs->form_close()." +
        "; + } else { + $text = "
        ".LCLAN_CAT_11."
        "; + } + $ns->tablerender(LCLAN_CAT_12, $text); + unset($row['link_category_name'], $row['link_category_description'], $row['link_category_icon']); + } + + function show_submitted() { + global $sql, $rs, $qs, $ns, $tp; + + if (!$submitted_total = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ")) { + $text = "
        ".LCLAN_SL_2."
        "; + }else{ + $text = " + ".$rs->form_open("post", e_SELF."?sn", "submitted_links")." + + + + + + "; + while ($row = $sql->db_Fetch()) { + $tmp_time = $row['tmp_time']; + $submitted = explode("^", $row['tmp_info']); + if (!strstr($submitted[2], "http")) { + $submitted[2] = "http://".$submitted[2]; + } + $text .= " + + + + \n"; + } + $text .= "
        ".LCLAN_SL_3."".LCLAN_SL_4."".LCLAN_SL_5."
        ".$submitted[2]."".$submitted[5]." + ".LINK_ICON_EDIT." + toJS(LCLAN_SL_8." [ ".$tmp_time." ]")."')\" /> +
        ".$rs->form_close(); + } + $ns->tablerender(LCLAN_SL_1, $text); + } + + function show_pref_options() { + global $linkspage_pref, $ns, $rs, $pref; + + $text = " + "; + + $TOPIC_ROW = " + + {TOPIC_TOPIC} + {TOPIC_FIELD} + "; + + $TOPIC_TITLE_ROW = "{TOPIC_CAPTION}"; + $TOPIC_ROW_SPACER = ""; + $TOPIC_TABLE_END = $this->pref_submit().""; + + $text .= " +
        + ".$rs -> form_open("post", e_SELF."?".e_QUERY, "optform", "", "", "")." + +
        + "; + + $TOPIC_CAPTION = LCLAN_OPT_MENU_1; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW); + + $TOPIC_TOPIC = LCLAN_OPT_7; + $TOPIC_FIELD = " + ".$rs -> form_radio("link_page_categories", "1", ($linkspage_pref['link_page_categories'] ? "1" : "0"), "", "").LCLAN_OPT_3." + ".$rs -> form_radio("link_page_categories", "0", ($linkspage_pref['link_page_categories'] ? "0" : "1"), "", "").LCLAN_OPT_4; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $TOPIC_TOPIC = LCLAN_OPT_8; + $TOPIC_FIELD = " + ".$rs -> form_radio("link_submit", "1", ($linkspage_pref['link_submit'] ? "1" : "0"), "", "").LCLAN_OPT_3." + ".$rs -> form_radio("link_submit", "0", ($linkspage_pref['link_submit'] ? "0" : "1"), "", "").LCLAN_OPT_4; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $TOPIC_TOPIC = LCLAN_OPT_9; + $TOPIC_FIELD = r_userclass("link_submit_class", $linkspage_pref['link_submit_class']); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $TOPIC_TOPIC = LCLAN_OPT_48; + $TOPIC_FIELD = " + ".$rs -> form_radio("link_submit_directpost", "1", ($linkspage_pref['link_submit_directpost'] ? "1" : "0"), "", "").LCLAN_OPT_3." + ".$rs -> form_radio("link_submit_directpost", "0", ($linkspage_pref['link_submit_directpost'] ? "0" : "1"), "", "").LCLAN_OPT_4."
        ".LCLAN_OPT_49; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //link_nextprev + $TOPIC_TOPIC = LCLAN_OPT_10; + $TOPIC_FIELD = " + ".$rs -> form_radio("link_nextprev", "1", ($linkspage_pref["link_nextprev"] ? "1" : "0"), "", "").LCLAN_OPT_3." + ".$rs -> form_radio("link_nextprev", "0", ($linkspage_pref["link_nextprev"] ? "0" : "1"), "", "").LCLAN_OPT_4; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //link_nextprev_number + $TOPIC_TOPIC = LCLAN_OPT_11; + $TOPIC_FIELD = $rs -> form_select_open("link_nextprev_number"); + for($i=2;$i<52;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($linkspage_pref["link_nextprev_number"] == $i ? "1" : "0"), $i); + $i++; + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //link_comment + $TOPIC_TOPIC = LCLAN_OPT_55; + $TOPIC_FIELD = " + ".$rs -> form_radio("link_comment", "1", ($linkspage_pref["link_comment"] ? "1" : "0"), "", "").LCLAN_OPT_3." + ".$rs -> form_radio("link_comment", "0", ($linkspage_pref["link_comment"] ? "0" : "1"), "", "").LCLAN_OPT_4; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $TOPIC_TOPIC = LCLAN_OPT_27; + $TOPIC_FIELD = " + ".$rs -> form_radio("link_rating", "1", ($linkspage_pref['link_rating'] ? "1" : "0"), "", "").LCLAN_OPT_3." + ".$rs -> form_radio("link_rating", "0", ($linkspage_pref['link_rating'] ? "0" : "1"), "", "").LCLAN_OPT_4; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $TOPIC_TOPIC = LCLAN_OPT_62; + $TOPIC_FIELD = "
        + ".$rs -> form_checkbox("link_navigator_frontpage", 1, ($linkspage_pref['link_navigator_frontpage'] ? "1" : "0"))." ".LCLAN_OPT_60."
        + ".$rs -> form_checkbox("link_navigator_submit", 1, ($linkspage_pref['link_navigator_submit'] ? "1" : "0"))." ".LCLAN_OPT_58."
        + ".$rs -> form_checkbox("link_navigator_manager", 1, ($linkspage_pref['link_navigator_manager'] ? "1" : "0"))." ".LCLAN_OPT_59."
        + ".$rs -> form_checkbox("link_navigator_refer", 1, ($linkspage_pref['link_navigator_refer'] ? "1" : "0"))." ".LCLAN_OPT_20."
        +
        + ".$rs -> form_checkbox("link_navigator_rated", 1, ($linkspage_pref['link_navigator_rated'] ? "1" : "0"))." ".LCLAN_OPT_21."
        + ".$rs -> form_checkbox("link_navigator_allcat", 1, ($linkspage_pref['link_navigator_allcat'] ? "1" : "0"))." ".LCLAN_OPT_66."
        + ".$rs -> form_checkbox("link_navigator_links", 1, ($linkspage_pref['link_navigator_links'] ? "1" : "0"))." ".LCLAN_OPT_67."
        + ".$rs -> form_checkbox("link_navigator_category", 1, ($linkspage_pref['link_navigator_category'] ? "1" : "0"))." ".LCLAN_OPT_61."
        +
        "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $text .= $TOPIC_TABLE_END; + + $text .= " +
        "; + + +$text = " +"; + +$text .= " +
        +".$rs -> form_open("post", e_SELF, "menu_conf_form", "", "enctype='multipart/form-data'")."\n"; + +$text .= parse_menu_options("recent_menu"); +$text .= parse_menu_options("new_menu"); +$text .= parse_page_options("recent_page"); +$text .= parse_page_options("new_page"); + +$text .= " + +
        "; + +$ns -> tablerender(LIST_ADMIN_1, $text); + + +function parse_global_options($type){ + global $rc, $list_pref, $rs, $tp, $sections, $titles, $iconlist, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END; + + //show sections + $TOPIC_TOPIC = LIST_ADMIN_SECT_1; + $TOPIC_HEADING = LIST_ADMIN_SECT_2; + $TOPIC_HELP = LIST_ADMIN_SECT_3; + $TOPIC_FIELD = ""; + for($i=0;$i form_checkbox($sections[$i]."_".$type."_display", 1, ($list_pref[$sections[$i]."_".$type."_display"]) ? "1" : "0")." ".$titles[$i]."
        "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //open or closed + $TOPIC_TOPIC = LIST_ADMIN_SECT_4; + $TOPIC_HEADING = LIST_ADMIN_SECT_5; + $TOPIC_HELP = LIST_ADMIN_SECT_6; + $TOPIC_FIELD = ""; + for($i=0;$i form_checkbox($sections[$i]."_".$type."_open", 1, (isset($list_pref[$sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$titles[$i]."
        "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //author + $TOPIC_TOPIC = LIST_ADMIN_SECT_7; + $TOPIC_HEADING = LIST_ADMIN_SECT_8; + $TOPIC_HELP = LIST_ADMIN_SECT_9; + $TOPIC_FIELD = ""; + for($i=0;$i form_checkbox($sections[$i]."_".$type."_author", 1, (isset($list_pref[$sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$titles[$i]."
        "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //category + $TOPIC_TOPIC = LIST_ADMIN_SECT_10; + $TOPIC_HEADING = LIST_ADMIN_SECT_11; + $TOPIC_HELP = LIST_ADMIN_SECT_12; + $TOPIC_FIELD = ""; + for($i=0;$i form_checkbox($sections[$i]."_".$type."_category", 1, (isset($list_pref[$sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$titles[$i]."
        "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //date + $TOPIC_TOPIC = LIST_ADMIN_SECT_13; + $TOPIC_HEADING = LIST_ADMIN_SECT_14; + $TOPIC_HELP = LIST_ADMIN_SECT_15; + $TOPIC_FIELD = ""; + for($i=0;$i form_checkbox($sections[$i]."_".$type."_date", 1, (isset($list_pref[$sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$titles[$i]."
        "; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //icon + $TOPIC_TOPIC = LIST_ADMIN_SECT_22; + $TOPIC_HEADING = LIST_ADMIN_SECT_23; + $TOPIC_HELP = LIST_ADMIN_SECT_24; + $TOPIC_FIELD = ""; + for($i=0;$i + + "; + } + $TOPIC_FIELD .= "
        + ".$rs -> form_text($sections[$i]."_".$type."_icon", 15, $list_pref[$sections[$i]."_".$type."_icon"], 100)." + + +
        "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //amount + $maxitems_amount = "50"; + $TOPIC_TOPIC = LIST_ADMIN_SECT_16; + $TOPIC_HEADING = LIST_ADMIN_SECT_17; + $TOPIC_HELP = LIST_ADMIN_SECT_18; + $TOPIC_FIELD = ""; + for($i=0;$i + + "; + } + $TOPIC_FIELD .= "
        + ".$rs -> form_select_open($sections[$i]."_".$type."_amount"); + for($a=1; $a<=$maxitems_amount; $a++){ + $TOPIC_FIELD .= ($list_pref[$sections[$i]."_".$type."_amount"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a)); + } + $TOPIC_FIELD .= $rs -> form_select_close()." +
        "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //order + $max = count($sections); + $TOPIC_TOPIC = LIST_ADMIN_SECT_19; + $TOPIC_HEADING = LIST_ADMIN_SECT_20; + $TOPIC_HELP = LIST_ADMIN_SECT_21; + $TOPIC_FIELD = ""; + for($i=0;$i + + "; + } + $TOPIC_FIELD .= "
        + ".$rs -> form_select_open($sections[$i]."_".$type."_order"); + for($a=1; $a<=$max; $a++){ + $TOPIC_FIELD .= ($list_pref[$sections[$i]."_".$type."_order"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a)); + } + $TOPIC_FIELD .= $rs -> form_select_close()." +
        "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + //caption + $TOPIC_TOPIC = LIST_ADMIN_SECT_25; + $TOPIC_HEADING = LIST_ADMIN_SECT_26; + $TOPIC_HELP = LIST_ADMIN_SECT_27; + $TOPIC_FIELD = ""; + for($i=0;$i + + "; + } + $TOPIC_FIELD .= "
        + ".$rs -> form_text($sections[$i]."_".$type."_caption", 30, $tp->toHTML($list_pref[$sections[$i]."_".$type."_caption"],"","defs"), "50", "tbox")." +
        "; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + + $text .= $TOPIC_ROW_SPACER; + + return $text; +} + + +//--------------------------------------------------------------------------------------------------- +function parse_menu_options($type){ + global $rc, $list_pref, $rs, $tp, $sections, $titles, $iconlist, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END; + + $text = " + "; + +//TIMELAPSE SELECT ----------------------------------------------------------- +$LIST_TIMELAPSE_TABLE = "
        {LIST_TIMELAPSE}
        "; + +?> \ No newline at end of file diff --git a/e107_plugins/list_new/plugin.php b/e107_plugins/list_new/plugin.php new file mode 100644 index 000000000..2608306aa --- /dev/null +++ b/e107_plugins/list_new/plugin.php @@ -0,0 +1,76 @@ + \ No newline at end of file diff --git a/e107_plugins/list_new/section/list_comment.php b/e107_plugins/list_new/section/list_comment.php new file mode 100644 index 000000000..6eb70f826 --- /dev/null +++ b/e107_plugins/list_new/section/list_comment.php @@ -0,0 +1,43 @@ + getBullet($arr[6], $mode); + +$qry = ''; +if($mode == "new_page" || $mode == "new_menu" ){ + $lvisit = $this -> getlvisit(); + $qry = "comment_datestamp>".$lvisit; +} + +$data = $cobj->getCommentData(intval($arr[7]), '0', $qry); + +foreach($data as $row){ + $rowheading = $this -> parse_heading($row['comment_title'], $mode); + if($row['comment_url']){ + $HEADING = "".$tp -> toHTML($rowheading, TRUE).""; + }else{ + $HEADING = $tp -> toHTML($rowheading, TRUE); + } + $CATEGORY = ''; + if($arr[4]){ + if($row['comment_category_url']){ + $CATEGORY = "".$row['comment_category_heading'].""; + }else{ + $CATEGORY = $row['comment_category_heading']; + } + } + $AUTHOR = ($arr[3] ? $row['comment_author'] : ''); + $DATE = ($arr[5] ? $this -> getListDate($row['comment_datestamp'], $mode) : ""); + $ICON = $bullet; + $INFO = ''; + + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); +} + +?> \ No newline at end of file diff --git a/e107_plugins/list_new/section/list_download.php b/e107_plugins/list_new/section/list_download.php new file mode 100644 index 000000000..692e54ac8 --- /dev/null +++ b/e107_plugins/list_new/section/list_download.php @@ -0,0 +1,38 @@ + getlvisit(); + $qry = " AND download_datestamp>".$lvisit; + }else{ + $qry = " "; + } + + $bullet = $this -> getBullet($arr[6], $mode); + + $mp = MPREFIX; + $qry = "SELECT download_id, download_name, download_author, download_datestamp, {$mp}download_category.download_category_id, {$mp}download_category.download_category_name, {$mp}download_category.download_category_class FROM {$mp}download LEFT JOIN {$mp}download_category ON {$mp}download.download_category={$mp}download_category.download_category_id WHERE download_category_class REGEXP '".e_CLASS_REGEXP."' AND download_class REGEXP '".e_CLASS_REGEXP."' AND {$mp}download.download_active != '0' ".$qry." ORDER BY download_datestamp DESC LIMIT 0,".intval($arr[7])." "; + + $downloads = $sql -> db_Select_gen($qry); + if($downloads == 0) { + $LIST_DATA = LIST_DOWNLOAD_2; + }else{ + while($row = $sql -> db_Fetch()){ + + $rowheading = $this -> parse_heading($row['download_name'], $mode); + $ICON = $bullet; + $HEADING = "".$rowheading.""; + $AUTHOR = ($arr[3] ? $row['download_author'] : ""); + //$AUTHOR = ($arr[3] ? (USERID ? "".$row['download_author']."" : $row['download_author']) : ""); + $CATEGORY = ($arr[4] ? "".$row['download_category_name']."" : ""); + $DATE = ($arr[5] ? $this -> getListDate($row['download_datestamp'], $mode) : ""); + $INFO = ""; + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + +?> \ No newline at end of file diff --git a/e107_plugins/list_new/section/list_members.php b/e107_plugins/list_new/section/list_members.php new file mode 100644 index 000000000..6475247f1 --- /dev/null +++ b/e107_plugins/list_new/section/list_members.php @@ -0,0 +1,34 @@ + getlvisit(); + $qry = "user_join>".$lvisit." AND user_ban='0' AND "; + }else{ + $qry = " "; + } + $qry .= " (user_class = '' || user_class REGEXP '".e_CLASS_REGEXP."') ORDER BY user_join DESC LIMIT 0,".intval($arr[7]); + + $bullet = $this -> getBullet($arr[6], $mode); + + if(!$sql -> db_Select("user", "*", $qry)){ + $LIST_DATA = LIST_MEMBER_2; + }else{ + while($row = $sql -> db_Fetch()){ + + $rowheading = $this -> parse_heading($row['user_name'], $mode); + $ICON = $bullet; + $HEADING = (USER ? "".$rowheading."" : $rowheading); + $CATEGORY = ""; + $AUTHOR = ""; + $DATE = ($arr[5] ? $this -> getListDate($row['user_join'], $mode) : ""); + $INFO = ""; + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + +?> \ No newline at end of file diff --git a/e107_plugins/list_new/section/list_news.php b/e107_plugins/list_new/section/list_news.php new file mode 100644 index 000000000..cf0ba9e34 --- /dev/null +++ b/e107_plugins/list_new/section/list_news.php @@ -0,0 +1,62 @@ + getlvisit(); + $qry = " news_datestamp>".$lvisit; + }else{ + $qry = " (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") "; + } + + $bullet = $this -> getBullet($arr[6], $mode); + + $LIST_CAPTION = $arr[0]; + $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); + + $qry = " + SELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name + FROM #news AS n + LEFT JOIN #news_category AS c ON c.category_id = n.news_category + LEFT JOIN #user AS u ON n.news_author = u.user_id + WHERE ".$qry." AND n.news_class REGEXP '".e_CLASS_REGEXP."' + ORDER BY n.news_datestamp DESC LIMIT 0,".intval($arr[7])." + "; + + if(!$sql -> db_Select_gen($qry)){ + $LIST_DATA = LIST_NEWS_2; + }else{ + while($row = $sql -> db_Fetch()){ + + // Code from Lisa + // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X + // instead of the actual hyperlink that may have been added to a newstitle on creation + $search = array(); + $replace = array(); + $search[0] = "/\(.*?)<\/a>/si"; + $replace[0] = '\\2'; + $search[1] = "/\(.*?)<\/a>/si"; + $replace[1] = '\\2'; + $search[2] = "/\(.*?)<\/a>/si"; + $replace[2] = '\\2'; + $search[3] = "/\(.*?)<\/a>/si"; + $replace[3] = '\\2'; + $search[4] = "/\(.*?)<\/a>/si"; + $replace[4] = '\\2'; + $search[5] = "/\(.*?)<\/a>/si"; + $replace[5] = '\\2'; + $news_title = preg_replace($search, $replace, $row['news_title']); + // End of code from Lisa + + $rowheading = $this -> parse_heading($news_title, $mode); + $ICON = $bullet; + $HEADING = "".$rowheading.""; + $AUTHOR = ($arr[3] ? ($row['news_author'] == 0 ? $row['news_author'] : ($row['news_author_name'] ? "".$row['news_author_name']."" : "") ) : ""); + $CATEGORY = ($arr[4] ? "".$row['news_category_name']."" : ""); + $DATE = ($arr[5] ? $this -> getListDate($row['news_datestamp'], $mode) : ""); + $INFO = ""; + $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO ); + } + } + +?> \ No newline at end of file diff --git a/e107_plugins/log/admin_config.php b/e107_plugins/log/admin_config.php new file mode 100644 index 000000000..ccd256012 --- /dev/null +++ b/e107_plugins/log/admin_config.php @@ -0,0 +1,336 @@ + $wipe) + { + switch($key) + { + case "statWipePage": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='pageTotal' "); + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statTotal' "); + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statUnique' "); + break; + case "statWipeBrowser": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statBrowser' "); + break; + case "statWipeOs": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statOs' "); + break; + case "statWipeScreen": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statScreen' "); + break; + case "statWipeDomain": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statDomain' "); + break; + case "statWipeRefer": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statReferer' "); + break; + case "statWipeQuery": + $sql -> db_Update("logstats", "log_data='' WHERE log_id='statQuery' "); + break; + } + } + $message = ADSTAT_L25; +} + + + +if(!is_writable(LOGPATH."logs")) { + $message = "You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)"; +} + +if (isset($_POST['updatesettings'])) { + $pref['statActivate'] = $_POST['statActivate']; + $pref['statCountAdmin'] = $_POST['statCountAdmin']; + $pref['statUserclass'] = $_POST['statUserclass']; + $pref['statBrowser'] = $_POST['statBrowser']; + $pref['statOs'] = $_POST['statOs']; + $pref['statScreen'] = $_POST['statScreen']; + $pref['statDomain'] = $_POST['statDomain']; + $pref['statRefer'] = $_POST['statRefer']; + $pref['statQuery'] = $_POST['statQuery']; + $pref['statRecent'] = $_POST['statRecent']; + $pref['statDisplayNumber'] = $_POST['statDisplayNumber']; + save_prefs(); + $message = ADSTAT_L17; +} + + +if (isset($message)) { + $ns->tablerender("", "
        ".$message."
        "); +} + +$text = "
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + + $text .= " + + + + + + +
        ".ADSTAT_L4." + ".ADSTAT_ON."   + ".ADSTAT_OFF." +
        ".ADSTAT_L18."".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."
        ".ADSTAT_L20." + ".ADSTAT_ON."   + ".ADSTAT_OFF." +
        ".ADSTAT_L21." + +
        ".ADSTAT_L5." + ".ADSTAT_L6."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + + ".ADSTAT_L7."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + + ".ADSTAT_L8."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + + ".ADSTAT_L9."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + + ".ADSTAT_L10."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + + ".ADSTAT_L11."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + + ".ADSTAT_L19."   + ".ADSTAT_ON."   + ".ADSTAT_OFF."
        + +
        ".ADSTAT_L12."
        ".ADSTAT_L13."
        + ".ADSTAT_L14."
        + ".ADSTAT_L6."
        + ".ADSTAT_L7."
        + ".ADSTAT_L8."
        + ".ADSTAT_L9."
        + ".ADSTAT_L10."
        + ".ADSTAT_L11."
        +
        +
        ".ADSTAT_L26."
        ".ADSTAT_L27."
        +
        + +
        +
        +
        "; + +$ns->tablerender(ADSTAT_L16, $text); +require_once(e_ADMIN."footer.php"); + + + + +function rempage() +{ + global $sql, $ns; + + $logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php"; + if(is_readable($logfile)) + { + require($logfile); + } + + $sql -> db_Select("logstats", "*", "log_id='pageTotal' "); + $row = $sql -> db_Fetch(); + $pageTotal = unserialize($row['log_data']); + + foreach($pageInfo as $url => $tmpcon) { + $pageTotal[$url]['url'] = $tmpcon['url']; + $pageTotal[$url]['ttlv'] += $tmpcon['ttl']; + $pageTotal[$url]['unqv'] += $tmpcon['unq']; + } + + $text = "
        +
        + + + + + + + + "; + + foreach($pageTotal as $key => $page) + { + $text .= " + + + + + + "; + } + + $text .= " + + + + + +
        ".ADSTAT_L29."URL".ADSTAT_L30." ...
        $key".$page['url']."
        +
        +
        +
        + "; + + $ns -> tablerender(ADSTAT_L32, $text); +} + + +function rempagego() +{ + global $sql; + + $sql -> db_Select("logstats", "*", "log_id='pageTotal' "); + $row = $sql -> db_Fetch(); + $pageTotal = unserialize($row['log_data']); + + $logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php"; + if(is_readable($logfile)) + { + require($logfile); + } + + foreach($_POST['remcb'] as $page) + { + unset($pageInfo[$page]); + unset($pageTotal[$page]); + } + + $pagetotal = serialize($pageTotal); + if(!$sql -> db_Update("logstats", "log_data='$pagetotal' WHERE log_id='pageTotal' ")) + { + $sql -> db_Insert("logstats", "0, 'pageTotal', '$pagetotal' "); + } + + $varStart = chr(36); + $quote = chr(34); + + $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n". + $varStart."ipAddresses = ".$quote.$ipAddresses.$quote.";\n". + $varStart."siteTotal = ".$quote.$siteTotal.$quote.";\n". + $varStart."siteUnique = ".$quote.$siteUnique.$quote.";\n"; + + $loop = FALSE; + $data .= $varStart."pageInfo = array(\n"; + foreach($pageInfo as $info) + { + $page = preg_replace("/(\?.*)|(\_.*)|(\.php)|(\s)|(\')|(\")|(eself)|( )/", "", basename ($info['url'])); + $page = str_replace("\\", "", $page); + $info['url'] = preg_replace("/(\s)|(\')|(\")|(eself)|( )/", "", $info['url']); + $info['url'] = str_replace("\\", "", $info['url']); + $page = trim($page); + if($page && !strstr($page, "cache") && !strstr($page, "file:")) + { + if($loop){ $data .= ",\n"; } + $data .= $quote.$page.$quote." => array('url' => '".$info['url']."', 'ttl' => ".$info['ttl'].", 'unq' => ".$info['unq'].")"; + $loop = 1; + } + } + + $data .= "\n);\n\n?". chr(62); + + if ($handle = fopen($logfile, 'w')) { + fwrite($handle, $data); + } + fclose($handle); + + +} +?> diff --git a/e107_plugins/log/consolidate.php b/e107_plugins/log/consolidate.php new file mode 100644 index 000000000..951bf45c2 --- /dev/null +++ b/e107_plugins/log/consolidate.php @@ -0,0 +1,284 @@ + db_Select("logstats", "*", "log_id='statBrowser' OR log_id='statOs' OR log_id='statScreen' OR log_id='statDomain' OR log_id='statTotal' OR log_id='statUnique' OR log_id='statReferer' OR log_id='statQuery'")) { + $infoArray = array(); + while($row = $sql -> db_Fetch()) + { + $$row[1] = unserialize($row[2]); + if($row[1] == "statUnique") $statUnique = $row[2]; + if($row[1] == "statTotal") $statTotal = $row[2]; + } +}else{ + /* this must be the first time a consolidation has happened - this will only ever happen once ... */ + $sql -> db_Insert("logstats", "0, 'statBrowser', ''"); + $sql -> db_Insert("logstats", "0, 'statOs', ''"); + $sql -> db_Insert("logstats", "0, 'statScreen', ''"); + $sql -> db_Insert("logstats", "0, 'statDomain', ''"); + $sql -> db_Insert("logstats", "0, 'statReferer', ''"); + $sql -> db_Insert("logstats", "0, 'statQuery', ''"); + $sql -> db_Insert("logstats", "0, 'statTotal', '0'"); + $sql -> db_Insert("logstats", "0, 'statUnique', '0'"); + $statBrowser =array(); + $statOs =array(); + $statScreen =array(); + $statDomain =array(); + $statReferer =array(); + $statQuery =array(); +} + +require_once($pathtologs.$pfileprev); +require_once($pathtologs.$ifileprev); + +foreach($browserInfo as $name => $amount) { + $statBrowser[$name] += $amount; +} + +foreach($osInfo as $name => $amount) { + $statOs[$name] += $amount; +} + +foreach($screenInfo as $name => $amount) { + $statScreen[$name] += $amount; +} + + +foreach($domainInfo as $name => $amount) { + if(!is_numeric($name)) { + $statDomain[$name] += $amount; + } +} + +foreach($refInfo as $name => $info) { + $statReferer[$name]['url'] = $info['url']; + $statReferer[$name]['ttl'] += $info['ttl']; +} + + +foreach($searchInfo as $name => $amount) { + $statQuery[$name] += $amount; +} + +$browser = serialize($statBrowser); +$os = serialize($statOs); +$screen = serialize($statScreen); +$domain = serialize($statDomain); +$refer = serialize($statReferer); +$squery = serialize($statQuery); + +$statTotal += $siteTotal; +$statUnique += $siteUnique; + +$sql -> db_Update("logstats", "log_data='$browser' WHERE log_id='statBrowser'"); +$sql -> db_Update("logstats", "log_data='$os' WHERE log_id='statOs'"); +$sql -> db_Update("logstats", "log_data='$screen' WHERE log_id='statScreen'"); +$sql -> db_Update("logstats", "log_data='$domain' WHERE log_id='statDomain'"); +$sql -> db_Update("logstats", "log_data='$refer' WHERE log_id='statReferer'"); +$sql -> db_Update("logstats", "log_data='$squery' WHERE log_id='statQuery'"); +$sql -> db_Update("logstats", "log_data='".intval($statTotal)."' WHERE log_id='statTotal'"); +$sql -> db_Update("logstats", "log_data='".intval($statUnique)."' WHERE log_id='statUnique'"); + + +/* get monthly info from db */ +if($sql -> db_Select("logstats", "*", "log_id='$date3' ")) { + $tmp = $sql -> db_Fetch(); + $monthlyInfo = unserialize($tmp['log_data']); + unset($tmp); + $MonthlyExistsFlag = TRUE; +} + +foreach($pageInfo as $key => $info) +{ + $monthlyInfo['TOTAL']['ttlv'] += $info['ttl']; + $monthlyInfo['TOTAL']['unqv'] += $info['unq']; + $monthlyInfo[$key]['ttlv'] += $info['ttl']; + $monthlyInfo[$key]['unqv'] += $info['unq']; +} + +$monthlyinfo = serialize($monthlyInfo); + +if($MonthlyExistsFlag) { + $sql -> db_Update("logstats", "log_data='$monthlyinfo' WHERE log_id='$date3'"); +} else { + $sql->db_Insert("logstats", "0, '$date3', '$monthlyinfo'"); +} + + +/* collate page total information */ +if($sql -> db_Select("logstats", "*", "log_id='pageTotal' ")) +{ + $tmp = $sql -> db_Fetch(); + $pageTotal = unserialize($tmp['log_data']); + unset($tmp); +} +else +{ + $pageTotal = array(); +} + +foreach($pageInfo as $key => $info) +{ + $pageTotal[$key]['url'] = $info['url']; + $pageTotal[$key]['ttlv'] += $info['ttl']; + $pageTotal[$key]['unqv'] += $info['unq']; +} + +$pagetotal = serialize($pageTotal); + +if(!$sql -> db_Update("logstats", "log_data='$pagetotal' WHERE log_id='pageTotal' ")) +{ + $sql -> db_Insert("logstats", "0, 'pageTotal', '$pagetotal' "); +} + + +/* now we need to collate the individual page information into an array ... */ + +$data = ""; +$dailytotal = 0; +$uniquetotal = 0; +foreach($pageInfo as $key => $value) +{ + $data .= $value['url']."|".$value['ttl']."|".$value['unq'].chr(1); + $dailytotal += $value['ttl']; + $uniquetotal += $value['unq']; +} + +$data = $dailytotal.chr(1).$uniquetotal.chr(1) . $data; +$sql -> db_Insert("logstats", "0, '$date2', '".$tp -> toDB($data, true)."'"); + + +/* ok, we're finished with the log file now, we can empty it ... */ +if(!unlink($pathtologs.$pfileprev)) +{ + $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n\n\n".chr(47)."* THE INFORMATION IN THIS LOG FILE HAS BEEN CONSOLIDATED INTO THE DATABASE - YOU CAN SAFELY DELETE IT. *". chr(47)."\n\n\n?". chr(62); + if ($handle = fopen($pathtologs.$pfileprev, 'w')) { + fwrite($handle, $data); + } + fclose($handle); +} +if(!unlink($pathtologs.$ifileprev)) +{ + $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n\n\n".chr(47)."* THE INFORMATION IN THIS LOG INFO FILE HAS BEEN CONSOLIDATED INTO THE DATABASE - YOU CAN SAFELY DELETE IT. *". chr(47)."\n\n\n?". chr(62); + if ($handle = fopen($pathtologs.$ifileprev, 'w')) { + fwrite($handle, $data); + } + fclose($handle); +} + +/* and finally, we need to create a new logfiles for today ... */ +createLog(); +/* done! */ + + +function createLog($mode="default") { + global $pathtologs, $statTotal, $statUnique, $pageArray, $pfile, $ifile; + if(!is_writable($pathtologs)) { + echo "Log directory is not writable - please CHMOD ".e_PLUGIN."log/logs to 777"; + return FALSE; + } + + $varStart = chr(36); + $quote = chr(34); + + $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n". + $varStart."refererData = ".$quote.$quote.";\n". + $varStart."ipAddresses = ".$quote.$quote.";\n". + $varStart."hosts = ".$quote.$quote.";\n". + $varStart."siteTotal = ".$quote."0".$quote.";\n". + $varStart."siteUnique = ".$quote."0".$quote.";\n". + $varStart."screenInfo = array();\n". + $varStart."browserInfo = array();\n". + $varStart."osInfo = array();\n". + $varStart."pageInfo = array(\n"; + + if($mode == "default") { + reset($pageArray); + $loop = FALSE; + foreach($pageArray as $key => $info) { + if($loop) { + $data .= ",\n"; + } + $data .= $quote.$key.$quote." => array('url' => '".$info['url']."', 'ttl' => 0, 'unq' => 0, 'ttlv' => ".$info['ttlv'].", 'unqv' => ".$info['unqv'].")"; + $loop = TRUE; + } + } + + $data .= "\n);\n\n?". chr(62); + + if(!touch($pathtologs.$pfile)) { + return FALSE; + } + + if(!touch($pathtologs.$ifile)) { + return FALSE; + } + + if(!is_writable($pathtologs.$pfile)) { + $old = umask(0); + chmod($pathtologs.$pfile, 0777); + umask($old); + // return FALSE; + } + + if(!is_writable($pathtologs.$ifile)) { + $old = umask(0); + chmod($pathtologs.$ifile, 0777); + umask($old); + // return FALSE; + } + + if ($handle = fopen($pathtologs.$pfile, 'w')) { + fwrite($handle, $data); + } + fclose($handle); + + if ($handle = fopen($pathtologs.$ifile, 'w')) { + fwrite($handle, ""); + } + fclose($handle); + return; +} + +?> \ No newline at end of file diff --git a/e107_plugins/log/e_meta.php b/e107_plugins/log/e_meta.php new file mode 100644 index 000000000..6efebb4e0 --- /dev/null +++ b/e107_plugins/log/e_meta.php @@ -0,0 +1,35 @@ +\n"; + echo "\n"; + echo ""; + } +} + + + +?> \ No newline at end of file diff --git a/e107_plugins/log/images/abrowse.png b/e107_plugins/log/images/abrowse.png new file mode 100644 index 000000000..0bfd1f4d3 Binary files /dev/null and b/e107_plugins/log/images/abrowse.png differ diff --git a/e107_plugins/log/images/amaya.png b/e107_plugins/log/images/amaya.png new file mode 100644 index 000000000..4ff2d23c8 Binary files /dev/null and b/e107_plugins/log/images/amaya.png differ diff --git a/e107_plugins/log/images/ant.png b/e107_plugins/log/images/ant.png new file mode 100644 index 000000000..6b6a2b5a1 Binary files /dev/null and b/e107_plugins/log/images/ant.png differ diff --git a/e107_plugins/log/images/aol.png b/e107_plugins/log/images/aol.png new file mode 100644 index 000000000..c1db9c709 Binary files /dev/null and b/e107_plugins/log/images/aol.png differ diff --git a/e107_plugins/log/images/aol2.png b/e107_plugins/log/images/aol2.png new file mode 100644 index 000000000..c1db9c709 Binary files /dev/null and b/e107_plugins/log/images/aol2.png differ diff --git a/e107_plugins/log/images/avantbrowser.png b/e107_plugins/log/images/avantbrowser.png new file mode 100644 index 000000000..4227d6bc2 Binary files /dev/null and b/e107_plugins/log/images/avantbrowser.png differ diff --git a/e107_plugins/log/images/avantgo.png b/e107_plugins/log/images/avantgo.png new file mode 100644 index 000000000..d3d1fd706 Binary files /dev/null and b/e107_plugins/log/images/avantgo.png differ diff --git a/e107_plugins/log/images/aweb.png b/e107_plugins/log/images/aweb.png new file mode 100644 index 000000000..52e81c733 Binary files /dev/null and b/e107_plugins/log/images/aweb.png differ diff --git a/e107_plugins/log/images/bar.png b/e107_plugins/log/images/bar.png new file mode 100644 index 000000000..82b53c3da Binary files /dev/null and b/e107_plugins/log/images/bar.png differ diff --git a/e107_plugins/log/images/beonex.png b/e107_plugins/log/images/beonex.png new file mode 100644 index 000000000..11da7a809 Binary files /dev/null and b/e107_plugins/log/images/beonex.png differ diff --git a/e107_plugins/log/images/beos.png b/e107_plugins/log/images/beos.png new file mode 100644 index 000000000..bab61ff4a Binary files /dev/null and b/e107_plugins/log/images/beos.png differ diff --git a/e107_plugins/log/images/blazer.png b/e107_plugins/log/images/blazer.png new file mode 100644 index 000000000..1af34ea73 Binary files /dev/null and b/e107_plugins/log/images/blazer.png differ diff --git a/e107_plugins/log/images/camino.png b/e107_plugins/log/images/camino.png new file mode 100644 index 000000000..d48b9df1c Binary files /dev/null and b/e107_plugins/log/images/camino.png differ diff --git a/e107_plugins/log/images/chimera.png b/e107_plugins/log/images/chimera.png new file mode 100644 index 000000000..1ff66ed90 Binary files /dev/null and b/e107_plugins/log/images/chimera.png differ diff --git a/e107_plugins/log/images/columbus.png b/e107_plugins/log/images/columbus.png new file mode 100644 index 000000000..5663b16ef Binary files /dev/null and b/e107_plugins/log/images/columbus.png differ diff --git a/e107_plugins/log/images/crazybrowser.png b/e107_plugins/log/images/crazybrowser.png new file mode 100644 index 000000000..69130deec Binary files /dev/null and b/e107_plugins/log/images/crazybrowser.png differ diff --git a/e107_plugins/log/images/curl.png b/e107_plugins/log/images/curl.png new file mode 100644 index 000000000..ff2f8dc19 Binary files /dev/null and b/e107_plugins/log/images/curl.png differ diff --git a/e107_plugins/log/images/deepnet.png b/e107_plugins/log/images/deepnet.png new file mode 100644 index 000000000..6a6ce279b Binary files /dev/null and b/e107_plugins/log/images/deepnet.png differ diff --git a/e107_plugins/log/images/dillo.png b/e107_plugins/log/images/dillo.png new file mode 100644 index 000000000..f53db608f Binary files /dev/null and b/e107_plugins/log/images/dillo.png differ diff --git a/e107_plugins/log/images/doris.png b/e107_plugins/log/images/doris.png new file mode 100644 index 000000000..ace3c9b9c Binary files /dev/null and b/e107_plugins/log/images/doris.png differ diff --git a/e107_plugins/log/images/epiphany.png b/e107_plugins/log/images/epiphany.png new file mode 100644 index 000000000..1f2bacc36 Binary files /dev/null and b/e107_plugins/log/images/epiphany.png differ diff --git a/e107_plugins/log/images/explorer.png b/e107_plugins/log/images/explorer.png new file mode 100644 index 000000000..f289a21b2 Binary files /dev/null and b/e107_plugins/log/images/explorer.png differ diff --git a/e107_plugins/log/images/firebird.png b/e107_plugins/log/images/firebird.png new file mode 100644 index 000000000..4e03f451b Binary files /dev/null and b/e107_plugins/log/images/firebird.png differ diff --git a/e107_plugins/log/images/firefox.png b/e107_plugins/log/images/firefox.png new file mode 100644 index 000000000..264c08d60 Binary files /dev/null and b/e107_plugins/log/images/firefox.png differ diff --git a/e107_plugins/log/images/freebsd.png b/e107_plugins/log/images/freebsd.png new file mode 100644 index 000000000..ef1e9e74f Binary files /dev/null and b/e107_plugins/log/images/freebsd.png differ diff --git a/e107_plugins/log/images/galeon.png b/e107_plugins/log/images/galeon.png new file mode 100644 index 000000000..b2d464455 Binary files /dev/null and b/e107_plugins/log/images/galeon.png differ diff --git a/e107_plugins/log/images/html.png b/e107_plugins/log/images/html.png new file mode 100644 index 000000000..173274770 Binary files /dev/null and b/e107_plugins/log/images/html.png differ diff --git a/e107_plugins/log/images/ibrowse.png b/e107_plugins/log/images/ibrowse.png new file mode 100644 index 000000000..b69d91fe1 Binary files /dev/null and b/e107_plugins/log/images/ibrowse.png differ diff --git a/e107_plugins/log/images/icab.png b/e107_plugins/log/images/icab.png new file mode 100644 index 000000000..98c18456d Binary files /dev/null and b/e107_plugins/log/images/icab.png differ diff --git a/e107_plugins/log/images/ice.png b/e107_plugins/log/images/ice.png new file mode 100644 index 000000000..7a76e3ec6 Binary files /dev/null and b/e107_plugins/log/images/ice.png differ diff --git a/e107_plugins/log/images/isilox.png b/e107_plugins/log/images/isilox.png new file mode 100644 index 000000000..144b36a1d Binary files /dev/null and b/e107_plugins/log/images/isilox.png differ diff --git a/e107_plugins/log/images/k-meleon.png b/e107_plugins/log/images/k-meleon.png new file mode 100644 index 000000000..7ea885ec6 Binary files /dev/null and b/e107_plugins/log/images/k-meleon.png differ diff --git a/e107_plugins/log/images/konqueror.png b/e107_plugins/log/images/konqueror.png new file mode 100644 index 000000000..2fc9f6e27 Binary files /dev/null and b/e107_plugins/log/images/konqueror.png differ diff --git a/e107_plugins/log/images/links.png b/e107_plugins/log/images/links.png new file mode 100644 index 000000000..7dbafef2b Binary files /dev/null and b/e107_plugins/log/images/links.png differ diff --git a/e107_plugins/log/images/linux.png b/e107_plugins/log/images/linux.png new file mode 100644 index 000000000..e55a615df Binary files /dev/null and b/e107_plugins/log/images/linux.png differ diff --git a/e107_plugins/log/images/logo.png b/e107_plugins/log/images/logo.png new file mode 100644 index 000000000..be7a2ff96 Binary files /dev/null and b/e107_plugins/log/images/logo.png differ diff --git a/e107_plugins/log/images/lotus.png b/e107_plugins/log/images/lotus.png new file mode 100644 index 000000000..b6ead033b Binary files /dev/null and b/e107_plugins/log/images/lotus.png differ diff --git a/e107_plugins/log/images/lunascape.png b/e107_plugins/log/images/lunascape.png new file mode 100644 index 000000000..2cfe8641b Binary files /dev/null and b/e107_plugins/log/images/lunascape.png differ diff --git a/e107_plugins/log/images/lynx.png b/e107_plugins/log/images/lynx.png new file mode 100644 index 000000000..4f7b59dea Binary files /dev/null and b/e107_plugins/log/images/lynx.png differ diff --git a/e107_plugins/log/images/mac.png b/e107_plugins/log/images/mac.png new file mode 100644 index 000000000..03f56f402 Binary files /dev/null and b/e107_plugins/log/images/mac.png differ diff --git a/e107_plugins/log/images/maxthon.png b/e107_plugins/log/images/maxthon.png new file mode 100644 index 000000000..9b0c6e7b8 Binary files /dev/null and b/e107_plugins/log/images/maxthon.png differ diff --git a/e107_plugins/log/images/mbrowser.png b/e107_plugins/log/images/mbrowser.png new file mode 100644 index 000000000..0d600ee3c Binary files /dev/null and b/e107_plugins/log/images/mbrowser.png differ diff --git a/e107_plugins/log/images/mosaic.png b/e107_plugins/log/images/mosaic.png new file mode 100644 index 000000000..b0d97dfe7 Binary files /dev/null and b/e107_plugins/log/images/mosaic.png differ diff --git a/e107_plugins/log/images/mozilla.png b/e107_plugins/log/images/mozilla.png new file mode 100644 index 000000000..0e7909096 Binary files /dev/null and b/e107_plugins/log/images/mozilla.png differ diff --git a/e107_plugins/log/images/mozilla2.png b/e107_plugins/log/images/mozilla2.png new file mode 100644 index 000000000..0e7909096 Binary files /dev/null and b/e107_plugins/log/images/mozilla2.png differ diff --git a/e107_plugins/log/images/multibrowser.png b/e107_plugins/log/images/multibrowser.png new file mode 100644 index 000000000..eb4d71b86 Binary files /dev/null and b/e107_plugins/log/images/multibrowser.png differ diff --git a/e107_plugins/log/images/nautilus.png b/e107_plugins/log/images/nautilus.png new file mode 100644 index 000000000..93ac5c3a8 Binary files /dev/null and b/e107_plugins/log/images/nautilus.png differ diff --git a/e107_plugins/log/images/netbsd.png b/e107_plugins/log/images/netbsd.png new file mode 100644 index 000000000..3b5986287 Binary files /dev/null and b/e107_plugins/log/images/netbsd.png differ diff --git a/e107_plugins/log/images/netcaptor.png b/e107_plugins/log/images/netcaptor.png new file mode 100644 index 000000000..d4c374420 Binary files /dev/null and b/e107_plugins/log/images/netcaptor.png differ diff --git a/e107_plugins/log/images/netfront.png b/e107_plugins/log/images/netfront.png new file mode 100644 index 000000000..36fecf681 Binary files /dev/null and b/e107_plugins/log/images/netfront.png differ diff --git a/e107_plugins/log/images/netpositive.png b/e107_plugins/log/images/netpositive.png new file mode 100644 index 000000000..510326cb9 Binary files /dev/null and b/e107_plugins/log/images/netpositive.png differ diff --git a/e107_plugins/log/images/netscape.png b/e107_plugins/log/images/netscape.png new file mode 100644 index 000000000..03e90d976 Binary files /dev/null and b/e107_plugins/log/images/netscape.png differ diff --git a/e107_plugins/log/images/netscape2.png b/e107_plugins/log/images/netscape2.png new file mode 100644 index 000000000..03e90d976 Binary files /dev/null and b/e107_plugins/log/images/netscape2.png differ diff --git a/e107_plugins/log/images/omniweb.png b/e107_plugins/log/images/omniweb.png new file mode 100644 index 000000000..5a0d5eaef Binary files /dev/null and b/e107_plugins/log/images/omniweb.png differ diff --git a/e107_plugins/log/images/openbsd.png b/e107_plugins/log/images/openbsd.png new file mode 100644 index 000000000..7d672e5d8 Binary files /dev/null and b/e107_plugins/log/images/openbsd.png differ diff --git a/e107_plugins/log/images/opera.png b/e107_plugins/log/images/opera.png new file mode 100644 index 000000000..9b709885e Binary files /dev/null and b/e107_plugins/log/images/opera.png differ diff --git a/e107_plugins/log/images/oregano.png b/e107_plugins/log/images/oregano.png new file mode 100644 index 000000000..13fd160c2 Binary files /dev/null and b/e107_plugins/log/images/oregano.png differ diff --git a/e107_plugins/log/images/phaseout.png b/e107_plugins/log/images/phaseout.png new file mode 100644 index 000000000..80d108864 Binary files /dev/null and b/e107_plugins/log/images/phaseout.png differ diff --git a/e107_plugins/log/images/phoenix.png b/e107_plugins/log/images/phoenix.png new file mode 100644 index 000000000..758de7d59 Binary files /dev/null and b/e107_plugins/log/images/phoenix.png differ diff --git a/e107_plugins/log/images/proxomitron.png b/e107_plugins/log/images/proxomitron.png new file mode 100644 index 000000000..e353a3f41 Binary files /dev/null and b/e107_plugins/log/images/proxomitron.png differ diff --git a/e107_plugins/log/images/remove.png b/e107_plugins/log/images/remove.png new file mode 100644 index 000000000..e21d71f98 Binary files /dev/null and b/e107_plugins/log/images/remove.png differ diff --git a/e107_plugins/log/images/robot.png b/e107_plugins/log/images/robot.png new file mode 100644 index 000000000..86048035d Binary files /dev/null and b/e107_plugins/log/images/robot.png differ diff --git a/e107_plugins/log/images/safari.png b/e107_plugins/log/images/safari.png new file mode 100644 index 000000000..8cf3be981 Binary files /dev/null and b/e107_plugins/log/images/safari.png differ diff --git a/e107_plugins/log/images/screen.png b/e107_plugins/log/images/screen.png new file mode 100644 index 000000000..41ef1d054 Binary files /dev/null and b/e107_plugins/log/images/screen.png differ diff --git a/e107_plugins/log/images/shiira.png b/e107_plugins/log/images/shiira.png new file mode 100644 index 000000000..fd08d30bf Binary files /dev/null and b/e107_plugins/log/images/shiira.png differ diff --git a/e107_plugins/log/images/sleipnir.png b/e107_plugins/log/images/sleipnir.png new file mode 100644 index 000000000..425bfdd41 Binary files /dev/null and b/e107_plugins/log/images/sleipnir.png differ diff --git a/e107_plugins/log/images/slimbrowser.png b/e107_plugins/log/images/slimbrowser.png new file mode 100644 index 000000000..b2fb5fee5 Binary files /dev/null and b/e107_plugins/log/images/slimbrowser.png differ diff --git a/e107_plugins/log/images/spiders.png b/e107_plugins/log/images/spiders.png new file mode 100644 index 000000000..9b591b59d Binary files /dev/null and b/e107_plugins/log/images/spiders.png differ diff --git a/e107_plugins/log/images/staroffice.png b/e107_plugins/log/images/staroffice.png new file mode 100644 index 000000000..522d73925 Binary files /dev/null and b/e107_plugins/log/images/staroffice.png differ diff --git a/e107_plugins/log/images/stats_16.png b/e107_plugins/log/images/stats_16.png new file mode 100644 index 000000000..85bf7b8ed Binary files /dev/null and b/e107_plugins/log/images/stats_16.png differ diff --git a/e107_plugins/log/images/stats_32.png b/e107_plugins/log/images/stats_32.png new file mode 100644 index 000000000..d127cbc27 Binary files /dev/null and b/e107_plugins/log/images/stats_32.png differ diff --git a/e107_plugins/log/images/sunos.png b/e107_plugins/log/images/sunos.png new file mode 100644 index 000000000..07961dee9 Binary files /dev/null and b/e107_plugins/log/images/sunos.png differ diff --git a/e107_plugins/log/images/sunrise.png b/e107_plugins/log/images/sunrise.png new file mode 100644 index 000000000..da42fe074 Binary files /dev/null and b/e107_plugins/log/images/sunrise.png differ diff --git a/e107_plugins/log/images/unix.png b/e107_plugins/log/images/unix.png new file mode 100644 index 000000000..e8cd22a4d Binary files /dev/null and b/e107_plugins/log/images/unix.png differ diff --git a/e107_plugins/log/images/unknown.png b/e107_plugins/log/images/unknown.png new file mode 100644 index 000000000..58188b93e Binary files /dev/null and b/e107_plugins/log/images/unknown.png differ diff --git a/e107_plugins/log/images/unspecified.png b/e107_plugins/log/images/unspecified.png new file mode 100644 index 000000000..58188b93e Binary files /dev/null and b/e107_plugins/log/images/unspecified.png differ diff --git a/e107_plugins/log/images/voyager.png b/e107_plugins/log/images/voyager.png new file mode 100644 index 000000000..724c1acc9 Binary files /dev/null and b/e107_plugins/log/images/voyager.png differ diff --git a/e107_plugins/log/images/w3m.png b/e107_plugins/log/images/w3m.png new file mode 100644 index 000000000..ed3e89923 Binary files /dev/null and b/e107_plugins/log/images/w3m.png differ diff --git a/e107_plugins/log/images/web%20indexing%20robot.png b/e107_plugins/log/images/web%20indexing%20robot.png new file mode 100644 index 000000000..86048035d Binary files /dev/null and b/e107_plugins/log/images/web%20indexing%20robot.png differ diff --git a/e107_plugins/log/images/webtv.png b/e107_plugins/log/images/webtv.png new file mode 100644 index 000000000..c581a2b0c Binary files /dev/null and b/e107_plugins/log/images/webtv.png differ diff --git a/e107_plugins/log/images/windows.png b/e107_plugins/log/images/windows.png new file mode 100644 index 000000000..763396217 Binary files /dev/null and b/e107_plugins/log/images/windows.png differ diff --git a/e107_plugins/log/images/xiino.png b/e107_plugins/log/images/xiino.png new file mode 100644 index 000000000..c787c259c Binary files /dev/null and b/e107_plugins/log/images/xiino.png differ diff --git a/e107_plugins/log/languages/English.php b/e107_plugins/log/languages/English.php new file mode 100644 index 000000000..ff244e64f --- /dev/null +++ b/e107_plugins/log/languages/English.php @@ -0,0 +1,64 @@ +click here to run update routine."); +define("ADSTAT_L3", "Statistic Logging"); +define("ADSTAT_L4", "You do not have permission to view this page."); +define("ADSTAT_L5", "The features on this page have been disabled."); +define("ADSTAT_L6", "Site Statistics"); +define("ADSTAT_L7", "Statistics for this type is not being gathered."); +define("ADSTAT_L8", "Today's Stats"); +define("ADSTAT_L9", "All-time Stats"); +define("ADSTAT_L10", "Daily Stats"); +define("ADSTAT_L11", "Monthly Stats"); +define("ADSTAT_L12", "Browser Stats"); +define("ADSTAT_L13", "Operating System Stats"); +define("ADSTAT_L14", "Domain Stats"); +define("ADSTAT_L15", "Screen Resolution / Color Depth Stats"); +define("ADSTAT_L16", "Referral Stats"); +define("ADSTAT_L17", "Search String Stats"); +define("ADSTAT_L18", "Recent Visitors"); +define("ADSTAT_L19", "Page"); +define("ADSTAT_L20", "Visits Today"); +define("ADSTAT_L21", "Total"); +define("ADSTAT_L22", "Unique"); +define("ADSTAT_L23", "Total Visits"); +define("ADSTAT_L24", "Total Unique Visits"); +define("ADSTAT_L25", "No statistics yet."); +define("ADSTAT_L26", "Browser"); +define("ADSTAT_L27", "Operating System"); +define("ADSTAT_L28", "Countries / Domains"); +define("ADSTAT_L29", "Screen Resolution"); +define("ADSTAT_L30", "Site Referrals"); +define("ADSTAT_L31", "Search Engine Query Strings"); +define("ADSTAT_L32", "Referred from"); +define("ADSTAT_L33", "Visits in last"); +define("ADSTAT_L34", "Visits"); +define("ADSTAT_L35", "Unique visits in last"); +define("ADSTAT_L36", "days by page"); +define("ADSTAT_L37", "Visits by month"); +define("ADSTAT_L38", "Unique visits by month"); +define("ADSTAT_L39", "remove this entry"); +define("ADSTAT_L40", "days"); +define("ADSTAT_L41", "Error"); + +?> \ No newline at end of file diff --git a/e107_plugins/log/languages/admin/English.php b/e107_plugins/log/languages/admin/English.php new file mode 100644 index 000000000..b6224d3b2 --- /dev/null +++ b/e107_plugins/log/languages/admin/English.php @@ -0,0 +1,61 @@ +You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)"); +define("ADSTAT_L3", "Statistic Logging"); +define("ADSTAT_L4", "Activate statistic logging"); +define("ADSTAT_L5", "Statistic types"); +define("ADSTAT_L6", "Browsers"); +define("ADSTAT_L7", "Operating Systems"); +define("ADSTAT_L8", "Screen resolutions / depths"); +define("ADSTAT_L9", "Countries/domains visited from"); +define("ADSTAT_L10", "Referrers"); +define("ADSTAT_L11", "Search queries"); +define("ADSTAT_L12", "Reset stats"); +define("ADSTAT_L13", "this will erase stats - careful!"); +define("ADSTAT_L14", "Page counts"); +define("ADSTAT_L15", "Update Statistic Settings"); +define("ADSTAT_L16", "Site Statistic Settings"); +define("ADSTAT_L17", "Statistic settings updated"); +define("ADSTAT_L18", "Allow access to main statistics page to ..."); +define("ADSTAT_L19", "Recent visitors"); +define("ADSTAT_L20", "Count admin visits"); +define("ADSTAT_L21", "Maximum records to display on stats page"); +define("ADSTAT_L22", "Run update routine"); +define("ADSTAT_L23", "logs from a previous version of e107 have been detected, update them here"); +define("ADSTAT_L24", "Go to update script"); +define("ADSTAT_L25", "Selected stats reset"); +define("ADSTAT_L26", "Remove page entries"); +define("ADSTAT_L27", "if your stats have incorrect pages, you can remove them here"); +define("ADSTAT_L28", "Open page"); + + +define("ADSTAT_L29", "Page Name"); +define("ADSTAT_L30", "Check to remove"); +define("ADSTAT_L31", "Remove selected pages"); +define("ADSTAT_L32", "Page Tidy"); +//define("ADSTAT_L10", "Referrers"); +//define("ADSTAT_L10", "Referrers"); + + + +?> \ No newline at end of file diff --git a/e107_plugins/log/log.php b/e107_plugins/log/log.php new file mode 100644 index 000000000..cb8ce5efb --- /dev/null +++ b/e107_plugins/log/log.php @@ -0,0 +1,122 @@ + $url, 'ttl' => 1, 'unq' => 1); + $flag = TRUE; +} + +if(!strstr($ipAddresses, $ip)) { + /* unique visit */ + if(!$flag) { + $pageInfo[$pageName]['unq'] ++; + } + $siteUnique ++; + $ipAddresses .= $ip."."; + require_once("loginfo.php"); +} + +$siteTotal ++; +$info_data = var_export($pageInfo, true); +$date_stamp = date("z:Y", time()); + +$data = ""; + +if ($handle = fopen($logPfile, 'w')) { + fwrite($handle, $data); +} +fclose($handle); + +function getip($mode=TRUE) { + if (getenv('HTTP_X_FORWARDED_FOR')) { + $ip = $_SERVER['REMOTE_ADDR']; + if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) { + $ip2 = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/'); + $ip = preg_replace($ip2, $ip, $ip3[1]); + } + } else { + $ip = $_SERVER['REMOTE_ADDR']; + } + if ($ip == "") { + $ip = "x.x.x.x"; + } + if($mode) { + $ipa = explode(".", $ip); + return sprintf('%02x%02x%02x%02x', $ipa[0], $ipa[1], $ipa[2], $ipa[3]); + } else { + return $ip; + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/log/log_sql.php b/e107_plugins/log/log_sql.php new file mode 100644 index 000000000..8a49db937 --- /dev/null +++ b/e107_plugins/log/log_sql.php @@ -0,0 +1,7 @@ +CREATE TABLE logstats ( + log_uniqueid int(11) NOT NULL auto_increment, + log_id varchar(50) NOT NULL default '', + log_data longtext NOT NULL, + PRIMARY KEY (log_uniqueid), + UNIQUE KEY log_id (log_id) +) TYPE=MyISAM; \ No newline at end of file diff --git a/e107_plugins/log/log_update.php b/e107_plugins/log/log_update.php new file mode 100644 index 000000000..8192c3be3 --- /dev/null +++ b/e107_plugins/log/log_update.php @@ -0,0 +1,330 @@ + db_Select("generic", "*", "gen_type='stat_update' && gen_intdata=".$i)) { + if (!$sql -> db_Select("stat_info", "*", "info_type='99' && info_count='".$i."'")) { + $func = "stage".$i; + $us -> $func(); + $sql -> db_Insert("stat_info", "'Stats Update Stage ".$i." Complete', '".$i."', '99'"); + } + } else { + $sql -> db_Insert("stat_info", "'Stats Update Stage ".$i." Complete', '".$i."', '99'"); + $sql -> db_Delete("generic", "gen_type='stat_update' && gen_intdata=".$i); + } +} + +if (!$sql -> db_Select("logstats", "*", "log_id='statQuery'")) { + $sql -> db_Insert("logstats", "0, 'statQuery', ''"); +} + +class updateStats { + + function stage1() { + global $sql; + // Converting stat_counter entries + + $stattotal = $sql -> db_Select("logstats", "*", "log_id='statTotal' "); + $statunique = $sql -> db_Select("logstats", "*", "log_id='statUnique' "); + + if($sql -> db_Select("logstats", "*", "log_id='pageTotal' ")) + { + $row = $sql -> db_Fetch(); + $pageTotal = unserialize($row['log_data']); + } + else + { + $pageTotal = array(); + } + + if(!$sql -> db_Select("stat_counter", "*", "ORDER BY counter_date, counter_url DESC", "nowhere")) + { + return; + } + + $monthArray = array(); + $totalArray = array(); + while($stat = $sql -> db_Fetch()) + { + extract($stat); + + /* collate pageTotal */ + $pagename = str_replace(".php", "", $counter_url); + $totalArray[$pagename]['ttlv'] += $counter_total; + $totalArray[$pagename]['unqv'] += $counter_unique; + $stattotal += $counter_total; + $statunique += $counter_unique; + + /* done */ + + /* collate monthly totals */ + list($year, $month, $day) = explode("-", $counter_date); + $monthstore = $year."-".$month; + if(strstr($pagename, "forum")) + { + $pagename = "forum"; + } + + $monthArray[$monthstore]['TOTAL']['ttlv'] += $counter_total; + $monthArray[$monthstore]['TOTAL']['unqv'] += $counter_unique; + $monthArray[$monthstore][$counter_url]['ttlv'] += $counter_total; + $monthArray[$monthstore][$counter_url]['unqv'] += $counter_unique; + + $dailyArray[$counter_date][$pagename] = array('url' => $counter_url, 'ttl' => $counter_total, 'unq' => $counter_unique); + $dailyTotal[$counter_date]['ttl'] += $counter_total; + $dailyTotal[$counter_date]['unq'] += $counter_unique; + } + + if(!$sql -> db_Update("logstats", "log_data='$stattotal' WHERE log_id='statTotal' ")) + { + $sql -> db_Insert("logstats", "0, 'statTotal', '$stattotal' "); + } + if(!$sql -> db_Update("logstats", "log_data='$statunique' WHERE log_id='statUnique' ")) + { + $sql -> db_Insert("logstats", "0, 'statUnique', '$statunique' "); + } + + $totalarray = serialize($totalArray); + + if(!$sql -> db_Update("logstats", "log_data='$totalarray' WHERE log_id='pageTotal' ")) + { + $sql -> db_Insert("logstats", "0, 'pageTotal', '$totalarray' "); + } + + foreach($monthArray as $key => $value) + { + $sql -> db_Insert("logstats", "0, '$key', '".serialize($value)."'"); + } + + foreach($dailyArray as $key => $value) + { + $data = ""; + foreach($value as $value2) + { + $data .= $value2['url']."|".$value2['ttl']."|".$value2['unq'].chr(1); + } + $data = $dailyTotal[$key]['ttl'].chr(1).$dailyTotal[$key]['unq'].chr(1) . $data; + $sql -> db_Insert("logstats", "0, '$key', '$data'"); + } + } + +/* ----------------------------------------------------------------------------------------------------------------------- */ + + function stage2() + { + // Converting browser entries + global $sql; + + if($sql -> db_Select("logstats", "*", "log_id='statBrowser' ")) + { + $row = $sql -> db_Fetch(); + $browserTotal = unserialize($row['log_data']); + } + else + { + $browserTotal = array(); + } + + if(!$sql -> db_Select("stat_info", "*", "info_type='1'")) + { + return; + } + + while($stat = $sql -> db_Fetch()) + { + extract($stat); + $browserTotal[$info_name] += $info_count; + } + + $data = serialize($browserTotal); + + if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statBrowser' ")) + { + $sql -> db_Insert("logstats", "0, 'statBrowser', '$data' "); + } + } + +/* ----------------------------------------------------------------------------------------------------------------------- */ + + function stage3() + { + // Operating system entries + global $sql; + if($sql -> db_Select("logstats", "*", "log_id='statOs' ")) + { + $row = $sql -> db_Fetch(); + $osTotal = unserialize($row['log_data']); + } + else + { + $osTotal = array(); + } + if(!$sql -> db_Select("stat_info", "*", "info_type='2'")) + { + return; + } + while($stat = $sql -> db_Fetch()) + { + extract($stat); + $osTotal[$info_name] += $info_count; + } + $data = serialize($osTotal); + if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statOs' ")) + { + $sql -> db_Insert("logstats", "0, 'statOs', '$data' "); + } + } + +/* ----------------------------------------------------------------------------------------------------------------------- */ + + function stage4() + { + // Domain entries to convert + global $sql; + if($sql -> db_Select("logstats", "*", "log_id='statDomain' ")) + { + $row = $sql -> db_Fetch(); + $domTotal = unserialize($row['log_data']); + } + else + { + $domTotal = array(); + } + if(!$sql -> db_Select("stat_info", "*", "info_type='4'")) + { + return; + } + while($stat = $sql -> db_Fetch()) + { + extract($stat); + $domTotal[$info_name] += $info_count; + } + $data = serialize($domTotal); + if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statDomain' ")) + { + $sql -> db_Insert("logstats", "0, 'statDomain', '$data' "); + } + } + +/* ----------------------------------------------------------------------------------------------------------------------- */ + + function stage5() + { + // Screen entries to convert + global $sql; + if($sql -> db_Select("logstats", "*", "log_id='statScreen' ")) + { + $row = $sql -> db_Fetch(); + $screenTotal = unserialize($row['log_data']); + } + else + { + $screenTotal = array(); + } + if(!$sql -> db_Select("stat_info", "*", "info_type='5'")) + { + return; + } + while($stat = $sql -> db_Fetch()) + { + extract($stat); + if(!strstr($info_name, "undefined") && !strstr($info_name, "res")) + { + $info_name = str_replace(" @ ", "@", $info_name); + $screenTotal[$info_name] += $info_count; + } + } + + $data = serialize($screenTotal); + if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statScreen' ")) + { + $sql -> db_Insert("logstats", "0, 'statScreen', '$data' "); + } + } + +/* ----------------------------------------------------------------------------------------------------------------------- */ + +function stage6() + { + // Converting referrer entries + global $sql; + if($sql -> db_Select("logstats", "*", "log_id='statReferer' ")) + { + $row = $sql -> db_Fetch(); + $refTotal = unserialize($row['log_data']); + } + else + { + $refTotal = array(); + } + if(!$sql -> db_Select("stat_info", "*", "info_type='6'")) + { + return; + } + while($stat = $sql -> db_Fetch()) + { + extract($stat); + if(!strstr($info_name, "undefined") && !strstr($info_name, "'")) + { + $refTotal[$info_name]['url'] = $info_name; + $refTotal[$info_name]['ttl'] += $info_count; + } + } + $data = serialize($refTotal); + + if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statReferer' ")) + { + $sql -> db_Insert("logstats", "0, 'statReferer', '$data' "); + } + } + + + /* ----------------------------------------------------------------------------------------------------------------------- */ + + function stage7() + { + // Correcting referrer entries + global $sql; + $sql -> db_Select("logstats", "*", "log_id='statReferer'"); + $row = $sql -> db_Fetch(); + $refTotal = unserialize($row['log_data']); + + foreach ($refTotal as $key => $ref) { + if (!is_array($ref)){ + unset($refTotal['key']); + $refTotal[$key]['url'] = $key; + $refTotal[$key]['ttl'] = $ref; + } + } + $data = serialize($refTotal); + + if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statReferer' ")) + { + $sql -> db_Insert("logstats", "0, 'statReferer', '$data' "); + } + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/log/log_update_check.php b/e107_plugins/log/log_update_check.php new file mode 100644 index 000000000..bd86e9b7e --- /dev/null +++ b/e107_plugins/log/log_update_check.php @@ -0,0 +1,39 @@ + db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) { + if ($sql -> db_Count('stat_info','(*)',"WHERE info_type='99'") < 7) { + return FALSE; + } else { + return TRUE; + } + } else { + return TRUE; + } + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/log/loginfo.php b/e107_plugins/log/loginfo.php new file mode 100644 index 000000000..0f0ac4e6d --- /dev/null +++ b/e107_plugins/log/loginfo.php @@ -0,0 +1,245 @@ + $ref, 'ttl' => 1); + } + } +} + +/* is the referal from Google? If so get search string ... */ +if(preg_match("#q=(.*?)($|&)#is", $oldref, $match)) { + $schstr = trim($match[1]); + $schstr = htmlentities(urldecode($schstr)); + if(array_key_exists($schstr, $searchInfo) && $schstr) { + $searchInfo[$schstr] ++; + } else { + $searchInfo[$schstr] = 1; + } +} + +if ($tmp = gethostbyaddr(getenv('REMOTE_ADDR'))) { + $host = trim(strtolower(substr($tmp, strrpos($tmp, ".")+1))); + if(!is_numeric($host) && !strstr($host, "calhost")) { + if(array_key_exists($host, $domainInfo)) { + $domainInfo[$host] ++; + } else { + $domainInfo[$host] =1; + } + } +} + +/* last 20 visitors */ +if(count($visitInfo) >= 20) { + $length = 20; + $offset = count($visitInfo)-$length; + $visitInfo = array_slice($visitInfo, $offset, $length); +} + +$visitInfo[$tmp] = array( + 'host' => trim($tmp), + 'date' => time(), + 'os' => trim($os), + 'browser' => trim($browser), + 'screen' => trim($screenstats), + 'referer' => substr(trim($ref), 0, 255), +); + +$data = "'; + +if ($handle = fopen($logIfile, 'w')) { + fwrite($handle, $data); +} +fclose($handle); + +function getBrowser($agent) { + + // + // All "root" browsers must come at the end of the list, unfortunately. + // Otherwise, browsers based on them will never be seen. + //(But #1997) + // + $browsers = array( + "netcaptor" => array('name' => 'Netcaptor', 'rule' => 'netcaptor[ /]([0-9.]{1,10})'), + "opera" => array('name' => 'Opera', 'rule' => 'opera[ /]([0-9.]{1,10})'), + "aol" => array('name' => 'AOL', 'rule' => 'aol[ /\-]([0-9.]{1,10})'), + "aol2" => array('name' => 'AOL', 'rule' => 'aol[ /\-]?browser'), + "mosaic" => array('name' => 'Mosaic', 'rule' => 'mosaic[ /]([0-9.]{1,10})'), + "k-meleon" => array('name' => 'K-Meleon', 'rule' => 'K-Meleon[ /]([0-9.]{1,10})'), + "konqueror" => array('name' => 'Konqueror', 'rule' => 'konqueror/([0-9.]{1,10})'), + "avantbrowser" => array('name' => 'Avant Browser', 'rule' => 'Avant[ ]?Browser'), + "avantgo" => array('name' => 'AvantGo', 'rule' => 'AvantGo[ /]([0-9.]{1,10})'), + "proxomitron" => array('name' => 'Proxomitron', 'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'), + "safari" => array('name' => 'Safari', 'rule' => 'safari/([0-9.]{1,10})'), + "lynx" => array('name' => 'Lynx', 'rule' => 'lynx/([0-9a-z.]{1,10})'), + "links" => array('name' => 'Links', 'rule' => 'Links[ /]\(([0-9.]{1,10})'), + "galeon" => array('name' => 'Galeon', 'rule' => 'galeon/([0-9.]{1,10})'), + "abrowse" => array('name' => 'ABrowse', 'rule' => 'abrowse/([0-9.]{1,10})'), + "amaya" => array('name' => 'Amaya', 'rule' => 'amaya/([0-9.]{1,10})'), + "ant" => array('name' => 'ANTFresco', 'rule' => 'ANTFresco[ /]([0-9.]{1,10})'), + "aweb" => array('name' => 'Aweb', 'rule' => 'Aweb[/ ]([0-9.]{1,10})'), + "beonex" => array('name' => 'Beonex', 'rule' => 'beonex/([0-9.]{1,10})'), + "blazer" => array('name' => 'Blazer', 'rule' => 'Blazer[/ ]([0-9.]{1,10})'), + "camino" => array('name' => 'Camino', 'rule' => 'camino/([0-9.+]{1,10})'), + "chimera" => array('name' => 'Chimera', 'rule' => 'chimera/([0-9.+]{1,10})'), + "columbus" => array('name' => 'Columbus', 'rule' => 'columbus[ /]([0-9.]{1,10})'), + "crazybrowser" => array('name' => 'Crazy Browser', 'rule' => 'Crazy Browser[ /]([0-9.]{1,10})'), + "curl" => array('name' => 'Curl', 'rule' => 'curl[ /]([0-9.]{1,10})'), + "deepnet" => array('name' => 'Deepnet Explorer', 'rule' => 'Deepnet Explorer[/ ]([0-9.]{1,10})'), + "dillo" => array('name' => 'Dillo', 'rule' => 'dillo/([0-9.]{1,10})'), + "doris" => array('name' => 'Doris', 'rule' => 'Doris/([0-9.]{1,10})'), + "elinks" => array('name' => 'ELinks', 'rule' => 'ELinks[ /][(]*([0-9.]{1,10})'), + "epiphany" => array('name' => 'Epiphany', 'rule' => 'Epiphany/([0-9.]{1,10})'), + "ibrowse" => array('name' => 'IBrowse', 'rule' => 'ibrowse[ /]([0-9.]{1,10})'), + "icab" => array('name' => 'iCab', 'rule' => 'icab[/ ]([0-9.]{1,10})'), + "ice" => array('name' => 'ICEbrowser', 'rule' => 'ICEbrowser/v?([0-9._]{1,10})'), + "isilox" => array('name' => 'iSiloX', 'rule' => 'iSilox/([0-9.]{1,10})'), + "lotus" => array('name' => 'Lotus Notes', 'rule' => 'Lotus[ -]?Notes[ /]([0-9.]{1,10})'), + "lunascape" => array('name' => 'Lunascape', 'rule' => 'Lunascape[ /]([0-9.]{1,10})'), + "maxthon" => array('name' => 'Maxthon', 'rule' => ' Maxthon[);]'), + "mbrowser" => array('name' => 'mBrowser', 'rule' => 'mBrowser[ /]([0-9.]{1,10})'), + "multibrowser" => array('name' => 'Multi-Browser', 'rule' => 'Multi-Browser[ /]([0-9.]{1,10})'), + "nautilus" => array('name' => 'Nautilus', 'rule' => '(gnome[ -]?vfs|nautilus)/([0-9.]{1,10})'), + "netfront" => array('name' => 'NetFront', 'rule' => 'NetFront[ /]([0-9.]{1,10})$'), + "netpositive" => array('name' => 'NetPositive', 'rule' => 'netpositive[ /]([0-9.]{1,10})'), + "omniweb" => array('name' => 'OmniWeb', 'rule' => 'omniweb/[ a-z]?([0-9.]{1,10})$'), + "oregano" => array('name' => 'Oregano', 'rule' => 'Oregano[0-9]?[ /]([0-9.]{1,10})$'), + "phaseout" => array('name' => 'PhaseOut', 'rule' => 'www.phaseout.net'), + "plink" => array('name' => 'PLink', 'rule' => 'PLink[ /]([0-9a-z.]{1,10})'), + "phoenix" => array('name' => 'Phoenix', 'rule' => 'Phoenix/([0-9.+]{1,10})'), + "proxomitron" => array('name' => 'Proxomitron', 'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'), + "shiira" => array('name' => 'Shiira', 'rule' => 'Shiira/([0-9.]{1,10})'), + "sleipnir" => array('name' => 'Sleipnir', 'rule' => 'Sleipnir( Version)?[ /]([0-9.]{1,10})'), + "slimbrowser" => array('name' => 'SlimBrowser', 'rule' => 'Slimbrowser'), + "staroffice" => array('name' => 'StarOffice', 'rule' => 'staroffice[ /]([0-9.]{1,10})'), + "sunrise" => array('name' => 'Sunrise', 'rule' => 'SunriseBrowser[ /]([0-9.]{1,10})'), + "voyager" => array('name' => 'Voyager', 'rule' => 'voyager[ /]([0-9.]{1,10})'), + "w3m" => array('name' => 'w3m', 'rule' => 'w3m/([0-9.]{1,10})'), + "webtv" => array('name' => 'Webtv', 'rule' => 'webtv[ /]([0-9.]{1,10})'), + "xiino" => array('name' => 'Xiino', 'rule' => '^Xiino[ /]([0-9a-z.]{1,10})'), + "explorer" => array('name' => 'Internet Explorer', 'rule' => '\(compatible; MSIE[ /]([0-9.]{1,10})'), + "firefox" => array('name' => 'Firefox', 'rule' => 'Firefox/([0-9.+]{1,10})'), + "netscape" => array('name' => 'Netscape', 'rule' => 'netscape[0-9]?/([0-9.]{1,10})'), + "netscape2" => array('name' => 'Netscape', 'rule' => '^mozilla/([0-4]\.[0-9.]{1,10})'), + "mozilla" => array('name' => 'Mozilla', 'rule' => '^mozilla/[5-9]\.[0-9.]{1,10}.+rv:([0-9a-z.+]{1,10})'), + "mozilla2" => array('name' => 'Mozilla', 'rule' => '^mozilla/([5-9]\.[0-9a-z.]{1,10})'), + "firebird" => array('name' => 'Firebird', 'rule' => 'Firebird/([0-9.+]{1,10})'), + ); + $browser = ""; + foreach($browsers as $info) { + if (preg_match("#".$info['rule']."#i", $agent, $results)) { + return ($info['name']." v".$results[1]); + } + } + return ("Unknown"); +} + +function getOs($agent) { + $os = array( + "windows2003" => array('name' => 'Windows 2003', 'rule' => 'wi(n|ndows)[ \-]?(2003|nt[ /]?5\.2)'), + "windowsxp" => array('name' => 'Windows XP', 'rule' => 'Windows XP'), + "windowsxp2" => array('name' => 'Windows XP', 'rule' => 'wi(n|ndows)[ \-]?nt[ /]?5\.1'), + "windows2k" => array('name' => 'Windows 2000', 'rule' => 'wi(n|ndows)[ \-]?(2000|nt[ /]?5\.0)'), + "windows95" => array('name' => 'Windows 95', 'rule' => 'wi(n|ndows)[ \-]?95'), + "windowsce" => array('name' => 'Windows CE', 'rule' => 'wi(n|ndows)[ \-]?ce'), + "windowsme" => array('name' => 'Windows ME', 'rule' => 'win 9x 4\.90'), + "windowsme2" => array('name' => 'Windows ME', 'rule' => 'wi(n|ndows)[ \-]?me'), + "windowsnt" => array('name' => 'Windows NT', 'rule' => 'wi(n|ndows)[ \-]?nt[ /]?([0-4][0-9.]{1,10})'), + "windowsnt2" => array('name' => 'Windows NT', 'rule' => 'wi(n|ndows)[ \-]?nt'), + "windows98" => array('name' => 'Windows 98', 'rule' => 'wi(n|ndows)[ \-]?98'), + "windows" => array('name' => 'Windows', 'rule' => 'wi(n|n32|ndows)'), + "linux" => array('name' => 'Linux', 'rule' => 'mdk for ([0-9.]{1,10})'), + "linux2" => array('name' => 'Linux', 'rule' => 'linux[ /\-]([a-z0-9.]{1,10})'), + "linux3" => array('name' => 'Linux', 'rule' => 'linux'), + "macosx" => array('name' => 'MacOS X', 'rule' => 'Mac[ ]?OS[ ]?X'), + "macppc" => array('name' => 'MacOS PPC', 'rule' => 'Mac(_Power|intosh.+P)PC'), + "mac" => array('name' => 'MacOS', 'rule' => 'mac[^hk]'), + "amiga" => array('name' => 'Amiga', 'rule' => 'Amiga[ ]?OS[ /]([0-9.]{1,10})'), + "beos" => array('name' => 'BeOS', 'rule' => 'beos[ a-z]*([0-9.]{1,10})'), + "freebsd" => array('name' => 'FreeBSD', 'rule' => 'free[ \-]?bsd[ /]([a-z0-9.]{1,10})'), + "freebsd2" => array('name' => 'FreeBSD', 'rule' => 'free[ \-]?bsd'), + "irix" => array('name' => 'Irix', 'rule' => 'irix[0-9]*[ /]([0-9.]{1,10})'), + "netbsd" => array('name' => 'NetBSD', 'rule' => 'net[ \-]?bsd[ /]([a-z0-9.]{1,10})'), + "netbsd2" => array('name' => 'NetBSD', 'rule' => 'net[ \-]?bsd'), + "os2" => array('name' => 'OS/2 Warp', 'rule' => 'warp[ /]?([0-9.]{1,10})'), + "os22" => array('name' => 'OS/2 Warp', 'rule' => 'os[ /]?2'), + "openbsd" => array('name' => 'OpenBSD', 'rule' => 'open[ \-]?bsd[ /]([a-z0-9.]{1,10})'), + "openbsd2" => array('name' => 'OpenBSD', 'rule' => 'open[ \-]?bsd'), + "palm" => array('name' => 'PalmOS', 'rule' => 'Palm[ \-]?(Source|OS)[ /]?([0-9.]{1,10})'), + "palm2" => array('name' => 'PalmOS', 'rule' => 'Palm[ \-]?(Source|OS)') + ); + foreach($os as $key => $info) { + if (preg_match("#".$info['rule']."#i", $agent, $results)) { + if(strstr($key, "win")) { + return ($info['name']); + } else { + return ($info['name']." ".$results[1]); + } + } + } + return ("Unspecified"); +} + +?> diff --git a/e107_plugins/log/logs/null.txt b/e107_plugins/log/logs/null.txt new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/log/plugin.php b/e107_plugins/log/plugin.php new file mode 100644 index 000000000..7ce6e4b61 --- /dev/null +++ b/e107_plugins/log/plugin.php @@ -0,0 +1,78 @@ + 0, "statUserclass" => "", "statClass" => 0, "statBrowser" => 1, "statOs" => 1, "statScreen" => 1, "statDomain" => 1, "statRefer" => 1, "statQuery" => 1, "statRecent" => 1); + +// List of table names ----------------------------------------------------------------------------------------------- +$eplug_table_names = array("logstats"); + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = array( +"CREATE TABLE ".MPREFIX."logstats ( + log_uniqueid int(11) NOT NULL auto_increment, + log_id varchar(50) NOT NULL default '', + log_data longtext NOT NULL, + PRIMARY KEY (log_uniqueid), + UNIQUE KEY log_id (log_id) +) TYPE=MyISAM "); + + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$eplug_link = TRUE; +$eplug_link_name = "Site Stats"; +$eplug_link_url = e_PLUGIN."log/stats.php?1"; + + +// Text to display after plugin successfully installed ------------------------------------------------------------------ +$eplug_done = ADSTAT_L2; + + +?> \ No newline at end of file diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php new file mode 100644 index 000000000..cef74891c --- /dev/null +++ b/e107_plugins/log/stats.php @@ -0,0 +1,1212 @@ + + +"; +} + +require_once(HEADERF); + +if(!check_class($pref['statUserclass'])) { + $text = "
        ".ADSTAT_L4."
        "; + $ns->tablerender(ADSTAT_L6, $text); + require_once(FOOTERF); + exit; +} + +if (!$pref['statActivate']) { + $text = (ADMIN ? "
        ".ADSTAT_L41."
        " : "
        ".ADSTAT_L5."
        "); + $ns->tablerender(ADSTAT_L6, $text); + require_once(FOOTERF); + exit; +} + +if(strstr(e_QUERY, ".")) { + list($action, $order) = explode(".", e_QUERY); +} else { + $action = e_QUERY; + $order = FALSE; +} + +$action = intval($action); +$toremove = $order; +$order = intval($order); + +if($stat -> error) { + $ns->tablerender(ADSTAT_L6, $stat -> error); + require_once(FOOTERF); + exit; +} + +$browser_map = array ( +'Netcaptor' => "netcaptor", +'Internet Explorer' => "explorer", +'Firefox' => "firefox", +'Opera' => "opera", +'AOL' => "aol", +'Netscape' => "netscape", +'Mozilla' => "mozilla", +'Mosaic' => "mosaic", +'K-Meleon' => "k-meleon", +'Konqueror' => "konqueror", +'Avant Browser' => "avantbrowser", +'AvantGo' => "avantgo", +'Proxomitron' => "proxomitron", +'Safari' => "safari", +'Lynx' => "lynx", +'Links' => "links", +'Galeon' => "galeon", +'ABrowse' => "abrowse", +'Amaya' => "amaya", +'ANTFresco' => "ant", +'Aweb' => "aweb", +'Beonex' => "beonex", +'Blazer' => "blazer", +'Camino' => "camino", +'Chimera' => "chimera", +'Columbus' => "columbus", +'Crazy Browser' => "crazybrowser", +'Curl' => "curl", +'Deepnet Explorer' => "deepnet", +'Dillo' => "dillo", +'Doris' => "doris", +'ELinks' => "elinks", +'Epiphany' => "epiphany", +'Firebird' => "firebird", +'IBrowse' => "ibrowse", +'iCab' => "icab", +'ICEbrowser' => "ice", +'iSiloX' => "isilox", +'Lotus Notes' => "lotus", +'Lunascape' => "lunascape", +'Maxthon' => "maxthon", +'mBrowser' => "mbrowser", +'Multi-Browser' => "multibrowser", +'Nautilus' => "nautilus", +'NetFront' => "netfront", +'NetPositive' => "netpositive", +'OmniWeb' => "omniweb", +'Oregano' => "oregano", +'PhaseOut' => "phaseout", +'PLink' => "plink", +'Phoenix' => "phoenix", +'Proxomitron' => "proxomitron", +'Shiira' => "shiira", +'Sleipnir' => "sleipnir", +'SlimBrowser' => "slimbrowser", +'StarOffice' => "staroffice", +'Sunrise' => "sunrise", +'Voyager' => "voyager", +'w3m' => "w3m", +'Webtv' => "webtv", +'Xiino' => "xiino", +); + +$country["arpa"] = "ARPANet"; +$country["com"] = "Commercial Users"; +$country["edu"] = "Education"; +$country["gov"] = "Government"; +$country["int"] = "Oganization established by an International Treaty"; +$country["mil"] = "Military"; +$country["net"] = "Network"; +$country["org"] = "Organization"; +$country["ad"] = "Andorra"; +$country["ae"] = "United Arab Emirates"; +$country["af"] = "Afghanistan"; +$country["ag"] = "Antigua & Barbuda"; +$country["ai"] = "Anguilla"; +$country["al"] = "Albania"; +$country["am"] = "Armenia"; +$country["an"] = "Netherland Antilles"; +$country["ao"] = "Angola"; +$country["aq"] = "Antarctica"; +$country["ar"] = "Argentina"; +$country["as"] = "American Samoa"; +$country["at"] = "Austria"; +$country["au"] = "Australia"; +$country["aw"] = "Aruba"; +$country["az"] = "Azerbaijan"; +$country["ba"] = "Bosnia-Herzegovina"; +$country["bb"] = "Barbados"; +$country["bd"] = "Bangladesh"; +$country["be"] = "Belgium"; +$country["bf"] = "Burkina Faso"; +$country["bg"] = "Bulgaria"; +$country["bh"] = "Bahrain"; +$country["bi"] = "Burundi"; +$country["bj"] = "Benin"; +$country["bm"] = "Bermuda"; +$country["bn"] = "Brunei Darussalam"; +$country["bo"] = "Bolivia"; +$country["br"] = "Brasil"; +$country["bs"] = "Bahamas"; +$country["bt"] = "Bhutan"; +$country["bv"] = "Bouvet Island"; +$country["bw"] = "Botswana"; +$country["by"] = "Belarus"; +$country["bz"] = "Belize"; +$country["ca"] = "Canada"; +$country["cc"] = "Cocos (Keeling) Islands"; +$country["cf"] = "Central African Republic"; +$country["cg"] = "Congo"; +$country["ch"] = "Switzerland"; +$country["ci"] = "Ivory Coast"; +$country["ck"] = "Cook Islands"; +$country["cl"] = "Chile"; +$country["cm"] = "Cameroon"; +$country["cn"] = "China"; +$country["co"] = "Colombia"; +$country["cr"] = "Costa Rica"; +$country["cs"] = "Czechoslovakia"; +$country["cu"] = "Cuba"; +$country["cv"] = "Cape Verde"; +$country["cx"] = "Christmas Island"; +$country["cy"] = "Cyprus"; +$country["cz"] = "Czech Republic"; +$country["de"] = "Germany"; +$country["dj"] = "Djibouti"; +$country["dk"] = "Denmark"; +$country["dm"] = "Dominica"; +$country["do"] = "Dominican Republic"; +$country["dz"] = "Algeria"; +$country["ec"] = "Ecuador"; +$country["ee"] = "Estonia"; +$country["eg"] = "Egypt"; +$country["eh"] = "Western Sahara"; +$country["er"] = "Eritrea"; +$country["es"] = "Spain"; +$country["et"] = "Ethiopia"; +$country["fi"] = "Finland"; +$country["fj"] = "Fiji"; +$country["fk"] = "Falkland Islands (Malvibas)"; +$country["fm"] = "Micronesia"; +$country["fo"] = "Faroe Islands"; +$country["fr"] = "France"; +$country["fx"] = "France (European Territory)"; +$country["ga"] = "Gabon"; +$country["gb"] = "Great Britain"; +$country["gd"] = "Grenada"; +$country["ge"] = "Georgia"; +$country["gf"] = "Guyana (French)"; +$country["gh"] = "Ghana"; +$country["gi"] = "Gibralta"; +$country["gl"] = "Greenland"; +$country["gm"] = "Gambia"; +$country["gn"] = "Guinea"; +$country["gp"] = "Guadeloupe (French)"; +$country["gq"] = "Equatorial Guinea"; +$country["gr"] = "Greece"; +$country["gs"] = "South Georgia & South Sandwich Islands"; +$country["gt"] = "Guatemala"; +$country["gu"] = "Guam (US)"; +$country["gw"] = "Guinea Bissau"; +$country["gy"] = "Guyana"; +$country["hk"] = "Hong Kong"; +$country["hm"] = "Heard & McDonald Islands"; +$country["hn"] = "Honduras"; +$country["hr"] = "Croatia"; +$country["ht"] = "Haiti"; +$country["hu"] = "Hungary"; +$country["id"] = "Indonesia"; +$country["ie"] = "Ireland"; +$country["il"] = "Israel"; +$country["in"] = "India"; +$country["io"] = "British Indian Ocean Territories"; +$country["iq"] = "Iraq"; +$country["ir"] = "Iran"; +$country["is"] = "Iceland"; +$country["it"] = "Italy"; +$country["jm"] = "Jamaica"; +$country["jo"] = "Jordan"; +$country["jp"] = "Japan"; +$country["ke"] = "Kenya"; +$country["kg"] = "Kyrgyz Republic"; +$country["kh"] = "Cambodia"; +$country["ki"] = "Kiribati"; +$country["km"] = "Comoros"; +$country["kn"] = "Saint Kitts Nevis Anguilla"; +$country["kp"] = "Korea (North)"; +$country["kr"] = "Korea (South)"; +$country["kw"] = "Kuwait"; +$country["ky"] = "Cayman Islands"; +$country["kz"] = "Kazachstan"; +$country["la"] = "Laos"; +$country["lb"] = "Lebanon"; +$country["lc"] = "Saint Lucia"; +$country["li"] = "Liechtenstein"; +$country["lk"] = "Sri Lanka"; +$country["lr"] = "Liberia"; +$country["ls"] = "Lesotho"; +$country["lt"] = "Lithuania"; +$country["lu"] = "Luxembourg"; +$country["lv"] = "Latvia"; +$country["ly"] = "Libya"; +$country["ma"] = "Morocco"; +$country["mc"] = "Monaco"; +$country["md"] = "Moldova"; +$country["mg"] = "Madagascar"; +$country["mh"] = "Marshall Islands"; +$country["mk"] = "Macedonia"; +$country["ml"] = "Mali"; +$country["mm"] = "Myanmar"; +$country["mn"] = "Mongolia"; +$country["mo"] = "Macau"; +$country["mp"] = "Northern Mariana Islands"; +$country["mq"] = "Martinique (French)"; +$country["mr"] = "Mauretania"; +$country["ms"] = "Montserrat"; +$country["mt"] = "Malta"; +$country["mu"] = "Mauritius"; +$country["mv"] = "Maldives"; +$country["mw"] = "Malawi"; +$country["mx"] = "Mexico"; +$country["my"] = "Malaysia"; +$country["mz"] = "Mozambique"; +$country["na"] = "Namibia"; +$country["nc"] = "New Caledonia (French)"; +$country["ne"] = "Niger"; +$country["nf"] = "Norfolk Island"; +$country["ng"] = "Nigeria"; +$country["ni"] = "Nicaragua"; +$country["nl"] = "Netherlands"; +$country["no"] = "Norway"; +$country["np"] = "Nepal"; +$country["nr"] = "Nauru"; +$country["nt"] = "Saudiarab. Irak)"; +$country["nu"] = "Niue"; +$country["nz"] = "New Zealand"; +$country["om"] = "Oman"; +$country["pa"] = "Panama"; +$country["pe"] = "Peru"; +$country["pf"] = "Polynesia (French)"; +$country["pg"] = "Papua New Guinea"; +$country["ph"] = "Philippines"; +$country["pk"] = "Pakistan"; +$country["pl"] = "Poland"; +$country["pm"] = "Saint Pierre & Miquelon"; +$country["pn"] = "Pitcairn"; +$country["pr"] = "Puerto Rico (US)"; +$country["pt"] = "Portugal"; +$country["pw"] = "Palau"; +$country["py"] = "Paraguay"; +$country["qa"] = "Qatar"; +$country["re"] = "Reunion (French)"; +$country["ro"] = "Romania"; +$country["ru"] = "Russian Federation"; +$country["rw"] = "Rwanda"; +$country["sa"] = "Saudi Arabia"; +$country["sb"] = "Salomon Islands"; +$country["sc"] = "Seychelles"; +$country["sd"] = "Sudan"; +$country["se"] = "Sweden"; +$country["sg"] = "Singapore"; +$country["sh"] = "Saint Helena"; +$country["si"] = "Slovenia"; +$country["sj"] = "Svalbard & Jan Mayen"; +$country["sk"] = "Slovakia"; +$country["sl"] = "Sierra Leone"; +$country["sm"] = "San Marino"; +$country["sn"] = "Senegal"; +$country["so"] = "Somalia"; +$country["sr"] = "Suriname"; +$country["st"] = "Sao Tome & Principe"; +$country["su"] = "Soviet Union"; +$country["sv"] = "El Salvador"; +$country["sy"] = "Syria"; +$country["sz"] = "Swaziland"; +$country["tc"] = "Turks & Caicos Islands"; +$country["td"] = "Chad"; +$country["tf"] = "French Southern Territories"; +$country["tg"] = "Togo"; +$country["th"] = "Thailand"; +$country["tj"] = "Tadjikistan"; +$country["tk"] = "Tokelau"; +$country["tm"] = "Turkmenistan"; +$country["tn"] = "Tunisia"; +$country["to"] = "Tonga"; +$country["tp"] = "East Timor"; +$country["tr"] = "Turkey"; +$country["tt"] = "Trinidad & Tobago"; +$country["tv"] = "Tuvalu"; +$country["tw"] = "Taiwan"; +$country["tz"] = "Tanzania"; +$country["ua"] = "Ukraine"; +$country["ug"] = "Uganda"; +$country["uk"] = "United Kingdom"; +$country["um"] = "US Minor outlying Islands"; +$country["us"] = "United States"; +$country["uy"] = "Uruguay"; +$country["uz"] = "Uzbekistan"; +$country["va"] = "Vatican City State"; +$country["vc"] = "St Vincent & Grenadines"; +$country["ve"] = "Venezuela"; +$country["vg"] = "Virgin Islands (British)"; +$country["vi"] = "Virgin Islands (US)"; +$country["vn"] = "Vietnam"; +$country["vu"] = "Vanuatu"; +$country["wf"] = "Wallis & Futuna Islands"; +$country["ws"] = "Samoa"; +$country["ye"] = "Yemen"; +$country["yt"] = "Mayotte"; +$country["yu"] = "Yugoslavia"; +$country["za"] = "South Africa"; +$country["zm"] = "Zambia"; +$country["zr"] = "Zaire"; +$country["zw"] = "Zimbabwe"; + +/* stats displayed will depend on the query string. For example, ?1.2.4 will render today's stats, all time stats and browser stats */ +/* +1: today's stats +2: all time total and unique +3: browsers +4: operating systems +5: domains +6: screen resolution/colour depth +7: referers +8: search engine strings +*/ + +switch($action) { + case 1: + $text = $stat -> renderTodaysVisits(); + break; + case 2: + $text = $stat -> renderAlltimeVisits(); + break; + case 3: + if($pref['statBrowser']) { + $text = $stat -> renderBrowsers(); + } else { + $text = ADSTAT_L7; + } + break; + case 4: + if($pref['statOs']) { + $text = $stat -> renderOses(); + } else { + $text = ADSTAT_L7; + } + break; + case 5: + if($pref['statDomain']) { + $text = $stat -> renderDomains(); + } else { + $text = ADSTAT_L7; + } + break; + case 6: + if($pref['statScreen']) { + $text = $stat -> renderScreens(); + } else { + $text = ADSTAT_L7; + } + break; + case 7: + if($pref['statRefer']) { + $text = $stat -> renderRefers(); + } else { + $text = ADSTAT_L7; + } + break; + case 8: + if($pref['statQuery']) { + $text = $stat -> renderQueries(); + } else { + $text = ADSTAT_L7; + } + break; + case 9: + if($pref['statRecent']) { + $text = $stat -> recentVisitors(); + } else { + $text = ADSTAT_L7; + } + break; + case 10: + $text = $stat -> renderDaily(); + break; + case 11: + $text = $stat -> renderMonthly(); + break; + case "rem": + $stat -> remove_entry($toremove); + break; +} + + +/* render links */ +$path = e_PLUGIN."log/stats.php"; +$links = " +
        ". +(e_QUERY != 1 ? "".ADSTAT_L8."" : "".ADSTAT_L8."")." | ". +(e_QUERY != 2 ? "".ADSTAT_L9."" : "".ADSTAT_L9."")." | ". +(e_QUERY != 10 ? "".ADSTAT_L10."" : "".ADSTAT_L10."")." | ". +(e_QUERY != 11 ? "".ADSTAT_L11."" : "".ADSTAT_L11."")." | ". +(e_QUERY != 3 && $pref['statBrowser'] ? "".ADSTAT_L12." | " : ($pref['statBrowser'] ? "".ADSTAT_L12." | " : "")). +(e_QUERY != 4 && $pref['statOs'] ? "".ADSTAT_L13." | " : ($pref['statOs'] ? "".ADSTAT_L13." | " : "")). +(e_QUERY != 5 && $pref['statDomain'] ? "".ADSTAT_L14." | " : ($pref['statDomain'] ? "".ADSTAT_L14." | " : "")). +(e_QUERY != 6 && $pref['statScreen'] ? "".ADSTAT_L15." | " : ($pref['statScreen'] ? "".ADSTAT_L15." | " : "")). +(e_QUERY != 7 && $pref['statRefer'] ? "".ADSTAT_L16." | " : ($pref['statRefer'] ? "".ADSTAT_L16." | " : "")). +(e_QUERY != 8 && $pref['statQuery'] ? "".ADSTAT_L17." | " : ($pref['statQuery'] ? "".ADSTAT_L17." | " : "")). +(e_QUERY != 9 && $pref['statRecent'] ? "".ADSTAT_L18."" : ($pref['statRecent'] ? "".ADSTAT_L18."" : "")). +"


        "; + + + +$ns->tablerender(ADSTAT_L6, $links.$text); +require_once(FOOTERF); + +class siteStats { + + var $dbPageInfo; + var $fileInfo; + var $fileBrowserInfo; + var $fileOsInfo; + var $fileScreenInfo; + var $fileDomainInfo; + var $fileReferInfo; + var $fileQueryInfo; + var $fileRecent; + var $error; + var $order; + var $bar; + + var $filesiteTotal; + var $filesiteUnique; + + function siteStats() { + /* constructor */ + global $sql; + + /* get today's logfile ... */ + $logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php"; + if(is_readable($logfile)) { + require($logfile); + } + $logfile = e_PLUGIN."log/logs/logi_".date("z.Y", time()).".php"; + if(is_readable($logfile)) { + require($logfile); + } + + $this -> filesiteTotal = $siteTotal; + $this -> filesiteUnique = $siteUnique; + + /* set order var */ + global $order; + $this -> order = $order; + + $this -> fileInfo = $pageInfo; + $this -> fileBrowserInfo = $browserInfo; + $this -> fileOsInfo = $osInfo; + $this -> fileScreenInfo = $screenInfo; + $this -> fileDomainInfo = $domainInfo; + $this -> fileReferInfo = $refInfo; + $this -> fileQueryInfo = $searchInfo; + $this -> fileRecent = $visitInfo; + + /* get main stat info from database */ + if($sql -> db_Select("logstats", "*", "log_id='pageTotal'")){ + $row = $sql -> db_Fetch(); + $this -> dbPageInfo = unserialize($row[2]); + } else { + $this -> dbPageInfo = array(); + } + + /* temp consolidate today's info (if it exists)... */ + if(is_array($pageInfo)) { + foreach($pageInfo as $key => $info) { + $key = preg_replace("/\?.*/", "", $key); + if(array_key_exists($key, $this -> dbPageInfo)) { + $this -> dbPageInfo[$key]['ttlv'] += $info['ttl']; + $this -> dbPageInfo[$key]['unqv'] += $info['unq']; + } else { + $this -> dbPageInfo[$key]['url'] = $info['url']; + $this -> dbPageInfo[$key]['ttlv'] = $info['ttl']; + $this -> dbPageInfo[$key]['unqv'] = $info['unq']; + } + } + } + + $this -> bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_IMAGE."generic/bar.png"); + + + /* end constructor */ + } + + function arraySort($array, $column, $order = SORT_DESC){ + /* sorts multi-dimentional array based on which field is passed */ + $i=0; + foreach($array as $info) { + $sortarr[]=$info[$column]; + $i++; + } + array_multisort($sortarr, $order, $array, $order); + return($array); + /* end method */ + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderTodaysVisits() { + /* renders information for today only */ + $totalArray = $this -> arraySort($this -> fileInfo, "ttl"); + + foreach($totalArray as $key => $info) { + $totalv += $info['ttl']; + $totalu += $info['unq']; + } + + $text = "\n\n\n\n\n\n"; + foreach($totalArray as $key => $info) { + if($info['ttl']){ + $percentage = round(($info['ttl']/$totalv) * 100, 2); + $text .= "\n\n\n\n\n"; + } + } + $text .= "
        ".ADSTAT_L19."".ADSTAT_L20."%
        ".$key." + ".$this -> bar($percentage, $info['ttl']." [".$info['unq']."]")."".$percentage."%
        ".ADSTAT_L21." [".ADSTAT_L22."]$totalv [$totalu]
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderAlltimeVisits() { + /* renders information for alltime, total and unique */ + + global $sql; + + $sql -> db_Select("logstats", "*", "log_id='pageTotal' "); + $row = $sql -> db_Fetch(); + $pageTotal = unserialize($row['log_data']); + + foreach($this -> fileInfo as $url => $tmpcon) { + $pageTotal[$url]['url'] = $tmpcon['url']; + $pageTotal[$url]['ttlv'] += $tmpcon['ttl']; + $pageTotal[$url]['unqv'] += $tmpcon['unq']; + } + + $totalArray = $this -> arraySort($pageTotal, "ttlv"); + + foreach($totalArray as $key => $info) { + $total += $info['ttlv']; + } + $text .= "\n\n\n\n\n\n"; + foreach($totalArray as $key => $info) { + if($info['ttlv']){ + $percentage = round(($info['ttlv']/$total) * 100, 2); + $text .= " + + + + \n"; + } + } + $text .= "\n
        ".ADSTAT_L19."".ADSTAT_L23."%
        + ".(ADMIN && getperms("P") ? "".ADSTAT_L39." " : "")." + ".$key." + "; + $text .= "".$this->bar($percentage, $info['ttlv'])."".$percentage."%
        ".ADSTAT_L21."$total
        "; + + $uniqueArray = $this -> arraySort($this -> dbPageInfo, "unqv"); + foreach($uniqueArray as $key => $info) { + $totalv += $info['unqv']; + } + $text .= "
        \n\n\n\n\n\n"; + foreach($uniqueArray as $key => $info) { + if($info['ttlv']){ + $percentage = round(($info['unqv']/$total) * 100, 2); + $text .= " + + + + \n"; + } + } + $text .= "\n
        Page".ADSTAT_L24."%
        ".$key."".$this -> bar($percentage, $info['unqv'])."".$percentage."%
        ".ADSTAT_L21."$totalv
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderBrowsers() { + global $sql, $browser_map; + + if($entries = $sql -> db_Select("logstats", "*", "log_id='statBrowser'")) { + $row = $sql -> db_Fetch(); + $statBrowser = unserialize($row['log_data']); + } + + /* temp consolidate today's data ... */ + foreach($this -> fileBrowserInfo as $name => $count) { + $statBrowser[$name] += $count; + } + + if(!is_array($statBrowser)) { + return "
        ".ADSTAT_L25."
        "; + } + + if(is_array($statBrowser)) { + if($this -> order) { + ksort($statBrowser); + reset ($statBrowser); + $browserArray = $statBrowser; + } else { + $browserArray = $this -> arraySort($statBrowser, 0); + } + $total = array_sum($browserArray); + $text = "\n\n\n\n\n\n"; + + foreach($browserArray as $key => $info) { + $image = ""; + foreach ($browser_map as $name => $file) { + if(strstr($key, $name)) { + $image = "{$file}.png"; + break; + } + } + if($image == "") { + $image = "unknown.png"; + } + $percentage = round(($info/$total) * 100, 2); + $text .= " + ". + ($entries == 1 ? "" : "")." + + \n"; + } + $text .= "\n
        ".ADSTAT_L26."".ADSTAT_L21."%
        ".($image ? " " : "").$key."".$this -> bar($percentage, $info)."".$this -> bar($percentage, $info)."".$percentage."%
        ".ADSTAT_L21."$total
        "; + } + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderOses() { + global $sql; + + if($entries = $sql -> db_Select("logstats", "*", "log_id='statOs'")) { + $row = $sql -> db_Fetch(); + $statOs = unserialize($row['log_data']); + } + + /* temp consolidate today's data ... */ + foreach($this -> fileOsInfo as $name => $count) { + $statOs[$name] += $count; + } + + if(!is_array($statOs)) { + return "
        ".ADSTAT_L25.".
        "; + } + + if($this -> order) { + ksort($statOs); + reset ($statOs); + $osArray = $statOs; + } else { + $osArray = $this -> arraySort($statOs, 0); + } + + $total = array_sum($osArray); + $text = "\n\n\n\n\n\n"; + foreach($osArray as $key => $info) { + + $image = ""; + if(strstr($key, "Windows")) { $image = "windows.png"; } + if(strstr($key, "Mac")) { $image = "mac.png"; } + if(strstr($key, "Linux")) { $image = "linux.png"; } + if(strstr($key, "BeOS")) { $image = "beos.png"; } + if(strstr($key, "FreeBSD")) { $image = "freebsd.png"; } + if(strstr($key, "NetBSD")) { $image = "netbsd.png"; } + if(strstr($key, "Unspecified")) { $image = "unspecified.png"; } + if(strstr($key, "OpenBSD")) { $image = "openbsd.png"; } + if(strstr($key, "Unix")) { $image = "unix.png"; } + if(strstr($key, "Spiders")) { $image = "spiders.png"; } + + $percentage = round(($info/$total) * 100, 2); + $text .= " + ". + ($entries == 1 ? "" : "")." + + \n"; + } + $text .= "\n
        ".ADSTAT_L27."".ADSTAT_L21."%
        ".($image ? " " : "").$key."".$this -> bar($percentage, $info)."".$this -> bar($percentage, $info)."".$percentage."%
        ".ADSTAT_L21."$total
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderDomains() { + global $sql; + + if($sql -> db_Select("logstats", "*", "log_id='statDomain'")) { + $row = $sql -> db_Fetch(); + $statDom = unserialize($row['log_data']); + } + + /* temp consolidate today's data ... */ + foreach($this -> fileDomainInfo as $name => $count) { + $statDom[$name] += $count; + } + + if(!count($statDom)) { + return "
        ".ADSTAT_L25.".
        "; + } + + if($this -> order) { + ksort($statDom); + reset ($statDom); + $domArray = $statDom; + } else { + $domArray = $this -> arraySort($statDom, 0); + } + + $total = array_sum($domArray); + $text = "\n\n\n\n\n\n"; + foreach($domArray as $key => $info) { + if($key = $this -> getcountry($key)) { + $percentage = round(($info/$total) * 100, 2); + $text .= " + + + + \n"; + } + } + $text .= "\n
        ".ADSTAT_L28."".ADSTAT_L21."%
        ".$key."".$this -> bar($percentage, $info)."".$percentage."%
        ".ADSTAT_L21."$total
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderScreens() { + global $sql; + + if($entries = $sql -> db_Select("logstats", "*", "log_id='statScreen'")) { + $row = $sql -> db_Fetch(); + $statScreen = unserialize($row['log_data']); + } + + /* temp consolidate today's data ... */ + foreach($this -> fileScreenInfo as $name => $count) { + $statScreen[$name] += $count; + } + + if(!is_array($statScreen)) { + return "
        ".ADSTAT_L25."
        "; + } + + if($this -> order) { + $nsarray = array(); + foreach($statScreen as $key => $info) { + if(preg_match("/(\d+)x/", $key, $match)) { + $nsarray[$key] = array('width' => $match[1], 'info' => $info); + } + } + $nsarray = $this -> arraySort($nsarray, 'width', SORT_ASC); + reset($nsarray); + $screenArray = array(); + foreach($nsarray as $key => $info) { + $screenArray[$key] = $info['info']; + } + + } else { + $screenArray = $this -> arraySort($statScreen, 0); + } + + $total = array_sum($screenArray); + $text = "\n\n\n\n\n\n"; + foreach($screenArray as $key => $info) { + if(strstr($key, "@") && !strstr($key, "undefined") && preg_match("/(\d+)x(\d+)@(\d+)/", $key)) { + $percentage = round(($info/$total) * 100, 2); + $text .= " + ". + ($entries == 1 ? "" : "")." + + \n"; + } + } + $text .= "\n
        ".ADSTAT_L29."".ADSTAT_L21."%
        ".$key."".$this -> bar($percentage, $info)."".$this -> bar($percentage, $info)."".$percentage."%
        ".ADSTAT_L21."$total
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderRefers() { + global $sql, $pref; + + if($sql -> db_Select("logstats", "*", "log_id='statReferer'")) { + $row = $sql -> db_Fetch(); + $statRefer = unserialize($row['log_data']); + } + + /* temp consolidate today's data ... */ + foreach($this -> fileReferInfo as $name => $count) { + $statRefer[$name]['url'] = $count['url']; + $statRefer[$name]['ttl'] += $count['ttl']; + } + + //echo "
        "; print_r($statRefer); echo "
        "; exit; + + if(!is_array($statRefer) || !count($statRefer)) { + return "
        ".ADSTAT_L25.".
        "; + } + + $statArray = $this -> arraySort($statRefer, 'ttl'); + + $total = 0; + foreach($statArray as $key => $info) { + $total += $info['ttl']; + } + + $text = "\n\n\n\n\n\n"; + $count = 0; + foreach($statArray as $key => $info) { + $percentage = round(($info['ttl']/$total) * 100, 2); + if (!$this -> order && strlen($key) > 50) { + $key = substr($key, 0, 50)." ..."; + } + $text .= " + + + + \n"; + $count++; + if($count == $pref['statDisplayNumber']) { + break; + } + } + $text .= "\n
        ".ADSTAT_L30."".ADSTAT_L21."%
        ".$key."".$this -> bar($percentage, $info['ttl'])."".$percentage."%
        ".ADSTAT_L21."$total
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderQueries() { + global $sql; + + if($sql -> db_Select("logstats", "*", "log_id='statQuery'")) { + $row = $sql -> db_Fetch(); + $statQuery = unserialize($row['log_data']); + } + + /* temp consolidate today's data ... */ + foreach($this -> fileQueryInfo as $name => $count) { + $statQuery[$name] += $count; + } + + if(!is_array($statQuery) || !count($statQuery)) { + return "
        ".ADSTAT_L25."
        "; + } + + $queryArray = $this -> arraySort($statQuery, 0); + $total = array_sum($queryArray); + $text = "\n\n\n\n\n\n"; + $count = 1; + foreach($queryArray as $key => $info) { + $percentage = round(($info/$total) * 100, 2); + $key = str_replace("%20", " ", $key); + $text .= " + + + + \n"; + $count ++; + if($count == $pref['statDisplayNumber']) { + break; + } + } + $text .= "\n
        ".ADSTAT_L31."".ADSTAT_L21."%
        ".$key."".$this -> bar($percentage, $info)."".$percentage."%
        ".ADSTAT_L21."$total
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function recentVisitors() { + if(!is_array($this -> fileRecent) || !count($this -> fileRecent)) { + return "
        ".ADSTAT_L25.".
        "; + } + + $gen = new convert; + $recentArray = array_reverse($this -> fileRecent, TRUE); + $text = "\n\n\n\n\n"; + + foreach($recentArray as $key => $info) { + if(is_array($info)) { + $host = $info['host']; + $datestamp = $info['date']; + $os = $info['os']; + $browser = $info['browser']; + $screen = $info['screen']; + $referer = $info['referer']; + } else { + list($host, $datestamp, $os, $browser, $screen, $referer) = explode(chr(1), $info); + } + $datestamp = $gen -> convert_date($datestamp, "long"); + + $text .= " + + + \n"; + } + + $text .= "
        ".ADSTAT_L18."Information
        $datestampHost: $host
        ".ADSTAT_L26.": $browser
        ".ADSTAT_L27.": $os
        ".ADSTAT_L29.": $screen".($referer ? "
        ".ADSTAT_L32.": $referer" : "")."
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderDaily() { + global $sql, $siteTotal, $siteUnique; + + $td = date("Y-m-j", time()); + $dayarray[$td] = array(); + $pagearray = array(); + + $qry = " + SELECT * from #logstats WHERE log_id REGEXP('[[:digit:]]+\-[[:digit:]]+\-[[:digit:]]+') + ORDER BY CONCAT(LEFT(log_id,4), SUBSTRING(log_id, 6, 2), LPAD(SUBSTRING(log_id, 9), 2, '0')) + DESC LIMIT 0,14 + "; + + if($amount = $sql -> db_Select_gen($qry)) { + $array = $sql -> db_getList(); + + $ttotal = 0; + $utotal = 0; + + foreach($array as $key => $value) { + extract($value); + if(is_array($log_data)) { + $entries[0] = $log_data['host']; + $entries[1] = $log_data['date']; + $entries[2] = $log_data['os']; + $entries[3] = $log_data['browser']; + $entries[4] = $log_data['screen']; + $entries[5] = $log_data['referer']; + } else { + $entries = explode(chr(1), $log_data); + } + + $dayarray[$log_id]['daytotal'] = $entries[0]; + $dayarray[$log_id]['dayunique'] = $entries[1]; + + unset($entries[0]); + unset($entries[1]); + + foreach($entries as $entry) { + if($entry) { + list($url, $total, $unique) = explode("|", $entry); + if(strstr($url, "/")) { + $urlname = preg_replace("/\.php|\?.*/", "", substr($url, (strrpos($url, "/")+1))); + } else { + $urlname = preg_replace("/\.php|\?.*/", "", $url); + } + $dayarray[$log_id][$urlname] = array('url' => $url, 'total' => $total, 'unique' => $unique); + $pagearray[$urlname]['total'] += $total; + $pagearray[$urlname]['unique'] += $unique; + $ttotal += $total; + $utotal += $unique; + } + } + } + } + + foreach($this -> fileInfo as $fkey => $fvalue) + { + $dayarray[$td][$fkey]['total'] += $fvalue['ttl']; + $dayarray[$td][$fkey]['unique'] += $fvalue['unq']; + $dayarray[$td]['daytotal'] += $fvalue['ttl']; + $dayarray[$td]['dayunique'] += $fvalue['unq']; + $pagearray[$fkey]['total'] += $fvalue['ttl']; + $pagearray[$fkey]['unique'] += $fvalue['unq']; + $ttotal += $fvalue['ttl']; + $utotal += $fvalue['unq']; + } + + $text = "\n\n\n\n\n"; + + foreach($dayarray as $date => $total) { + + list($year, $month, $day) = explode("-", $date); + $date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year)); + $barWidth = round(($total['daytotal']/$ttotal) * 100, 2); + $text .= " + + + \n"; + } + + $text .= "
        ".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L40."".ADSTAT_L34."
        $date".$this -> bar($barWidth, $total['daytotal'])."
        "; + $text .= "
        \n\n\n\n\n"; + + + foreach($dayarray as $date => $total) { + list($year, $month, $day) = explode("-", $date); + $date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year)); + $barWidth = round(($total['dayunique']/$utotal) * 100, 2); + $text .= " + + + \n"; + } + $text .= "
        ".ADSTAT_L35." ".($amount+1)." ".ADSTAT_L40."".ADSTAT_L34."
        $date".$this -> bar($barWidth, $total['dayunique'])."
        "; + + $text .= "
        \n\n\n\n\n"; + + $newArray = $this -> arraySort($pagearray, "total"); + foreach($newArray as $key => $total) { + $barWidth = round(($total['total']/$ttotal) * 100, 2); + $text .= " + + + \n"; + + } + $text .= "
        ".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L36."".ADSTAT_L34."
        $key".$this -> bar($barWidth, $total['total'])."
        "; + $text .= "
        \n\n\n\n\n"; + $newArray = $this -> arraySort($pagearray, "unique"); + + foreach($newArray as $key => $total) { + $barWidth = round(($total['unique']/$utotal) * 100, 2); + $text .= " + + + \n"; + } + $text .= "
        ".ADSTAT_L35." ".($amount+1)." ".ADSTAT_L36."".ADSTAT_L34."
        $key".$this -> bar($barWidth, $total['unique'])."
        "; + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function renderMonthly() { + global $sql; + + if(!$entries = $sql -> db_Select("logstats", "*", "log_id REGEXP('^[[:digit:]]+\-[[:digit:]]+$') ORDER BY CONCAT(LEFT(log_id,4), RIGHT(log_id,2)) DESC")) { + return "No monthly stats yet."; + } + + $array = $sql -> db_getList(); + + $monthTotal = array(); + $mtotal = 0; + $utotal = 0; + foreach($array as $info) { + $date = $info['log_id']; + $stats = unserialize($info['log_data']); + + foreach($stats as $key => $total) { + $monthTotal[$date]['totalv'] += $total['ttlv']; + $monthTotal[$date]['uniquev'] += $total['unqv']; + $mtotal += $total['ttlv']; + $utotal += $total['unqv']; + } + } + + $tmpArray = $this -> arraySort($monthTotal, "totalv"); + + $text .= "\n\n\n\n\n"; + + foreach($monthTotal as $date => $total) { + + list($year, $month) = explode("-", $date); + $date = strftime ("%B %Y", mktime (0,0,0,$month,1,$year)); + $barWidth = round(($total['totalv']/$mtotal) * 100, 2); + $text .= " + ". + ($entries == 1 ? "" : "")." + \n"; + } + $text .= "
        ".ADSTAT_L37."".ADSTAT_L34."
        $date".$this -> bar($barWidth, $total['totalv'])."".$this -> bar($barWidth, $total['totalv'])."
        "; + + $text .= "
        \n\n\n\n\n"; + + foreach($monthTotal as $date => $total) { + $barWidth = round(($total['uniquev']/$utotal) * 100, 2); + list($year, $month) = explode("-", $date); + $date = strftime ("%B %Y", mktime (0,0,0,$month,1,$year)); + $text .= " + ". + ($entries == 1 ? "" : "")." + \n"; + } + $text .= "
        ".ADSTAT_L38."".ADSTAT_L34."
        $date".$this -> bar($barWidth, $total['uniquev'])."".$this -> bar($barWidth, $total['uniquev'])."
        "; + + + return $text; + } + + /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + function getWidthRatio ($array, $column) { + $tmpArray = $this -> arraySort($array, $column); + $data = each($tmpArray); + $maxValue = $data[1]['totalv']; + echo "maxValue ".$maxValue."
        "; + $ratio = 0; + while($maxValue > 100) { + $maxValue = ($maxValue / 2); + $ratio ++; + } + if(!$ratio) + { + return 1; + } + echo "ratio ".$ratio."
        "; + return $ratio; + } + + function getcountry($dom) { + global $country; + return $country[$dom]; + } + + function bar($percen, $val) + { + return "
        + + ".$val; + } + + function remove_entry($toremove) { + global $sql; + $sql -> db_Select("logstats", "*", "log_id='pageTotal'"); + $row = $sql -> db_Fetch(); + $dbPageInfo = unserialize($row[2]); + unset($dbPageInfo[$toremove]); + $dbPageDone = serialize($dbPageInfo); + $sql -> db_Update("logstats", "log_data='$dbPageDone' WHERE log_id='pageTotal' "); + $this -> renderAlltimeVisits(); + } +} + + + +?> \ No newline at end of file diff --git a/e107_plugins/login_menu/config.php b/e107_plugins/login_menu/config.php new file mode 100644 index 000000000..878bdf65b --- /dev/null +++ b/e107_plugins/login_menu/config.php @@ -0,0 +1,96 @@ +db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); + $ns->tablerender("", '
        '.LAN_SETSAVED.'
        '); +} + +$text = ' +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        '.LOGIN_MENU_L31.' + +
        '.LOGIN_MENU_L32.' + +
        '.LOGIN_MENU_L33.' + +
        '.LOGIN_MENU_L34.' + +
        '.LOGIN_MENU_L35.' + +
        '.LOGIN_MENU_L36.' + +
        +
        +
        + '; + +$ns->tablerender(LOGIN_MENU_L41, $text); + +require_once(e_ADMIN."footer.php"); + +?> diff --git a/e107_plugins/login_menu/languages/English.php b/e107_plugins/login_menu/languages/English.php new file mode 100644 index 000000000..2a731e791 --- /dev/null +++ b/e107_plugins/login_menu/languages/English.php @@ -0,0 +1,65 @@ +Please click here to destroy cookie."); +define("LOGIN_MENU_L8", "Logout"); +define("LOGIN_MENU_L9", "Login Error"); +define("LOGIN_MENU_L10", "The maintenance flag is true - this means normal visitors are being redirected to sitedown.php. To reset the flag go to admin/maintenance."); +define("LOGIN_MENU_L11", "Admin Area"); +define("LOGIN_MENU_L12", "Settings"); +define("LOGIN_MENU_L13", "Profile"); +define("LOGIN_MENU_L14", "news item"); +define("LOGIN_MENU_L15", "news items"); +define("LOGIN_MENU_L16", "chatbox post"); +define("LOGIN_MENU_L17", "chatbox posts"); +define("LOGIN_MENU_L18", "comment"); +define("LOGIN_MENU_L19", "comments"); +define("LOGIN_MENU_L20", "forum post"); +define("LOGIN_MENU_L21", "forum posts"); +define("LOGIN_MENU_L22", "new site member"); +define("LOGIN_MENU_L23", "new site members"); +define("LOGIN_MENU_L24", "Click here to see list of new items"); +define("LOGIN_MENU_L25", "Since your last visit there have been"); +define("LOGIN_MENU_L26", "no"); +define("LOGIN_MENU_L27", "and"); +define("LOGIN_MENU_L28", "Login"); + +define("LOGIN_MENU_L29", "new article"); +define("LOGIN_MENU_L30", "new articles"); + +// New config options +define('LOGIN_MENU_L31', 'Show New News Posts'); +define('LOGIN_MENU_L32', 'Show New Article Posts'); +define('LOGIN_MENU_L33', 'Show New Chatbox Posts'); +define('LOGIN_MENU_L34', 'Show New Comment Posts'); +define('LOGIN_MENU_L35', 'Show New Forum Posts'); +define('LOGIN_MENU_L36', 'Show New Members'); + + +define('LOGIN_MENU_L39', 'Leave Admin'); +define("LOGIN_MENU_L40", "Resend Activation Email"); +define("LOGIN_MENU_L41", "Login Menu Settings"); + +?> diff --git a/e107_plugins/login_menu/login_menu.php b/e107_plugins/login_menu/login_menu.php new file mode 100644 index 000000000..87d38e0f1 --- /dev/null +++ b/e107_plugins/login_menu/login_menu.php @@ -0,0 +1,212 @@ +getip(); + + if(defined("BULLET")) + { + $bullet = ""; + } + elseif(file_exists(THEME."images/bullet2.gif")) + { + $bullet = "bullet"; + } + else + { + $bullet = ""; + } + +if (defined('CORRUPT_COOKIE') && CORRUPT_COOKIE == TRUE) +{ + $text = "
        ".LOGIN_MENU_L7."

        + ".$bullet." ".LOGIN_MENU_L8."
        "; + $ns->tablerender(LOGIN_MENU_L9, $text, 'login'); +} +$use_imagecode = ($pref['logcode'] && extension_loaded('gd')); + +if ($use_imagecode) +{ + global $sec_img; + include_once(e_HANDLER.'secure_img_handler.php'); + $sec_img = new secure_image; +} +$text = ''; +if (USER == TRUE || ADMIN == TRUE) +{ + if (!isset($LOGIN_MENU_LOGGED)) { + if (file_exists(THEME."login_menu_template.php")){ + require(THEME."login_menu_template.php"); + }else{ + require(e_PLUGIN."login_menu/login_menu_template.php"); + } + } + + if(!$LOGIN_MENU_LOGGED){ // if still doesn't exist in the user template. + require(e_PLUGIN."login_menu/login_menu_template.php"); + } + + $text = $tp->parseTemplate($LOGIN_MENU_LOGGED, true, $login_menu_shortcodes); + + if (!$sql->db_Select('online', 'online_ip', "`online_ip` = '{$ip}' AND `online_user_id` = '0' ")) + { + $sql->db_Delete('online', "`online_ip` = '{$ip}' AND `online_user_id` = '0' "); + } + + $new_total = 0; + $time = USERLV; + + // ------------ News Stats ----------- + + if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_news'] == true) + { + $new_news = $sql->db_Count("news", "(*)", "WHERE `news_datestamp` > {$time} AND news_class REGEXP '".e_CLASS_REGEXP."'"); + $new_total += $new_news; + if (!$new_news) + { + $new_news = LOGIN_MENU_L26; + } + $NewItems[] = $new_news.' '.($new_news == 1 ? LOGIN_MENU_L14 : LOGIN_MENU_L15); + } + + // ------------ Comments Stats ----------- + + if (varset($menu_pref['login_menu']['new_comments'], false, true) == true) + { + $new_comments = 0; + $new_comments = $sql->db_Count('comments', '(*)', 'WHERE `comment_datestamp` > '.$time); + + if (!$new_comments) + { + $new_comments = LOGIN_MENU_L26; + } + $NewItems[] = $new_comments.' '.($new_comments == 1 ? LOGIN_MENU_L18 : LOGIN_MENU_L19); + } + + // ------------ Chatbox Stats ----------- + + if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_chatbox'] == true) { + $display_chats = TRUE; + + if(in_array('chatbox_menu',$eMenuActive)){ + $new_chat = $sql->db_Count('chatbox', '(*)', 'WHERE `cb_datestamp` > '.$time); + $new_total += $new_chat; + } else { + $display_chats = FALSE; + } + if (isset($new_chat) && !$new_chat) { + $new_chat = ($display_chats ? LOGIN_MENU_L26 : ''); + } + if ($display_chats == true) { + $NewItems[] = $new_chat.' '.($new_chat == 1 ? LOGIN_MENU_L16 : LOGIN_MENU_L17); + + } + } + + // ------------ Forum Stats ----------- + + if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_forum'] == true) { + $qry = " + SELECT count(*) as count FROM #forum_t as t + LEFT JOIN #forum as f + ON t.thread_forum_id = f.forum_id + WHERE t.thread_datestamp > {$time} and f.forum_class IN (".USERCLASS_LIST.") + "; + if($sql->db_Select_gen($qry)) + { + $row = $sql->db_Fetch(); + $new_forum = $row['count']; + $new_total += $new_forum; + } + if (!$new_forum) { + $new_forum = LOGIN_MENU_L26; + } + $NewItems[] = $new_forum.' '.($new_forum == 1 ? LOGIN_MENU_L20 : LOGIN_MENU_L21); + } + + // ------------ Member Stats ----------- + + if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_members'] == true) { + $new_users = $sql->db_Count('user', '(user_join)', 'WHERE user_join > '.$time); + $new_total += $new_users; + if (!$new_users) { + $new_users = LOGIN_MENU_L26; + } + $NewItems[] = $new_users.' '.($new_users == 1 ? LOGIN_MENU_L22 : LOGIN_MENU_L23); + } + if (isset($NewItems) && $NewItems) { + $text .= '

        '.LOGIN_MENU_L25.'
        '.implode(',
        ', $NewItems).'
        '; + if ($new_total) { + if ($sql -> db_Select("plugin", "plugin_installflag", "plugin_path='list_new' AND plugin_installflag='1'")) + { + $text .= '
        '.LOGIN_MENU_L24.''; + } + } + } + + if (file_exists(THEME.'images/login_menu.png')) { + $caption = ''.LOGIN_MENU_L5.' '.USERNAME; + } else { + $caption = LOGIN_MENU_L5.' '.USERNAME; + } + $ns->tablerender($caption, $text, 'login'); +} else { + if (!$LOGIN_MENU_FORM || !$LOGIN_MENU_MESSAGE) { + if (file_exists(THEME."login_menu_template.php")){ + require_once(THEME."login_menu_template.php"); + }else{ + require_once(e_PLUGIN."login_menu/login_menu_template.php"); + } + } + if(!$LOGIN_MENU_FORM || !$LOGIN_MENU_MESSAGE){ + require(e_PLUGIN."login_menu/login_menu_template.php"); + } + + if (strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) + { + + if (LOGINMESSAGE != '') { + $text = $tp->parseTemplate($LOGIN_MENU_MESSAGE, true, $login_menu_shortcodes); + } + + $text .= '
        '; + $text .= $tp->parseTemplate($LOGIN_MENU_FORM, true, $login_menu_shortcodes); + $text .= '
        '; + } else { + $text = $tp->parseTemplate("
        {LM_FPW_LINK}
        ", true, $login_menu_shortcodes); + } + + + if (file_exists(THEME.'images/login_menu.png')) { + $caption = ''.LOGIN_MENU_L5; + } else { + $caption = LOGIN_MENU_L5; + } + $ns->tablerender($caption, $text, 'login'); +} + +?> diff --git a/e107_plugins/login_menu/login_menu_shortcodes.php b/e107_plugins/login_menu/login_menu_shortcodes.php new file mode 100755 index 000000000..6ba739196 --- /dev/null +++ b/e107_plugins/login_menu/login_menu_shortcodes.php @@ -0,0 +1,160 @@ + e_sc -> parse_scbatch(__FILE__); + +/* +SC_BEGIN LM_USERNAME_INPUT +return "\n"; +SC_END + +SC_BEGIN LM_PASSWORD_INPUT +return "\n\n"; +SC_END + +SC_BEGIN LM_IMAGECODE +global $use_imagecode, $sec_img; +if($use_imagecode) +{ + return ' + '.$sec_img->r_image().' +

        '; +} +SC_END + +SC_BEGIN LM_LOGINBUTTON +return ""; +SC_END + +SC_BEGIN LM_REMEMBERME +global $pref; +if($parm == "hidden"){ + return ""; +} +if($pref['user_tracking'] != "session") +{ + return "".LOGIN_MENU_L6; +} +SC_END + +SC_BEGIN LM_SIGNUP_LINK +global $pref; +if ($pref['user_reg']) +{ + if (!$pref['auth_method'] || $pref['auth_method'] == 'e107') + { + return ""; + } +} +return ""; +SC_END + +SC_BEGIN LM_FPW_LINK +global $pref; +if ($pref['user_reg']) +{ + if (!$pref['auth_method'] || $pref['auth_method'] == 'e107') + { + return ""; + } +} +return ""; +SC_END + +SC_BEGIN LM_RESEND_LINK +global $pref; +if(isset($pref['user_reg_veri']) && $pref['user_reg_veri'] == 1){ + if (!$pref['auth_method'] || $pref['auth_method'] == 'e107' ) + { + return ""; + } +} +return ""; +SC_END + +SC_BEGIN LM_MAINTENANCE +global $pref; +if(ADMIN == TRUE){ + return ($pref['maintainance_flag'] == 1 ? '
        '.LOGIN_MENU_L10.'

        ' : '' ); +} +SC_END + +SC_BEGIN LM_ADMINLINK_BULLET +global $bullet; +if(ADMIN==TRUE && $bullet !='bullet'){ + return $bullet; +} +SC_END + +SC_BEGIN LM_ADMINLINK +global $ADMIN_DIRECTORY, $eplug_admin; + +//die(e_PAGE); + +if(ADMIN == TRUE) { + if (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || $eplug_admin == true || substr(e_PAGE, 0, 6) == 'admin_') + { + return ''; + } + else + { + return ''; + } +} +SC_END + + + +SC_BEGIN LM_BULLET +global $bullet; +return $bullet; + +SC_END + +SC_BEGIN LM_USERSETTINGS +$text = ($parm) ? $parm : LOGIN_MENU_L12; +return ''; +SC_END + +SC_BEGIN LM_PROFILE +$text = ($parm) ? $parm : LOGIN_MENU_L13; +return ''; +SC_END + +SC_BEGIN LM_LOGOUT +$text = ($parm) ? $parm : LOGIN_MENU_L8; +return ''; +SC_END + +SC_BEGIN LM_MESSAGE +global $tp; +if($parm == "popup"){ + $srch = array("
        ","'"); + $rep = array("\\n","\'"); + return ""; +}else{ + return LOGINMESSAGE; +} +SC_END + +*/ +?> diff --git a/e107_plugins/login_menu/login_menu_template.php b/e107_plugins/login_menu/login_menu_template.php new file mode 100644 index 000000000..225d52a9e --- /dev/null +++ b/e107_plugins/login_menu/login_menu_template.php @@ -0,0 +1,70 @@ +[ "; +$sc_style['LM_SIGNUP_LINK']['post'] = " ]"; + +$sc_style['LM_FPW_LINK']['pre'] = "
        [ "; +$sc_style['LM_FPW_LINK']['post'] = " ]"; + +$sc_style['LM_RESEND_LINK']['pre'] = "
        [ "; +$sc_style['LM_RESEND_LINK']['post'] = " ]"; + +$sc_style['LM_REMEMBERME']['pre'] = "
        "; +$sc_style['LM_REMEMBERME']['post'] = ""; + +if (!isset($LOGIN_MENU_FORM)){ + + $LOGIN_MENU_FORM = " +
        ". + LOGIN_MENU_L1." +
        \n + {LM_USERNAME_INPUT} +
        ". + LOGIN_MENU_L2." +
        \n + {LM_PASSWORD_INPUT} +
        \n + {LM_IMAGECODE} + {LM_LOGINBUTTON} + {LM_REMEMBERME} +
        + {LM_SIGNUP_LINK} + {LM_FPW_LINK} + {LM_RESEND_LINK} +
        + "; +} + +if (!isset($LOGIN_MENU_LOGGED)){ + $sc_style['LM_ADMINLINK']['pre'] = ""; + $sc_style['LM_ADMINLINK']['post'] = "
        "; + + $LOGIN_MENU_LOGGED = " + {LM_MAINTENANCE} + {LM_ADMINLINK_BULLET} {LM_ADMINLINK} + {LM_BULLET} {LM_USERSETTINGS}
        + {LM_BULLET} {LM_PROFILE}
        + {LM_BULLET} {LM_LOGOUT} + "; +} + +if (!isset($LOGIN_MENU_MESSAGE)){ + $LOGIN_MENU_MESSAGE = '
        {LM_MESSAGE}
        '; +} +?> diff --git a/e107_plugins/newforumposts_main/admin_config.php b/e107_plugins/newforumposts_main/admin_config.php new file mode 100644 index 000000000..8f65faaa9 --- /dev/null +++ b/e107_plugins/newforumposts_main/admin_config.php @@ -0,0 +1,100 @@ +tablerender("", "
        $message
        "); +} + + + +$text = "
        + +
        "; +$ns->tablerender(NFPM_L12, $text); + +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/newforumposts_main/images/logo.png b/e107_plugins/newforumposts_main/images/logo.png new file mode 100644 index 000000000..b434f9e1a Binary files /dev/null and b/e107_plugins/newforumposts_main/images/logo.png differ diff --git a/e107_plugins/newforumposts_main/images/new_forum_16.png b/e107_plugins/newforumposts_main/images/new_forum_16.png new file mode 100644 index 000000000..a5d37dec8 Binary files /dev/null and b/e107_plugins/newforumposts_main/images/new_forum_16.png differ diff --git a/e107_plugins/newforumposts_main/images/new_forum_32.png b/e107_plugins/newforumposts_main/images/new_forum_32.png new file mode 100644 index 000000000..79c7643a5 Binary files /dev/null and b/e107_plugins/newforumposts_main/images/new_forum_32.png differ diff --git a/e107_plugins/newforumposts_main/languages/English.php b/e107_plugins/newforumposts_main/languages/English.php new file mode 100644 index 000000000..e70df8a5c --- /dev/null +++ b/e107_plugins/newforumposts_main/languages/English.php @@ -0,0 +1,29 @@ +Default is latest topics."); +define('NFPM_L16', '[user deleted]'); + + +?> \ No newline at end of file diff --git a/e107_plugins/newforumposts_main/newforumposts.sc b/e107_plugins/newforumposts_main/newforumposts.sc new file mode 100644 index 000000000..b7310975d --- /dev/null +++ b/e107_plugins/newforumposts_main/newforumposts.sc @@ -0,0 +1,10 @@ +// $Id: newforumposts.sc,v 1.1.1.1 2006-12-02 04:35:30 mcfly_e107 Exp $ +// use $parm to restrict visibility based on matching part of the URL +if($parm && !strpos(e_SELF,$parm)) +{ + return; +} +else +{ + include(e_PLUGIN."newforumposts_main/newforumposts_main.php"); +} diff --git a/e107_plugins/newforumposts_main/newforumposts_main.php b/e107_plugins/newforumposts_main/newforumposts_main.php new file mode 100644 index 000000000..0c4681102 --- /dev/null +++ b/e107_plugins/newforumposts_main/newforumposts_main.php @@ -0,0 +1,152 @@ + +
        \n + + + + + + + + \n"; + + $NEWFORUMPOSTSTYLE_MAIN = " + + + + + + + + \n"; + + $NEWFORUMPOSTSTYLE_FOOTER = "\n\n\n
         ".NFPM_LAN_1."".NFPM_LAN_2."".NFPM_LAN_3."".NFPM_LAN_4."".NFPM_LAN_5."
        {ICON}{THREAD} ({FORUM}){POSTER}{VIEWS}{REPLIES}{LASTPOST}
        {LASTPOSTDATE} 
        + ".NFPM_LAN_6.": {TOTAL_TOPICS} | ".NFPM_LAN_4.": {TOTAL_REPLIES} | ".NFPM_LAN_3.": {TOTAL_VIEWS}\n
        \n
        "; + +} + +$results = $sql->db_Select_gen(" +SELECT t.thread_id, t.thread_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class, lp.user_name AS lp_name +FROM #forum_t AS t +LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id +LEFT JOIN #user AS lp ON SUBSTRING_INDEX(t.thread_lastuser,'.',1) = lp.user_id +LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id +LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id +WHERE f.forum_id = t.thread_forum_id AND t.thread_parent=0 AND f.forum_class IN (".USERCLASS_LIST.") +AND fp.forum_class IN (".USERCLASS_LIST.") +ORDER BY t.$query DESC LIMIT 0, ".$pref['nfp_amount']); + +$forumArray = $sql->db_getList(); + +if (!isset($gen) || !is_object($gen)) { + $gen = new convert; +} + +$ICON = ""; +$TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' "); +$TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' "); +$sql->db_Select_gen("SELECT sum(thread_views) FROM ".MPREFIX."forum_t"); +$tmp = $sql->db_Fetch(); +$TOTAL_VIEWS = $tmp[0]; +$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER); + +foreach($forumArray as $forumInfo) +{ + extract($forumInfo); + + $r_datestamp = $gen->convert_date($thread_lastpost, "forum"); + if($thread_total_replies) + { + $tmp = explode(".", $thread_lastuser, 2); + if($lp_name) + { + $LASTPOST = "$lp_name"; + } + else + { + if($tmp[1]) + { + $LASTPOST = $tmp[1]; + } + else + { + $LASTPOST = NFPM_L16; + } + } + $LASTPOSTDATE = "$r_datestamp"; + } + else + { + $LASTPOST = " - "; + $LASTPOSTDATE = ""; + } + + $x = explode(chr(1), $thread_user); + $tmp = explode(".", $x[0], 2); + if($user_name) + { + $POSTER = "$user_name"; + } + else + { + if($tmp[1]) + { + $POSTER = $tmp[1]; + } + else + { + $POSTER = NFPM_L16; + } + } + + $THREAD = "$thread_name"; + $FORUM = "$forum_name"; + + $VIEWS = $thread_views; + $REPLIES = $thread_total_replies; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_MAIN); + +} +$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_FOOTER); + +$text = ($pref['nfp_layer'] ? "
        ".$text."
        " : $text); + +if ($results) +{ + $ns->tablerender($pref['nfp_caption'], $text, "nfp"); +} + +?> diff --git a/e107_plugins/newforumposts_main/plugin.php b/e107_plugins/newforumposts_main/plugin.php new file mode 100644 index 000000000..b7691f8dc --- /dev/null +++ b/e107_plugins/newforumposts_main/plugin.php @@ -0,0 +1,85 @@ + 0, + "nfp_caption" => "Latest Forum Posts", + "nfp_amount" => 5, + ); + +// List of table names ----------------------------------------------------------------------------------------------- +$eplug_table_names = ""; + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = ""; + + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$eplug_link = FALSE; +$eplug_link_name = ""; +$ec_dir = e_PLUGIN.""; +$eplug_link_url = ""; + + +// Text to display after plugin successfully installed ------------------------------------------------------------------ +$eplug_done = "To configure please click on the link in the plugins section of the admin front page"; + + +// upgrading ... // + +$upgrade_add_prefs = ""; + +$upgrade_remove_prefs = ""; + +$upgrade_alter_tables = ""; + +$eplug_upgrade_done = ""; + + + + + +?> \ No newline at end of file diff --git a/e107_plugins/newsfeed/admin_config.php b/e107_plugins/newsfeed/admin_config.php new file mode 100644 index 000000000..dba8f9738 --- /dev/null +++ b/e107_plugins/newsfeed/admin_config.php @@ -0,0 +1,198 @@ + toDB($_POST['newsfeed_name']); + $description = $tp -> toDB($_POST['newsfeed_description']); + $imgfield = $_POST['newsfeed_image']."::".$_POST['newsfeed_showmenu']."::".$_POST['newsfeed_showmain']; + $sql->db_Insert("newsfeed", "0, '$name', '".$_POST['newsfeed_url']."', '', '0', '{$description}', '{$imgfield}', ".$_POST['newsfeed_active'].", ".$_POST['newsfeed_updateint']." "); + $message = NFLAN_23; + } else { + $message = NFLAN_24; + } +} + +if(isset($_POST['updateFeed'])) +{ + $name = $tp -> toDB($_POST['newsfeed_name']); + $description = $tp -> toDB($_POST['newsfeed_description']); + $imgfield = $_POST['newsfeed_image']."::".$_POST['newsfeed_showmenu']."::".$_POST['newsfeed_showmain']; + $sql->db_Update("newsfeed", "newsfeed_name='{$name}', newsfeed_url='".$_POST['newsfeed_url']."', newsfeed_timestamp='0', newsfeed_image='{$imgfield}', newsfeed_description='{$description}', newsfeed_active=".$_POST['newsfeed_active'].", newsfeed_updateint=".$_POST['newsfeed_updateint']." WHERE newsfeed_id=".$_POST['newsfeed_id']); + $message = NFLAN_25; +} + +if($action == "delete") { + $sql->db_Delete("newsfeed", "newsfeed_id=$id"); + $message = NFLAN_40; +} + +if (isset($message)) { + $ns->tablerender("", "
        ".$message."
        "); +} + + +if($headline_total = $sql->db_Select("newsfeed")) +{ + $nfArray = $sql -> db_getList(); + + $text = "
        + + + + + + + + \n"; + + $active = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21); + + foreach($nfArray as $newsfeed) + { + extract($newsfeed); + + $text .= " + + + + + \n"; + } + + $text .= "
        ID".NFLAN_30."".NFLAN_26."".NFLAN_12."".NFLAN_27."
        $newsfeed_id$newsfeed_name".($newsfeed_updateint ? $newsfeed_updateint : "3600")."".$active[$newsfeed_active]."".ADMIN_EDIT_ICON." ".ADMIN_DELETE_ICON."
        \n
        "; +} +else +{ + $text = NFLAN_41; +} +$ns->tablerender(NFLAN_07, $text); + +if($action == "edit") +{ + if($sql->db_Select("newsfeed", "*", "newsfeed_id=$id")) + { + $row = $sql->db_Fetch(); + extract($row); + list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image); + } +} +else +{ + unset($newsfeed_showmenu, $newsfeed_showmain, $newsfeed_name, $newsfeed_url, $newsfeed_image, $newsfeed_description, $newsfeed_updateint, $newsfeed_active); +} + +$text = "
        +
        \n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".NFLAN_30." + +
        ".NFLAN_10." + +
        ".NFLAN_11."
        ".NFLAN_17."
        + +
        ".NFLAN_36."
        ".NFLAN_37."
        + +
        ".NFLAN_18."
        ".NFLAN_19."
        + +
        ".NFLAN_12."
        ".NFLAN_22."
        + + ".NFLAN_13." 
        + ".NFLAN_14." 
        + ".NFLAN_20." 
        + ".NFLAN_21."  +
        ".NFLAN_45."
        ".NFLAN_47."
        + +
        ".NFLAN_46."
        ".NFLAN_47."
        + +
        + +
        +".($action == "edit" ? "" : "")." +
        +
        "; + +$ns->tablerender(NFLAN_09, $text); + +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/newsfeed/e_frontpage.php b/e107_plugins/newsfeed/e_frontpage.php new file mode 100644 index 000000000..bc9de7524 --- /dev/null +++ b/e107_plugins/newsfeed/e_frontpage.php @@ -0,0 +1,17 @@ + $PLUGINS_DIRECTORY.'newsfeed/newsfeed.php', 'title' => NWSF_FP_2); + +if ($sql -> db_Select("newsfeed", "newsfeed_id, newsfeed_name")) { + while ($row = $sql -> db_Fetch()) { + $front_page['newsfeed']['page'][] = array('page' => $PLUGINS_DIRECTORY.'newsfeed/newsfeed.php?show.'.$row['newsfeed_id'], 'title' => $row['newsfeed_name']); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/newsfeed/help.php b/e107_plugins/newsfeed/help.php new file mode 100644 index 000000000..1dca1d9fc --- /dev/null +++ b/e107_plugins/newsfeed/help.php @@ -0,0 +1,24 @@ +tablerender(NFLAN_43, NFLAN_42); +?> \ No newline at end of file diff --git a/e107_plugins/newsfeed/images/newsfeed_16.png b/e107_plugins/newsfeed/images/newsfeed_16.png new file mode 100644 index 000000000..86e0768b5 Binary files /dev/null and b/e107_plugins/newsfeed/images/newsfeed_16.png differ diff --git a/e107_plugins/newsfeed/images/newsfeed_32.png b/e107_plugins/newsfeed/images/newsfeed_32.png new file mode 100644 index 000000000..8b557b0eb Binary files /dev/null and b/e107_plugins/newsfeed/images/newsfeed_32.png differ diff --git a/e107_plugins/newsfeed/languages/English.php b/e107_plugins/newsfeed/languages/English.php new file mode 100644 index 000000000..0e7acc487 --- /dev/null +++ b/e107_plugins/newsfeed/languages/English.php @@ -0,0 +1,91 @@ +» Feed Name: + The identifying name of the feed can be anything you like. +

        + » URL to rss feed: + The address of the rss feed +

        + » Path to image: + If the feed has an image defined in it, enter 'default' to use it. To use your own image, enter the full path to it. Leave blank to use no image at all. +

        + » Description: + Enter a short description of the feed, or 'default' to use the description defined in the feed (if there is one). +

        + » Update interval in seconds: + The amount of seconds that elapse before the feed is updated, for example, 1800: 30 minutes, 3600: an hour. +

        + » Activation: + Where you want the feed results to be displayed, to see menu feeds you will need to activate the newsfeeds menu on the menus page. +

        For a good list of available feeds, see syndic8.com or feedster.com"); +define("NFLAN_43", "Newsfeed help"); +define("NFLAN_44", "click to view"); + +define("NFLAN_45", "Number of items to show in menu"); +define("NFLAN_46", "Number of items to show on main page"); +define("NFLAN_47", "0 or blank to show all"); + +define("NFLAN_48", "Unable to save raw data in database."); +define("NFLAN_49", "Unable to unserialize rss data - uses non-standard syntax"); + +?> diff --git a/e107_plugins/newsfeed/languages/English_frontpage.php b/e107_plugins/newsfeed/languages/English_frontpage.php new file mode 100644 index 000000000..807e9f37d --- /dev/null +++ b/e107_plugins/newsfeed/languages/English_frontpage.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/e107_plugins/newsfeed/newsfeed.php b/e107_plugins/newsfeed/newsfeed.php new file mode 100644 index 000000000..4fc905d66 --- /dev/null +++ b/e107_plugins/newsfeed/newsfeed.php @@ -0,0 +1,168 @@ + db_Select("newsfeed", "*", "(newsfeed_active=2 OR newsfeed_active=3) AND newsfeed_id=$id")) + { + $row = $sql->db_Fetch(); + extract ($row); + list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image); + $numtoshow = $newsfeed_showmain; + $numtoshow = (intval($numtoshow) > 0 ? $numtoshow : 999); + + $rss = unserialize($newsfeed_data); + + if(!is_object($rss)) + { + $text = NFLAN_49; + $ns->tablerender(NFLAN_01, $text); + require_once(FOOTERF); + exit; + } + + $FEEDNAME = "$newsfeed_name"; + $FEEDDESCRIPTION = $newsfeed_description; + if($newsfeed_image == "default") + { + if($file = fopen ($rss -> image['url'], "r")) + { + /* remote image exists - use it! */ + $FEEDIMAGE = "".$rss -> image["; + } + else + { + /* remote image doesn't exist - ghah! */ + $FEEDIMAGE = ""; + } + + + }else if ($newsfeed_image) + { + $FEEDIMAGE = ""; + } + else + { + $FEEDIMAGE = ""; + } + $FEEDLANGUAGE = $rss -> channel['language']; + + if($rss -> channel['lastbuilddate']) + { + $pubbed = $rss -> channel['lastbuilddate']; + } + else if($rss -> channel['dc']['date']) + { + $pubbed = $rss -> channel['dc']['date']; + } + else + { + $pubbed = NFLAN_34; + } + + $FEEDLASTBUILDDATE = NFLAN_33.$pubbed; + $FEEDCOPYRIGHT = $tp -> toHTML($rss -> channel['copyright'], TRUE); + $FEEDDOCS = $rss -> channel['docs']; + $FEEDTITLE = "".$rss -> channel['title'].""; + $FEEDLINK = $rss -> channel['link']; + + $data = ""; + + $i = 0; + while($i < $numtoshow && $rss->items[$i]) + { + $item = $rss->items[$i]; +// foreach ($rss -> items as $item) +// { + + if($NEWSFEED_COLLAPSE) + { + $FEEDITEMLINK = "".$tp -> toHTML($item['title'], TRUE)." +
        + "; + $FEEDITEMTEXT = preg_replace("/[.*]/", "", $tp -> toHTML($item['description'], TRUE))." +

        ".NFLAN_44."

        +
        "; + } + else + { + $FEEDITEMLINK = "".$tp -> toHTML($item['title'], TRUE)."\n"; + $feeditemtext = preg_replace("#\[[a-z0-9=]+\]|\[\/[a-z]+\]|\{[A-Z_]+\}#si", "", $item['description']); + $FEEDITEMTEXT = $tp -> toHTML($feeditemtext, TRUE)."\n"; + } + $FEEDITEMCREATOR = $tp -> toHTML($item['author'], TRUE); + $data .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MAIN); + $i++; + } + $BACKLINK = "".NFLAN_31.""; + $text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MAIN_START) . $data . preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MAIN_END); + $ns->tablerender(NFLAN_01, $text); + require_once(FOOTERF); + exit; + } +} + +/* no action - display feed list ... */ +if ($feeds = $sql -> db_Select("newsfeed", "*", "newsfeed_active=2 OR newsfeed_active=3")) +{ + $data = ""; + while ($row = $sql->db_Fetch()) + { + extract($row); + $FEEDNAME = "$newsfeed_name"; + $FEEDDESCRIPTION = ((!$newsfeed_description || $newsfeed_description == "default") ? " " : $newsfeed_description); + $FEEDIMAGE = $newsfeed_image; + $data .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_LIST); + } +} + +$text = $NEWSFEED_LIST_START . $data . $NEWSFEED_LIST_END; +$ns->tablerender(NFLAN_29, $text); +require_once(FOOTERF); + +?> diff --git a/e107_plugins/newsfeed/newsfeed_functions.php b/e107_plugins/newsfeed/newsfeed_functions.php new file mode 100644 index 000000000..5c847c04e --- /dev/null +++ b/e107_plugins/newsfeed/newsfeed_functions.php @@ -0,0 +1,200 @@ + db_Select("newsfeed", "*", $tp -> toDB($query, true))) + { + $feedArray = $sql -> db_getList(); + foreach($feedArray as $feed) + { + extract ($feed); + if($newsfeed_timestamp + $newsfeed_updateint < time()) + { + if($rawData = $xml -> getRemoteXmlFile($newsfeed_url)) + { + $rss = new MagpieRSS( $rawData ); + $serializedArray = addslashes(serialize($rss)); + + $newsfeed_des = FALSE; + if($newsfeed_description == "default") + { + if($rss -> channel['description']) + { + $newsfeed_des = $tp -> toDB($rss -> channel['description']); + } + else if($rss -> channel['tagline']) + { + $newsfeed_des = $tp -> toDB($rss -> channel['tagline']); + } + } + + if(!$sql->db_Update('newsfeed', "newsfeed_data='{$serializedArray}', newsfeed_timestamp=".time().($newsfeed_des ? ", newsfeed_description='{$newsfeed_des}'": "")." WHERE newsfeed_id=".intval($newsfeed_id))) + { + echo NFLAN_48."

        ".$serializedArray; + } + } + else + { + echo $xml -> error; + } + } + } + } + } +} + +if(!function_exists("newsfeed_info")) +{ + function newsfeed_info($which, $where = 'main') + { + global $tp, $sql; + if($which == 'all') + { + $qry = "newsfeed_active=1 OR newsfeed_active=3"; + } + else + { + $qry = "newsfeed_id = ".intval($which); + } + + $text = ""; + checkUpdate($qry); + + /* get template */ + if (file_exists(THEME."newsfeed_menu_template.php")) + { + include(THEME."newsfeed_menu_template.php"); + } + else + { + include(e_PLUGIN."newsfeed/templates/newsfeed_menu_template.php"); + } + + if ($feeds = $sql -> db_Select("newsfeed", "*", $qry)) + { + while($row = $sql->db_Fetch()) + { + + extract ($row); + list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image); + $numtoshow = ($where == 'main' ? $newsfeed_showmain : $newsfeed_showmenu); + $numtoshow = (intval($numtoshow) > 0 ? $numtoshow : 999); + $rss = unserialize($newsfeed_data); + + $FEEDNAME = "$newsfeed_name"; + $FEEDDESCRIPTION = $newsfeed_description; + if($newsfeed_image == "default") + { + if($file = fopen ($rss -> image['url'], "r")) + { + /* remote image exists - use it! */ + $FEEDIMAGE = "".$rss -> image["; + } + else + { + /* remote image doesn't exist - ghah! */ + $FEEDIMAGE = ""; + } + } + else if ($newsfeed_image) + { + $FEEDIMAGE = ""; + } + else + { + $FEEDIMAGE = ""; + } + $FEEDLANGUAGE = $rss -> channel['language']; + + if($rss -> channel['lastbuilddate']) + { + $pubbed = $rss -> channel['lastbuilddate']; + } + else if($rss -> channel['dc']['date']) + { + $pubbed = $rss -> channel['dc']['date']; + } + else + { + $pubbed = NFLAN_34; + } + + $FEEDLASTBUILDDATE = NFLAN_33.$pubbed; + $FEEDCOPYRIGHT = $tp -> toHTML($rss -> channel['copyright'], TRUE); + $FEEDTITLE = "".$rss -> channel['title'].""; + $FEEDLINK = $rss -> channel['link']; + if($newsfeed_active == 2 or $newsfeed_active == 3) + { + $LINKTOMAIN = "".NFLAN_39.""; + } + else + { + $LINKTOMAIN = ""; + } + + $data = ""; + + $amount = ($items) ? $items : $numtoshow; + + $item_total = array_slice($rss->items, 0, $amount); + + $i = 0; + while($i < $numtoshow && $item_total[$i]) + { + $item = $item_total[$i]; + $FEEDITEMLINK = "".$tp -> toHTML($item['title'], TRUE)."\n"; + $feeditemtext = preg_replace("#\[[a-z0-9=]+\]|\[\/[a-z]+\]|\{[A-Z_]+\}#si", "", $item['description']); + $FEEDITEMTEXT = $tp->text_truncate($feeditemtext, $truncate, $truncate_string); + + $FEEDITEMCREATOR = $tp -> toHTML($item['author'], TRUE); + $data .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MENU); + $i++; + } + + $BACKLINK = "".NFLAN_31.""; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MENU_START) . $data . preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MENU_END); + } + } + + if($which == 'all') + { + $ret['title'] = $NEWSFEED_MENU_CAPTION; + } + else + { + $ret['title'] = $newsfeed_name." ".$NEWSFEED_MAIN_CAPTION; + } + $ret['text'] = $text; + + return $ret; + } +} + + +?> diff --git a/e107_plugins/newsfeed/newsfeed_menu.php b/e107_plugins/newsfeed/newsfeed_menu.php new file mode 100644 index 000000000..3cd5a2079 --- /dev/null +++ b/e107_plugins/newsfeed/newsfeed_menu.php @@ -0,0 +1,27 @@ +tablerender($info['title'], $info['text']); +} +?> \ No newline at end of file diff --git a/e107_plugins/newsfeed/plugin.php b/e107_plugins/newsfeed/plugin.php new file mode 100644 index 000000000..05cc17c8e --- /dev/null +++ b/e107_plugins/newsfeed/plugin.php @@ -0,0 +1,79 @@ + \ No newline at end of file diff --git a/e107_plugins/newsfeed/templates/newsfeed_menu_template.php b/e107_plugins/newsfeed/templates/newsfeed_menu_template.php new file mode 100644 index 000000000..da0427e89 --- /dev/null +++ b/e107_plugins/newsfeed/templates/newsfeed_menu_template.php @@ -0,0 +1,42 @@ + +
        {FEEDIMAGE}
        {FEEDTITLE}
        \n
        + +"; + +$NEWSFEED_MENU = " +\n"; + +$NEWSFEED_MENU_END = "
        »{FEEDITEMLINK}
        {FEEDITEMTEXT}

        + +

        {FEEDLASTBUILDDATE}
        {LINKTOMAIN}
        \n +\n\n"; + + +?> diff --git a/e107_plugins/newsfeed/templates/newsfeed_template.php b/e107_plugins/newsfeed/templates/newsfeed_template.php new file mode 100644 index 000000000..d29859204 --- /dev/null +++ b/e107_plugins/newsfeed/templates/newsfeed_template.php @@ -0,0 +1,64 @@ +\n"; + +$NEWSFEED_LIST = " + +{FEEDNAME} +{FEEDDESCRIPTION} +\n"; + +$NEWSFEED_LIST_END = " +\n"; + +$NEWSFEED_MAIN_START = " + + + + + + + + + + + + + + + +
        {FEEDIMAGE} {FEEDTITLE}
        +
          \n"; + +$NEWSFEED_MAIN = " +
        • {FEEDITEMLINK} {FEEDITEMCREATOR}
          {FEEDITEMTEXT}

        • \n"; + + +$NEWSFEED_MAIN_END = " +
        +
        {FEEDCOPYRIGHT} | {FEEDLASTBUILDDATE}
        {BACKLINK}
        \n"; + + +?> diff --git a/e107_plugins/newsletter/admin_config.php b/e107_plugins/newsletter/admin_config.php new file mode 100644 index 000000000..da28db470 --- /dev/null +++ b/e107_plugins/newsletter/admin_config.php @@ -0,0 +1,518 @@ + showExistingNewsletters(); +} +else +{ + $function = $action."Newsletter"; + $nl -> $function(); +} + +class newsletter +{ + + var $message; + + + function newsletter() + { + global $ns; + + foreach($_POST as $key => $value) + { + if(strstr($key, "nlmailnow")) + { + $this -> releaseIssue($key); + break; + } + } + + if(isset($_POST['delete'])) + { + $this -> deleteNewsletter(); + } + + if(isset($_POST['createNewsletter'])) + { + $this -> createNewsletter(); + } + + if(isset($_POST['createIssue'])) + { + $this -> createIssue(); + } + + if($this -> message) + { + $ns->tablerender("", "
        ".$this -> message."
        "); + } + } + + + function showExistingNewsletters() + { + global $sql, $ns, $tp; + + if(!$sql -> db_Select("newsletter", "*", "newsletter_parent='0' ORDER BY newsletter_id DESC")) + { + $text = NLLAN_05; + } + else + { + $text = "
        + + + + + + + + "; + + $nlArray = $sql -> db_getList(); + foreach($nlArray as $data) + { + $text .= " + + + + + + "; + } + + $text .= "
        ID".NLLAN_06."".NLLAN_07."".NLLAN_08."
        ".$data['newsletter_id']."".$data['newsletter_title']."".substr_count($data['newsletter_subscribers'], chr(1))." + ".ADMIN_EDIT_ICON." + toJS(NLLAN_09." [ID: ".$data['newsletter_id']." ]")."') \"/> + +
        +
        +
        + "; + } + $ns -> tablerender(NLLAN_10, $text); + + + if(!$sql -> db_Select("newsletter", "*", "newsletter_parent!='0' ORDER BY newsletter_id DESC")) + { + $text = NLLAN_11; + } + else + { + + $text = "
        + + + + + + + + + "; + + $nlArray = $sql -> db_getList(); + + foreach($nlArray as $data) + { + + $text .= " + + + + + + + "; + } + + $text .= "
        ID".NLLAN_12."".NLLAN_13."".NLLAN_14."".NLLAN_15."
        ".$data['newsletter_id']."".$data['newsletter_issue']."[ ".$data['newsletter_parent']." ] ".$data['newsletter_title']."".($data['newsletter_flag'] ? NLLAN_16 : "toJS(NLLAN_18)."') \" />")." + ".ADMIN_EDIT_ICON." + toJS(NLLAN_19." [ID: ".$data['newsletter_id']." ]")."') \"/> + +
        +
        +
        + "; + + } + $ns -> tablerender(NLLAN_20, $text); + + } + + + function defineNewsletter($edit=FALSE) + { + + global $ns, $tp; + + if($edit) + { + extract($edit); + $newsletter_title = $tp -> toFORM($newsletter_title); + $newsletter_text = $tp -> toFORM($newsletter_text); + $newsletter_footer = $tp -> toFORM($newsletter_footer); + } + + $text .= "
        +
        + + + + + + + + + + + + + + + + + + + + + +
        ".NLLAN_21."
        ".NLLAN_22."
        ".NLLAN_23."
        ".NLLAN_24."
        + ". + ($edit ? "\n" : "")." +
        +
        +
        + "; + + $caption = ($edit ? NLLAN_25 : NLLAN_26); + + $ns -> tablerender($caption, $text); + + + } + + + function createNewsletter() + { + global $sql, $tp; + + $newsletter_title = $tp -> toDB($_POST['newsletter_title']); + $newsletter_text = $tp -> toDB($_POST['newsletter_text']); + $newsletter_header = $tp -> toDB($_POST['newsletter_header']); + $newsletter_footer = $tp -> toDB($_POST['newsletter_footer']); + + if(isset($_POST['editid'])) + { + $sql -> db_Update("newsletter", "newsletter_title='$newsletter_title', newsletter_text='$newsletter_text', newsletter_header='$newsletter_header', newsletter_footer='$newsletter_footer' WHERE newsletter_id='".$_POST['editid']."' "); + $this -> message = NLLAN_27; + } + else + { + $sql -> db_Insert("newsletter", "0, '".time()."', '$newsletter_title', '$newsletter_text', '$newsletter_header', '$newsletter_footer', '', '0', '0', '0' "); + $this -> message = NLLAN_28; + } + } + + + function makeNewsletter($edit=FALSE) + { + + global $sql, $ns, $tp; + + if($edit) + { + extract($edit); + $newsletter_title = $tp -> toFORM($newsletter_title); + $newsletter_text = $tp -> toFORM($newsletter_text); + } + + if(!$sql -> db_Select("newsletter", "*", "newsletter_parent='0' ")) + { + $this -> message = NLLAN_29; + return; + } + + $nlArray = $sql -> db_getList(); + + $text .= "
        +
        + + + + + + + + + + + + + + + + + + + +
        ".NLLAN_30." + + + +
        ".NLLAN_31."
        ".NLLAN_32."
        ".NLLAN_33."
        + ". + ($edit ? "\n" : "")." +
        +
        +
        + "; + + $caption = ($edit ? NLLAN_36 : NLLAN_37); + + $ns -> tablerender($caption, $text); + } + + + function createIssue() + { + global $sql, $tp; + $newsletter_title = $tp -> toDB($_POST['newsletter_title']); + $newsletter_text = $tp -> toDB($_POST['newsletter_text']); + + if(isset($_POST['editid'])) + { + $sql -> db_Update("newsletter", "newsletter_title='$newsletter_title', newsletter_text='$newsletter_text', newsletter_parent='".$_POST['newsletter_parent']."', newsletter_issue='".$_POST['newsletter_issue']."' WHERE newsletter_id='".$_POST['editid']."' "); + $this -> message = NLLAN_38; + } + else + { + $sql -> db_Insert("newsletter", "0, '".time()."', '$newsletter_title', '$newsletter_text', '', '', '', '".$_POST['newsletter_parent']."', '0', '".$_POST['newsletter_issue']."' "); + $this -> message = NLLAN_39; + } + } + + + function releaseIssue($issue) + { + + global $pref, $sql, $ns, $tp, $THEMES_DIRECTORY; + + $issue = str_replace("nlmailnow_", "", $issue); + + if(!$sql -> db_Select("newsletter", "*", "newsletter_id='$issue' ")) + { + return FALSE; + } + $newsletterInfo = $sql -> db_Fetch(); + + if(!$sql -> db_Select("newsletter", "*", "newsletter_id='".$newsletterInfo['newsletter_parent']."' ")) + { + return FALSE; + } + $newsletterParentInfo = $sql -> db_Fetch(); + $memberArray = explode(chr(1), $newsletterParentInfo['newsletter_subscribers']); + + require(e_HANDLER."phpmailer/class.phpmailer.php"); + + $mail = new PHPMailer(); + + $mail->From = $pref['siteadminemail']; + $mail->FromName = $pref['siteadmin']; + if ($pref['mailer'] == "smtp") + { + $mail->Mailer = "smtp"; + $mail->SMTPKeepAlive = TRUE; + $mail->SMTPAuth = TRUE; + $mail->Username = $pref['smtp_username']; + $mail->Password = $pref['smtp_password']; + $mail->Host = $pref['smtp_server']; + } + else + { + $mail->Mailer = "mail"; + } + + $mail->WordWrap = 50; + $mail->Charset = CHARSET; + $mail->Subject = $newsletterParentInfo['newsletter_title'] . ": ".$newsletterInfo['newsletter_title']; + $mail->IsHTML(true); + + // ============================ Render Results and Mailit ========= + + $message_subject = stripslashes($tp -> toHTML($mail->Subject)); + $message_body = stripslashes($tp -> toHTML($mail->Subject, TRUE)); + $message_body = str_replace(""", '"', $tp -> toHTML($newsletterInfo['newsletter_text'], TRUE)); + $message_body = str_replace('src="', 'src="'.SITEURL, $message_body); + + $newsletter_header = $tp -> toHTML($newsletterParentInfo['newsletter_header'], TRUE); + $newsletter_footer = $tp -> toHTML($newsletterParentInfo['newsletter_footer'], TRUE); + + + $theme = $THEMES_DIRECTORY.$pref['sitetheme']."/"; + $mail_style = ""; + $mail_style .= "
        "; + $mail_style .= "
        "; + $mail_style .= "
        $message_subject
        [ ".NLLAN_12." ".$newsletterInfo['newsletter_issue']." ]


        "; + $mail_style .= "
        "; + $message_body = $mail_style.$newsletter_header."
        ".$message_body."


        ".$newsletter_footer."
        "; + + $message_body = str_replace("\n", "
        ", $message_body); + + $mail->Body = $tp->toHTML($message_body, TRUE); + $mail->AltBody = strip_tags(str_replace("
        ", "\n", $message_body)); + + $sent_counter = 0; + + foreach($memberArray as $memberID) + { + if($memberID) + { + if($sql -> db_Select("user", "user_name, user_email", "user_id='$memberID' ")) + { + $row = $sql -> db_Fetch(); + $mname = $row['user_name']; + $memail = $row['user_email']; + } + + $mail->AddAddress($memail, $mname); + + echo "".NLLAN_54." ".$mname." ( ".$memail." )
        "; + + $mail->Send(); + $sent_counter ++; + + $mail->ClearAddresses(); + if ($pref['mailer'] == "smtp") { + $mail->SmtpClose(); + } + } + } + $sql -> db_Update("newsletter", "newsletter_flag='1' WHERE newsletter_id='$issue' "); + $this -> message = NLLAN_40.$sent_counter.NLLAN_41; + } + + + + function editNewsletter() + { + global $id, $sql; + + if($sql -> db_Select("newsletter", "*", "newsletter_id='$id' ")) + { + $foo = $sql -> db_Fetch(); + if(!$foo['newsletter_parent']) + { + $this -> defineNewsletter($foo); + } + else + { + $this -> makeNewsletter($foo); + } + } + } + + + function deleteNewsletter() + { + global $sql; + $tmp = each($_POST['delete']); + if(strstr($tmp['key'], "newsletter")) + { + $id = str_replace("newsletter_", "", $tmp['key']); + $sql -> db_Delete("newsletter", "newsletter_id='$id' "); + $this -> message = NLLAN_42; + } + else + { + $id = str_replace("issue_", "", $tmp['key']); + $sql -> db_Delete("newsletter", "newsletter_id='$id' "); + $this -> message = NLLAN_43; + } + } + + + + function show_options($action) + { + global $sql; + if ($action == "") + { + $action = "main"; + } + // ##### Display options --------------------------------------------------------------------------------------------------------- + + $var['main']['text'] = NLLAN_44; + $var['main']['link'] = e_SELF; + + $var['define']['text'] = NLLAN_45; + $var['define']['link'] = e_SELF."?define"; + + $var['make']['text'] = NLLAN_46; + $var['make']['link'] = e_SELF."?make"; + + show_admin_menu(NLLAN_47, $action, $var); + } + +} + + + +require_once(e_ADMIN."footer.php"); + + +function admin_config_adminmenu() +{ + global $nl; + global $action; + $nl->show_options($action); +} + + +?> diff --git a/e107_plugins/newsletter/images/nl_16.png b/e107_plugins/newsletter/images/nl_16.png new file mode 100644 index 000000000..932745a6f Binary files /dev/null and b/e107_plugins/newsletter/images/nl_16.png differ diff --git a/e107_plugins/newsletter/images/nl_32.png b/e107_plugins/newsletter/images/nl_32.png new file mode 100644 index 000000000..5104245c8 Binary files /dev/null and b/e107_plugins/newsletter/images/nl_32.png differ diff --git a/e107_plugins/newsletter/languages/English.php b/e107_plugins/newsletter/languages/English.php new file mode 100644 index 000000000..825da5de1 --- /dev/null +++ b/e107_plugins/newsletter/languages/English.php @@ -0,0 +1,86 @@ + diff --git a/e107_plugins/newsletter/newsletter_menu.php b/e107_plugins/newsletter/newsletter_menu.php new file mode 100644 index 000000000..95ccce00b --- /dev/null +++ b/e107_plugins/newsletter/newsletter_menu.php @@ -0,0 +1,91 @@ + db_Select("newsletter", "*", "newsletter_parent='0' ")) +{ + // no newsletters defined yet // + return FALSE; +} + +$newsletterArray = $sql -> db_getList(); +$requery = false; + +foreach($_POST as $key => $value) +{ + if(strstr($key, "nlUnsubscribe_")) + { + $subid = str_replace("nlUnsubscribe_", "", $key); + $newsletterArray[$subid]['newsletter_subscribers'] = str_replace(chr(1).USERID, "", $newsletterArray[$subid]['newsletter_subscribers']); + $sql -> db_Update("newsletter", "newsletter_subscribers='".$newsletterArray[$subid]['newsletter_subscribers']."' WHERE newsletter_id='".intval($subid)."' "); + $requery = true; + } + else if(strstr($key, "nlSubscribe_")) + { + $subid = str_replace("nlSubscribe_", "", $key); + $newsletterArray[$subid]['newsletter_subscribers'] .= chr(1).USERID; + $sql -> db_Update("newsletter", "newsletter_subscribers='".$newsletterArray[$subid]['newsletter_subscribers']."' WHERE newsletter_id='".intval($subid)."' "); + $requery = true; + } +} + +global $tp; + +if($requery) +{ + if($sql -> db_Select("newsletter", "*", "newsletter_parent='0' ")) + { + $newsletterArray = $sql -> db_getList(); + } +} + +$text = ""; +foreach($newsletterArray as $nl) +{ + $text .= "
        +
        + ". + $tp -> toHTML($nl['newsletter_title'], TRUE)."
        + ". + $tp -> toHTML($nl['newsletter_text'], TRUE)."

        + "; + + if(preg_match("#".chr(1).USERID."(".chr(1)."|$)#si", $nl['newsletter_subscribers'])) + { + $text .= NLLAN_48."

        + toJS(NLLAN_49)."') \" /> + "; + } + else + { + $text .= NLLAN_50." ".USEREMAIL." ) ...

        + toJS(NLLAN_53)."') \" /> + "; + } + $text .= "
        +
        +
        + "; +} + +$ns -> tablerender(NLLAN_MENU_CAPTION, $text); + + +?> \ No newline at end of file diff --git a/e107_plugins/newsletter/plugin.php b/e107_plugins/newsletter/plugin.php new file mode 100644 index 000000000..9a7a80f01 --- /dev/null +++ b/e107_plugins/newsletter/plugin.php @@ -0,0 +1,81 @@ + \ No newline at end of file diff --git a/e107_plugins/online_extended_menu/images/user.png b/e107_plugins/online_extended_menu/images/user.png new file mode 100644 index 000000000..03438a6e3 Binary files /dev/null and b/e107_plugins/online_extended_menu/images/user.png differ diff --git a/e107_plugins/online_extended_menu/languages/English.php b/e107_plugins/online_extended_menu/languages/English.php new file mode 100644 index 000000000..37a471dc9 --- /dev/null +++ b/e107_plugins/online_extended_menu/languages/English.php @@ -0,0 +1,33 @@ +here
        "); + +?> \ No newline at end of file diff --git a/e107_plugins/online_extended_menu/online_extended_menu.php b/e107_plugins/online_extended_menu/online_extended_menu.php new file mode 100644 index 000000000..e0dbdce09 --- /dev/null +++ b/e107_plugins/online_extended_menu/online_extended_menu.php @@ -0,0 +1,88 @@ +"; + + if (MEMBERS_ONLINE) { + global $listuserson, $ADMIN_DIRECTORY; + foreach($listuserson as $uinfo => $pinfo) { + + + list($oid, $oname) = explode(".", $uinfo, 2); + $online_location_page = substr(strrchr($pinfo, "/"), 1); + if ($pinfo == "log.php" || $pinfo == "error.php") { + $online_location_page = "news.php"; + $pinfo = "news.php"; + } + if ($online_location_page == "request.php") { + $pinfo = "download.php"; + } + if (strstr($online_location_page, "forum")) { + $pinfo = e_PLUGIN."forum/forum.php"; + $online_location_page = "forum.php"; + } + if (strstr($online_location_page, "content")) { + $pinfo = "content.php"; + $online_location_page = "content.php"; + } + if (strstr($online_location_page, "comment")) { + $pinfo = "comment.php"; + $online_location_page = "comment.php"; + } + $text .= " $oname ".ONLINE_EL7; + (!strstr($pinfo, $ADMIN_DIRECTORY) ? $text .= " $online_location_page
        " : $text .= " $online_location_page
        "); + } + } + + if ((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])) { + $menu_pref['most_members_online'] = MEMBERS_ONLINE; + $menu_pref['most_guests_online'] = GUESTS_ONLINE; + $menu_pref['most_online_datestamp'] = time(); + $tmp = addslashes(serialize($menu_pref)); + $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); + } + global $gen; + if (!is_object($gen)) { + $gen = new convert; + } + + $datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short"); + + $text .= "
        ".ONLINE_EL8." ".($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])."
        (".ONLINE_EL2.$menu_pref['most_members_online'].", ".ONLINE_EL1.$menu_pref['most_guests_online'].") ".ONLINE_EL9." ".$datestamp."
        "; + + $total_members = $sql->db_Count("user","(*)","where user_ban='0'"); // greatly optimizes the query below. + if ($total_members > 1) { + + $newest_member = $sql->db_Select("user", "user_id, user_name", "user_id > ".($total_members-2)." AND user_ban='0' ORDER BY user_join DESC LIMIT 1"); + + $row = $sql->db_Fetch(); + extract($row); + $text .= "
        ".ONLINE_EL5.": ".$total_members."
        ".ONLINE_EL6.": ".$user_name.""; + } +} else { + $text = TRACKING_MESSAGE; +} + + +$ns->tablerender(ONLINE_EL4, $text, 'online_extended'); + +?> diff --git a/e107_plugins/online_menu/languages/English.php b/e107_plugins/online_menu/languages/English.php new file mode 100644 index 000000000..9c920c778 --- /dev/null +++ b/e107_plugins/online_menu/languages/English.php @@ -0,0 +1,27 @@ +here
        "); +?> \ No newline at end of file diff --git a/e107_plugins/online_menu/online_menu.php b/e107_plugins/online_menu/online_menu.php new file mode 100644 index 000000000..9a8424b97 --- /dev/null +++ b/e107_plugins/online_menu/online_menu.php @@ -0,0 +1,53 @@ + ".ONLINE_L4 : ONLINE_L4); + +if(!defined("e_TRACKING_DISABLED") && (isset($pref['track_online']) && $pref['track_online'])) { + $text = ONLINE_L1.GUESTS_ONLINE."
        "; + //if($pref['user_reg'] == 1){ + $text .= ONLINE_L2.MEMBERS_ONLINE.(MEMBERS_ONLINE ? ", ": "").MEMBER_LIST."
        "; + //} + $text .= ONLINE_L3.ON_PAGE; + + global $e107cache; + $members_totals = $e107cache->retrieve("online_menu_totals", 120); + if($members_totals == false) { + $total_members = $sql->db_Count("user"); + $newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); + $row = $sql->db_Fetch(); + extract($row); + $members_totals = "
        ".ONLINE_L5.": ".$total_members.", ".ONLINE_L6.": {$user_name}"; + $e107cache->set("online_menu_totals", $members_totals); + } + $text .= $members_totals; + +} else { + if(ADMIN) { + $text = TRACKING_MESSAGE; + } else { + return; + } +} + +$ns->tablerender($caption, $text, 'online'); + +?> \ No newline at end of file diff --git a/e107_plugins/other_news_menu/languages/English.php b/e107_plugins/other_news_menu/languages/English.php new file mode 100644 index 000000000..1594d2cd8 --- /dev/null +++ b/e107_plugins/other_news_menu/languages/English.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/e107_plugins/other_news_menu/other_news2_menu.php b/e107_plugins/other_news_menu/other_news2_menu.php new file mode 100644 index 000000000..21dd557b1 --- /dev/null +++ b/e107_plugins/other_news_menu/other_news2_menu.php @@ -0,0 +1,137 @@ +retrieve("nq_othernews2")) +{ + echo $cacheData; + return; +} + + +require_once(e_HANDLER."news_class.php"); +unset($text); +global $OTHERNEWS2_STYLE; +$ix = new news; + +if(!$OTHERNEWS2_STYLE) { + $OTHERNEWS2_STYLE = " + + + + + +
        + {NEWSCATICON} + {NEWSCATEGORY} +
        + {NEWSTITLELINK} +
        + {NEWSSUMMARY} +
        + {NEWSTHUMBNAIL} +
        + "; +} + +if(!defined("OTHERNEWS2_LIMIT")){ + define("OTHERNEWS2_LIMIT",5); +} + +if(!defined("OTHERNEWS2_ITEMLINK")){ + define("OTHERNEWS2_ITEMLINK",""); +} +if(!defined("OTHERNEWS2_CATLINK")){ + define("OTHERNEWS2_CATLINK",""); +} +if(!defined("OTHERNEWS2_CATICON")){ + define("OTHERNEWS2_CATICON","border:0px"); +} +if(!defined("OTHERNEWS2_THUMB")){ + define("OTHERNEWS2_THUMB","border:0px"); +} + +if(!defined("OTHERNEWS2_COLS")){ + define("OTHERNEWS2_COLS","1"); +} + +if(!defined("OTHERNEWS2_CELL")){ + define("OTHERNEWS2_CELL","padding:0px;vertical-align:top"); +} + +if(!defined("OTHERNEWS2_SPACING")){ + define("OTHERNEWS2_SPACING","0"); +} + +$param['itemlink'] = OTHERNEWS2_ITEMLINK; +$param['thumbnail'] = OTHERNEWS2_THUMB; +$param['catlink'] = OTHERNEWS2_CATLINK; +$param['caticon'] = OTHERNEWS2_CATICON; + +$style = OTHERNEWS2_CELL; +$nbr_cols = OTHERNEWS2_COLS; + +$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n +LEFT JOIN #user AS u ON n.news_author = u.user_id +LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id +WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type=3 ORDER BY n.news_datestamp DESC LIMIT 0,".OTHERNEWS2_LIMIT; + +if ($sql->db_Select_gen($query)) { + $text = ""; + $t = 0; + $wid = floor(100/$nbr_cols); + while ($row = $sql->db_Fetch()) { + $text .= ($t % $nbr_cols == 0) ? "" : ""; + $text .= "\n\n"; + if (($t+1) % $nbr_cols == 0) { + $text .= ""; + $t++; + } + else { + $t++; + } + } + + while ($t % $nbr_cols != 0){ + $text .= "\n"; + $text .= (($t+1) % nbr_cols == 0) ? "" : ""; + $t++; + + } + $text .= "
        \n"; + + $text .= $ix->render_newsitem($row, 'return', '', $OTHERNEWS2_STYLE, $param); + + $text .= "\n
         
        "; + + + // Save Data + ob_start(); + + $ns->tablerender(TD_MENU_L2, $text, 'other_news2'); + + $cache_data = ob_get_flush(); + $e107cache->set("nq_othernews2", $cache_data); + +} + +?> \ No newline at end of file diff --git a/e107_plugins/other_news_menu/other_news_menu.php b/e107_plugins/other_news_menu/other_news_menu.php new file mode 100644 index 000000000..d4eb66557 --- /dev/null +++ b/e107_plugins/other_news_menu/other_news_menu.php @@ -0,0 +1,133 @@ +retrieve("nq_othernews")) +{ + echo $cacheData; + return; +} + + +require_once(e_HANDLER."news_class.php"); +unset($text); +global $OTHERNEWS_STYLE; +$ix = new news; + +if(!$OTHERNEWS_STYLE) +{ + $OTHERNEWS_STYLE = " +
        + + +
        + {NEWSCATICON} + + {NEWSTITLELINK} +
        +
        \n"; +} + + +if(!defined("OTHERNEWS_LIMIT")){ + define("OTHERNEWS_LIMIT",10); +} + +if(!defined("OTHERNEWS_ITEMLINK")){ + define("OTHERNEWS_ITEMLINK",""); +} + +if(!defined("OTHERNEWS_CATLINK")){ + define("OTHERNEWS_CATLINK",""); +} +if(!defined("OTHERNEWS_THUMB")){ + define("OTHERNEWS_THUMB","border:0px"); +} +if(!defined("OTHERNEWS_CATICON")){ + define("OTHERNEWS_CATICON","border:0px"); +} + +if(!defined("OTHERNEWS_COLS")){ + define("OTHERNEWS_COLS","1"); +} + +if(!defined("OTHERNEWS_CELL")){ + define("OTHERNEWS_CELL","padding:0px;vertical-align:top"); +} + +if(!defined("OTHERNEWS_SPACING")){ + define("OTHERNEWS_SPACING","0"); +} + +$param['itemlink'] = OTHERNEWS_ITEMLINK; +$param['thumbnail'] = OTHERNEWS_THUMB; +$param['catlink'] = OTHERNEWS_CATLINK; +$param['caticon'] = OTHERNEWS_CATICON; + +$style = OTHERNEWS_CELL; +$nbr_cols = OTHERNEWS_COLS; + + +$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n +LEFT JOIN #user AS u ON n.news_author = u.user_id +LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id +WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type=2 ORDER BY n.news_datestamp DESC LIMIT 0,".OTHERNEWS_LIMIT; + +if ($sql->db_Select_gen($query)){ + $text = ""; + $t = 0; + $wid = floor(100/$nbr_cols); + while ($row = $sql->db_Fetch()) { + $text .= ($t % $nbr_cols == 0) ? "" : ""; + $text .= "\n\n"; + if (($t+1) % $nbr_cols == 0) { + $text .= ""; + $t++; + } + else { + $t++; + } + } + + + while ($t % $nbr_cols != 0){ + $text .= "\n"; + $text .= (($t+1) % nbr_cols == 0) ? "" : ""; + $t++; + + } + $text .= "
        \n"; + $text .= $ix->render_newsitem($row, 'return', '', $OTHERNEWS_STYLE, $param); + + $text .= "\n
         
        "; + + + // Save Data + ob_start(); + + $ns->tablerender(TD_MENU_L1, $text, 'other_news'); + + $cache_data = ob_get_flush(); + $e107cache->set("nq_othernews", $cache_data); +} + +?> \ No newline at end of file diff --git a/e107_plugins/pdf/admin_pdf_config.php b/e107_plugins/pdf/admin_pdf_config.php new file mode 100644 index 000000000..91f6a1e9b --- /dev/null +++ b/e107_plugins/pdf/admin_pdf_config.php @@ -0,0 +1,188 @@ + $v){ + if(strpos($k, "pdf_") === 0){ + $pdfpref[$k] = $tp->toDB($v); + } + } + } + $tmp = $eArrayStorage->WriteArray($pdfpref); + $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='pdf' "); + + $message = PDF_LAN_18; + return $message; +} + +function getDefaultPDFPrefs(){ + $pdfpref['pdf_margin_left'] = '25'; + $pdfpref['pdf_margin_right'] = '15'; + $pdfpref['pdf_margin_top'] = '15'; + $pdfpref['pdf_font_family'] = 'arial'; + $pdfpref['pdf_font_size'] = '8'; + $pdfpref['pdf_font_size_sitename'] = '14'; + $pdfpref['pdf_font_size_page_url'] = '8'; + $pdfpref['pdf_font_size_page_number'] = '8'; + $pdfpref['pdf_show_logo'] = true; + $pdfpref['pdf_show_sitename'] = false; + $pdfpref['pdf_show_page_url'] = true; + $pdfpref['pdf_show_page_number'] = true; + $pdfpref['pdf_error_reporting'] = true; + return $pdfpref; +} + +function getPDFPrefs(){ + global $sql, $eArrayStorage; + + if(!is_object($sql)){ $sql = new db; } + $num_rows = $sql -> db_Select("core", "*", "e107_name='pdf' "); + if($num_rows == 0){ + $tmp = getDefaultPDFPrefs(); + $tmp2 = $eArrayStorage->WriteArray($tmp); + $sql -> db_Insert("core", "'pdf', '".$tmp2."' "); + $sql -> db_Select("core", "*", "e107_name='pdf' "); + } + $row = $sql -> db_Fetch(); + $pdfpref = $eArrayStorage->ReadArray($row['e107_value']); + return $pdfpref; +} + +if(isset($message)){ + $caption = PDF_LAN_1; + $ns -> tablerender($caption, $message); +} + +$pdfpref = getPDFPrefs(); + +if(!is_object($sql)){ $sql = new db; } + +$text = " +
        +".$rs -> form_open("post", e_SELF, "pdfform", "", "enctype='multipart/form-data'")." + + + + + + + + + + + + + +"; + +$fontlist=array("arial","times","courier","helvetica","symbol"); +$text .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".PDF_LAN_5."".$rs -> form_text("pdf_margin_left", 74, $pdfpref['pdf_margin_left'], 250)."
        ".PDF_LAN_6."".$rs -> form_text("pdf_margin_right", 74, $pdfpref['pdf_margin_right'], 250)."
        ".PDF_LAN_7."".$rs -> form_text("pdf_margin_top", 74, $pdfpref['pdf_margin_top'], 250)."
        ".PDF_LAN_8." + ".$rs -> form_select_open("pdf_font_family"); + foreach($fontlist as $font){ + $text .= $rs -> form_option($font, ($pdfpref['pdf_font_family'] == $font ? "1" : "0"), $font); + } + $text .= $rs -> form_select_close()." +
        ".PDF_LAN_9."".$rs -> form_text("pdf_font_size", 74, $pdfpref['pdf_font_size'], 250)."
        ".PDF_LAN_10."".$rs -> form_text("pdf_font_size_sitename", 74, $pdfpref['pdf_font_size_sitename'], 250)."
        ".PDF_LAN_11."".$rs -> form_text("pdf_font_size_page_url", 74, $pdfpref['pdf_font_size_page_url'], 250)."
        ".PDF_LAN_12."".$rs -> form_text("pdf_font_size_page_number", 74, $pdfpref['pdf_font_size_page_number'], 250)."
        ".PDF_LAN_13." + ".$rs -> form_radio("pdf_show_logo", "1", ($pdfpref['pdf_show_logo'] ? "1" : "0"), "", "").PDF_LAN_3." + ".$rs -> form_radio("pdf_show_logo", "0", ($pdfpref['pdf_show_logo'] ? "0" : "1"), "", "").PDF_LAN_4." +
        ".PDF_LAN_14." + ".$rs -> form_radio("pdf_show_sitename", "1", ($pdfpref['pdf_show_sitename'] ? "1" : "0"), "", "").PDF_LAN_3." + ".$rs -> form_radio("pdf_show_sitename", "0", ($pdfpref['pdf_show_sitename'] ? "0" : "1"), "", "").PDF_LAN_4." +
        ".PDF_LAN_15." + ".$rs -> form_radio("pdf_show_page_url", "1", ($pdfpref['pdf_show_page_url'] ? "1" : "0"), "", "").PDF_LAN_3." + ".$rs -> form_radio("pdf_show_page_url", "0", ($pdfpref['pdf_show_page_url'] ? "0" : "1"), "", "").PDF_LAN_4." +
        ".PDF_LAN_16." + ".$rs -> form_radio("pdf_show_page_number", "1", ($pdfpref['pdf_show_page_number'] ? "1" : "0"), "", "").PDF_LAN_3." + ".$rs -> form_radio("pdf_show_page_number", "0", ($pdfpref['pdf_show_page_number'] ? "0" : "1"), "", "").PDF_LAN_4." +
        ".PDF_LAN_20." + ".$rs -> form_radio("pdf_error_reporting", "1", ($pdfpref['pdf_error_reporting'] ? "1" : "0"), "", "").PDF_LAN_3." + ".$rs -> form_radio("pdf_error_reporting", "0", ($pdfpref['pdf_error_reporting'] ? "0" : "1"), "", "").PDF_LAN_4." +
        ".$rs -> form_button("submit", "update_pdf", PDF_LAN_17)."
        +".$rs -> form_close()." +
        "; + +$ns -> tablerender(PDF_LAN_2, $text); + +require_once(e_ADMIN."footer.php"); + +?> \ No newline at end of file diff --git a/e107_plugins/pdf/e107pdf.php b/e107_plugins/pdf/e107pdf.php new file mode 100644 index 000000000..732764852 --- /dev/null +++ b/e107_plugins/pdf/e107pdf.php @@ -0,0 +1,631 @@ +UFPDF($orientation,$unit,$format); + //Initialization + $this->B=0; + $this->I=0; + $this->U=0; + $this->BLOCKQUOTE=''; + $this->HREF=''; + $this->CENTER=''; + $this->ALIGN=''; + $this->IMG=''; + $this->SRC=''; + $this->WIDTH=''; + $this->HEIGHT=''; + $this->fontlist=array("arial","times","courier","helvetica","symbol"); + + $this->issetfont=false; + $this->issetcolor=false; + } + + //default preferences if none present + function getDefaultPDFPrefs(){ + $pdfpref['pdf_margin_left'] = '25'; + $pdfpref['pdf_margin_right'] = '15'; + $pdfpref['pdf_margin_top'] = '15'; + $pdfpref['pdf_font_family'] = 'arial'; + $pdfpref['pdf_font_size'] = '8'; + $pdfpref['pdf_font_size_sitename'] = '14'; + $pdfpref['pdf_font_size_page_url'] = '8'; + $pdfpref['pdf_font_size_page_number'] = '8'; + $pdfpref['pdf_show_logo'] = true; + $pdfpref['pdf_show_sitename'] = false; + $pdfpref['pdf_show_page_url'] = true; + $pdfpref['pdf_show_page_number'] = true; + $pdfpref['pdf_error_reporting'] = true; + return $pdfpref; + } + //get preferences from db + function getPDFPrefs(){ + global $sql, $eArrayStorage; + + if(!is_object($eArrayStorage)){ + e107_require_once(e_HANDLER.'arraystorage_class.php'); + $eArrayStorage = new ArrayData(); + } + + if(!is_object($sql)){ $sql = new db; } + $num_rows = $sql -> db_Select("core", "*", "e107_name='pdf' "); + if($num_rows == 0){ + $tmp = $this->getDefaultPDFPrefs(); + $tmp2 = $eArrayStorage->WriteArray($tmp); + $sql -> db_Insert("core", "'pdf', '".$tmp2."' "); + $sql -> db_Select("core", "*", "e107_name='pdf' "); + } + $row = $sql -> db_Fetch(); + $pdfpref = $eArrayStorage->ReadArray($row['e107_value']); + return $pdfpref; + } + + function toPDF($text){ + $search = array(''', ''', '$', '"'); + $replace = array("'", "'", '$', '"'); + $text = str_replace($search, $replace, $text); + return $text; + } + + function toPDFTitle($text){ + $search = array(":", "*", "?", '"', '<', '>', '|'); + $replace = array('-', '-', '-', '-', '-', '-', '-'); + $text = str_replace($search, $replace, $text); + return $text; + } + + /* + The makePDF function does all the real parsing and composing + input argument $text needs to be an array containing the following: + $text = array($text, $creator, $author, $title, $subject, $keywords, $url); + */ + function makePDF($text){ + global $tp, $pdfpref; + + //call get preferences + $pdfpref = $this->getPDFPrefs(); + + //define logo and source pageurl (before the parser!) + if(is_readable(THEME."images/logopdf.png")){ + $logo = THEME."images/logopdf.png"; + }else{ + $logo = e_IMAGE."logo.png"; + } + define('PDFLOGO', $logo); //define logo to add in header + define('PDFPAGEURL', $text[6]); //define page url to add in header + + //parse the data + $text[3] = $this->toPDF($text[3]); //replace some in the title + $text[3] = $this->toPDFTitle($text[3]); //replace some in the title + foreach($text as $k=>$v){ + $text[$k] = $tp->toHTML($v, TRUE); + } + + //set some variables + $this->SetMargins($pdfpref['pdf_margin_left'],$pdfpref['pdf_margin_top'],$pdfpref['pdf_margin_right']); + //$this->SetAutoPageBreak(true,25); + + //start creating the pdf and adding the data + $this->AliasNbPages(); //calculate current page + number of pages + $this->AddPage(); //start page + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); //set font + $this->WriteHTML($text[0], true); //write text + $this->SetCreator($text[1]); //name of creator + $this->SetAuthor($text[2]); //name of author + $this->SetTitle($text[3]); //title + $this->SetSubject($text[4]); //subject + $this->SetKeywords($text[5]); //space/comma separated + $file = $text[3].".pdf"; //name of the file + $this->Output($file, 'D'); //Save PDF to file (D = output to download window) + return; + } + + + //create a header; this will be added on each page + function Header(){ + global $pdfpref; + + $this->SetY(15); + $y0 = $this->GetY(); + if($pdfpref['pdf_show_logo']){ + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + $this->PutImage(PDFLOGO, '1'); + $x1 = $this->GetX(); + $y1 = $this->GetY(); + + $image_wh = getimagesize(PDFLOGO); + $newx = $x1 + ($image_wh[0]/$this->k); + $newy = ($image_wh[1]/$this->k); + + $a=$this->GetStringWidth(SITENAME); + $b=$this->GetStringWidth(PDFPAGEURL); + if($a>$b){$c=$a;}else{$c=$b;} + if($x1+$newx+$c > 210){ + $this->SetX($this->lMargin); + $this->SetY($y1+2); + }else{ + if($pdfpref['pdf_show_sitename']){ + $m = 5; + } + if($pdfpref['pdf_show_page_url']){ + $m += 5; + } + if($pdfpref['pdf_show_page_number']){ + $m += 5; + } + $y = $this->GetY(); + $this->SetY($y-$m); + } + } + $cellwidth = 210-$this->lMargin-$this->rMargin; + $align = "R"; + if($pdfpref['pdf_show_sitename']){ + $this->SetFont($pdfpref['pdf_font_family'],'B',$pdfpref['pdf_font_size_sitename']); + $this->Cell($cellwidth,5,SITENAME,0,1,$align); + } + if($pdfpref['pdf_show_page_url']){ + $this->SetFont($pdfpref['pdf_font_family'],'I',$pdfpref['pdf_font_size_page_url']); + $this->Cell($cellwidth,5,PDFPAGEURL,0,1,$align,'',PDFPAGEURL); + } + if($pdfpref['pdf_show_page_number']){ + $this->SetFont($pdfpref['pdf_font_family'],'I',$pdfpref['pdf_font_size_page_number']); + $this->Cell($cellwidth,5,PDF_LAN_19.' '.$this->PageNo().'/{nb}',0,1,$align); + } + $y = $this->GetY()+2; + $this->Line($this->lMargin, $y, 210-$this->rMargin, $y); + $this->Ln(10); + $this->SetX($this->lMargin); + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + } + + function txtentities($html){ + $html = str_replace("\r\n", "\\n", $html); + $html = str_replace("\r", "", $html); + $trans_tbl = get_html_translation_table (HTML_ENTITIES); + $trans_tbl = array_flip ($trans_tbl); + return strtr ($html, $trans_tbl); + } + + //function hex2dec + //returns an associative array (keys: R,G,B) from + //a hex html code (e.g. #3FE5AA) + function hex2dec($couleur = "#000000"){ + $R = substr($couleur, 1, 2); + $rouge = hexdec($R); + $V = substr($couleur, 3, 2); + $vert = hexdec($V); + $B = substr($couleur, 5, 2); + $bleu = hexdec($B); + $tbl_couleur = array(); + $tbl_couleur['R']=$rouge; + $tbl_couleur['G']=$vert; + $tbl_couleur['B']=$bleu; + return $tbl_couleur; + } + + function WriteHTML($html,$scale){ + + $search = array("\n", "
        ", "
        ", '»', 'º', '·', '™', '©', '€', '[', '&#091;', ' ', '‘', '’', ' />', '(', ')', '{', '}', '[', ']'); + $replace = array(" ", "
        ", "
        ", '»', 'º', '·', '™', '©', '', '[', '[', ' ', "'", "'", '>', '(', ')', '{', '}', '[',']' ); + //replace carriage returns by spaces, and some html variants + $html=str_replace($search, $replace, $html); + $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); //explodes the string + + foreach($a as $i=>$e) + { + if($i%2==0) + { + //Text + if($this->HREF){ + $this->PutLink($this->HREF,$e); + $this->HREF=''; + }elseif($this->IMG){ + //correct url + if(is_readable($this->SRC)){ + $file = $this->SRC; + $pos=strrpos($file,'.'); + $type=substr($file,$pos+1); + $type=strtolower($type); + //for now only jpg, jpeg and png are supported + if($type=='jpg' || $type=='jpeg' || $type=='png'){ + + $url = str_replace("../", "", $this->SRC); + $imgsearch = array(e_IMAGE, e_THEME, e_PLUGIN, e_FILE, e_HANDLER); + //e_BASE and e_ADMIN are not taken into account ! + foreach($imgsearch as $p){ + $p = str_replace("../", "", $p); + $l = strpos($url, $p); + if ($l !== false) { + $url = SITEURL.$url; + } + } + $this->Ln(2); + $this->PutImage($url,$scale); + $this->Ln(2); + $this->SetX($this->lMargin); + } + } + $this->IMG=''; + $this->SRC=''; + $this->WIDTH=''; + $this->HEIGHT=''; + + }elseif($this->CENTER){ + $this->Cell(0,5,$e,0,1,'C'); + }elseif($this->ALIGN == 'center'){ + $this->Cell(0,5,$e,0,1,'C'); + }elseif($this->ALIGN == 'right'){ + $this->Cell(0,5,$e,0,1,'R'); + }elseif($this->ALIGN == 'left'){ + $this->Cell(0,5,$e,0,1,'L'); + }elseif($this->BLOCKQUOTE == 'BLOCKQUOTE'){ + $this->SetFont('Courier','',11); + $this->SetStyle('B',true); + $this->SetStyle('I',true); + $this->Cell(0,5,$e,1,1,'L'); + $this->SetStyle('B',false); + $this->SetStyle('I',false); + if ($this->issetcolor==true) { + $this->SetTextColor(0); + $this->issetcolor=false; + } + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + }else{ + $this->Write(5,stripslashes($this->txtentities($e))); + } + } + else + { + //Tag + if($e{0}=='/'){ + $this->CloseTag(strtoupper(substr($e,1))); + }else{ + //Extract attributes + $a2=explode(' ',$e); + $tag=strtoupper(array_shift($a2)); + $attr=array(); + foreach($a2 as $v){ + if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3)){ + $attr[strtoupper($a3[1])]=$a3[2]; + } + } + $this->OpenTag($tag,$attr,$scale); + } + } + } + } + + function OpenTag($tag,$attr,$scale){ + $tag = strtoupper($tag); + //Opening tag + + switch($tag){ + case 'STRONG': + $this->SetStyle('B',true); + break; + case 'EM': + $this->SetStyle('I',true); + break; + case 'B': + case 'I': + case 'U': + $this->SetStyle($tag,true); + break; + case 'A': + $this->HREF=$attr['HREF']; + break; + case 'P': + $this->ALIGN=$attr['ALIGN']; + break; + case 'SPAN': + if(isset($attr['STYLE'])){ + if($attr['STYLE'] == 'text-decoration:underline'){ + $this->SetStyle('U',true); + } + if(strstr($attr['STYLE'], 'color:')){ + $attr['COLOR'] = substr($attr['STYLE'],6); + $coul=$this->hex2dec($attr['COLOR']); + $this->SetTextColor($coul['R'],$coul['G'],$coul['B']); + $this->issetcolor=true; + } + if(strstr($attr['STYLE'], 'font-size:')){ + $attr['FONTSIZE'] = intval(substr($attr['STYLE'],10)); + $this->SetFont('','',$attr['FONTSIZE']); + $this->issetfont=true; + } + break; + } + case 'DIV': + if($attr['STYLE'] == 'text-align:center'){ + $this->ALIGN='center'; + } + if($attr['STYLE'] == 'text-align:left'){ + $this->ALIGN='left'; + } + if($attr['STYLE'] == 'text-align:right'){ + $this->ALIGN='right'; + } + if($attr['CLASS'] == 'indent'){ + // $this->BLOCKQUOTE='BLOCKQUOTE'; + } + break; + case 'IMG': + $this->IMG=true; + $this->SRC=$attr['SRC']; + $this->WIDTH=$attr['WIDTH']; + $this->HEIGHT=$attr['HEIGHT']; + break; + case 'TR': + break; + case 'TD': + break; + case 'CODE': + case 'BLOCKQUOTE': + case 'PRE': + $this->Ln(5); + $this->SetFont('Courier','',11); + $this->issetcolor=true; + $this->issetfont=true; + $this->SetStyle('B',true); + $this->SetStyle('I',true); + break; + case 'LI': + $this->Write(5,' » '); + break; + case 'BR': + $this->Ln(5); + break; + case 'HR': + if( $attr['WIDTH'] != '' ) $Width = $attr['WIDTH']; + else $Width = $this->w - $this->lMargin-$this->rMargin; + $this->Ln(2); + $x = $this->GetX(); + $y = $this->GetY(); + $this->SetLineWidth(0.4); + $this->Line($x,$y,$x+$Width,$y); + $this->SetLineWidth(0.2); + $this->Ln(2); + break; + case 'FONT': + if (isset($attr['COLOR']) && $attr['COLOR']!='') { + $coul=$this->hex2dec($attr['COLOR']); + $this->SetTextColor($coul['R'],$coul['G'],$coul['B']); + $this->issetcolor=true; + } + if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { + $this->SetFont(strtolower($attr['FACE'])); + $this->issetfont=true; + } + break; + case 'H1': + $this->Ln(5); + $this->SetFontSize(22); + $this->issetfont=true; + break; + case 'H2': + $this->Ln(5); + $this->SetFontSize(18); + $this->issetfont=true; + $this->SetStyle('U',true); + break; + case 'H3': + $this->Ln(5); + $this->SetFontSize(16); + $this->issetfont=true; + $this->SetStyle('U',true); + break; + case 'H4': + $this->Ln(5); + $this->SetFontSize(14); + $this->issetfont=true; + $this->SetStyle('B',true); + break; + + } + } + + function CloseTag($tag){ + global $pdfpref; + + if ($this->issetcolor==true) { + $this->SetTextColor(0); + } + if ($this->issetfont==true) { + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + $this->issetfont=false; + } + + $tag = strtoupper($tag); + //Closing tag + if($tag=='SPAN'){ + $tag='U'; + if ($this->issetcolor==true) { + $this->SetTextColor(0); + } + if ($this->issetfont==true) { + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + $this->issetfont=false; + } + } + if($tag=='DIV'){ + $tag='DIV'; + $this->ALIGN=''; + $this->BLOCKQUOTE=''; + } + if($tag=='STRONG'){ + $tag='B'; + } + if($tag=='EM'){ + $tag='I'; + } + if($tag=='B' or $tag=='I' or $tag=='U'){ + $this->SetStyle($tag,false); + } + if($tag=='A'){ + $this->HREF=''; + } + if($tag=='P'){ + $this->ALIGN=''; + } + if($tag=='IMG'){ + $this->IMG=''; + $this->SRC=''; + $this->WIDTH=''; + $this->HEIGHT=''; + } + if($tag=='LI'){ + $this->Ln(5); + } + if($tag=='TD'){ + $this->Write(5,' '); + } + if($tag=='TR' || $tag=='BLOCKQUOTE' || $tag=='CODE' || $tag=='PRE'){ + $this->SetStyle('B',false); + $this->SetStyle('I',false); + $this->Ln(5); + if ($this->issetcolor==true) { + $this->SetTextColor(0); + $this->issetcolor=false; + } + if ($this->issetfont==true) { + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + $this->issetfont=false; + } + } + if($tag=='FONT'){ + if ($this->issetcolor==true) { + $this->SetTextColor(0); + $this->issetcolor=false; + } + if ($this->issetfont==true) { + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + $this->issetfont=false; + } + } + if ($tag=='H1' || $tag=='H2' || $tag=='H3' || $tag=='H4'){ + $this->H1=''; + $this->H2=''; + $this->H3=''; + $this->H4=''; + $this->SetStyle('B',false); + $this->SetStyle('U',false); + $this->Ln(5); + if($this->issetfont==true){ + $this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']); + $this->issetfont=false; + } + } + } + + function SetStyle($tag,$enable){ + //Modify style and select corresponding font + $this->$tag+=($enable ? 1 : -1); + $style=''; + foreach(array('B','I','U') as $s) + if($this->$s>0) + $style.=$s; + $this->SetFont('',$style); + } + + function PutLink($URL,$txt){ + //remove leading 'http://' + if(strpos($URL, "http://")!==false){ + $URL = substr($URL, strpos($URL, "http://")+strlen('http://') ); + } + //Put a hyperlink + $this->SetTextColor(0,0,255); + $this->SetStyle('U',true); + $this->Write(5,$txt,$URL); + $this->SetStyle('U',false); + $this->SetTextColor(0); + } + + function px2mm($px){ + return $px*25.4/72; + } + + //put the image in pdf with scaling... + //width and height-options inside the IMG-Tag are ignored, + //we get the image info directly from PHP... + //$scale is the global scaling factor, passing through from WriteHTML() + //(c)2004/03/12 by St@neCold + function PutImage($url,$scale) + { + if($scale<0) $scale=0; + //$scale<=0: put NO image inside the pdf! + if($scale>0){ + $xsflag=0; + $ysflag=0; + $yhflag=0; + $xscale=1; + $yscale=1; + //get image info + $oposy=$this->GetY(); + $iminfo=@getimagesize($url); + if($iminfo){ + $iw=$scale * $this->px2mm($iminfo[0]); + $ih=$scale * $this->px2mm($iminfo[1]); + $iw = ($iw)?$iw:1; + $ih = ($ih)?$ih:1; + $nw=$iw; + $nh=$ih; + //resizing in x-direction + $xsflag=0; + if($iw>150) { + $xscale=150 / $iw; + $yscale=$xscale; + $nw=$xscale * $iw; + $nh=$xscale * $ih; + $xsflag=1; + } + //now eventually resizing in y-direction + $ysflag=0; + if(($oposy+$nh)>250){ + $yscale=(250-$oposy)/$ih; + $nw=$yscale * $iw; + $nh=$yscale * $ih; + $ysflag=1; + } + //uups, if the scaling factor of resized image is < 0.33 + //remark: without(!) the global factor $scale! + //that's hard -> on the next page please... + $yhflag=0; + if($yscale<0.33 and ($xsflag==1 or $ysflag==1)) { + $nw=$xscale * $iw; + $nh=$xscale * $ih; + $ysflag==0; + $xsflag==1; + $yhflag=1; + } + if($yhflag==1) $this->AddPage(); + $oposy=$this->GetY(); + $this->Image($url, $this->GetX(), $this->GetY(), $nw, $nh); + $this->SetY($oposy+$nh); + //if($yhflag==0 and $ysflag==1) $this->AddPage(); + } + } + } + +} + +?> diff --git a/e107_plugins/pdf/font/courier.php b/e107_plugins/pdf/font/courier.php new file mode 100644 index 000000000..4c009f39b --- /dev/null +++ b/e107_plugins/pdf/font/courier.php @@ -0,0 +1,7 @@ + diff --git a/e107_plugins/pdf/font/helvetica.php b/e107_plugins/pdf/font/helvetica.php new file mode 100644 index 000000000..8fa7683e7 --- /dev/null +++ b/e107_plugins/pdf/font/helvetica.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/e107_plugins/pdf/font/helveticab.php b/e107_plugins/pdf/font/helveticab.php new file mode 100644 index 000000000..a8473c94d --- /dev/null +++ b/e107_plugins/pdf/font/helveticab.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/e107_plugins/pdf/font/helveticabi.php b/e107_plugins/pdf/font/helveticabi.php new file mode 100644 index 000000000..41379537d --- /dev/null +++ b/e107_plugins/pdf/font/helveticabi.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/e107_plugins/pdf/font/helveticai.php b/e107_plugins/pdf/font/helveticai.php new file mode 100644 index 000000000..d5bb6e094 --- /dev/null +++ b/e107_plugins/pdf/font/helveticai.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/e107_plugins/pdf/font/makefont/cp1250.map b/e107_plugins/pdf/font/makefont/cp1250.map new file mode 100644 index 000000000..ec110af06 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1250.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/e107_plugins/pdf/font/makefont/cp1251.map b/e107_plugins/pdf/font/makefont/cp1251.map new file mode 100644 index 000000000..de6a198d9 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1251.map @@ -0,0 +1,255 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0402 afii10051 +!81 U+0403 afii10052 +!82 U+201A quotesinglbase +!83 U+0453 afii10100 +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+20AC Euro +!89 U+2030 perthousand +!8A U+0409 afii10058 +!8B U+2039 guilsinglleft +!8C U+040A afii10059 +!8D U+040C afii10061 +!8E U+040B afii10060 +!8F U+040F afii10145 +!90 U+0452 afii10099 +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0459 afii10106 +!9B U+203A guilsinglright +!9C U+045A afii10107 +!9D U+045C afii10109 +!9E U+045B afii10108 +!9F U+045F afii10193 +!A0 U+00A0 space +!A1 U+040E afii10062 +!A2 U+045E afii10110 +!A3 U+0408 afii10057 +!A4 U+00A4 currency +!A5 U+0490 afii10050 +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+0401 afii10023 +!A9 U+00A9 copyright +!AA U+0404 afii10053 +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+0407 afii10056 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+0406 afii10055 +!B3 U+0456 afii10103 +!B4 U+0491 afii10098 +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0451 afii10071 +!B9 U+2116 afii61352 +!BA U+0454 afii10101 +!BB U+00BB guillemotright +!BC U+0458 afii10105 +!BD U+0405 afii10054 +!BE U+0455 afii10102 +!BF U+0457 afii10104 +!C0 U+0410 afii10017 +!C1 U+0411 afii10018 +!C2 U+0412 afii10019 +!C3 U+0413 afii10020 +!C4 U+0414 afii10021 +!C5 U+0415 afii10022 +!C6 U+0416 afii10024 +!C7 U+0417 afii10025 +!C8 U+0418 afii10026 +!C9 U+0419 afii10027 +!CA U+041A afii10028 +!CB U+041B afii10029 +!CC U+041C afii10030 +!CD U+041D afii10031 +!CE U+041E afii10032 +!CF U+041F afii10033 +!D0 U+0420 afii10034 +!D1 U+0421 afii10035 +!D2 U+0422 afii10036 +!D3 U+0423 afii10037 +!D4 U+0424 afii10038 +!D5 U+0425 afii10039 +!D6 U+0426 afii10040 +!D7 U+0427 afii10041 +!D8 U+0428 afii10042 +!D9 U+0429 afii10043 +!DA U+042A afii10044 +!DB U+042B afii10045 +!DC U+042C afii10046 +!DD U+042D afii10047 +!DE U+042E afii10048 +!DF U+042F afii10049 +!E0 U+0430 afii10065 +!E1 U+0431 afii10066 +!E2 U+0432 afii10067 +!E3 U+0433 afii10068 +!E4 U+0434 afii10069 +!E5 U+0435 afii10070 +!E6 U+0436 afii10072 +!E7 U+0437 afii10073 +!E8 U+0438 afii10074 +!E9 U+0439 afii10075 +!EA U+043A afii10076 +!EB U+043B afii10077 +!EC U+043C afii10078 +!ED U+043D afii10079 +!EE U+043E afii10080 +!EF U+043F afii10081 +!F0 U+0440 afii10082 +!F1 U+0441 afii10083 +!F2 U+0442 afii10084 +!F3 U+0443 afii10085 +!F4 U+0444 afii10086 +!F5 U+0445 afii10087 +!F6 U+0446 afii10088 +!F7 U+0447 afii10089 +!F8 U+0448 afii10090 +!F9 U+0449 afii10091 +!FA U+044A afii10092 +!FB U+044B afii10093 +!FC U+044C afii10094 +!FD U+044D afii10095 +!FE U+044E afii10096 +!FF U+044F afii10097 diff --git a/e107_plugins/pdf/font/makefont/cp1252.map b/e107_plugins/pdf/font/makefont/cp1252.map new file mode 100644 index 000000000..dd490e596 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1252.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/cp1253.map b/e107_plugins/pdf/font/makefont/cp1253.map new file mode 100644 index 000000000..4bd826fb2 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1253.map @@ -0,0 +1,239 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+0385 dieresistonos +!A2 U+0386 Alphatonos +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/e107_plugins/pdf/font/makefont/cp1254.map b/e107_plugins/pdf/font/makefont/cp1254.map new file mode 100644 index 000000000..829473b28 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1254.map @@ -0,0 +1,249 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/cp1255.map b/e107_plugins/pdf/font/makefont/cp1255.map new file mode 100644 index 000000000..079e10c61 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1255.map @@ -0,0 +1,233 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AA afii57636 +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00D7 multiply +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD sfthyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 middot +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00F7 divide +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+05B0 afii57799 +!C1 U+05B1 afii57801 +!C2 U+05B2 afii57800 +!C3 U+05B3 afii57802 +!C4 U+05B4 afii57793 +!C5 U+05B5 afii57794 +!C6 U+05B6 afii57795 +!C7 U+05B7 afii57798 +!C8 U+05B8 afii57797 +!C9 U+05B9 afii57806 +!CB U+05BB afii57796 +!CC U+05BC afii57807 +!CD U+05BD afii57839 +!CE U+05BE afii57645 +!CF U+05BF afii57841 +!D0 U+05C0 afii57842 +!D1 U+05C1 afii57804 +!D2 U+05C2 afii57803 +!D3 U+05C3 afii57658 +!D4 U+05F0 afii57716 +!D5 U+05F1 afii57717 +!D6 U+05F2 afii57718 +!D7 U+05F3 gereshhebrew +!D8 U+05F4 gershayimhebrew +!E0 U+05D0 afii57664 +!E1 U+05D1 afii57665 +!E2 U+05D2 afii57666 +!E3 U+05D3 afii57667 +!E4 U+05D4 afii57668 +!E5 U+05D5 afii57669 +!E6 U+05D6 afii57670 +!E7 U+05D7 afii57671 +!E8 U+05D8 afii57672 +!E9 U+05D9 afii57673 +!EA U+05DA afii57674 +!EB U+05DB afii57675 +!EC U+05DC afii57676 +!ED U+05DD afii57677 +!EE U+05DE afii57678 +!EF U+05DF afii57679 +!F0 U+05E0 afii57680 +!F1 U+05E1 afii57681 +!F2 U+05E2 afii57682 +!F3 U+05E3 afii57683 +!F4 U+05E4 afii57684 +!F5 U+05E5 afii57685 +!F6 U+05E6 afii57686 +!F7 U+05E7 afii57687 +!F8 U+05E8 afii57688 +!F9 U+05E9 afii57689 +!FA U+05EA afii57690 +!FD U+200E afii299 +!FE U+200F afii300 diff --git a/e107_plugins/pdf/font/makefont/cp1257.map b/e107_plugins/pdf/font/makefont/cp1257.map new file mode 100644 index 000000000..2f2ecfa21 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1257.map @@ -0,0 +1,244 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8D U+00A8 dieresis +!8E U+02C7 caron +!8F U+00B8 cedilla +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!9D U+00AF macron +!9E U+02DB ogonek +!A0 U+00A0 space +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00D8 Oslash +!A9 U+00A9 copyright +!AA U+0156 Rcommaaccent +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00C6 AE +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00F8 oslash +!B9 U+00B9 onesuperior +!BA U+0157 rcommaaccent +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00E6 ae +!C0 U+0104 Aogonek +!C1 U+012E Iogonek +!C2 U+0100 Amacron +!C3 U+0106 Cacute +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+0118 Eogonek +!C7 U+0112 Emacron +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0179 Zacute +!CB U+0116 Edotaccent +!CC U+0122 Gcommaaccent +!CD U+0136 Kcommaaccent +!CE U+012A Imacron +!CF U+013B Lcommaaccent +!D0 U+0160 Scaron +!D1 U+0143 Nacute +!D2 U+0145 Ncommaaccent +!D3 U+00D3 Oacute +!D4 U+014C Omacron +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0172 Uogonek +!D9 U+0141 Lslash +!DA U+015A Sacute +!DB U+016A Umacron +!DC U+00DC Udieresis +!DD U+017B Zdotaccent +!DE U+017D Zcaron +!DF U+00DF germandbls +!E0 U+0105 aogonek +!E1 U+012F iogonek +!E2 U+0101 amacron +!E3 U+0107 cacute +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+0119 eogonek +!E7 U+0113 emacron +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+017A zacute +!EB U+0117 edotaccent +!EC U+0123 gcommaaccent +!ED U+0137 kcommaaccent +!EE U+012B imacron +!EF U+013C lcommaaccent +!F0 U+0161 scaron +!F1 U+0144 nacute +!F2 U+0146 ncommaaccent +!F3 U+00F3 oacute +!F4 U+014D omacron +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0173 uogonek +!F9 U+0142 lslash +!FA U+015B sacute +!FB U+016B umacron +!FC U+00FC udieresis +!FD U+017C zdotaccent +!FE U+017E zcaron +!FF U+02D9 dotaccent diff --git a/e107_plugins/pdf/font/makefont/cp1258.map b/e107_plugins/pdf/font/makefont/cp1258.map new file mode 100644 index 000000000..fed915f71 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp1258.map @@ -0,0 +1,247 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+0300 gravecomb +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+00D1 Ntilde +!D2 U+0309 hookabovecomb +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+01A0 Ohorn +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+01AF Uhorn +!DE U+0303 tildecomb +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+0301 acutecomb +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+00F1 ntilde +!F2 U+0323 dotbelowcomb +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+01A1 ohorn +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+01B0 uhorn +!FE U+20AB dong +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/cp874.map b/e107_plugins/pdf/font/makefont/cp874.map new file mode 100644 index 000000000..1006e6b17 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/cp874.map @@ -0,0 +1,225 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!85 U+2026 ellipsis +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/e107_plugins/pdf/font/makefont/iso-8859-1.map b/e107_plugins/pdf/font/makefont/iso-8859-1.map new file mode 100644 index 000000000..61740a38f --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-1.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/iso-8859-11.map b/e107_plugins/pdf/font/makefont/iso-8859-11.map new file mode 100644 index 000000000..916881206 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-11.map @@ -0,0 +1,248 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/e107_plugins/pdf/font/makefont/iso-8859-15.map b/e107_plugins/pdf/font/makefont/iso-8859-15.map new file mode 100644 index 000000000..6c2b57127 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-15.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AC Euro +!A5 U+00A5 yen +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+017D Zcaron +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/iso-8859-16.map b/e107_plugins/pdf/font/makefont/iso-8859-16.map new file mode 100644 index 000000000..202c8fe59 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-16.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0105 aogonek +!A3 U+0141 Lslash +!A4 U+20AC Euro +!A5 U+201E quotedblbase +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+0218 Scommaaccent +!AB U+00AB guillemotleft +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017A zacute +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+010C Ccaron +!B3 U+0142 lslash +!B4 U+017D Zcaron +!B5 U+201D quotedblright +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+010D ccaron +!BA U+0219 scommaaccent +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+017C zdotaccent +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0106 Cacute +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+015A Sacute +!D8 U+0170 Uhungarumlaut +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0118 Eogonek +!DE U+021A Tcommaaccent +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+0107 cacute +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+015B sacute +!F8 U+0171 uhungarumlaut +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0119 eogonek +!FE U+021B tcommaaccent +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/iso-8859-2.map b/e107_plugins/pdf/font/makefont/iso-8859-2.map new file mode 100644 index 000000000..65ae09f95 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-2.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+013D Lcaron +!A6 U+015A Sacute +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+015E Scedilla +!AB U+0164 Tcaron +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+013E lcaron +!B6 U+015B sacute +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+015F scedilla +!BB U+0165 tcaron +!BC U+017A zacute +!BD U+02DD hungarumlaut +!BE U+017E zcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/e107_plugins/pdf/font/makefont/iso-8859-4.map b/e107_plugins/pdf/font/makefont/iso-8859-4.map new file mode 100644 index 000000000..a7d87bf3e --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-4.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0138 kgreenlandic +!A3 U+0156 Rcommaaccent +!A4 U+00A4 currency +!A5 U+0128 Itilde +!A6 U+013B Lcommaaccent +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+0112 Emacron +!AB U+0122 Gcommaaccent +!AC U+0166 Tbar +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0157 rcommaaccent +!B4 U+00B4 acute +!B5 U+0129 itilde +!B6 U+013C lcommaaccent +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+0113 emacron +!BB U+0123 gcommaaccent +!BC U+0167 tbar +!BD U+014A Eng +!BE U+017E zcaron +!BF U+014B eng +!C0 U+0100 Amacron +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+012E Iogonek +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+0116 Edotaccent +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+012A Imacron +!D0 U+0110 Dcroat +!D1 U+0145 Ncommaaccent +!D2 U+014C Omacron +!D3 U+0136 Kcommaaccent +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+0172 Uogonek +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0168 Utilde +!DE U+016A Umacron +!DF U+00DF germandbls +!E0 U+0101 amacron +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+012F iogonek +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+0117 edotaccent +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+012B imacron +!F0 U+0111 dcroat +!F1 U+0146 ncommaaccent +!F2 U+014D omacron +!F3 U+0137 kcommaaccent +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+0173 uogonek +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0169 utilde +!FE U+016B umacron +!FF U+02D9 dotaccent diff --git a/e107_plugins/pdf/font/makefont/iso-8859-5.map b/e107_plugins/pdf/font/makefont/iso-8859-5.map new file mode 100644 index 000000000..f9cd4edcf --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-5.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0401 afii10023 +!A2 U+0402 afii10051 +!A3 U+0403 afii10052 +!A4 U+0404 afii10053 +!A5 U+0405 afii10054 +!A6 U+0406 afii10055 +!A7 U+0407 afii10056 +!A8 U+0408 afii10057 +!A9 U+0409 afii10058 +!AA U+040A afii10059 +!AB U+040B afii10060 +!AC U+040C afii10061 +!AD U+00AD hyphen +!AE U+040E afii10062 +!AF U+040F afii10145 +!B0 U+0410 afii10017 +!B1 U+0411 afii10018 +!B2 U+0412 afii10019 +!B3 U+0413 afii10020 +!B4 U+0414 afii10021 +!B5 U+0415 afii10022 +!B6 U+0416 afii10024 +!B7 U+0417 afii10025 +!B8 U+0418 afii10026 +!B9 U+0419 afii10027 +!BA U+041A afii10028 +!BB U+041B afii10029 +!BC U+041C afii10030 +!BD U+041D afii10031 +!BE U+041E afii10032 +!BF U+041F afii10033 +!C0 U+0420 afii10034 +!C1 U+0421 afii10035 +!C2 U+0422 afii10036 +!C3 U+0423 afii10037 +!C4 U+0424 afii10038 +!C5 U+0425 afii10039 +!C6 U+0426 afii10040 +!C7 U+0427 afii10041 +!C8 U+0428 afii10042 +!C9 U+0429 afii10043 +!CA U+042A afii10044 +!CB U+042B afii10045 +!CC U+042C afii10046 +!CD U+042D afii10047 +!CE U+042E afii10048 +!CF U+042F afii10049 +!D0 U+0430 afii10065 +!D1 U+0431 afii10066 +!D2 U+0432 afii10067 +!D3 U+0433 afii10068 +!D4 U+0434 afii10069 +!D5 U+0435 afii10070 +!D6 U+0436 afii10072 +!D7 U+0437 afii10073 +!D8 U+0438 afii10074 +!D9 U+0439 afii10075 +!DA U+043A afii10076 +!DB U+043B afii10077 +!DC U+043C afii10078 +!DD U+043D afii10079 +!DE U+043E afii10080 +!DF U+043F afii10081 +!E0 U+0440 afii10082 +!E1 U+0441 afii10083 +!E2 U+0442 afii10084 +!E3 U+0443 afii10085 +!E4 U+0444 afii10086 +!E5 U+0445 afii10087 +!E6 U+0446 afii10088 +!E7 U+0447 afii10089 +!E8 U+0448 afii10090 +!E9 U+0449 afii10091 +!EA U+044A afii10092 +!EB U+044B afii10093 +!EC U+044C afii10094 +!ED U+044D afii10095 +!EE U+044E afii10096 +!EF U+044F afii10097 +!F0 U+2116 afii61352 +!F1 U+0451 afii10071 +!F2 U+0452 afii10099 +!F3 U+0453 afii10100 +!F4 U+0454 afii10101 +!F5 U+0455 afii10102 +!F6 U+0456 afii10103 +!F7 U+0457 afii10104 +!F8 U+0458 afii10105 +!F9 U+0459 afii10106 +!FA U+045A afii10107 +!FB U+045B afii10108 +!FC U+045C afii10109 +!FD U+00A7 section +!FE U+045E afii10110 +!FF U+045F afii10193 diff --git a/e107_plugins/pdf/font/makefont/iso-8859-7.map b/e107_plugins/pdf/font/makefont/iso-8859-7.map new file mode 100644 index 000000000..e163796b1 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-7.map @@ -0,0 +1,250 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+2018 quoteleft +!A2 U+2019 quoteright +!A3 U+00A3 sterling +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+0385 dieresistonos +!B6 U+0386 Alphatonos +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/e107_plugins/pdf/font/makefont/iso-8859-9.map b/e107_plugins/pdf/font/makefont/iso-8859-9.map new file mode 100644 index 000000000..48c123ae6 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/iso-8859-9.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/e107_plugins/pdf/font/makefont/koi8-r.map b/e107_plugins/pdf/font/makefont/koi8-r.map new file mode 100644 index 000000000..6ad5d05d0 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/koi8-r.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2219 periodcentered +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+2553 SF520000 +!A5 U+2554 SF390000 +!A6 U+2555 SF220000 +!A7 U+2556 SF210000 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+255C SF270000 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+2562 SF200000 +!B5 U+2563 SF230000 +!B6 U+2564 SF470000 +!B7 U+2565 SF480000 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+256B SF530000 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/e107_plugins/pdf/font/makefont/koi8-u.map b/e107_plugins/pdf/font/makefont/koi8-u.map new file mode 100644 index 000000000..40a7e4fd7 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/koi8-u.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2022 bullet +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+0454 afii10101 +!A5 U+2554 SF390000 +!A6 U+0456 afii10103 +!A7 U+0457 afii10104 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+0491 afii10098 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+0404 afii10053 +!B5 U+2563 SF230000 +!B6 U+0406 afii10055 +!B7 U+0407 afii10056 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+0490 afii10050 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/e107_plugins/pdf/font/makefont/makefont.php b/e107_plugins/pdf/font/makefont/makefont.php new file mode 100644 index 000000000..6bca6e5a3 --- /dev/null +++ b/e107_plugins/pdf/font/makefont/makefont.php @@ -0,0 +1,416 @@ +Error: encoding not found: '.$enc); + $cc2gn=array(); + foreach($a as $l) + { + if($l{0}=='!') + { + $e=preg_split('/[ \\t]+/',rtrim($l)); + $cc=hexdec(substr($e[0],1)); + $gn=$e[2]; + $cc2gn[$cc]=$gn; + } + } + for($i=0;$i<=255;$i++) + { + if(!isset($cc2gn[$i])) + $cc2gn[$i]='.notdef'; + } + return $cc2gn; +} + +function ReadAFM($file,&$map) +{ + //Read a font metric file + $a=file($file); + if(empty($a)) + die('File not found'); + $widths=array(); + $fm=array(); + $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent', + 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut', + 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent', + 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent', + 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent', + 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat', + 'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb', + 'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong'); + foreach($a as $l) + { + $e=explode(' ',rtrim($l)); + if(count($e)<2) + continue; + $code=$e[0]; + $param=$e[1]; + if($code=='C') + { + //Character metrics + $cc=(int)$e[1]; + $w=$e[4]; + $gn=$e[7]; + if(substr($gn,-4)=='20AC') + $gn='Euro'; + if(isset($fix[$gn])) + { + //Fix incorrect glyph name + foreach($map as $c=>$n) + { + if($n==$fix[$gn]) + $map[$c]=$gn; + } + } + if(empty($map)) + { + //Symbolic font: use built-in encoding + $widths[$cc]=$w; + } + else + { + $widths[$gn]=$w; + if($gn=='X') + $fm['CapXHeight']=$e[13]; + } + if($gn=='.notdef') + $fm['MissingWidth']=$w; + } + elseif($code=='FontName') + $fm['FontName']=$param; + elseif($code=='Weight') + $fm['Weight']=$param; + elseif($code=='ItalicAngle') + $fm['ItalicAngle']=(double)$param; + elseif($code=='Ascender') + $fm['Ascender']=(int)$param; + elseif($code=='Descender') + $fm['Descender']=(int)$param; + elseif($code=='UnderlineThickness') + $fm['UnderlineThickness']=(int)$param; + elseif($code=='UnderlinePosition') + $fm['UnderlinePosition']=(int)$param; + elseif($code=='IsFixedPitch') + $fm['IsFixedPitch']=($param=='true'); + elseif($code=='FontBBox') + $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]); + elseif($code=='CapHeight') + $fm['CapHeight']=(int)$param; + elseif($code=='StdVW') + $fm['StdVW']=(int)$param; + } + if(!isset($fm['FontName'])) + die('FontName not found'); + if(!empty($map)) + { + if(!isset($widths['.notdef'])) + $widths['.notdef']=600; + if(!isset($widths['Delta']) and isset($widths['increment'])) + $widths['Delta']=$widths['increment']; + //Order widths according to map + for($i=0;$i<=255;$i++) + { + if(!isset($widths[$map[$i]])) + { + echo 'Warning: character '.$map[$i].' is missing
        '; + $widths[$i]=$widths['.notdef']; + } + else + $widths[$i]=$widths[$map[$i]]; + } + } + $fm['Widths']=$widths; + return $fm; +} + +function MakeFontDescriptor($fm,$symbolic) +{ + //Ascent + $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000); + $fd="array('Ascent'=>".$asc; + //Descent + $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200); + $fd.=",'Descent'=>".$desc; + //CapHeight + if(isset($fm['CapHeight'])) + $ch=$fm['CapHeight']; + elseif(isset($fm['CapXHeight'])) + $ch=$fm['CapXHeight']; + else + $ch=$asc; + $fd.=",'CapHeight'=>".$ch; + //Flags + $flags=0; + if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch']) + $flags+=1<<0; + if($symbolic) + $flags+=1<<2; + if(!$symbolic) + $flags+=1<<5; + if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0) + $flags+=1<<6; + $fd.=",'Flags'=>".$flags; + //FontBBox + if(isset($fm['FontBBox'])) + $fbb=$fm['FontBBox']; + else + $fbb=array(0,$des-100,1000,$asc+100); + $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'"; + //ItalicAngle + $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0); + $fd.=",'ItalicAngle'=>".$ia; + //StemV + if(isset($fm['StdVW'])) + $stemv=$fm['StdVW']; + elseif(isset($fm['Weight']) and preg_match('/(bold|black)/i',$fm['Weight'])) + $stemv=120; + else + $stemv=70; + $fd.=",'StemV'=>".$stemv; + //MissingWidth + if(isset($fm['MissingWidth'])) + $fd.=",'MissingWidth'=>".$fm['MissingWidth']; + $fd.=')'; + return $fd; +} + +function MakeWidthArray($fm) +{ + //Make character width array + $s="array(\n\t"; + $cw=$fm['Widths']; + for($i=0;$i<=255;$i++) + { + if(chr($i)=="'") + $s.="'\\''"; + elseif(chr($i)=="\\") + $s.="'\\\\'"; + elseif($i>=32 and $i<=126) + $s.="'".chr($i)."'"; + else + $s.="chr($i)"; + $s.='=>'.$fm['Widths'][$i]; + if($i<255) + $s.=','; + if(($i+1)%22==0) + $s.="\n\t"; + } + $s.=')'; + return $s; +} + +function MakeFontEncoding($map) +{ + //Build differences from reference encoding + $ref=ReadMap('cp1252'); + $s=''; + $last=0; + for($i=32;$i<=255;$i++) + { + if($map[$i]!=$ref[$i]) + { + if($i!=$last+1) + $s.=$i.' '; + $last=$i; + $s.='/'.$map[$i].' '; + } + } + return rtrim($s); +} + +function SaveToFile($file,$s,$mode='t') +{ + $f=fopen($file,'w'.$mode); + if(!$f) + die('Can\'t write to file '.$file); + fwrite($f,$s,strlen($s)); + fclose($f); +} + +function ReadShort($f) +{ + $a=unpack('n1n',fread($f,2)); + return $a['n']; +} + +function ReadLong($f) +{ + $a=unpack('N1N',fread($f,4)); + return $a['N']; +} + +function CheckTTF($file) +{ + //Check if font license allows embedding + $f=fopen($file,'rb'); + if(!$f) + die('Error: Can\'t open '.$file); + //Extract number of tables + fseek($f,4,SEEK_CUR); + $nb=ReadShort($f); + fseek($f,6,SEEK_CUR); + //Seek OS/2 table + $found=false; + for($i=0;$i<$nb;$i++) + { + if(fread($f,4)=='OS/2') + { + $found=true; + break; + } + fseek($f,12,SEEK_CUR); + } + if(!$found) + { + fclose($f); + return; + } + fseek($f,4,SEEK_CUR); + $offset=ReadLong($f); + fseek($f,$offset,SEEK_SET); + //Extract fsType flags + fseek($f,8,SEEK_CUR); + $fsType=ReadShort($f); + $rl=($fsType & 0x02)!=0; + $pp=($fsType & 0x04)!=0; + $e=($fsType & 0x08)!=0; + fclose($f); + if($rl and !$pp and !$e) + echo 'Warning: font license does not allow embedding'; +} + +/******************************************************************************* +* $fontfile : chemin du fichier TTF (ou chane vide si pas d'incorporation) * +* $afmfile : chemin du fichier AFM * +* $enc : encodage (ou chane vide si la police est symbolique) * +* $patch : patch optionnel pour l'encodage * +* $type : type de la police si $fontfile est vide * +*******************************************************************************/ +function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType') +{ + //Generate a font definition file + set_magic_quotes_runtime(0); + e107_ini_set('auto_detect_line_endings','1'); + if($enc) + { + $map=ReadMap($enc); + foreach($patch as $cc=>$gn) + $map[$cc]=$gn; + } + else + $map=array(); + if(!file_exists($afmfile)) + die('Error: AFM file not found: '.$afmfile); + $fm=ReadAFM($afmfile,$map); + if($enc) + $diff=MakeFontEncoding($map); + else + $diff=''; + $fd=MakeFontDescriptor($fm,empty($map)); + //Find font type + if($fontfile) + { + $ext=strtolower(substr($fontfile,-3)); + if($ext=='ttf') + $type='TrueType'; + elseif($ext=='pfb') + $type='Type1'; + else + die('Error: unrecognized font file extension: '.$ext); + } + else + { + if($type!='TrueType' and $type!='Type1') + die('Error: incorrect font type: '.$type); + } + //Start generation + $s='Error: font file not found: '.$fontfile); + if($type=='TrueType') + CheckTTF($fontfile); + $f=fopen($fontfile,'rb'); + if(!$f) + die('Error: Can\'t open '.$fontfile); + $file=fread($f,filesize($fontfile)); + fclose($f); + if($type=='Type1') + { + //Find first two sections and discard third one + $header=(ord($file{0})==128); + if($header) + { + //Strip first binary header + $file=substr($file,6); + } + $pos=strpos($file,'eexec'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size1=$pos+6; + if($header and ord($file{$size1})==128) + { + //Strip second binary header + $file=substr($file,0,$size1).substr($file,$size1+6); + } + $pos=strpos($file,'00000000'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size2=$pos-$size1; + $file=substr($file,0,$size1+$size2); + } + if(function_exists('gzcompress')) + { + $cmp=$basename.'.z'; + SaveToFile($cmp,gzcompress($file),'b'); + $s.='$file=\''.$cmp."';\n"; + echo 'Font file compressed ('.$cmp.')
        '; + } + else + { + $s.='$file=\''.basename($fontfile)."';\n"; + echo 'Notice: font file could not be compressed (zlib extension not available)
        '; + } + if($type=='Type1') + { + $s.='$size1='.$size1.";\n"; + $s.='$size2='.$size2.";\n"; + } + else + $s.='$originalsize='.filesize($fontfile).";\n"; + } + else + { + //Not embedded font + $s.='$file='."'';\n"; + } + $s.="?>\n"; + SaveToFile($basename.'.php',$s); + echo 'Font definition file generated ('.$basename.'.php'.')
        '; +} +?> diff --git a/e107_plugins/pdf/font/symbol.php b/e107_plugins/pdf/font/symbol.php new file mode 100644 index 000000000..b556ed84c --- /dev/null +++ b/e107_plugins/pdf/font/symbol.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549, + ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722, + 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768, + 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576, + 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0, + chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603, + chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768, + chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042, + chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329, + chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0); +?> diff --git a/e107_plugins/pdf/font/times.php b/e107_plugins/pdf/font/times.php new file mode 100644 index 000000000..b9be1b21d --- /dev/null +++ b/e107_plugins/pdf/font/times.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722, + 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944, + 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500); +?> diff --git a/e107_plugins/pdf/font/timesb.php b/e107_plugins/pdf/font/timesb.php new file mode 100644 index 000000000..c3eb9fa75 --- /dev/null +++ b/e107_plugins/pdf/font/timesb.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000, + 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833, + 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/e107_plugins/pdf/font/timesbi.php b/e107_plugins/pdf/font/timesbi.php new file mode 100644 index 000000000..161f6302c --- /dev/null +++ b/e107_plugins/pdf/font/timesbi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667, + 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889, + 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/e107_plugins/pdf/font/timesi.php b/e107_plugins/pdf/font/timesi.php new file mode 100644 index 000000000..de171fd19 --- /dev/null +++ b/e107_plugins/pdf/font/timesi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611, + 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833, + 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/e107_plugins/pdf/font/zapfdingbats.php b/e107_plugins/pdf/font/zapfdingbats.php new file mode 100644 index 000000000..f2bdfd5c9 --- /dev/null +++ b/e107_plugins/pdf/font/zapfdingbats.php @@ -0,0 +1,15 @@ +0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0, + chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939, + ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692, + 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776, + 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873, + 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317, + chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788, + chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788, + chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918, + chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874, + chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0); +?> diff --git a/e107_plugins/pdf/fpdf.css b/e107_plugins/pdf/fpdf.css new file mode 100644 index 000000000..d979baec2 --- /dev/null +++ b/e107_plugins/pdf/fpdf.css @@ -0,0 +1,11 @@ +BODY {font-family:times new roman,serif} +H2 {color:#4000A0} +P.demo {text-align:center; margin-top:-10px} +A.demo {text-decoration:none; font-weight:bold; color:#0000CC} +A.demo:link {text-decoration:none; font-weight:bold; color:#0000CC} +A.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF} +A.demo:active {text-decoration:none; font-weight:bold; color:#0000FF} +.st {font-weight:bold; color:#900000} +.kw {color:#000080; font-weight:bold} +.str {color:#CC0000} +.cmt {color:#008000} diff --git a/e107_plugins/pdf/fpdf.php b/e107_plugins/pdf/fpdf.php new file mode 100644 index 000000000..fa21fd197 --- /dev/null +++ b/e107_plugins/pdf/fpdf.php @@ -0,0 +1,1664 @@ +_dochecks(); + //Initialization of properties + $this->page=0; + $this->n=2; + $this->buffer=''; + $this->pages=array(); + $this->OrientationChanges=array(); + $this->state=0; + $this->fonts=array(); + $this->FontFiles=array(); + $this->diffs=array(); + $this->images=array(); + $this->links=array(); + $this->InFooter=false; + $this->lasth=0; + $this->FontFamily=''; + $this->FontStyle=''; + $this->FontSizePt=12; + $this->underline=false; + $this->DrawColor='0 G'; + $this->FillColor='0 g'; + $this->TextColor='0 g'; + $this->ColorFlag=false; + $this->ws=0; + //Standard fonts + $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique', + 'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique', + 'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic', + 'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats'); + //Scale factor + if($unit=='pt') + $this->k=1; + elseif($unit=='mm') + $this->k=72/25.4; + elseif($unit=='cm') + $this->k=72/2.54; + elseif($unit=='in') + $this->k=72; + else + $this->Error('Incorrect unit: '.$unit); + //Page format + if(is_string($format)) + { + $format=strtolower($format); + if($format=='a3') + $format=array(841.89,1190.55); + elseif($format=='a4') + $format=array(595.28,841.89); + elseif($format=='a5') + $format=array(420.94,595.28); + elseif($format=='letter') + $format=array(612,792); + elseif($format=='legal') + $format=array(612,1008); + else + $this->Error('Unknown page format: '.$format); + $this->fwPt=$format[0]; + $this->fhPt=$format[1]; + } + else + { + $this->fwPt=$format[0]*$this->k; + $this->fhPt=$format[1]*$this->k; + } + $this->fw=$this->fwPt/$this->k; + $this->fh=$this->fhPt/$this->k; + //Page orientation + $orientation=strtolower($orientation); + if($orientation=='p' || $orientation=='portrait') + { + $this->DefOrientation='P'; + $this->wPt=$this->fwPt; + $this->hPt=$this->fhPt; + } + elseif($orientation=='l' || $orientation=='landscape') + { + $this->DefOrientation='L'; + $this->wPt=$this->fhPt; + $this->hPt=$this->fwPt; + } + else + $this->Error('Incorrect orientation: '.$orientation); + $this->CurOrientation=$this->DefOrientation; + $this->w=$this->wPt/$this->k; + $this->h=$this->hPt/$this->k; + //Page margins (1 cm) + $margin=28.35/$this->k; + $this->SetMargins($margin,$margin); + //Interior cell margin (1 mm) + $this->cMargin=$margin/10; + //Line width (0.2 mm) + $this->LineWidth=.567/$this->k; + //Automatic page break + $this->SetAutoPageBreak(true,2*$margin); + //Full width display mode + $this->SetDisplayMode('fullwidth'); + //Enable compression + $this->SetCompression(true); + //Set default PDF version number + $this->PDFVersion='1.3'; +} + +function SetMargins($left,$top,$right=-1) +{ + //Set left, top and right margins + $this->lMargin=$left; + $this->tMargin=$top; + if($right==-1) + $right=$left; + $this->rMargin=$right; +} + +function SetLeftMargin($margin) +{ + //Set left margin + $this->lMargin=$margin; + if($this->page>0 && $this->x<$margin) + $this->x=$margin; +} + +function SetTopMargin($margin) +{ + //Set top margin + $this->tMargin=$margin; +} + +function SetRightMargin($margin) +{ + //Set right margin + $this->rMargin=$margin; +} + +function SetAutoPageBreak($auto,$margin=0) +{ + //Set auto page break mode and triggering margin + $this->AutoPageBreak=$auto; + $this->bMargin=$margin; + $this->PageBreakTrigger=$this->h-$margin; +} + +function SetDisplayMode($zoom,$layout='continuous') +{ + //Set display mode in viewer + if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) + $this->ZoomMode=$zoom; + else + $this->Error('Incorrect zoom display mode: '.$zoom); + if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') + $this->LayoutMode=$layout; + else + $this->Error('Incorrect layout display mode: '.$layout); +} + +function SetCompression($compress) +{ + //Set page compression + if(function_exists('gzcompress')) + $this->compress=$compress; + else + $this->compress=false; +} + +function SetTitle($title) +{ + //Title of document + $this->title=$title; +} + +function SetSubject($subject) +{ + //Subject of document + $this->subject=$subject; +} + +function SetAuthor($author) +{ + //Author of document + $this->author=$author; +} + +function SetKeywords($keywords) +{ + //Keywords of document + $this->keywords=$keywords; +} + +function SetCreator($creator) +{ + //Creator of document + $this->creator=$creator; +} + +function AliasNbPages($alias='{nb}') +{ + //Define an alias for total number of pages + $this->AliasNbPages=$alias; +} + +function Error($msg) +{ + //Fatal error + die('FPDF error: '.$msg); +} + +function Open() +{ + //Begin document + $this->state=1; +} + +function Close() +{ + //Terminate document + if($this->state==3) + return; + if($this->page==0) + $this->AddPage(); + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + //Close document + $this->_enddoc(); +} + +function AddPage($orientation='') +{ + //Start a new page + if($this->state==0) + $this->Open(); + $family=$this->FontFamily; + $style=$this->FontStyle.($this->underline ? 'U' : ''); + $size=$this->FontSizePt; + $lw=$this->LineWidth; + $dc=$this->DrawColor; + $fc=$this->FillColor; + $tc=$this->TextColor; + $cf=$this->ColorFlag; + if($this->page>0) + { + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + } + //Start new page + $this->_beginpage($orientation); + //Set line cap style to square + $this->_out('2 J'); + //Set line width + $this->LineWidth=$lw; + $this->_out(sprintf('%.2f w',$lw*$this->k)); + //Set font + if($family) + $this->SetFont($family,$style,$size); + //Set colors + $this->DrawColor=$dc; + if($dc!='0 G') + $this->_out($dc); + $this->FillColor=$fc; + if($fc!='0 g') + $this->_out($fc); + $this->TextColor=$tc; + $this->ColorFlag=$cf; + //Page header + $this->Header(); + //Restore line width + if($this->LineWidth!=$lw) + { + $this->LineWidth=$lw; + $this->_out(sprintf('%.2f w',$lw*$this->k)); + } + //Restore font + if($family) + $this->SetFont($family,$style,$size); + //Restore colors + if($this->DrawColor!=$dc) + { + $this->DrawColor=$dc; + $this->_out($dc); + } + if($this->FillColor!=$fc) + { + $this->FillColor=$fc; + $this->_out($fc); + } + $this->TextColor=$tc; + $this->ColorFlag=$cf; +} + +function Header() +{ + //To be implemented in your own inherited class +} + +function Footer() +{ + //To be implemented in your own inherited class +} + +function PageNo() +{ + //Get current page number + return $this->page; +} + +function SetDrawColor($r,$g=-1,$b=-1) +{ + //Set color for all stroking operations + if(($r==0 && $g==0 && $b==0) || $g==-1) + $this->DrawColor=sprintf('%.3f G',$r/255); + else + $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255); + if($this->page>0) + $this->_out($this->DrawColor); +} + +function SetFillColor($r,$g=-1,$b=-1) +{ + //Set color for all filling operations + if(($r==0 && $g==0 && $b==0) || $g==-1) + $this->FillColor=sprintf('%.3f g',$r/255); + else + $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); + if($this->page>0) + $this->_out($this->FillColor); +} + +function SetTextColor($r,$g=-1,$b=-1) +{ + //Set color for text + if(($r==0 && $g==0 && $b==0) || $g==-1) + $this->TextColor=sprintf('%.3f g',$r/255); + else + $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); +} + +function GetStringWidth($s) +{ + //Get width of a string in the current font + $s=(string)$s; + $cw=&$this->CurrentFont['cw']; + $w=0; + $l=strlen($s); + for($i=0;$i<$l;$i++) + $w+=$cw[$s{$i}]; + return $w*$this->FontSize/1000; +} + +function SetLineWidth($width) +{ + //Set line width + $this->LineWidth=$width; + if($this->page>0) + $this->_out(sprintf('%.2f w',$width*$this->k)); +} + +function Line($x1,$y1,$x2,$y2) +{ + //Draw a line + $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k)); +} + +function Rect($x,$y,$w,$h,$style='') +{ + //Draw a rectangle + if($style=='F') + $op='f'; + elseif($style=='FD' || $style=='DF') + $op='B'; + else + $op='S'; + $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op)); +} + +function AddFont($family,$style='',$file='') +{ + //Add a TrueType or Type1 font + $family=strtolower($family); + if($file=='') + $file=str_replace(' ','',$family).strtolower($style).'.php'; + if($family=='arial') + $family='helvetica'; + $style=strtoupper($style); + if($style=='IB') + $style='BI'; + $fontkey=$family.$style; + if(isset($this->fonts[$fontkey])) + $this->Error('Font already added: '.$family.' '.$style); + include($this->_getfontpath().$file); + if(!isset($name)) + $this->Error('Could not include font definition file'); + $i=count($this->fonts)+1; + $this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file); + if($diff) + { + //Search existing encodings + $d=0; + $nb=count($this->diffs); + for($i=1;$i<=$nb;$i++) + { + if($this->diffs[$i]==$diff) + { + $d=$i; + break; + } + } + if($d==0) + { + $d=$nb+1; + $this->diffs[$d]=$diff; + } + $this->fonts[$fontkey]['diff']=$d; + } + if($file) + { + if($type=='TrueType') + $this->FontFiles[$file]=array('length1'=>$originalsize); + else + $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2); + } +} + +function SetFont($family,$style='',$size=0) +{ + //Select a font; size given in points + global $fpdf_charwidths; + + $family=strtolower($family); + if($family=='') + $family=$this->FontFamily; + if($family=='arial') + $family='helvetica'; + elseif($family=='symbol' || $family=='zapfdingbats') + $style=''; + $style=strtoupper($style); + if(strpos($style,'U')!==false) + { + $this->underline=true; + $style=str_replace('U','',$style); + } + else + $this->underline=false; + if($style=='IB') + $style='BI'; + if($size==0) + $size=$this->FontSizePt; + //Test if font is already selected + if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) + return; + //Test if used for the first time + $fontkey=$family.$style; + if(!isset($this->fonts[$fontkey])) + { + //Check if one of the standard fonts + if(isset($this->CoreFonts[$fontkey])) + { + if(!isset($fpdf_charwidths[$fontkey])) + { + //Load metric file + $file=$family; + if($family=='times' || $family=='helvetica') + $file.=strtolower($style); + include($this->_getfontpath().$file.'.php'); + if(!isset($fpdf_charwidths[$fontkey])) + $this->Error('Could not include font metric file'); + } + $i=count($this->fonts)+1; + $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]); + } + else + $this->Error('Undefined font: '.$family.' '.$style); + } + //Select it + $this->FontFamily=$family; + $this->FontStyle=$style; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + $this->CurrentFont=&$this->fonts[$fontkey]; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function SetFontSize($size) +{ + //Set font size in points + if($this->FontSizePt==$size) + return; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function AddLink() +{ + //Create a new internal link + $n=count($this->links)+1; + $this->links[$n]=array(0,0); + return $n; +} + +function SetLink($link,$y=0,$page=-1) +{ + //Set destination of internal link + if($y==-1) + $y=$this->y; + if($page==-1) + $page=$this->page; + $this->links[$link]=array($page,$y); +} + +function Link($x,$y,$w,$h,$link) +{ + //Put a link on the page + $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link); +} + +function Text($x,$y,$txt) +{ + //Output a string + $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); + if($this->underline && $txt!='') + $s.=' '.$this->_dounderline($x,$y,$txt); + if($this->ColorFlag) + $s='q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); +} + +function AcceptPageBreak() +{ + //Accept automatic page break or not + return $this->AutoPageBreak; +} + +function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='') +{ + //Output a cell + $k=$this->k; + if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak()) + { + //Automatic page break + $x=$this->x; + $ws=$this->ws; + if($ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation); + $this->x=$x+$this->lMargin; + if($ws>0) + { + $this->ws=$ws; + $this->_out(sprintf('%.3f Tw',$ws*$k)); + } + } + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $s=''; + if($fill==1 || $border==1) + { + if($fill==1) + $op=($border==1) ? 'B' : 'f'; + else + $op='S'; + $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); + } + if(is_string($border)) + { + $x=$this->x; + $y=$this->y; + if(strpos($border,'L')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); + if(strpos($border,'T')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); + if(strpos($border,'R')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + if(strpos($border,'B')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + } + if($txt!=='') + { + if($align=='R') + $dx=$w-$this->cMargin-$this->GetStringWidth($txt); + elseif($align=='C') + $dx=($w-$this->GetStringWidth($txt))/2; + else + $dx=$this->cMargin; + if($this->ColorFlag) + $s.='q '.$this->TextColor.' '; + $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt))); + $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2); + if($this->underline) + $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); + if($this->ColorFlag) + $s.=' Q'; + if($link) + $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); + } + if($s) + $this->_out($s); + $this->lasth=$h; + if($ln>0) + { + //Go to next line + $this->y+=$h; + if($ln==1) + $this->x=$this->lMargin; + } + else + $this->x+=$w; +} + +function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0) +{ + //Output text with automatic or explicit line breaks + $cw=&$this->CurrentFont['cw']; + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + if($nb>0 && $s[$nb-1]=="\n") + $nb--; + $b=0; + if($border) + { + if($border==1) + { + $border='LTRB'; + $b='LRT'; + $b2='LR'; + } + else + { + $b2=''; + if(strpos($border,'L')!==false) + $b2.='L'; + if(strpos($border,'R')!==false) + $b2.='R'; + $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2; + } + } + $sep=-1; + $i=0; + $j=0; + $l=0; + $ns=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s{$i}; + if($c=="\n") + { + //Explicit line break + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $i++; + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border && $nl==2) + $b=$b2; + continue; + } + if($c==' ') + { + $sep=$i; + $ls=$l; + $ns++; + } + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($i==$j) + $i++; + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + else + { + if($align=='J') + { + $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; + $this->_out(sprintf('%.3f Tw',$this->ws*$this->k)); + } + $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border && $nl==2) + $b=$b2; + } + else + $i++; + } + //Last chunk + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + if($border && strpos($border,'B')!==false) + $b.='B'; + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $this->x=$this->lMargin; +} + +function Write($h,$txt,$link='') +{ + //Output text in flowing mode + $cw=&$this->CurrentFont['cw']; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s{$i}; + if($c=="\n") + { + //Explicit line break + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + $i++; + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + continue; + } + if($c==' ') + $sep=$i; + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($this->x>$this->lMargin) + { + //Move to next line + $this->x=$this->lMargin; + $this->y+=$h; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $i++; + $nl++; + continue; + } + if($i==$j) + $i++; + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + } + else + { + $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + } + else + $i++; + } + //Last chunk + if($i!=$j) + $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link); +} + +function Image($file,$x,$y,$w=0,$h=0,$type='',$link='') +{ + //Put an image on the page + if(!isset($this->images[$file])) + { + //First use of image, get info + if($type=='') + { + $pos=strrpos($file,'.'); + if(!$pos) + $this->Error('Image file has no extension and no type was specified: '.$file); + $type=substr($file,$pos+1); + } + $type=strtolower($type); + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + if($type=='jpg' || $type=='jpeg'){ + $info=$this->_parsejpg($file); + }elseif($type=='png'){ + $info=$this->_parsepng($file); + }else{ + //Allow for additional formats + $mtd='_parse'.$type; + if(!method_exists($this,$mtd)) + $this->Error('Unsupported image type: '.$type); + $info=$this->$mtd($file); + } + if($info){ + set_magic_quotes_runtime($mqr); + $info['i']=count($this->images)+1; + $this->images[$file]=$info; + } + } + else + $info=$this->images[$file]; + if($info){ + //Automatic width and height calculation if needed + if($w==0 && $h==0) + { + //Put image at 72 dpi + $w=$info['w']/$this->k; + $h=$info['h']/$this->k; + } + if($w==0) + $w=$h*$info['w']/$info['h']; + if($h==0) + $h=$w*$info['h']/$info['w']; + $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i'])); + if($link) + $this->Link($x,$y,$w,$h,$link); + } +} + +function Ln($h='') +{ + //Line feed; default value is last cell height + $this->x=$this->lMargin; + if(is_string($h)) + $this->y+=$this->lasth; + else + $this->y+=$h; +} + +function GetX() +{ + //Get x position + return $this->x; +} + +function SetX($x) +{ + //Set x position + if($x>=0) + $this->x=$x; + else + $this->x=$this->w+$x; +} + +function GetY() +{ + //Get y position + return $this->y; +} + +function SetY($y) +{ + //Set y position and reset x + $this->x=$this->lMargin; + if($y>=0) + $this->y=$y; + else + $this->y=$this->h+$y; +} + +function SetXY($x,$y) +{ + //Set x and y positions + $this->SetY($y); + $this->SetX($x); +} + +function Output($name='',$dest='') +{ + //Output PDF to some destination + //Finish document if necessary + if($this->state<3) + $this->Close(); + //Normalize parameters + if(is_bool($dest)) + $dest=$dest ? 'D' : 'F'; + $dest=strtoupper($dest); + if($dest=='') + { + if($name=='') + { + $name='doc.pdf'; + $dest='I'; + } + else + $dest='F'; + } + switch($dest) + { + case 'I': + //Send to standard output + if(ob_get_contents()) + $this->Error('Some data has already been output, can\'t send PDF file'); + if(php_sapi_name()!='cli') + { + //We send to a browser + //Secure https check + if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype'){ + header('Pragma: public'); + } + header('Content-Type: application/pdf'); + if(headers_sent()) + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-disposition: inline; filename="'.$name.'"'); + } + echo $this->buffer; + break; + case 'D': + //Download file + if(ob_get_contents()) + $this->Error('Some data has already been output, can\'t send PDF file'); + //Secure https check + if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype') + header('Pragma: public'); + if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) + header('Content-Type: application/force-download'); + else + header('Content-Type: application/octet-stream'); + if(headers_sent()) + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-disposition: attachment; filename="'.$name.'"'); + echo $this->buffer; + break; + case 'F': + //Save to local file + $f=fopen($name,'wb'); + if(!$f) + $this->Error('Unable to create output file: '.$name); + fwrite($f,$this->buffer,strlen($this->buffer)); + fclose($f); + break; + case 'S': + //Return as a string + return $this->buffer; + default: + $this->Error('Incorrect output destination: '.$dest); + } + return ''; +} + +/******************************************************************************* +* * +* Protected methods * +* * +*******************************************************************************/ +function _dochecks() +{ + //Check for locale-related bug + if(1.1==1) + $this->Error('Don\'t alter the locale before including class file'); + //Check for decimal separator + if(sprintf('%.1f',1.0)!='1.0') + setlocale(LC_NUMERIC,'C'); +} + +function _getfontpath() +{ + if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) + define('FPDF_FONTPATH',dirname(__FILE__).'/font/'); + return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; +} + +function _putpages() +{ + $nb=$this->page; + if(!empty($this->AliasNbPages)) + { + //Replace number of pages + for($n=1;$n<=$nb;$n++) + $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]); + } + if($this->DefOrientation=='P') + { + $wPt=$this->fwPt; + $hPt=$this->fhPt; + } + else + { + $wPt=$this->fhPt; + $hPt=$this->fwPt; + } + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + for($n=1;$n<=$nb;$n++) + { + //Page + $this->_newobj(); + $this->_out('<_out('/Parent 1 0 R'); + if(isset($this->OrientationChanges[$n])) + $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt)); + $this->_out('/Resources 2 0 R'); + if(isset($this->PageLinks[$n])) + { + //Links + $annots='/Annots ['; + foreach($this->PageLinks[$n] as $pl) + { + $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]); + $annots.='<_textstring($pl[4]).'>>>>'; + $annots.='/A <_escapetext($pl[4]).'>>>>'; + else + { + $l=$this->links[$pl[4]]; + $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt; + $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k); + } + } + $this->_out($annots.']'); + } + $this->_out('/Contents '.($this->n+1).' 0 R>>'); + $this->_out('endobj'); + //Page content + $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; + $this->_newobj(); + $this->_out('<<'.$filter.'/Length '.strlen($p).'>>'); + $this->_putstream($p); + $this->_out('endobj'); + } + //Pages root + $this->offsets[1]=strlen($this->buffer); + $this->_out('1 0 obj'); + $this->_out('<_out($kids.']'); + $this->_out('/Count '.$nb); + $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt)); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putfonts() +{ + $nf=$this->n; + foreach($this->diffs as $diff) + { + //Encodings + $this->_newobj(); + $this->_out('<>'); + $this->_out('endobj'); + } + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + foreach($this->FontFiles as $file=>$info) + { + //Font file embedding + $this->_newobj(); + $this->FontFiles[$file]['n']=$this->n; + $font=''; + $f=fopen($this->_getfontpath().$file,'rb',1); + if(!$f) + $this->Error('Font file not found'); + while(!feof($f)) + $font.=fread($f,8192); + fclose($f); + $compressed=(substr($file,-2)=='.z'); + if(!$compressed && isset($info['length2'])) + { + $header=(ord($font{0})==128); + if($header) + { + //Strip first binary header + $font=substr($font,6); + } + if($header && ord($font{$info['length1']})==128) + { + //Strip second binary header + $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6); + } + } + $this->_out('<_out('/Filter /FlateDecode'); + $this->_out('/Length1 '.$info['length1']); + if(isset($info['length2'])) + $this->_out('/Length2 '.$info['length2'].' /Length3 0'); + $this->_out('>>'); + $this->_putstream($font); + $this->_out('endobj'); + } + set_magic_quotes_runtime($mqr); + foreach($this->fonts as $k=>$font) + { + //Font objects + $this->fonts[$k]['n']=$this->n+1; + $type=$font['type']; + $name=$font['name']; + if($type=='core') + { + //Standard font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /Type1'); + if($name!='Symbol' && $name!='ZapfDingbats') + $this->_out('/Encoding /WinAnsiEncoding'); + $this->_out('>>'); + $this->_out('endobj'); + } + elseif($type=='Type1' || $type=='TrueType') + { + //Additional Type1 or TrueType font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /'.$type); + $this->_out('/FirstChar 32 /LastChar 255'); + $this->_out('/Widths '.($this->n+1).' 0 R'); + $this->_out('/FontDescriptor '.($this->n+2).' 0 R'); + if($font['enc']) + { + if(isset($font['diff'])) + $this->_out('/Encoding '.($nf+$font['diff']).' 0 R'); + else + $this->_out('/Encoding /WinAnsiEncoding'); + } + $this->_out('>>'); + $this->_out('endobj'); + //Widths + $this->_newobj(); + $cw=&$font['cw']; + $s='['; + for($i=32;$i<=255;$i++) + $s.=$cw[chr($i)].' '; + $this->_out($s.']'); + $this->_out('endobj'); + //Descriptor + $this->_newobj(); + $s='<$v) + $s.=' /'.$k.' '.$v; + $file=$font['file']; + if($file) + $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R'; + $this->_out($s.'>>'); + $this->_out('endobj'); + } + else + { + //Allow for additional types + $mtd='_put'.strtolower($type); + if(!method_exists($this,$mtd)) + $this->Error('Unsupported font type: '.$type); + $this->$mtd($font); + } + } +} + +function _putimages() +{ + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + reset($this->images); + while(list($file,$info)=each($this->images)) + { + $this->_newobj(); + $this->images[$file]['n']=$this->n; + $this->_out('<_out('/Subtype /Image'); + $this->_out('/Width '.$info['w']); + $this->_out('/Height '.$info['h']); + if($info['cs']=='Indexed') + $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); + else + { + $this->_out('/ColorSpace /'.$info['cs']); + if($info['cs']=='DeviceCMYK') + $this->_out('/Decode [1 0 1 0 1 0 1 0]'); + } + $this->_out('/BitsPerComponent '.$info['bpc']); + if(isset($info['f'])) + $this->_out('/Filter /'.$info['f']); + if(isset($info['parms'])) + $this->_out($info['parms']); + if(isset($info['trns']) && is_array($info['trns'])) + { + $trns=''; + for($i=0;$i_out('/Mask ['.$trns.']'); + } + $this->_out('/Length '.strlen($info['data']).'>>'); + $this->_putstream($info['data']); + unset($this->images[$file]['data']); + $this->_out('endobj'); + //Palette + if($info['cs']=='Indexed') + { + $this->_newobj(); + $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; + $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); + $this->_putstream($pal); + $this->_out('endobj'); + } + } +} + +function _putxobjectdict() +{ + foreach($this->images as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); +} + +function _putresourcedict() +{ + $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); + $this->_out('/Font <<'); + foreach($this->fonts as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + $this->_out('/XObject <<'); + $this->_putxobjectdict(); + $this->_out('>>'); +} + +function _putresources() +{ + $this->_putfonts(); + $this->_putimages(); + //Resource dictionary + $this->offsets[2]=strlen($this->buffer); + $this->_out('2 0 obj'); + $this->_out('<<'); + $this->_putresourcedict(); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putinfo() +{ + $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION)); + if(!empty($this->title)) + $this->_out('/Title '.$this->_textstring($this->title)); + if(!empty($this->subject)) + $this->_out('/Subject '.$this->_textstring($this->subject)); + if(!empty($this->author)) + $this->_out('/Author '.$this->_textstring($this->author)); + if(!empty($this->keywords)) + $this->_out('/Keywords '.$this->_textstring($this->keywords)); + if(!empty($this->creator)) + $this->_out('/Creator '.$this->_textstring($this->creator)); + $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis'))); +} + +function _putcatalog() +{ + $this->_out('/Type /Catalog'); + $this->_out('/Pages 1 0 R'); + if($this->ZoomMode=='fullpage') + $this->_out('/OpenAction [3 0 R /Fit]'); + elseif($this->ZoomMode=='fullwidth') + $this->_out('/OpenAction [3 0 R /FitH null]'); + elseif($this->ZoomMode=='real') + $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); + elseif(!is_string($this->ZoomMode)) + $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']'); + if($this->LayoutMode=='single') + $this->_out('/PageLayout /SinglePage'); + elseif($this->LayoutMode=='continuous') + $this->_out('/PageLayout /OneColumn'); + elseif($this->LayoutMode=='two') + $this->_out('/PageLayout /TwoColumnLeft'); +} + +function _putheader() +{ + $this->_out('%PDF-'.$this->PDFVersion); +} + +function _puttrailer() +{ + $this->_out('/Size '.($this->n+1)); + $this->_out('/Root '.$this->n.' 0 R'); + $this->_out('/Info '.($this->n-1).' 0 R'); +} + +function _enddoc() +{ + $this->_putheader(); + $this->_putpages(); + $this->_putresources(); + //Info + $this->_newobj(); + $this->_out('<<'); + $this->_putinfo(); + $this->_out('>>'); + $this->_out('endobj'); + //Catalog + $this->_newobj(); + $this->_out('<<'); + $this->_putcatalog(); + $this->_out('>>'); + $this->_out('endobj'); + //Cross-ref + $o=strlen($this->buffer); + $this->_out('xref'); + $this->_out('0 '.($this->n+1)); + $this->_out('0000000000 65535 f '); + for($i=1;$i<=$this->n;$i++) + $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i])); + //Trailer + $this->_out('trailer'); + $this->_out('<<'); + $this->_puttrailer(); + $this->_out('>>'); + $this->_out('startxref'); + $this->_out($o); + $this->_out('%%EOF'); + $this->state=3; +} + +function _beginpage($orientation) +{ + $this->page++; + $this->pages[$this->page]=''; + $this->state=2; + $this->x=$this->lMargin; + $this->y=$this->tMargin; + $this->FontFamily=''; + //Page orientation + if(!$orientation) + $orientation=$this->DefOrientation; + else + { + $orientation=strtoupper($orientation{0}); + if($orientation!=$this->DefOrientation) + $this->OrientationChanges[$this->page]=true; + } + if($orientation!=$this->CurOrientation) + { + //Change orientation + if($orientation=='P') + { + $this->wPt=$this->fwPt; + $this->hPt=$this->fhPt; + $this->w=$this->fw; + $this->h=$this->fh; + } + else + { + $this->wPt=$this->fhPt; + $this->hPt=$this->fwPt; + $this->w=$this->fh; + $this->h=$this->fw; + } + $this->PageBreakTrigger=$this->h-$this->bMargin; + $this->CurOrientation=$orientation; + } +} + +function _endpage() +{ + //End of page contents + $this->state=1; +} + +function _newobj() +{ + //Begin a new object + $this->n++; + $this->offsets[$this->n]=strlen($this->buffer); + $this->_out($this->n.' 0 obj'); +} + +function _dounderline($x,$y,$txt) +{ + //Underline text + $up=$this->CurrentFont['up']; + $ut=$this->CurrentFont['ut']; + $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '); + return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); +} + +function _parsejpg($file) +{ + //Extract info from a JPEG file + $a=GetImageSize($file); + if(!$a) + $this->Error('Missing or incorrect image file: '.$file); + if($a[2]!=2) + $this->Error('Not a JPEG file: '.$file); + if(!isset($a['channels']) || $a['channels']==3) + $colspace='DeviceRGB'; + elseif($a['channels']==4) + $colspace='DeviceCMYK'; + else + $colspace='DeviceGray'; + $bpc=isset($a['bits']) ? $a['bits'] : 8; + //Read whole file + $f=fopen($file,'rb'); + $data=''; + while(!feof($f)) + $data.=fread($f,4096); + fclose($f); + return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data); +} + +function _parsepng($file) +{ + //Extract info from a PNG file + $f=fopen($file,'rb'); + if(!$f) + $this->Error('Can\'t open image file: '.$file); + //Check signature + if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) + $this->Error('Not a PNG file: '.$file); + //Read header chunk + fread($f,4); + if(fread($f,4)!='IHDR') + $this->Error('Incorrect PNG file: '.$file); + $w=$this->_freadint($f); + $h=$this->_freadint($f); + $bpc=ord(fread($f,1)); + if($bpc>8) + $this->Error('16-bit depth not supported: '.$file); + $ct=ord(fread($f,1)); + if($ct==0) + $colspace='DeviceGray'; + elseif($ct==2) + $colspace='DeviceRGB'; + elseif($ct==3) + $colspace='Indexed'; + else + $colspace = ''; + //$this->Error('Alpha channel not supported: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Unknown compression method: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Unknown filter method: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Interlacing not supported: '.$file); + fread($f,4); + $parms='/DecodeParms <>'; + //Scan chunks looking for palette, transparency and image data + $pal=''; + $trns=''; + $data=''; + do + { + $n=$this->_freadint($f); + $type=fread($f,4); + if($type=='PLTE') + { + //Read palette + $pal=fread($f,$n); + fread($f,4); + } + elseif($type=='tRNS') + { + //Read transparency info + $t=fread($f,$n); + if($ct==0) + $trns=array(ord(substr($t,1,1))); + elseif($ct==2) + $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1))); + else + { + $pos=strpos($t,chr(0)); + if($pos!==false) + $trns=array($pos); + } + fread($f,4); + } + elseif($type=='IDAT') + { + //Read image data block + $data.=fread($f,$n); + fread($f,4); + } + elseif($type=='IEND') + break; + else + fread($f,$n+4); + } + while($n); + if($colspace=='Indexed' && empty($pal)) + $this->Error('Missing palette in '.$file); + fclose($f); + if($colspace!=''){ + return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data); + }else{ + return; + } +} + +function _freadint($f) +{ + //Read a 4-byte integer from file + $a=unpack('Ni',fread($f,4)); + return $a['i']; +} + +function _textstring($s) +{ + //Format a text string + return '('.$this->_escape($s).')'; +} + +function _escape($s) +{ + //Add \ before \, ( and ) + return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s))); +} + +function _putstream($s) +{ + $this->_out('stream'); + $this->_out($s); + $this->_out('endstream'); +} + +function _out($s) +{ + //Add a line to the document + if($this->state==2) + $this->pages[$this->page].=$s."\n"; + else + $this->buffer.=$s."\n"; +} +//End of class +} + +//Handle special IE contype request +if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype') +{ + Header('Pragma: public'); + header('Content-Type: application/pdf'); + exit; +} + +} +?> diff --git a/e107_plugins/pdf/images/pdf_16.png b/e107_plugins/pdf/images/pdf_16.png new file mode 100644 index 000000000..135c96507 Binary files /dev/null and b/e107_plugins/pdf/images/pdf_16.png differ diff --git a/e107_plugins/pdf/images/pdf_32.png b/e107_plugins/pdf/images/pdf_32.png new file mode 100644 index 000000000..a759933d3 Binary files /dev/null and b/e107_plugins/pdf/images/pdf_32.png differ diff --git a/e107_plugins/pdf/languages/English.php b/e107_plugins/pdf/languages/English.php new file mode 100644 index 000000000..60c8bf480 --- /dev/null +++ b/e107_plugins/pdf/languages/English.php @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/e107_plugins/pdf/pdf.php b/e107_plugins/pdf/pdf.php new file mode 100644 index 000000000..9971d8c4d --- /dev/null +++ b/e107_plugins/pdf/pdf.php @@ -0,0 +1,118 @@ +makePDF($text); + } + else + { + echo "file missing."; + exit; + } +} +else +{ + + if($source == 'news'){ + $con = new convert; + $sql->db_Select("news", "*", "news_id='".intval($parms)."'"); + $row = $sql->db_Fetch(); + $news_body = $tp->toHTML($row['news_body'], TRUE); + $news_extended = $tp->toHTML($row['news_extended'], TRUE); + if ($row['news_author'] == 0){ + $a_name = "e107"; + $category_name = "e107 welcome message"; + }else{ + $sql->db_Select("news_category", "category_id, category_name", "category_id='".intval($row['news_category'])."'"); + list($category_id, $category_name) = $sql->db_Fetch(); + $sql->db_Select("user", "user_id, user_name", "user_id='".intval($row['news_author'])."'"); + list($a_id, $a_name) = $sql->db_Fetch(); + } + $row['news_datestamp'] = $con->convert_date($row['news_datestamp'], "long"); + + $row['news_title'] = $tp -> toHTML($row['news_title'], TRUE, 'parse_sc'); + + //remove existing links from news title + $search = array(); + $replace = array(); + $search[0] = "/\(.*?)<\/a>/si"; + $replace[0] = '\\2'; + $search[1] = "/\(.*?)<\/a>/si"; + $replace[1] = '\\2'; + $search[2] = "/\(.*?)<\/a>/si"; + $replace[2] = '\\2'; + $search[3] = "/\(.*?)<\/a>/si"; + $replace[3] = '\\2'; + $search[4] = "/\(.*?)<\/a>/si"; + $replace[4] = '\\2'; + $row['news_title'] = preg_replace($search, $replace, $row['news_title']); + + $text = " + ".$row['news_title']."
        + ".$row['category_name']."
        + ".$a_name.", ".$row['news_datestamp']."
        +
        + ".$row['news_body']."
        + "; + + if ($row['news_extended'] != ""){ $text .= "

        ".$row['news_extended']; } + if ($row['news_source'] != ""){ $text .= "

        ".$row['news_source']; } + if ($row['news_url'] != ""){ $text .= "
        ".$row['news_url']; } + + $text = $text; //define text + $creator = SITENAME; //define creator + $author = $a_name; //define author + $title = $row['news_title']; //define title + $subject = $category_name; //define subject + $keywords = ""; //define keywords + + //define url and logo to use in the header of the pdf file + $url = SITEURL."news.php?item.".$row['news_id']; + + //always return an array with the following data: + $text = array($text, $creator, $author, $title, $subject, $keywords, $url); + $pdf->makePDF($text); + + } + +} + +?> \ No newline at end of file diff --git a/e107_plugins/pdf/pdf.sc b/e107_plugins/pdf/pdf.sc new file mode 100644 index 000000000..85676434b --- /dev/null +++ b/e107_plugins/pdf/pdf.sc @@ -0,0 +1,14 @@ +if (defined("ICONPRINTPDF") && file_exists(THEME."images/".ICONPRINTPDF)) +{ + $icon = THEME."images/".ICONPRINTPDF; +} +else +{ + $icon = e_PLUGIN."pdf/images/pdf_16.png"; +} +$parms = explode("^",$parm); + +//core //return "
        {$parms[0]}"; +//plugin //return "{$parms[0]}"; + +return " {$parms[0]}"; diff --git a/e107_plugins/pdf/plugin.php b/e107_plugins/pdf/plugin.php new file mode 100644 index 000000000..ef418c3c1 --- /dev/null +++ b/e107_plugins/pdf/plugin.php @@ -0,0 +1,69 @@ + \ No newline at end of file diff --git a/e107_plugins/pdf/ufpdf.php b/e107_plugins/pdf/ufpdf.php new file mode 100644 index 000000000..655bf9f9c --- /dev/null +++ b/e107_plugins/pdf/ufpdf.php @@ -0,0 +1,492 @@ + * +* License: GPL * +* * +* UFPDF is a modification of FPDF to support Unicode through UTF-8. * +* * +*******************************************************************************/ + +if(!class_exists('UFPDF')) +{ +define('UFPDF_VERSION','0.1'); + +include_once 'fpdf.php'; + +class UFPDF extends FPDF +{ + +/******************************************************************************* +* * +* Public methods * +* * +*******************************************************************************/ +function UFPDF($orientation='P',$unit='mm',$format='A4') +{ + FPDF::FPDF($orientation, $unit, $format); +} + +/* +function GetStringWidth($s) +{ + //Get width of a string in the current font + $s = (string)$s; + $codepoints=$this->utf8_to_codepoints($s); + $cw=&$this->CurrentFont['cw']; + $w=0; + foreach($codepoints as $cp) + $w+=$cw[$cp]; + return $w*$this->FontSize/1000; +} +*/ +function GetStringWidth($s) +{ + //Get width of a string in the current font + $s=(string)$s; + $cw=&$this->CurrentFont['cw']; + $w=0; + $l=strlen($s); + for($i=0;$i<$l;$i++) + $w+=$cw[$s{$i}]; + return $w*$this->FontSize/1000; +} +function AddFont($family,$style='',$file='') +{ + //Add a TrueType or Type1 font + $family=strtolower($family); + if($family=='arial') + $family='helvetica'; + $style=strtoupper($style); + if($style=='IB') + $style='BI'; + if(isset($this->fonts[$family.$style])) + $this->Error('Font already added: '.$family.' '.$style); + if($file=='') + $file=str_replace(' ','',$family).strtolower($style).'.php'; + if(defined('FPDF_FONTPATH')) + $file=FPDF_FONTPATH.$file; + include($file); + if(!isset($name)) + $this->Error('Could not include font definition file'); + $i=count($this->fonts)+1; + $this->fonts[$family.$style]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'file'=>$file,'ctg'=>$ctg); + if($file) + { + if($type=='TrueTypeUnicode') + $this->FontFiles[$file]=array('length1'=>$originalsize); + else + $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2); + } +} + +function Text($x,$y,$txt) +{ + //Output a string + $s=sprintf('BT %.2f %.2f Td %s Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escapetext($txt)); + if($this->underline and $txt!='') + $s.=' '.$this->_dounderline($x,$y,$this->GetStringWidth($txt),$txt); + if($this->ColorFlag) + $s='q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); +} + +function AcceptPageBreak() +{ + //Accept automatic page break or not + return $this->AutoPageBreak; +} + +function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='') +{ + //Output a cell + $k=$this->k; + if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak()) + { + //Automatic page break + $x=$this->x; + $ws=$this->ws; + if($ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation); + $this->x=$x; + if($ws>0) + { + $this->ws=$ws; + $this->_out(sprintf('%.3f Tw',$ws*$k)); + } + } + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $s=''; + if($fill==1 || $border==1) + { + if($fill==1) + $op=($border==1) ? 'B' : 'f'; + else + $op='S'; + $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); + } + if(is_string($border)) + { + $x=$this->x; + $y=$this->y; + if(is_int(strpos($border,'L'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); + if(is_int(strpos($border,'T'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); + if(is_int(strpos($border,'R'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + if(is_int(strpos($border,'B'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + } + if($txt!='') + { + $x=$this->x; + $y=$this->y; + $width = $this->GetStringWidth($txt); + if($align=='R') + $dx=$w-$this->cMargin-$width; + elseif($align=='C') + $dx=($w-$width)/2; + else + $dx=$this->cMargin; + if($this->ColorFlag) + $s.='q '.$this->TextColor.' '; + $txtstring=$this->_escapetext($txt); + $s.=sprintf('BT %.2f %.2f Td %s Tj ET',($x+$dx)*$k,($this->h-($y+.5*$h+.3*$this->FontSize))*$k,$txtstring); + if($this->underline) + $s.=' '.$this->_dounderline($x+$dx,$y+.5*$h+.3*$this->FontSize,$width,$txt); + if($this->ColorFlag) + $s.=' Q'; + if($link) + $this->Link($x+$dx,$y+.5*$h-.5*$this->FontSize,$width,$this->FontSize,$link); + } + + if($s) + $this->_out($s); + $this->lasth=$h; + if($ln>0) + { + //Go to next line + $this->y+=$h; + if($ln==1) + $this->x=$this->lMargin; + } + else + $this->x+=$w; +} +/******************************************************************************* +* * +* Protected methods * +* * +*******************************************************************************/ + +function _puttruetypeunicode($font) { + //Type0 Font + $this->_newobj(); + $this->_out('<_out('/Subtype /Type0'); + $this->_out('/BaseFont /'. $font['name'] .'-UCS'); + $this->_out('/Encoding /Identity-H'); + $this->_out('/DescendantFonts ['. ($this->n + 1) .' 0 R]'); + $this->_out('>>'); + $this->_out('endobj'); + + //CIDFont + $this->_newobj(); + $this->_out('<_out('/Subtype /CIDFontType2'); + $this->_out('/BaseFont /'. $font['name']); + $this->_out('/CIDSystemInfo <>'); + $this->_out('/FontDescriptor '. ($this->n + 1) .' 0 R'); + $c = 0; + foreach ($font['cw'] as $i => $w) { + $widths .= $i .' ['. $w.'] '; + } + $this->_out('/W ['. $widths .']'); + $this->_out('/CIDToGIDMap '. ($this->n + 2) .' 0 R'); + $this->_out('>>'); + $this->_out('endobj'); + + //Font descriptor + $this->_newobj(); + $this->_out('<_out('/FontName /'.$font['name']); + foreach ($font['desc'] as $k => $v) { + $s .= ' /'. $k .' '. $v; + } + if ($font['file']) { + $s .= ' /FontFile2 '. $this->FontFiles[$font['file']]['n'] .' 0 R'; + } + $this->_out($s); + $this->_out('>>'); + $this->_out('endobj'); + + //Embed CIDToGIDMap + $this->_newobj(); + if(defined('FPDF_FONTPATH')) + $file=FPDF_FONTPATH.$font['ctg']; + else + $file=$font['ctg']; + $size=filesize($file); + if(!$size) + $this->Error('Font file not found'); + $this->_out('<_out('/Filter /FlateDecode'); + $this->_out('>>'); + $f = fopen($file,'rb'); + $this->_putstream(fread($f,$size)); + fclose($f); + $this->_out('endobj'); +} + +function _dounderline($x,$y,$width,$txt) +{ + //Underline text + $up=$this->CurrentFont['up']; + $ut=$this->CurrentFont['ut']; + $w=$width+$this->ws*substr_count($txt,' '); + return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); +} + +function _textstring($s) +{ + //Convert to UTF-16BE + $s = $this->utf8_to_utf16be($s); + //Escape necessary characters + $trans = array(')' => '\\)', '(' => '\\(', '\\' => '\\\\'); + return '('.strtr($s, $trans).')'; +} + +function _escapetext($s) +{ + //Convert to UTF-16BE + $s = $this->utf8_to_utf16be($s, false); + //Escape necessary characters + $trans = array(')' => '\\)', '(' => '\\(', '\\' => '\\\\'); + return '('.strtr($s, $trans).')'; + //return strtr($s, $trans); +} + +function _putinfo() +{ + $this->_out('/Producer '.$this->_textstring('UFPDF '. UFPDF_VERSION)); + if(!empty($this->title)) + $this->_out('/Title '.$this->_textstring($this->title)); + if(!empty($this->subject)) + $this->_out('/Subject '.$this->_textstring($this->subject)); + if(!empty($this->author)) + $this->_out('/Author '.$this->_textstring($this->author)); + if(!empty($this->keywords)) + $this->_out('/Keywords '.$this->_textstring($this->keywords)); + if(!empty($this->creator)) + $this->_out('/Creator '.$this->_textstring($this->creator)); + $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis'))); +} + +// UTF-8 to UTF-16BE conversion. +// Correctly handles all illegal UTF-8 sequences. +function utf8_to_utf16be(&$txt, $bom = true) { + $l = strlen($txt); + $out = $bom ? "\xFE\xFF" : ''; + for ($i = 0; $i < $l; ++$i) { + $c = ord($txt{$i}); + // ASCII + if ($c < 0x80) { + //$out .= "\x00". $txt{$i}; + $out .= $txt{$i}; + } + // Lost continuation byte + else if ($c < 0xC0) { + $out .= "\xFF\xFD"; + continue; + } + // Multibyte sequence leading byte + else { + if ($c < 0xE0) { + $s = 2; + } + else if ($c < 0xF0) { + $s = 3; + } + else if ($c < 0xF8) { + $s = 4; + } + // 5/6 byte sequences not possible for Unicode. + else { + $out .= "\xFF\xFD"; + while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } + continue; + } + + $q = array($c); + // Fetch rest of sequence + while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } + + // Check length + if (count($q) != $s) { + $out .= "\xFF\xFD"; + continue; + } + + switch ($s) { + case 2: + $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); + // Overlong sequence + if ($cp < 0x80) { + $out .= "\xFF\xFD"; + } + else { + $out .= chr($cp >> 8); + $out .= chr($cp & 0xFF); + } + continue; + + case 3: + $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80); + // Overlong sequence + if ($cp < 0x800) { + $out .= "\xFF\xFD"; + } + // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder) + else if ($c > 0xD800 && $c < 0xDFFF) { + $out .= "\xFF\xFD"; + } + else { + $out .= chr($cp >> 8); + $out .= chr($cp & 0xFF); + } + continue; + + case 4: + $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80); + // Overlong sequence + if ($cp < 0x10000) { + $out .= "\xFF\xFD"; + } + // Outside of the Unicode range + else if ($cp >= 0x10FFFF) { + $out .= "\xFF\xFD"; + } + else { + // Use surrogates + $cp -= 0x10000; + $s1 = 0xD800 | ($cp >> 10); + $s2 = 0xDC00 | ($cp & 0x3FF); + + $out .= chr($s1 >> 8); + $out .= chr($s1 & 0xFF); + $out .= chr($s2 >> 8); + $out .= chr($s2 & 0xFF); + } + continue; + } + } + } + return $out; +} + +// UTF-8 to codepoint array conversion. +// Correctly handles all illegal UTF-8 sequences. +function utf8_to_codepoints(&$txt) { + $l = strlen($txt); + $out = array(); + for ($i = 0; $i < $l; ++$i) { + $c = ord($txt{$i}); + // ASCII + if ($c < 0x80) { + $out[] = ord($txt{$i}); + } + // Lost continuation byte + else if ($c < 0xC0) { + $out[] = 0xFFFD; + continue; + } + // Multibyte sequence leading byte + else { + if ($c < 0xE0) { + $s = 2; + } + else if ($c < 0xF0) { + $s = 3; + } + else if ($c < 0xF8) { + $s = 4; + } + // 5/6 byte sequences not possible for Unicode. + else { + $out[] = 0xFFFD; + while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } + continue; + } + + $q = array($c); + // Fetch rest of sequence + while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } + + // Check length + if (count($q) != $s) { + $out[] = 0xFFFD; + continue; + } + + switch ($s) { + case 2: + $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); + // Overlong sequence + if ($cp < 0x80) { + $out[] = 0xFFFD; + } + else { + $out[] = $cp; + } + continue; + + case 3: + $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80); + // Overlong sequence + if ($cp < 0x800) { + $out[] = 0xFFFD; + } + // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder) + else if ($c > 0xD800 && $c < 0xDFFF) { + $out[] = 0xFFFD; + } + else { + $out[] = $cp; + } + continue; + + case 4: + $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80); + // Overlong sequence + if ($cp < 0x10000) { + $out[] = 0xFFFD; + } + // Outside of the Unicode range + else if ($cp >= 0x10FFFF) { + $out[] = 0xFFFD; + } + else { + $out[] = $cp; + } + continue; + } + } + } + return $out; +} + +//End of class +} + +} +?> diff --git a/e107_plugins/pm/attachments/index.html b/e107_plugins/pm/attachments/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/pm/images/attach.png b/e107_plugins/pm/images/attach.png new file mode 100755 index 000000000..5e9cd1104 Binary files /dev/null and b/e107_plugins/pm/images/attach.png differ diff --git a/e107_plugins/pm/images/mail_block.png b/e107_plugins/pm/images/mail_block.png new file mode 100644 index 000000000..204d8eff0 Binary files /dev/null and b/e107_plugins/pm/images/mail_block.png differ diff --git a/e107_plugins/pm/images/mail_delete.png b/e107_plugins/pm/images/mail_delete.png new file mode 100644 index 000000000..18cd82058 Binary files /dev/null and b/e107_plugins/pm/images/mail_delete.png differ diff --git a/e107_plugins/pm/images/mail_get.png b/e107_plugins/pm/images/mail_get.png new file mode 100755 index 000000000..5dd90b38c Binary files /dev/null and b/e107_plugins/pm/images/mail_get.png differ diff --git a/e107_plugins/pm/images/mail_send.png b/e107_plugins/pm/images/mail_send.png new file mode 100755 index 000000000..1d0dafdc7 Binary files /dev/null and b/e107_plugins/pm/images/mail_send.png differ diff --git a/e107_plugins/pm/images/mail_unblock.png b/e107_plugins/pm/images/mail_unblock.png new file mode 100644 index 000000000..4747dc31f Binary files /dev/null and b/e107_plugins/pm/images/mail_unblock.png differ diff --git a/e107_plugins/pm/images/newpm.gif b/e107_plugins/pm/images/newpm.gif new file mode 100755 index 000000000..3453c1d73 Binary files /dev/null and b/e107_plugins/pm/images/newpm.gif differ diff --git a/e107_plugins/pm/images/pm.png b/e107_plugins/pm/images/pm.png new file mode 100755 index 000000000..567220f4d Binary files /dev/null and b/e107_plugins/pm/images/pm.png differ diff --git a/e107_plugins/pm/images/pvt_message_16.png b/e107_plugins/pm/images/pvt_message_16.png new file mode 100755 index 000000000..396dbb21c Binary files /dev/null and b/e107_plugins/pm/images/pvt_message_16.png differ diff --git a/e107_plugins/pm/images/pvt_message_32.png b/e107_plugins/pm/images/pvt_message_32.png new file mode 100755 index 000000000..0875d58f7 Binary files /dev/null and b/e107_plugins/pm/images/pvt_message_32.png differ diff --git a/e107_plugins/pm/images/read.png b/e107_plugins/pm/images/read.png new file mode 100755 index 000000000..61eea9ce4 Binary files /dev/null and b/e107_plugins/pm/images/read.png differ diff --git a/e107_plugins/pm/images/unread.png b/e107_plugins/pm/images/unread.png new file mode 100755 index 000000000..39dc4da69 Binary files /dev/null and b/e107_plugins/pm/images/unread.png differ diff --git a/e107_plugins/pm/index.html b/e107_plugins/pm/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_plugins/pm/languages/English.php b/e107_plugins/pm/languages/English.php new file mode 100755 index 000000000..a7eafddc7 --- /dev/null +++ b/e107_plugins/pm/languages/English.php @@ -0,0 +1,80 @@ + \ No newline at end of file diff --git a/e107_plugins/pm/languages/admin/English.php b/e107_plugins/pm/languages/admin/English.php new file mode 100755 index 000000000..b482b0340 --- /dev/null +++ b/e107_plugins/pm/languages/admin/English.php @@ -0,0 +1,63 @@ +
        If you need to convert messages from a previous version, please go to the main config page for this plugin and select the 'convert' link."); +define('ADLAN_PM_2', "Configure Private Messenger"); +define('ADLAN_PM_3', "PM settings not found, default values set"); +define('ADLAN_PM_4', "Options Updated"); +define('ADLAN_PM_5', "Limit for selected userclass already exists"); +define('ADLAN_PM_6', "Limit successfully added"); +define('ADLAN_PM_7', "Limit not added - unknown error"); +define('ADLAN_PM_8', "Limit status updated"); +define('ADLAN_PM_9', " - Limit successfully removed"); +define('ADLAN_PM_10', " - Limit not removed - unknown error"); +define('ADLAN_PM_11', " - Limit successfully updated"); +define('ADLAN_PM_12', "PM Options"); +define('ADLAN_PM_13', "PM Conversion"); +define('ADLAN_PM_14', "PM Limits"); +define('ADLAN_PM_15', "Add PM Limit"); +define('ADLAN_PM_16', "Plugin Title"); +define('ADLAN_PM_17', "Show new PM animation"); +define('ADLAN_PM_18', "Show user dropdown"); +define('ADLAN_PM_19', "READ message timeout"); +define('ADLAN_PM_20', "UNREAD message timeout"); +define('ADLAN_PM_21', "Popup notification on new PM"); +define('ADLAN_PM_22', "Popup delay timeout"); +define('ADLAN_PM_23', "Restrict PM use to"); +define('ADLAN_PM_24', "Number of PMs to show per page"); +define('ADLAN_PM_25', "Enable PM email notifications"); +define('ADLAN_PM_26', "Allow user to request read receipt email notifications"); +define('ADLAN_PM_27', "Allow posting of attachments"); +define('ADLAN_PM_28', "Maximum attachment size"); +define('ADLAN_PM_29', "Allow sending to all members"); +define('ADLAN_PM_30', "Allow sending to multiple recipients"); +define('ADLAN_PM_31', "Enable sending to userclass"); +define('ADLAN_PM_32', "Update Settings"); +define('ADLAN_PM_33', "Inactive (no limits)"); +define('ADLAN_PM_34', "PM counts"); +define('ADLAN_PM_35', "PM box sizes"); +define('ADLAN_PM_36', "Userclass"); +define('ADLAN_PM_37', "Count limits"); +define('ADLAN_PM_38', "Size limits (in KB)"); +define('ADLAN_PM_39', "Inbox :"); +define('ADLAN_PM_40', "Outbox :"); +define('ADLAN_PM_41', "There are currently no limits set."); +define('ADLAN_PM_42', "Update Limits"); +define('ADLAN_PM_43', "Add New Limit"); +define('ADLAN_PM_44', "seconds"); +define('ADLAN_PM_45', "Limit PM By: "); +define('ADLAN_PM_46', "PM Conversion"); +define('ADLAN_PM_47', "You do not appear to have any old messages from previous versions, it is safe to uninstall the old plugin"); +define('ADLAN_PM_48', "You have {OLDCOUNT} messages from the older version, please decide what you would like to do with these messages

        If converting messages, any message successfully converted will be removed from old system."); +define('ADLAN_PM_49', "Convert to new PM"); +define('ADLAN_PM_50', "Discard old messages"); +define('ADLAN_PM_51', "PM #{PMNUM} not converted"); +define('ADLAN_PM_52', "messages converted"); +define('ADLAN_PM_53', "No records found to convert."); + +define('ADLAN_PM_54', "Main settings"); +define('ADLAN_PM_55', "Limits"); +define('ADLAN_PM_56', "Conversion"); + +define('ADLAN_PM_57', "This plugin is a fully featured Private Messaging system."); +define('ADLAN_PM_58', "Private Messenger"); +?> diff --git a/e107_plugins/pm/plugin.php b/e107_plugins/pm/plugin.php new file mode 100755 index 000000000..c0182cb77 --- /dev/null +++ b/e107_plugins/pm/plugin.php @@ -0,0 +1,102 @@ +db_Delete("core", "e107_name = 'pm_prefs'"); + $sql->db_Delete("menus", "menu_name = 'private_msg_menu'"); + } +} + +?> diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php new file mode 100755 index 000000000..90fc6b867 --- /dev/null +++ b/e107_plugins/pm/pm.php @@ -0,0 +1,433 @@ +"); + +$qs = explode(".", e_QUERY); +$action = $qs[0]; +if($action == "") { $action = 'inbox'; } +$pm_prefs = $sysprefs->getArray("pm_prefs"); + +if(!check_class($pm_prefs['pm_class'])) +{ + require_once(HEADERF); + $ns->tablerender(LAN_PM, LAN_PM_12); + require_once(FOOTERF); + exit; +} + +$pm =& new private_message; +$message = ""; +$pm_prefs['perpage'] = intval($pm_prefs['perpage']); +if($pm_prefs['perpage'] == 0) +{ + $pm_prefs['perpage'] = 10; +} +//Auto-delete message, if timeout set in admin +$del_qry = array(); +$read_timeout = intval($pm_prefs['read_timeout']); +$unread_timeout = intval($pm_prefs['unread_timeout']); +if($read_timeout > 0) +{ + $timeout = time()-($read_timeout * 60); + $del_qry[] = "(pm_sent < {$timeout} AND pm_read > 0)"; +} +if($unread_timeout > 0) +{ + $timeout = time()-($unread_timeout * 60); + $del_qry[] = "(pm_sent < {$timeout} AND pm_read = 0)"; +} +if(count($del_qry) > 0) +{ + $qry = implode(" OR ", $del_qry); + if($sql->db_Select("private_msg", "pm_id", $qry)) + { + $delList = $sql->db_getList(); + foreach($delList as $p) + { + $pm->del($p['pm_id']); + } + } +} + +if("del" == $action || isset($_POST['pm_delete_selected'])) +{ + if(isset($_POST['pm_delete_selected'])) + { + foreach(array_keys($_POST['selected_pm']) as $id) + { + $message .= LAN_PM_24.": $id
        "; + $message .= $pm->del($id); + } + } + if('del' == $action) + { + $message = $pm->del(intval($qs[1])); + } + if($qs[2] != "") + { + $action = $qs[2]; + } + else + { + if(substr($_SERVER['HTTP_REFERER'], -5) == "inbox") + { + $action = "inbox"; + } + if(substr($_SERVER['HTTP_REFERER'], -6) == "outbox") + { + $action = "outbox"; + } + } + unset($qs); +} + +if('block' == $action) +{ + $message = $pm->block_add(intval($qs[1])); + $action = 'inbox'; +} + +if('unblock' == $action) +{ + $message = $pm->block_del(intval($qs[1])); + $action = 'inbox'; +} + +if("get" == $action) +{ + $pm->send_file(intval($qs[1]), intval($qs[2])); + exit; +} + +require_once(HEADERF); + +if(isset($_POST['postpm'])) +{ + $message = post_pm(); + $action = 'outbox'; +} + +if($message != "") +{ + $ns->tablerender("", $message); +} + +if("send" == $action) +{ + $ns->tablerender(LAN_PM, show_send(intval($qs[1]))); +} + +if("reply" == $action) +{ + $pmid = intval($qs[1]); + if($pm_info = $pm->pm_get($pmid)) + { + if($pm_info['pm_to'] != USERID) + { + $ns->tablerender(LAN_PM, LAN_PM_56); + } + else + { + $ns->tablerender(LAN_PM, show_send()); + } + } + else + { + $ns->tablerender(LAN_PM, LAN_PM_57); + } +} + +if("inbox" == $action) +{ + $ns->tablerender(LAN_PM." - ".LAN_PM_25, show_inbox(intval($qs[1])), "PM"); +} + +if("outbox" == $action) +{ + $ns->tablerender(LAN_PM." - ".LAN_PM_26, show_outbox(intval($qs[1])), "PM"); +} + +if("show" == $action) +{ + show_pm(intval($qs[1])); +} + +require_once(FOOTERF); +exit; + +function show_send($to_uid) +{ + global $tp, $pm_info; + $pm_outbox = pm_getInfo('outbox'); + if($to_uid) + { + $sql2 =& new db; + if($sql2->db_Select('user', 'user_name', "user_id = '".intval($to_uid)."'")) + { + $row=$sql2->db_Fetch(); + $pm_info['from_name'] = $row['user_name']; + } + } + + if($pm_outbox['outbox']['filled'] >= 100) + { + return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13); + } + require_once(e_PLUGIN."pm/pm_shortcodes.php"); + $tpl_file = THEME."pm_template.php"; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php"); + $enc = (check_class($pm_prefs['attach_class']) ? "enctype='multipart/form-data'" : ""); + $text = "
        +
        ". + $tp->parseTemplate($PM_SEND_PM, TRUE, $pm_shortcodes). + "
        "; + return $text; +} + +function show_inbox($start = 0) +{ + global $pm, $tp, $pm_shortcodes, $pm_info, $pm_blocks, $pmlist, $pm_start, $pm_prefs; + $pm_start = $start; + require_once(e_PLUGIN."pm/pm_shortcodes.php"); + $tpl_file = THEME."pm_template.php"; + include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php"); + $pm_blocks = $pm->block_get(); + $pmlist = $pm->pm_get_inbox(USERID, $pm_start, $pm_prefs['perpage']); + $txt = "
        "; + $txt .= $tp->parseTemplate($PM_INBOX_HEADER, true, $pm_shortcodes); + if($pmlist['total_messages']) + { + foreach($pmlist['messages'] as $rec) + { + if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = "[".LAN_PM_61."]"; } + $pm_info = $rec; + $txt .= $tp->parseTemplate($PM_INBOX_TABLE, true, $pm_shortcodes); + } + } + else + { + $txt .= $tp->parseTemplate($PM_INBOX_EMPTY, true, $pm_shortcodes); + } + $txt .= $tp->parseTemplate($PM_INBOX_FOOTER, true, $pm_shortcodes); + $txt .= "
        "; + return $txt; +} + +function show_outbox($start = 0) +{ + global $pm, $tp, $pm_shortcodes, $pm_info, $pm_start, $pm_prefs, $pmlist; + $pm_start = $start; + require_once(e_PLUGIN."pm/pm_shortcodes.php"); + $tpl_file = THEME."pm_template.php"; + include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php"); + $pmlist = $pm->pm_get_outbox(USERID, $pm_start, $pm_prefs['perpage']); + $txt = "
        "; + $txt .= $tp->parseTemplate($PM_OUTBOX_HEADER, true, $pm_shortcodes); + if($pmlist['total_messages']) + { + foreach($pmlist['messages'] as $rec) + { + if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = "[".LAN_PM_61."]"; } + $pm_info = $rec; + $txt .= $tp->parseTemplate($PM_OUTBOX_TABLE, true, $pm_shortcodes); + } + } + else + { + $txt .= $tp->parseTemplate($PM_OUTBOX_EMPTY, true, $pm_shortcodes); + } + $txt .= $tp->parseTemplate($PM_OUTBOX_FOOTER, true, $pm_shortcodes); + $txt .= "
        "; + return $txt; +} + +function show_pm($pmid) +{ + global $pm, $tp, $pm_shortcodes, $pm_info, $ns; + require_once(e_PLUGIN."pm/pm_shortcodes.php"); + $tpl_file = THEME."pm_template.php"; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php"); + $pm_info = $pm->pm_get($pmid); + if($pm_info['pm_to'] != USERID && $pm_info['pm_from'] != USERID) + { + $ns->tablerender(LAN_PM, LAN_PM_60); + require_once(FOOTERF); + exit; + } + if($pm_info['pm_read'] == 0 && $pm_info['pm_to'] == USERID) + { + $now = time(); + $pm_info['pm_read'] = $now; + $pm->pm_mark_read($pmid, $pm_info); + } + $txt .= $tp->parseTemplate($PM_SHOW, true, $pm_shortcodes); + $ns -> tablerender(LAN_PM, $txt); + if($pm_info['pm_from'] == USERID) { + $ns->tablerender(LAN_PM." - ".LAN_PM_26, show_outbox(intval($qs[1])), "PM"); + } + else + { + $ns->tablerender(LAN_PM." - ".LAN_PM_25, show_inbox(intval($qs[1])), "PM"); + } +} + +function post_pm() +{ + global $pm_prefs, $pm, $pref, $sql, $tp; + if(!check_class($pm_prefs['pm_class'])) + { + return LAN_PM_12; + } + + $pm_info = pm_getInfo('outbox'); + if($pm_info['outbox']['total'] != $_POST['numsent']) + { + return LAN_PM_14; + } + + if(isset($_POST['user'])) + { + $_POST['pm_to'] = $_POST['user']; + } + if(isset($_POST['pm_to'])) + { + $msg = ""; + if(isset($_POST['to_userclass']) && $_POST['to_userclass']) + { + if(!$pm_prefs['allow_userclass']) + { + return LAN_PM_15; + } + elseif(!check_class($_POST['pm_userclass']) && !ADMIN) + { + return LAN_PM_16; + } + } + else + { + $to_array = explode("\n", trim($_POST['pm_to'])); + foreach($to_array as $k => $v) + { + $to_array[$k] = trim($v); + } + $to_array = array_unique($to_array); + if(count($to_array) == 1) + { + $_POST['pm_to'] = $to_array[0]; + } + if(check_class($pm_prefs['multi_class']) && count($to_array) > 1) + { + foreach($to_array as $to) + { + if($to_info = $pm->pm_getuid($to)) + { + if(!$sql->db_Update("private_msg_block","pm_block_count=pm_block_count+1 WHERE pm_block_from = '".USERID."' AND pm_block_to = '".$tp -> toDB($to)."'")) + { + $_POST['to_array'][] = $to_info; + } + } + } + } + else + { + if($to_info = $pm->pm_getuid($_POST['pm_to'])) + { + $_POST['to_info'] = $to_info; + } + else + { + return LAN_PM_17; + } + + if($sql->db_Update("private_msg_block","pm_block_count=pm_block_count+1 WHERE pm_block_from = '".USERID."' AND pm_block_to = '{$to_info['user_id']}'")) + { + return LAN_PM_18.$to_info['user_name']; + } + } + } + + if(isset($_POST['receipt'])) + { + if(!check_class($pm_prefs['receipt_class'])) + { + unset($_POST['receipt']); + } + } + $totalsize = strlen($_POST['pm_message']); + $maxsize = intval($pm_prefs['attach_size']) * 1024; + foreach(array_keys($_FILES['file_userfile']['size']) as $fid) + { + if($maxsize > 0 && $_FILES['file_userfile']['size'][$fid] > $maxsize) + { + $msg .= str_replace("{FILENAME}", $_FILES['file_userfile']['name'][$fid], LAN_PM_62)."
        "; + $_FILES['file_userfile']['size'][$fid] = 0; + } + $totalsize += $_FILES['file_userfile']['size'][$fid]; + } + + if(intval($pref['pm_limit']) > 0) + { + if($pref['pm_limit'] == '1') + { + if($pm_info['outbox']['total'] == $pm_info['outbox']['limit']) + { + return LAN_PM_19; + } + } + else + { + if($pm_info['outbox']['size'] + $totalsize > $pm_info['outbox']['limit']) + { + return LAN_PM_21; + } + } + } + + if($_FILES['file_userfile']['name'][0]) + { + if(check_class($pm_prefs['attach_class'])) + { + require_once(e_HANDLER."upload_handler.php"); + $randnum = rand(1000, 9999); + $_POST['uploaded'] = file_upload(e_PLUGIN."pm/attachments", "attachment", $randnum."_"); + if($_POST['uploaded'] == FALSE) + { + unset($_POST['uploaded']); + $msg .= LAN_PM_22."
        "; + } + } + else + { + $msg .= LAN_PM_23."
        "; + unset($_POST['uploaded']); + } + } + $_POST['from_id'] = USERID; + return $msg.$pm->add($_POST); + } +} +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php new file mode 100755 index 000000000..310091f04 --- /dev/null +++ b/e107_plugins/pm/pm_class.php @@ -0,0 +1,428 @@ +del($pm_id); + } + else + { + $sql->db_Select_gen("UPDATE #private_msg SET pm_read = {$now} WHERE pm_id=".intval($pm_id)); + if(strpos($pm_info['pm_option'], "+rr") !== FALSE) + { + $this->pm_send_receipt($pm_info); + } + } + } + + function pm_get($pmid) + { + global $sql; + $qry = " + SELECT pm.*, ut.user_image AS sent_image, ut.user_name AS sent_name, uf.user_image AS from_image, uf.user_name AS from_name, uf.user_email as from_email, ut.user_email as to_email FROM #private_msg AS pm + LEFT JOIN #user AS ut ON ut.user_id = pm.pm_to + LEFT JOIN #user AS uf ON uf.user_id = pm.pm_from + WHERE pm.pm_id='".intval($pmid)."' + "; + if ($sql->db_Select_gen($qry)) + { + $row = $sql->db_Fetch(); + return $row; + } + return FALSE; + } + + function add($vars) + { + global $pm_prefs, $tp, $sql; + $vars['options'] = ""; + $pmsize = 0; + $attachlist = ""; + $pm_options = ""; + if(isset($vars['receipt']) && $vars['receipt']) {$pm_options .= "+rr+"; } + if(isset($vars['uploaded'])) + { + foreach($vars['uploaded'] as $u) + { + if(!isset($u['error'])) + { + $pmsize += $u['size']; + $a_list[] = $u['name']; + } + } + $attachlist = implode(chr(0), $a_list); + } + $pmsize += strlen($vars['pm_message']); + + $pm_subject = $tp->toDB($vars['pm_subject']); + $pm_message = $tp->toDB($vars['pm_message']); + $sendtime = time(); + if(isset($vars['to_userclass']) || isset($vars['to_array'])) + { + if(isset($vars['to_userclass'])) + { + require_once(e_HANDLER."userclass_class.php"); + $toclass = r_userclass_name($vars['pm_userclass']); + $tolist = $this->get_users_inclass($vars['pm_userclass']); + $ret .= LAN_PM_38.": {$vars['to_userclass']}
        "; + $class = TRUE; + } + else + { + $tolist = $vars['to_array']; + $class = FALSE; + } + foreach($tolist as $u) + { + set_time_limit(30); + if($pmid = $sql->db_Insert("private_msg", "0, '".intval($vars['from_id'])."', '".$tp -> toDB($u['user_id'])."', '".intval($sendtime)."', '0', '{$pm_subject}', '{$pm_message}', '1', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'")) + { + if($class == FALSE) + { + $toclass .= $u['user_name'].", "; + } + if(check_class($pm_prefs['notify_class'], $u['user_class'])) + { + $vars['to_info'] = $u; + $this->pm_send_notify($u['user_id'], $vars, $pmid, count($a_list)); + } + } + else + { + $ret .= LAN_PM_39.": {$u['user_name']}
        "; + } + } + if(!$pmid = $sql->db_Insert("private_msg", "0, '".intval($vars['from_id'])."', '".$tp -> toDB($toclass)."', '".intval($sendtime)."', '1', '{$pm_subject}', '{$pm_message}', '0', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'")) + { + $ret .= LAN_PM_41."
        "; + } + + } + else + { + if($pmid = $sql->db_Insert("private_msg", "0, '".intval($vars['from_id'])."', '".$tp -> toDB($vars['to_info']['user_id'])."', '".intval($sendtime)."', '0', '{$pm_subject}', '{$pm_message}', '0', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'")) + { + if(check_class($pm_prefs['notify_class'], $vars['to_info']['user_class'])) + { + set_time_limit(30); + $this->pm_send_notify($vars['to_info']['user_id'], $vars, $pmid, count($a_list)); + } + $ret .= LAN_PM_40.": {$vars['to_info']['user_name']}
        "; + } + } + return $ret; + } + + function del($pmid) + { + global $sql; + $ret = ""; + $del_pm = FALSE; + $newvals = ""; + if($sql->db_Select("private_msg", "*", "pm_id = ".intval($pmid)." AND (pm_from = ".USERID." OR pm_to = ".USERID.")")) + { + $row = $sql->db_Fetch(); + if($row['pm_to'] == USERID) + { + $newvals = "pm_read_del = 1"; + $ret .= LAN_PM_42."
        "; + if($row['pm_sent_del'] == 1) { $del_pm = TRUE; } + } + if($row['pm_from'] == USERID) + { + if($newvals != "") { $del_pm = TRUE; } + $newvals = "pm_sent_del = 1"; + $ret .= LAN_PM_43."
        "; + if($row['pm_read_del'] == 1) { $del_pm = TRUE; } + } + + if(count($newvals) == 2 || $del_pm == TRUE) + { + // Delete any attachments and remove PM from db + $attachments = explode(chr(0), $row['pm_attachments']); + foreach($attachments as $a) + { + $filename = getcwd()."/attachments/{$a}"; + unlink($filename); + } + $sql->db_Delete("private_msg", "pm_id = ".intval($pmid)); + } + else + { + $sql->db_Update("private_msg", $newvals." WHERE pm_id = ".intval($pmid)); + } + return $ret; + } + } + + function pm_send_notify($uid, $pminfo, $pmid, $attach_count = 0) + { + require_once(e_HANDLER."mail.php"); + global $PLUGINS_DIRECTORY; + $subject = LAN_PM_100.SITENAME; + $pmlink = SITEURL.$PLUGINS_DIRECTORY."pm/pm.php?show.{$pmid}"; + $txt = LAN_PM_101.SITENAME."\n\n"; + $txt .= LAN_PM_102.USERNAME."\n"; + $txt .= LAN_PM_103.$pminfo['pm_subject']."\n"; + if($attch_count > 0) + { + $txt .= LAN_PM_104.$attach_count."\n"; + } + $txt .= LAN_PM_105."\n".$pmlink."\n"; + sendemail($pminfo['to_info']['user_email'], $subject, $txt, $pminfo['to_info']['user_name']); + } + + function pm_send_receipt($pminfo) + { + require_once(e_HANDLER."mail.php"); + global $PLUGINS_DIRECTORY; + $subject = LAN_PM_106.$pminfo['sent_name']; + $pmlink = SITEURL.$PLUGINS_DIRECTORY."pm/pm.php?show.{$pminfo['pm_id']}"; + $txt = str_replace("{UNAME}", $pminfo['sent_name'], LAN_PM_107).date('l F dS Y h:i:s A')."\n\n"; + $txt .= LAN_PM_108.date('l F dS Y h:i:s A', $pminfo['pm_sent'])."\n"; + $txt .= LAN_PM_103.$pminfo['pm_subject']."\n"; + $txt .= LAN_PM_105."\n".$pmlink."\n"; + sendemail($pminfo['from_email'], $subject, $txt, $pminfo['from_name']); + } + + function block_get($to = USERID) + { + global $sql, $tp; + $ret = array(); + if($sql->db_Select("private_msg_block", "pm_block_from", "pm_block_to = '".$tp -> toDB($to)."'")) + { + while($row = $sql->db_Fetch()) + { + $ret[] = $row['pm_block_from']; + } + } + return $ret; + } + + function block_add($from, $to = USERID) + { + global $sql, $tp; + if($sql->db_Select("user", "user_name", "user_id = '".intval($from)."'")) + { + $uinfo = $sql->db_Fetch(); + if(!$sql->db_Count("private_msg_block", "(*)", "WHERE pm_block_from = '".intval($from)."' AND pm_block_to = '".$tp -> toDB($to)."'")) + { + if($sql->db_Insert("private_msg_block", "0, '".intval($from)."', '".$tp -> toDB($to)."', '".time()."', '0'")) + { + return str_replace('{UNAME}', $uinfo['user_name'], LAN_PM_47); + } + else + { + return LAN_PM_48; + } + } + else + { + return str_replace('{UNAME}', $uinfo['user_name'], LAN_PM_49); + } + } + else + { + return LAN_PM_17; + } + } + + function block_del($from, $to = USERID) + { + global $sql; + if($sql->db_Select("user", "user_name", "user_id = '".intval($from)."'")) + { + $uinfo = $sql->db_Fetch(); + if($sql->db_Select("private_msg_block", "pm_block_id", "pm_block_from = '".intval($from)."' AND pm_block_to = '".intval($to)."'")) + { + $row = $sql->db_Fetch(); + if($sql->db_Delete("private_msg_block", "pm_block_id = '".intval($row['pm_block_id'])."'")) + { + return str_replace("{UNAME}", $uinfo['user_name'], LAN_PM_44); + } + else + { + return LAN_PM_45; + } + } + else + { + return str_replace("{UNAME}", $uinfo['user_name'], LAN_PM_46); + } + } + else + { + return LAN_PM_17; + } + } + + function pm_getuid($var) + { + global $sql, $tp; + + if($sql->db_Select("user", "user_id, user_name, user_class, user_email", "user_name LIKE '".$sql -> escape(trim($var), TRUE)."'")) + { + $row = $sql->db_Fetch(); + return $row; + } + return FALSE; + } + + function get_users_inclass($class) + { + global $sql, $tp; + if($class == e_UC_MEMBER) + { + $qry = "SELECT user_id, user_name, user_email, user_class FROM #user WHERE 1"; + } + elseif($class == e_UC_ADMIN) + { + $qry = "SELECT user_id, user_name, user_email, user_class FROM #user WHERE user_admin = 1"; + } + elseif($class) + { + $regex = "(^|,)(".$tp -> toDB($class).")(,|$)"; + $qry = "SELECT user_id, user_name, user_email, user_class FROM #user WHERE user_class REGEXP '{$regex}'"; + } + if($sql->db_Select_gen($qry)) + { + $ret = $sql->db_getList(); + return $ret; + } + return FALSE; + } + + function pm_get_inbox($uid = USERID, $from = 0, $limit = 10) + { + global $sql; + $ret = ""; + if($total_messages = $sql->db_Count("private_msg", "(*)", "WHERE pm_to='{$uid}' AND pm_read_del=0")) + { + $qry = " + SELECT pm.*, u.user_image, u.user_name FROM #private_msg AS pm + LEFT JOIN #user AS u ON u.user_id = pm.pm_from + WHERE pm.pm_to='{$uid}' AND pm.pm_read_del=0 + ORDER BY pm.pm_sent DESC + LIMIT ".intval($from).", ".intval($limit)." + "; + if($sql->db_Select_gen($qry)) + { + $ret['messages'] = $sql->db_getList(); + $ret['total_messages'] = $total_messages; + } + return $ret; + } + } + + function pm_get_outbox($uid = USERID, $from = 0, $limit = 10) + { + global $sql; + if(intval($limit < 1)) { $limit = 10; } + if($total_messages = $sql->db_Count("private_msg", "(*)", "WHERE pm_from='{$uid}' AND pm_sent_del=0")) + { + $qry = " + SELECT pm.*, u.user_image, u.user_name FROM #private_msg AS pm + LEFT JOIN #user AS u ON u.user_id = pm.pm_to + WHERE pm.pm_from='{$uid}' AND pm.pm_sent_del=0 + ORDER BY pm.pm_sent DESC + LIMIT ".intval($from).", ".intval($limit)." + "; + if($sql->db_Select_gen($qry)) + { + $ret['messages'] = $sql->db_getList(); + $ret['total_messages'] = $total_messages; + } + } + return $ret; + } + + function send_file($pmid, $filenum) + { + global $pref; + $pm_info = $this->pm_get($pmid); + $attachments = explode(chr(0), $pm_info['pm_attachments']); + if(!isset($attachments[$filenum])) + { + return FALSE; + } + $fname = $attachments[$filenum]; + list($timestamp, $fromid, $rand, $file) = explode("_", $fname, 4); + $filename = getcwd()."/attachments/{$fname}"; + + if($fromid != $pm_info['pm_from']) + { + return FALSE; + } + if(!is_file($filename)) + { + return FALSE; + } + @set_time_limit(10 * 60); + @e107_ini_set("max_execution_time", 10 * 60); + while (@ob_end_clean()); // kill all output buffering else it eats server resources + if (connection_status() == 0) + { + if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { + $file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1); + } + if (isset($_SERVER['HTTP_RANGE'])) + { + $seek = intval(substr($_SERVER['HTTP_RANGE'] , strlen('bytes='))); + } + $bufsize = 2048; + ignore_user_abort(true); + $data_len = filesize($filename); + if ($seek > ($data_len - 1)) $seek = 0; + $res =& fopen($filename, 'rb'); + if ($seek) + { + fseek($res , $seek); + } + $data_len -= $seek; + header("Expires: 0"); + header("Cache-Control: max-age=30" ); + header("Content-Type: application/force-download"); + header("Content-Disposition: attachment; filename={$file}"); + header("Content-Length: {$data_len}"); + header("Pragma: public"); + if ($seek) + { + header("Accept-Ranges: bytes"); + header("HTTP/1.0 206 Partial Content"); + header("status: 206 Partial Content"); + header("Content-Range: bytes {$seek}-".($data_len - 1)."/{$data_len}"); + } + while (!connection_aborted() && $data_len > 0) + { + echo fread($res , $bufsize); + $data_len -= $bufsize; + } + fclose($res); + } + } +} +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_conf.php b/e107_plugins/pm/pm_conf.php new file mode 100755 index 000000000..b2813c6ae --- /dev/null +++ b/e107_plugins/pm/pm_conf.php @@ -0,0 +1,364 @@ +getArray("pm_prefs"); + +//pm_prefs record not found in core table, set to defaults and create record +if(!is_array($pm_prefs)) +{ + require_once(e_PLUGIN."pm/pm_default.php"); + $pm_prefs = pm_set_default_prefs(); + $sysprefs->setArray('pm_prefs'); + $message = ADLAN_PM_3; +} + +$lan_file = e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php"; +include_once(is_readable($lan_file) ? $lan_file : e_PLUGIN."pm/languages/admin/English.php"); + +if (isset($_POST['update_prefs'])) +{ + foreach($_POST['option'] as $k => $v) + { + $pm_prefs[$k] = $v; + } + $sysprefs->setArray('pm_prefs'); + $message = ADLAN_PM_4; +} + +if(isset($_POST['addlimit'])) +{ + if($sql->db_Select('generic','gen_id',"gen_type = 'pm_limit' AND gen_datestamp = {$_POST['newlimit_class']}")) + { + $message = ADLAN_PM_5; + } + else + { + if($sql->db_Insert('generic',"0, 'pm_limit', '{$_POST['newlimit_class']}', '{$_POST['new_inbox_count']}', '{$_POST['new_outbox_count']}', '{$_POST['new_inbox_size']}', '{$_POST['new_outbox_size']}'")) + { + $message = ADLAN_PM_6; + } + else + { + $message = ADLAN_PM_7; + } + } +} + +if(isset($_POST['updatelimits'])) +{ + if($pref['pm_limits'] != $_POST['pm_limits']) + { + $pref['pm_limits'] = $_POST['pm_limits']; + save_prefs(); + $message .= ADLAN_PM_8."
        "; + } + foreach(array_keys($_POST['inbox_count']) as $id) + { + if($_POST['inbox_count'][$id] == "" && $_POST['outbox_count'][$id] == "" && $_POST['inbox_size'][$id] == "" && $_POST['outbox_size'][$id] == "") + { + //All entries empty - Remove record + if($sql->db_Delete('generic',"gen_id = {$id}")) + { + $message .= $id.ADLAN_PM_9."
        "; + } + else + { + $message .= $id.ADLAN_PM_10."
        "; + } + } + else + { + $sql->db_Update('generic',"gen_user_id = '{$_POST['inbox_count'][$id]}', gen_ip = '{$_POST['outbox_count'][$id]}', gen_intdata = '{$_POST['inbox_size'][$id]}', gen_chardata = '{$_POST['outbox_size'][$id]}' WHERE gen_id = {$id}"); + $message .= $id.ADLAN_PM_11."
        "; + } + } +} + +if(isset($message)) +{ + $ns->tablerender("", $message); +} + + +if($action == "main") +{ + $ns->tablerender(ADLAN_PM_12, show_options()); +} + +if($action == "limits") +{ + $ns->tablerender(ADLAN_PM_14, show_limits()); + $ns->tablerender(ADLAN_PM_15, add_limit()); +} + +require_once(e_ADMIN."footer.php"); + +function yes_no($fname) +{ + global $pm_prefs; + $ret = + form::form_radio("option[{$fname}]", "1", ($pm_prefs[$fname] ? "1" : "0"), "", "").LAN_YES." ". + form::form_radio("option[{$fname}]", "0", ($pm_prefs[$fname] ? "0" : "1"), "", "").LAN_NO; + return $ret; +} + + +function show_options() +{ + global $pm_prefs; + $txt = " +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".ADLAN_PM_16."".form::form_text('option[title]', 20, $pm_prefs['title'], 50)."
        ".ADLAN_PM_17."".yes_no('animate')."
        ".ADLAN_PM_18."".yes_no('dropdown')."
        ".ADLAN_PM_19."".form::form_text('option[read_timeout]', 5, $pm_prefs['read_timeout'], 5)."
        ".ADLAN_PM_20."".form::form_text('option[unread_timeout]', 5, $pm_prefs['unread_timeout'], 5)."
        ".ADLAN_PM_21."".yes_no('popup')."
        ".ADLAN_PM_22."".form::form_text('option[popup_delay]', 5, $pm_prefs['popup_delay'], 5)." ".ADLAN_PM_44."
        ".ADLAN_PM_23."".r_userclass('option[pm_class]', $pm_prefs['pm_class'], 'off', 'members, admin, classes')."
        ".ADLAN_PM_24."".form::form_text('option[perpage]', 5, $pm_prefs['perpage'], 5)."
        ".ADLAN_PM_25."".r_userclass('option[notify_class]', $pm_prefs['notify_class'], 'off', 'nobody, members, admin, classes')."
        ".ADLAN_PM_26."".r_userclass('option[receipt_class]', $pm_prefs['receipt_class'], 'off', 'nobody, members, admin, classes')."
        ".ADLAN_PM_27."".r_userclass('option[attach_class]', $pm_prefs['attach_class'], 'off', 'nobody, members, admin, classes')."
        ".ADLAN_PM_28."".form::form_text('option[attach_size]', 8, $pm_prefs['attach_size'], 8)." kB
        ".ADLAN_PM_29."".r_userclass('option[sendall_class]', $pm_prefs['sendall_class'], 'off', 'nobody, members, admin, classes')."
        ".ADLAN_PM_30."".r_userclass('option[multi_class]', $pm_prefs['multi_class'], 'off', 'nobody, members, admin, classes')."
        ".ADLAN_PM_31."".yes_no('allow_userclass')."
        +
        + "; + return $txt; +} + +function show_limits() +{ + global $sql, $pref; + if($sql->db_Select('userclass_classes','userclass_id, userclass_name')) + { + $classList = $sql->db_getList(); + } + if($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'")) + { + while($row = $sql->db_Fetch()) + { + $limitList[$row['limit_classnum']] = $row; + } + } + $txt = " +
        + + + + + + + + + + "; + + if (isset($limitList)) { + foreach($limitList as $row) + { + $txt .= " + + + + + + "; + } + } else { + $txt .= " + + + + "; + } + + $txt .= " + + + + "; + + $txt .= "
        ".ADLAN_PM_45." + \n"; + + $txt .= " +
        ".ADLAN_PM_36."".ADLAN_PM_37."".ADLAN_PM_38."
        ".r_userclass_name($row['limit_classnum'])." + ".ADLAN_PM_39." + ".ADLAN_PM_40." + + ".ADLAN_PM_39." + ".ADLAN_PM_39." +
        ".ADLAN_PM_41."
        + +
        "; + return $txt; +} + +function add_limit() +{ + global $sql, $pref; + if($sql->db_Select('userclass_classes','userclass_id, userclass_name')) + { + $classList = $sql->db_getList(); + } + if($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'")) + { + while($row = $sql->db_Fetch()) + { + $limitList[$row['limit_classnum']] = $row; + } + } + $txt = " +
        + + + + + + + "; + + $txt .= " + + + + + + + + + "; + + $txt .= "
        ".ADLAN_PM_36."".ADLAN_PM_37."".ADLAN_PM_38."
        ".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")." + ".ADLAN_PM_39." + ".ADLAN_PM_40." + + ".ADLAN_PM_39." + ".ADLAN_PM_40." +
        + +
        "; + return $txt; +} + +function show_menu($action) +{ + global $sql; + if ($action == "") { $action = "main"; } + $var['main']['text'] = ADLAN_PM_54; + $var['main']['link'] = e_SELF; + $var['limits']['text'] = ADLAN_PM_55; + $var['limits']['link'] = e_SELF."?limits"; + show_admin_menu(ADLAN_PM_12, $action, $var); +} + +function pm_conf_adminmenu() { + global $action; + show_menu($action); +} + +?> diff --git a/e107_plugins/pm/pm_default.php b/e107_plugins/pm/pm_default.php new file mode 100755 index 000000000..58bdadeaf --- /dev/null +++ b/e107_plugins/pm/pm_default.php @@ -0,0 +1,25 @@ + 'PMLAN_PM', + 'animate' => '1', + 'dropdown' => '0', + 'read_timeout' => '0', + 'unread_timeout' => '0', + 'popup' => '0', + 'popup_delay' => '', + 'pm_class' => e_UC_MEMBER, + 'notify_class' => e_UC_ADMIN, + 'receipt_class' => e_UC_MEMBER, + 'attach_class' => e_UC_ADMIN, + 'attach_size' => 500, + 'sendall_class' => e_UC_ADMIN, + 'multi_class' => e_UC_ADMIN, + 'allow_userclass' => '1' + ); + return $ret; +} +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_func.php b/e107_plugins/pm/pm_func.php new file mode 100755 index 000000000..931128e25 --- /dev/null +++ b/e107_plugins/pm/pm_func.php @@ -0,0 +1,97 @@ +db_Select_gen($qry); + $pm_info[$which] = $sql->db_Fetch(); + if($which == 'inbox' && $pm_prefs['animate'] == 1 || $pm_prefs['popup'] == 1) + { + if($new = $sql->db_Count("private_msg", "(*)", "WHERE pm_sent > '.USERLV.' AND pm_read = 0 AND pm_to = '".USERID."' AND pm_read_del != 1")) + { + $pm_info['inbox']['new'] = $new; + } + } + } + if(!isset($pm_info[$which]['limit'])) + { + if($pref['pm_limits'] > 0) + { + if($pref['pm_limits'] == 1) + { + $qry = "SELECT MAX(gen_user_id) AS inbox_limit, MAX(gen_ip) as outbox_limit FROM #generic WHERE gen_type='pm_limit' AND gen_datestamp IN (".USERCLASS_LIST.")"; + } + else + { + $qry = "SELECT MAX(gen_intdata) AS inbox_limit, MAX(gen_chardata) as outbox_limit FROM #generic WHERE gen_type='pm_limit' AND gen_datestamp IN (".USERCLASS_LIST.")"; + } + if($sql->db_Select_gen($qry)) + { + $row = $sql->db_Fetch(); + $pm_info['inbox']['limit'] = $row['inbox_limit']; + $pm_info['outbox']['limit'] = $row['outbox_limit']; + } + $pm_info['inbox']['limit_val'] = ($pref['pm_limits'] == 1 ? $pm_info['inbox']['total'] : $pm_info['inbox']['size']); + if(!$pm_info['inbox']['limit'] || !$pm_info['inbox']['limit_val']) + { + $pm_info['inbox']['filled'] = 0; + } + else + { + $pm_info['inbox']['filled'] = number_format($pm_info['inbox']['limit_val']/$pm_info['inbox']['limit'] * 100, 2); + } + $pm_info['outbox']['limit_val'] = ($pref['pm_limits'] == 1 ? $pm_info['outbox']['total'] : $pm_info['outbox']['size']); + if(!$pm_info['outbox']['limit'] || !$pm_info['outbox']['limit_val']) + { + $pm_info['outbox']['filled'] = 0; + } + else + { + $pm_info['outbox']['filled'] = number_format($pm_info['outbox']['limit_val']/$pm_info['outbox']['limit'] * 100, 2); + } + } + else + { + $pm_info['inbox']['limit'] = ""; + $pm_info['outbox']['limit'] = ""; + $pm_info['inbox']['filled'] = ""; + $pm_info['outbox']['filled'] = ""; + } + } + return $pm_info; +} +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_notes.txt b/e107_plugins/pm/pm_notes.txt new file mode 100755 index 000000000..9f4451b4a --- /dev/null +++ b/e107_plugins/pm/pm_notes.txt @@ -0,0 +1,17 @@ +pm_id +pm_from +pm_to +pm_sent +pm_read +pm_subject +pm_text +pm_sent_del +pm_read_del +pm_attachments +pm_options + +pm_block_id +pm_block_from +pm_block_to +pm_block_datestamp +pm_block_count \ No newline at end of file diff --git a/e107_plugins/pm/pm_shortcodes.php b/e107_plugins/pm/pm_shortcodes.php new file mode 100755 index 000000000..49e618752 --- /dev/null +++ b/e107_plugins/pm/pm_shortcodes.php @@ -0,0 +1,371 @@ + e_sc -> parse_scbatch(__FILE__); + +/* +SC_BEGIN FORM_TOUSER +global $pm_prefs, $pm_info; +if($pm_info['from_name']) +{ + return "{$pm_info['from_name']}"; +} +require_once(e_HANDLER."user_select_class.php"); +$us = new user_select; +$type = ($pm_prefs['dropdown'] == TRUE ? 'list' : 'popup'); +if(check_class($pm_prefs['multi_class'])) +{ + $ret = $us->select_form($type, 'textarea.pm_to'); +} +else +{ + $ret = $us->select_form($type, 'pm_to'); +} +return $ret; +SC_END + +SC_BEGIN FORM_TOCLASS +global $pm_prefs, $pm_info; +if($pm_info['from_name']) +{ + return ""; +} +if($pm_prefs['allow_userclass']) +{ + $ret = "".LAN_PM_4." "; + require_once(e_HANDLER."userclass_class.php"); + $args = (ADMIN ? "admin, classes" : "matchclass"); + if(check_class($pm_prefs['sendall_class'])) + { + $args = "member, ".$args; + } + $ret .= r_userclass("pm_userclass", "", "off", $args); +} +return $ret; +SC_END + +SC_BEGIN FORM_SUBJECT +global $pm_info; +$value = ""; +if($pm_info['pm_subject']) +{ + $value = $pm_info['pm_subject']; + if(substr($value, 0, strlen(LAN_PM_58)) != LAN_PM_58) + { + $value = LAN_PM_58.$value; + } +} +return ""; +SC_END + +SC_BEGIN FORM_MESSAGE +global $pm_info; +$value = ""; +if($pm_info['pm_text']) +{ + if(isset($_POST['quote'])) + { + $t = time(); + $value = "[quote{$t}={$pm_info['from_name']}]\n{$pm_info['pm_text']}\n[/quote{$t}]\n\n"; + } +} +return ""; +SC_END + +SC_BEGIN EMOTES +require_once(e_HANDLER."emote.php"); +return r_emote(); +SC_END + +SC_BEGIN PM_POST_BUTTON +return ""; +SC_END + +SC_BEGIN PM_PREVIEW_BUTTON +return ""; +SC_END + +SC_BEGIN ATTACHMENT +global $pm_prefs; +if (check_class($pm_prefs['attach_class'])) +{ + $ret = " +
        + + + +
        + + "; + return $ret; +} +return ""; +SC_END + +SC_BEGIN PM_ATTACHMENT_ICON +global $pm_info; +if($pm_info['pm_attachments'] != "") +{ + return ATTACHMENT_ICON; +} +SC_END + +SC_BEGIN PM_ATTACHMENTS +global $pm_info; +if($pm_info['pm_attachments'] != "") +{ + $attachments = explode(chr(0), $pm_info['pm_attachments']); + $i = 0; + foreach($attachments as $a) + { + list($timestamp, $fromid, $rand, $filename) = explode("_", $a, 4); + $ret .= "{$filename}
        "; + $i++; + } + $ret = substr($ret, 0, -3); + return $ret; +} +SC_END + +SC_BEGIN RECEIPT +global $pm_prefs; +if (check_class($pm_prefs['receipt_class'])) +{ + return "".LAN_PM_10; +} +return ""; +SC_END + +SC_BEGIN INBOX_TOTAL +$pm_inbox = pm_getInfo('inbox'); +return $pm_inbox['inbox']['total']; +SC_END + +SC_BEGIN INBOX_UNREAD +$pm_inbox = pm_getInfo('inbox'); +return intval($pm_inbox['inbox']['unread']); +SC_END + +SC_BEGIN INBOX_FILLED +$pm_inbox = pm_getInfo('inbox'); +return (intval($pm_inbox['inbox']['filled']) > 0 ? $pm_inbox['inbox']['filled'] : ""); +SC_END + +SC_BEGIN OUTBOX_TOTAL +$pm_outbox = pm_getInfo('outbox'); +return $pm_outbox['outbox']['total']; +SC_END + +SC_BEGIN OUTBOX_UNREAD +$pm_outbox = pm_getInfo('outbox'); +return intval($pm_outbox['outbox']['unread']); +SC_END + +SC_BEGIN OUTBOX_FILLED +$pm_outbox = pm_getInfo('outbox'); +return (intval($pm_outbox['outbox']['filled']) > 0 ? $pm_outbox['outbox']['filled'] : ""); +SC_END + +SC_BEGIN PM_DATE +global $pm_info; +require_once(e_HANDLER."date_handler.php"); +if("lapse" != $parm) +{ + return convert::convert_date($pm_info['pm_sent'], $parm); +} +else +{ + return convert::computeLapse($pm_info['pm_sent']); +} +SC_END + +SC_BEGIN PM_READ +global $pm_info; +if($pm_info['pm_read'] == 0) +{ + return LAN_PM_27; +} +if($pm_info['pm_read'] == 1) +{ + return LAN_PM_28; +} +require_once(e_HANDLER."date_handler.php"); +if("lapse" != $parm) +{ + return convert::convert_date($pm_info['pm_read'], $parm); +} +else +{ + return convert::computeLapse($pm_info['pm_read']); +} +SC_END + + +SC_BEGIN PM_FROM_TO +global $pm_info, $tp; +if($pm_info['pm_from'] == USERID) +{ + $ret = LAN_PM_2.":
        "; + $pm_info['user_name'] = $pm_info['sent_name']; + $ret .= $tp->parseTemplate("{PM_TO=link}"); +} +else +{ + $ret = LAN_PM_31.":
        "; + $pm_info['user_name'] = $pm_info['from_name']; + $ret .= $tp->parseTemplate("{PM_FROM=link}"); +} +return $ret; +SC_END + +SC_BEGIN PM_SUBJECT +global $pm_info, $tp; +$ret = $tp->toHTML($pm_info['pm_subject'], true, 'no_make_clickable'); +if('link' == $parm) +{ + $ret = "".$ret.""; +} +return $ret; +SC_END + +SC_BEGIN PM_FROM +global $pm_info; +if("link" == $parm) +{ + return "{$pm_info['user_name']}"; +} +else +{ + return $pm_info['user_name']; +} +SC_END + +SC_BEGIN PM_SELECT +global $pm_info; +return ""; +SC_END + +SC_BEGIN PM_READ_ICON +global $pm_info; +if($pm_info['pm_read'] > 0 ) +{ + return PM_READ_ICON; +} +else +{ + return PM_UNREAD_ICON; +} +SC_END + +SC_BEGIN PM_AVATAR +global $pm_info, $tp; +return $tp->parseTemplate("{USER_AVATAR={$pm_info['user_image']}}"); +SC_END + +SC_BEGIN PM_BLOCK_USER +global $pm_info, $pm_blocks; +if(in_array($pm_info['pm_from'], $pm_blocks)) +{ + return "".LAN_PM_51.""; +} +else +{ + return "".LAN_PM_50.""; +} +SC_END + +SC_BEGIN PM_DELETE +global $pm_info; +$extra = $parm != "" ? ".{$parm}" : ""; +return "".LAN_PM_52.""; +SC_END + +SC_BEGIN DELETE_SELECTED +global $pm_info; +return ""; +SC_END + +SC_BEGIN PM_TO +global $pm_info; +if(is_numeric($pm_info['pm_to'])) +{ + if("link" == $parm) + { + return "{$pm_info['user_name']}"; + } + else + { + return $pm_info['user_name']; + } +} +else +{ + return LAN_PM_63." ".$pm_info['pm_to']; +} +SC_END + +SC_BEGIN PM_MESSAGE +global $pm_info, $tp; +return $tp->toHTML($pm_info['pm_text'], true); +SC_END + +SC_BEGIN PM_REPLY +global $pm_info; +if($pm_info['pm_to'] == USERID) +{ + $ret = " +
        + ".LAN_PM_54."     +
        + "; + return $ret; +} +SC_END + +SC_BEGIN SEND_PM_LINK +$pm_outbox = pm_getInfo('outbox'); +if($pm_outbox['outbox']['filled'] < 100) +{ + return "".PM_SEND_LINK.""; +} +return ""; +SC_END + +SC_BEGIN NEWPM_ANIMATE +global $pm_prefs, $pm_inbox; +if($pm_prefs['animate']) +{ + $pm_inbox = pm_getInfo('inbox'); + if($pm_inbox['inbox']['new'] > 0) + { + return NEWPM_ANIMATION; + } +} +return ""; +SC_END + +SC_BEGIN PM_NEXTPREV +global $pmlist, $tp, $pm_start, $pm_prefs, $pmlist; +return $tp->parseTemplate("{NEXTPREV={$pmlist['total_messages']},{$pm_prefs['perpage']},{$pm_start},".e_SELF."?{$parm}.[FROM]}"); +SC_END + +*/ +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_sql.php b/e107_plugins/pm/pm_sql.php new file mode 100755 index 000000000..7f6548112 --- /dev/null +++ b/e107_plugins/pm/pm_sql.php @@ -0,0 +1,24 @@ +CREATE TABLE private_msg ( + pm_id int(10) unsigned NOT NULL auto_increment, + pm_from int(10) unsigned NOT NULL default '0', + pm_to varchar(250) NOT NULL default '', + pm_sent int(10) unsigned NOT NULL default '0', + pm_read int(10) unsigned NOT NULL default '0', + pm_subject text NOT NULL, + pm_text text NOT NULL, + pm_sent_del tinyint(1) unsigned NOT NULL default '0', + pm_read_del tinyint(1) unsigned NOT NULL default '0', + pm_attachments text NOT NULL, + pm_option varchar(250) NOT NULL default '', + pm_size int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pm_id) +) TYPE=MyISAM AUTO_INCREMENT=1 ; + +CREATE TABLE private_msg_block ( + pm_block_id int(10) unsigned NOT NULL auto_increment, + pm_block_from int(10) unsigned NOT NULL default '0', + pm_block_to int(10) unsigned NOT NULL default '0', + pm_block_datestamp int(10) unsigned NOT NULL default '0', + pm_block_count int(10) unsigned NOT NULL default '0', + PRIMARY KEY (pm_block_id) +) TYPE=MyISAM AUTO_INCREMENT=1 ; diff --git a/e107_plugins/pm/pm_template.php b/e107_plugins/pm/pm_template.php new file mode 100755 index 000000000..8c86f0f85 --- /dev/null +++ b/e107_plugins/pm/pm_template.php @@ -0,0 +1,194 @@ +"); +define("PM_UNREAD_ICON", "".LAN_PM_27.""); + +$sc_style['PM_ATTACHMENT_ICON']['pre'] = " "; + +$sc_style['PM_ATTACHMENTS']['pre'] = "
        "; +$sc_style['PM_ATTACHMENTS']['post'] = "
        "; + +$sc_style['PM_NEXTPREV']['pre'] = " ".LAN_PM_59; +$sc_style['PM_NEXTPREV']['post'] = ""; + +$sc_style['EMOTES']['pre'] = " + + ".LAN_PM_7.": + +"; +$sc_style['EMOTES']['post'] = ""; + +$sc_style['ATTACHMENT']['pre'] = " + + ".LAN_PM_8.": + +"; +$sc_style['ATTACHMENT']['post'] = ""; + +$sc_style['RECEIPT']['pre'] = " + + ".LAN_PM_9.": + +"; +$sc_style['RECEIPT']['post'] = ""; + +$sc_style['PM_REPLY']['pre'] = " + +"; + +$sc_style['PM_REPLY']['post'] = " + +"; + +$PM_SEND_PM = "
        + + + + + + + + + + + + + + + + +{EMOTES} +{ATTACHMENT} +{RECEIPT} + + + +
        ".LAN_PM_1.":
        ".LAN_PM_2.": {FORM_TOUSER}
        {FORM_TOCLASS}
        ".LAN_PM_5.": {FORM_SUBJECT}
        ".LAN_PM_6.": {FORM_MESSAGE}
        {PM_POST_BUTTON}
        +
        +"; + +$PM_INBOX_HEADER = " + + + + + + + + + +"; + +$PM_INBOX_TABLE = " + + + + + + + + +"; + +$PM_INBOX_EMPTY = " + + + +"; + +$PM_INBOX_FOOTER = " + + + +{PM_NEXTPREV=inbox} +
          ".LAN_PM_5."".LAN_PM_31."".LAN_PM_32." 
        {PM_SELECT}{PM_READ_ICON}{PM_SUBJECT=link}{PM_ATTACHMENT_ICON}{PM_FROM=link}{PM_DATE}{PM_DELETE=inbox} {PM_BLOCK_USER}
        ".LAN_PM_34."
        + {DELETE_SELECTED} +
        +"; + +$PM_OUTBOX_HEADER = " + + + + + + + + + +"; + +$PM_OUTBOX_TABLE = " + + + + + + + + +"; + +$PM_OUTBOX_EMPTY = " + + + +"; + +$PM_OUTBOX_FOOTER = " + + + +{PM_NEXTPREV=outbox} +
          ".LAN_PM_5."".LAN_PM_2."".LAN_PM_33." 
        {PM_SELECT}{PM_READ_ICON}{PM_SUBJECT=link}{PM_ATTACHMENT_ICON}{PM_TO=link}{PM_DATE}{PM_DELETE=outbox}
        ".LAN_PM_34."
        + {DELETE_SELECTED} +
        +"; + +$PM_SHOW = +"
        + + + + + + + + +{PM_REPLY} +
        {PM_SUBJECT}
        + {PM_FROM_TO} +
        +
        + ".LAN_PM_29.":
        {PM_DATE}
        +
        +
        + ".LAN_PM_30.":
        {PM_READ}
        +
        +
        + {PM_DELETE} +
        {PM_MESSAGE}

        {PM_ATTACHMENTS}
        +
        +"; + +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_update.php b/e107_plugins/pm/pm_update.php new file mode 100644 index 000000000..b2d2371f4 --- /dev/null +++ b/e107_plugins/pm/pm_update.php @@ -0,0 +1,113 @@ +db_Update("plugin", "plugin_name=".ADLAN_PM." WHERE plugin_path='pm'"); + +require_once(e_HANDLER.'plugin_class.php'); +$plugin = new e107plugin; + +$sql -> db_Select_gen(" +CREATE TABLE ".MPREFIX."private_msg ( +pm_id int(10) unsigned NOT NULL auto_increment, +pm_from int(10) unsigned NOT NULL default '0', +pm_to varchar(250) NOT NULL default '', +pm_sent int(10) unsigned NOT NULL default '0', +pm_read int(10) unsigned NOT NULL default '0', +pm_subject text NOT NULL, +pm_text text NOT NULL, +pm_sent_del tinyint(1) unsigned NOT NULL default '0', +pm_read_del tinyint(1) unsigned NOT NULL default '0', +pm_attachments text NOT NULL, +pm_option varchar(250) NOT NULL default '', +pm_size int(10) unsigned NOT NULL default '0', +PRIMARY KEY (pm_id) +) TYPE=MyISAM AUTO_INCREMENT=1 ;"); + +$sql -> db_Select_gen(" +CREATE TABLE ".MPREFIX."private_msg_block ( +pm_block_id int(10) unsigned NOT NULL auto_increment, +pm_block_from int(10) unsigned NOT NULL default '0', +pm_block_to int(10) unsigned NOT NULL default '0', +pm_block_datestamp int(10) unsigned NOT NULL default '0', +pm_block_count int(10) unsigned NOT NULL default '0', +PRIMARY KEY (pm_block_id) +) TYPE=MyISAM AUTO_INCREMENT=1 ;"); + +$plugin -> manage_plugin_prefs('add', 'plug_sc', 'pm', 'SENDPM'); + +pm_convert(); + +function pm_convert() +{ + global $sql, $uinfo; + $sql2 =& new db; + $count = 0; + if($sql->db_Select("pm_messages","*")) + { + while($row = $sql->db_Fetch()) + { + $from = pm_convert_uid($row['pm_from_user']); + $to = pm_convert_uid($row['pm_to_user']); + $size = strlen($row['pm_message']); + if($sql2->db_Insert("private_msg", "0, '".intval($from)."', '{$to}', '".intval($row['pm_sent_datestamp'])."', '".intval($row['pm_rcv_datestamp'])."', '{$row['pm_subject']}', '{$row['pm_message']}', '0', '0', '', '', '".intval($size)."'")) + { + //Insertion of new PM successful, delete old + $sql2->db_Delete("pm_messages", "pm_id='{$row['pm_id']}'"); + $count++; + } + } + } +} + +function pm_convert_uid($name) +{ + global $uinfo, $tp; + $sqlu =& new db; + $name = trim($name); + if(!array_key_exists($uinfo[$name])) + { + if($sqlu->db_Select("user", "user_id", "user_name LIKE '".$tp -> todb($name, TRUE)."'")) + { + $row = $sqlu->db_Fetch(); + $uinfo[$name] = $row['user_id']; + } + else + { + if($sqlu->db_Select("user", "user_id", "user_loginname LIKE '".$tp -> todb($name, TRUE)."'")) + { + $row = $sqlu->db_Fetch(); + $uinfo[$name] = $row['user_id']; + } + else + { + return FALSE; + } + } + } + return $uinfo[$name]; +} + +?> \ No newline at end of file diff --git a/e107_plugins/pm/pm_update_check.php b/e107_plugins/pm/pm_update_check.php new file mode 100644 index 000000000..70b8eb183 --- /dev/null +++ b/e107_plugins/pm/pm_update_check.php @@ -0,0 +1,40 @@ + db_Select("plugin", "*", "plugin_path = 'pm_menu' AND plugin_installflag='1'")) { + if ($sql -> db_Count('pm_messages', '(*)')) { + return FALSE; + } else { + return TRUE; + } + } else { + return TRUE; + } + } +} + +?> diff --git a/e107_plugins/pm/private_msg_menu.php b/e107_plugins/pm/private_msg_menu.php new file mode 100755 index 000000000..e500bc50d --- /dev/null +++ b/e107_plugins/pm/private_msg_menu.php @@ -0,0 +1,113 @@ +getArray("pm_prefs"); +} +require_once(e_PLUGIN."pm/pm_func.php"); +pm_getInfo('clear'); + +define("PM_INBOX_ICON", "".LAN_PM_25.""); +define("PM_OUTBOX_ICON", "".LAN_PM_26.""); +define("PM_SEND_LINK", LAN_PM_35); +define("NEWPM_ANIMATION", ""); + +$sc_style['SEND_PM_LINK']['pre'] = "

        [ "; +$sc_style['SEND_PM_LINK']['post'] = " ]"; + +$sc_style['INBOX_FILLED']['pre'] = "["; +$sc_style['INBOX_FILLED']['post'] = "%]"; + +$sc_style['OUTBOX_FILLED']['pre'] = "["; +$sc_style['OUTBOX_FILLED']['post'] = "%]"; + +$sc_style['NEWPM_ANIMATE']['pre'] = ""; +$sc_style['NEWPM_ANIMATE']['post'] = ""; + + +if(!defined($pm_menu_template)) +{ + $pm_menu_template = " + ".PM_INBOX_ICON." + ".LAN_PM_25." + {NEWPM_ANIMATE} +
        + {INBOX_TOTAL} ".LAN_PM_36.", {INBOX_UNREAD} ".LAN_PM_37." {INBOX_FILLED} +
        + ".PM_OUTBOX_ICON." + ".LAN_PM_26."
        + {OUTBOX_TOTAL} ".LAN_PM_36.", {OUTBOX_UNREAD} ".LAN_PM_37." {OUTBOX_FILLED} + {SEND_PM_LINK} + "; +} + +if(check_class($pm_prefs['pm_class'])) +{ + global $tp, $pm_inbox; + $pm_inbox = pm_getInfo('inbox'); + require_once(e_PLUGIN."pm/pm_shortcodes.php"); + $txt = $tp->parseTemplate($pm_menu_template, TRUE, $pm_shortcodes); + if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, "pm.php") === FALSE && $_COOKIE["pm-alert"] != "ON") + { + $txt .= pm_show_popup(); + } + $ns->tablerender(LAN_PM, $txt, 'pm'); +} + +function pm_show_popup() +{ + global $pm_inbox, $pm_prefs; + $alertdelay = intval($pm_prefs['popup_delay']); + if($alertdelay == 0) { $alertdalay = 60; } + setcookie("pm-alert", "ON", time()+$alertdelay); + $popuptext = " + + + ".$pm_inbox['inbox']['new']." ".LAN_PM_109." + + + + + + + +
        +
        --- ".LAN_PM." ---
        ".$pm_inbox['inbox']['new']." ".LAN_PM_109."
        ".$pm_inbox['inbox']['unread']." ".LAN_PM_37."

        +
        + +
        +
        +
        + + "; + $popuptext = str_replace("\n", "", $popuptext); + $popuptext = str_replace("\t", "", $popuptext); + $text .= " + "; + return $text; +} +?> \ No newline at end of file diff --git a/e107_plugins/pm/sendpm.sc b/e107_plugins/pm/sendpm.sc new file mode 100644 index 000000000..4be27dd76 --- /dev/null +++ b/e107_plugins/pm/sendpm.sc @@ -0,0 +1,20 @@ +@include_once(e_PLUGIN."pm/languages/".e_LANGUAGE.".php"); +@include_once(e_PLUGIN."pm/languages/English.php"); +global $sysprefs, $pm_prefs; +$pm_prefs = $sysprefs->getArray("pm_prefs"); +if(check_class($pm_prefs['pm_class'])) +{ + if(file_exists(THEME."forum/pm.png")) + { + $img = "".LAN_PM.""; + } + else + { + $img = "".LAN_PM.""; + } + return "{$img}"; +} +else +{ + return ""; +} diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php new file mode 100644 index 000000000..de395f793 --- /dev/null +++ b/e107_plugins/poll/admin_config.php @@ -0,0 +1,172 @@ +delete_poll($id); + unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']); +} + +if (isset($_POST['submit'])) +{ + + if($_POST['poll_title']) + { + $message = $poll -> submit_poll(); + unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']); + } + else + { + $message = POLLAN_46; + } +} + +if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit']) +{ + + if ($sql->db_Select("polls", "*", "poll_id=".POLLID)) { + $row = $sql->db_Fetch(); + extract($row); + + $tmpArray = explode(chr(1), $poll_options); + + foreach($tmpArray as $option) + { + $_POST['poll_option'][] = $option; + } + + $_POST['activate'] = $poll_active; + $_POST['option_count'] = count($_POST['poll_option']); + $_POST['poll_title'] = $poll_title; + $_POST['poll_comment'] = $poll_comment; + + if ($poll_start_datestamp) + { + $tmp = getdate($poll_start_datestamp); + $_POST['startmonth'] = $tmp['mon']; + $_POST['startday'] = $tmp['mday']; + $_POST['startyear'] = $tmp['year']; + } + if ($poll_end_datestamp) + { + $tmp = getdate($poll_end_datestamp); + $_POST['endmonth'] = $tmp['mon']; + $_POST['endday'] = $tmp['mday']; + $_POST['endyear'] = $tmp['year']; + } + + $_POST['multipleChoice'] = $poll_allow_multiple; + $_POST['showResults'] = $poll_result_type; + $_POST['pollUserclass'] = $poll_vote_userclass; + $_POST['storageMethod'] = $poll_storage_method; + } +} + +if (isset($_POST['preview'])) +{ + $poll->render_poll($_POST, "preview"); +} + +if (isset($message)) +{ + $ns->tablerender("", "
        ".$message."
        "); +} + +$text = "
        +
        "; + +if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1")) { + $text .= " + + + + + "; + while ($row = $sql->db_Fetch()) { + extract($row); + $text .= " + + + + "; + } + $text .= "
        ID + + ".POLLAN_3."".POLLAN_4."
        $poll_id".$tp -> toHTML($poll_title, TRUE,"no_hook emotes_off defs")."
        ". $rs->form_button("button", "main_edit_{$poll_id}", POLLAN_5, "onclick=\"document.location='".e_SELF."?edit.$poll_id'\""). $rs->form_button("submit", "main_delete_{$poll_id}", POLLAN_6, "onclick=\"confirm_($poll_id)\"")." +
        "; +} else { + $text .= "
        ".POLLAN_7."
        "; +} +$text .= "
        "; +$ns->tablerender(POLLAN_1, $text); + +$poll_total = $sql->db_Select("polls"); + +$text = $poll -> renderPollForm(); + +$ns->tablerender(POLLAN_2, $text); +require_once(e_ADMIN."footer.php"); +function headerjs() { + global $tp; + $headerjs = ""; + return $headerjs; +} +?> \ No newline at end of file diff --git a/e107_plugins/poll/images/bar.png b/e107_plugins/poll/images/bar.png new file mode 100644 index 000000000..78506bbfe Binary files /dev/null and b/e107_plugins/poll/images/bar.png differ diff --git a/e107_plugins/poll/images/barl.png b/e107_plugins/poll/images/barl.png new file mode 100644 index 000000000..7ffb51e38 Binary files /dev/null and b/e107_plugins/poll/images/barl.png differ diff --git a/e107_plugins/poll/images/barr.png b/e107_plugins/poll/images/barr.png new file mode 100644 index 000000000..2c2a0ab75 Binary files /dev/null and b/e107_plugins/poll/images/barr.png differ diff --git a/e107_plugins/poll/images/polls_16.png b/e107_plugins/poll/images/polls_16.png new file mode 100644 index 000000000..297342b4f Binary files /dev/null and b/e107_plugins/poll/images/polls_16.png differ diff --git a/e107_plugins/poll/images/polls_32.png b/e107_plugins/poll/images/polls_32.png new file mode 100644 index 000000000..882d46e82 Binary files /dev/null and b/e107_plugins/poll/images/polls_32.png differ diff --git a/e107_plugins/poll/languages/English.php b/e107_plugins/poll/languages/English.php new file mode 100644 index 000000000..985f4f06f --- /dev/null +++ b/e107_plugins/poll/languages/English.php @@ -0,0 +1,74 @@ + \ No newline at end of file diff --git a/e107_plugins/poll/oldpolls.php b/e107_plugins/poll/oldpolls.php new file mode 100644 index 000000000..6aa7f6a24 --- /dev/null +++ b/e107_plugins/poll/oldpolls.php @@ -0,0 +1,151 @@ +db_Select_gen($query)) + { + + $row = $sql -> db_Fetch(); + extract($row); + + $optionArray = explode(chr(1), $poll_options); + $optionArray = array_slice($optionArray, 0, -1); + $voteArray = explode(chr(1), $poll_votes); + $voteArray = array_slice($voteArray, 0, -1); + + $voteTotal = array_sum($voteArray); + $percentage = array(); + foreach($voteArray as $votes) + { + $percentage[] = round(($votes/$voteTotal) * 100, 2); + } + + $start_datestamp = $gen->convert_date($poll_datestamp, "long"); + $end_datestamp = $gen->convert_date($poll_end_datestamp, "long"); + + $text = " + + + "; + + $count = 0; + + $barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png"); + $barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png"); + $bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png"); + + foreach($optionArray as $option) + { + $text .= " + + + \n"; + $count++; + + } + + $query = "SELECT c.*, u.* FROM #comments AS c + LEFT JOIN #user AS u ON FLOOR(SUBSTR(c.comment_author,1,INSTR(c.comment_author,'.')-1))=u.user_id + WHERE comment_item_id=".intval($poll_id)." AND comment_type=4 ORDER BY comment_datestamp"; + if ($comment_total = $sql->db_Select_gen($query) !== FALSE) + { + $text .= ""; + } + + $text .= "
        + ".$tp -> toHTML($poll_title)." +
        ".POLLAN_35." ".$user_name.".
        ".POLLAN_37." ".$start_datestamp." ".POLLAN_38." ".$end_datestamp.".
        ".POLLAN_26.": $voteTotal
        +
        + +
        ".$tp -> toHTML($option)."   + + +
        ".$percentage[$count]."% [".POLLAN_31.": ".$voteArray[$count]."] +


        "; + while ($row = $sql->db_Fetch()) { + $text .= $cobj->render_comment($row); + } + $text .= "
        "; + $ns->tablerender(POLL_ADLAN01." #".$poll_id, $text); + } +} + +$query = "SELECT p.*, u.user_name FROM #polls AS p +LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id +WHERE p.poll_type=1 +ORDER BY p.poll_datestamp DESC"; + +if(!$sql->db_Select_gen($query)) +{ + $ns->tablerender(POLLAN_28, "
        ".POLLAN_33."
        "); + require_once(FOOTERF); + exit; +} + +$array = $sql -> db_getList(); +$oldpollArray = array_slice($array, 1); + +if(!count($oldpollArray)) +{ + $ns->tablerender(POLLAN_28, "
        ".POLLAN_33."
        "); + require_once(FOOTERF); + exit; +} + +$text = " + + + + +\n"; + +foreach($oldpollArray as $oldpoll) +{ + extract($oldpoll); + $from = $gen->convert_date($poll_datestamp, "short"); + $to = $gen->convert_date($poll_end_datestamp, "short"); + + $text .= " + + + + \n"; +} + +$text .= "
        ".POLLAN_34."".POLLAN_35."".POLLAN_36."
        $poll_title$user_name$from ".POLLAN_38." $to
        "; +$ns->tablerender(POLLAN_28, $text); +require_once(FOOTERF); + +?> diff --git a/e107_plugins/poll/plugin.php b/e107_plugins/poll/plugin.php new file mode 100644 index 000000000..eb48ad268 --- /dev/null +++ b/e107_plugins/poll/plugin.php @@ -0,0 +1,87 @@ + diff --git a/e107_plugins/poll/poll.php b/e107_plugins/poll/poll.php new file mode 100644 index 000000000..8d340d94a --- /dev/null +++ b/e107_plugins/poll/poll.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php new file mode 100644 index 000000000..7f17b71a3 --- /dev/null +++ b/e107_plugins/poll/poll_class.php @@ -0,0 +1,595 @@ + db_Delete("polls", " poll_id='".intval($existing)."' ")) + { + if(function_exists("admin_purge_related")) + { + admin_purge_related("poll", $existing); + } + return "Poll deleted."; + } + } + + function submit_poll($mode=1) + { + + /* + $mode = 1 :: poll is main poll + $mode = 2 :: poll is forum poll + */ + + global $tp, $sql; + extract($_POST); + + $poll_title = $tp->toDB($poll_title); + $active_start = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear'])); + $active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear'])); + $poll_options = ""; + + foreach($poll_option as $key => $value) + { + $poll_options .= $tp->toDB($poll_option[$key]).chr(1); + } + + if(POLLACTION == "edit") + { + $sql -> db_Update("polls", "poll_title='$poll_title', poll_options='$poll_options', poll_type=$mode, poll_comment='".$tp -> toDB($poll_comment)."', poll_allow_multiple=".intval($multipleChoice).", poll_result_type=".intval($showResults).", poll_vote_userclass=".intval($pollUserclass).", poll_storage_method=".intval($storageMethod)." WHERE poll_id=".intval(POLLID)); + + /* update poll results - bugtracker #1124 .... */ + $sql -> db_Select("polls", "poll_votes", "poll_id='".intval(POLLID)."' "); + $foo = $sql -> db_Fetch(); + $voteA = explode(chr(1), $foo['poll_votes']); + + $opt = count($poll_option) - count($voteA); + + if($opt) + { + for($a=0; $a<=$opt; $a++) + { + $foo['poll_votes'] .= "0".chr(1); + } + $sql -> db_Update("polls", "poll_votes='".$foo['poll_votes']."' WHERE poll_id='".intval(POLLID)."' "); + } + + $message = POLLAN_45; + } else { + + $votes = ""; + for($a=1; $a<=count($_POST['poll_option']); $a++) + { + $votes .= "0".chr(1); + } + + if($mode == 1) + { + /* deactivate other polls */ + if($sql -> db_Select("polls", "*", "poll_type=1 AND poll_vote_userclass!=255")) + { + $deacArray = $sql -> db_getList(); + foreach($deacArray as $deacpoll) + { + $sql -> db_Update("polls", "poll_end_datestamp='".time()."', poll_vote_userclass='255' WHERE poll_id=".$deacpoll['poll_id']); + } + } + $sql -> db_Insert("polls", "'0', ".time().", ".intval($active_start).", ".intval($active_end).", ".ADMINID.", '$poll_title', '$poll_options', '$votes', '', '1', '".$tp -> toDB($poll_comment)."', '".intval($multipleChoice)."', '".intval($showResults)."', '".intval($pollUserclass)."', '".intval($storageMethod)."'"); + } + else + { + $sql -> db_Insert("polls", "'0', ".intval($_POST['iid']).", '0', '0', ".USERID.", '$poll_title', '$poll_options', '$votes', '', '2', '0', '".intval($multipleChoice)."', '0', '0', '".intval($storageMethod)."'"); + } + } + return $message; + } + + + function get_poll($query) + { + global $sql, $e107; + if ($sql->db_Select_gen($query)) + { + $pollArray = $sql -> db_Fetch(); + + if (!check_class($pollArray['poll_vote_userclass'])) + { + $POLLMODE = "disallowed"; + } + else + { + + switch($pollArray['poll_storage_method']) + { + case POLL_MODE_COOKIE: + $userid = ""; + $cookiename = "poll_".$pollArray['poll_id']; + if(isset($_COOKIE[$cookiename])) + { + $POLLMODE = "voted"; + } + else + { + $POLLMODE = "notvoted"; + } + break; + + case POLL_MODE_IP: + $userid = $e107->getip(); + $voted_ids = explode("^", substr($pollArray['poll_ip'], 0, -1)); + if (in_array($userid, $voted_ids)) + { + $POLLMODE = "voted"; + } + else + { + $POLLMODE = "notvoted"; + } + break; + + case POLL_MODE_USERID: + if(!USER) + { + $POLLMODE = "disallowed"; + } + else + { + $userid = USERID; + $voted_ids = explode("^", substr($pollArray['poll_ip'], 0, -1)); + if (in_array($userid, $voted_ids)) + { + $POLLMODE = "voted"; + } + else + { + $POLLMODE = "notvoted"; + } + } + break; + } + } + } + if(isset($_POST['pollvote']) && $POLLMODE == "notvoted" && ($POLLMODE != "disallowed")) + { + if ($_POST['votea']) + { +// $sql -> db_Select("polls", "*", "poll_vote_userclass!=255 AND poll_type=1 ORDER BY poll_datestamp DESC LIMIT 0,1"); + $row = $pollArray; + extract($row); + $votes = explode(chr(1), $poll_votes); + if(is_array($_POST['votea'])) + { + /* multiple choice vote */ + foreach($_POST['votea'] as $vote) + { + $vote = intval($vote); + $votes[($vote-1)] ++; + } + } + else + { + $votes[($_POST['votea']-1)] ++; + } + $optionArray = explode(chr(1), $pollArray['poll_options']); + $optionArray = array_slice($optionArray, 0, -1); + foreach($optionArray as $k=>$v) + { + if(!$votes[$k]) + { + $votes[$k] = 0; + } + } + $votep = implode(chr(1), $votes); + $pollArray['poll_votes'] = $votep; + + $sql->db_Update("polls", "poll_votes = '$votep', poll_ip='".$poll_ip.$userid."^' WHERE poll_id=".$poll_id); + echo " + + "; + $POLLMODE = "voted"; + + } + } + $this->pollRow = $pollArray; + $this->pollmode = $POLLMODE; + } + + + function render_poll($pollArray = "", $type = "menu", $POLLMODE = "", $returnMethod=FALSE) + { + global $POLLSTYLE, $sql, $tp, $ns; + if($POLLMODE == "query") + { + $this->get_poll($pollArray); + $pollArray = $this->pollRow; + $POLLMODE = $this->pollmode; + } + + $barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png"); + $barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png"); + $bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png"); + + if($type == "preview") + { + /* load lan file */ + @include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php"); + @include_once(e_PLUGIN."poll/languages/English.php"); + $optionArray = $pollArray['poll_option']; + $voteArray = array(); + $voteArray = array_pad($voteArray, count($optionArray), 0); + $pollArray['poll_allow_multiple'] = $pollArray['multipleChoice']; + } + else if($type == "forum") + { + @include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php"); + @include_once(e_PLUGIN."poll/languages/English.php"); + if(isset($_POST['fpreview'])) + { + $pollArray['poll_allow_multiple'] = $pollArray['multipleChoice']; + $optionArray = $pollArray['poll_option']; + } + else + { + $optionArray = explode(chr(1), $pollArray['poll_options']); + $optionArray = array_slice($optionArray, 0, -1); + } + $voteArray = explode(chr(1), $pollArray['poll_votes']); +// $voteArray = array_slice($voteArray, 0, -1); + } + else + { + $optionArray = explode(chr(1), $pollArray['poll_options']); + $optionArray = array_slice($optionArray, 0, -1); + $voteArray = explode(chr(1), $pollArray['poll_votes']); +// $voteArray = array_slice($voteArray, 0, -1); + } + + $voteTotal = array_sum($voteArray); + + $percentage = array(); + + + if(count($voteArray)) + { + foreach($voteArray as $votes){ + $percentage[] = round(($votes/$voteTotal) * 100, 2); + } + } + /* get template */ + if (file_exists(THEME."poll_template.php")) + { + require(THEME."poll_template.php"); + } + else if(!isset($POLL_NOTVOTED_START)) + { + require(e_PLUGIN."poll/templates/poll_template.php"); + } + + $preview = FALSE; + if ($type == "preview") + { + $POLLMODE = "notvoted"; + } + else if($type == "forum") { + $preview = TRUE; + } + + $comment_total = $sql->db_Select("comments", "*", "comment_item_id='".intval($pollArray['poll_id'])."' AND comment_type=4"); + + $QUESTION = $tp -> toHTML($pollArray['poll_title'], TRUE,"emotes_off defs"); + $VOTE_TOTAL = POLLAN_31.": ".$voteTotal; + $COMMENTS = ($pollArray['poll_comment'] ? " ".POLLAN_27.": ".$comment_total."" : ""); + $OLDPOLLS = ($type == "menu" ? "".POLLAN_28."" : ""); + $AUTHOR = POLLAN_35." ".($type == "preview" || $type == "forum" ? USERNAME : "".$pollArray['user_name'].""); + + switch ($POLLMODE) + { + case "notvoted": + $text = "
        \n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_START : $POLL_NOTVOTED_START)); + $count = 1; + $alt = 0; // alternate style. + foreach($optionArray as $option) { + // $MODE = ($mode) ? $mode : ""; /* debug */ + $OPTIONBUTTON = ($pollArray['poll_allow_multiple'] ? "" : ""); + $OPTION = $tp->toHTML($option, TRUE); + if(isset($POLL_NOTVOTED_LOOP_ALT) && $POLL_NOTVOTED_LOOP_ALT && $type != "forum"){ // alternating style + $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($alt == 0 ? $POLL_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP_ALT)); + $alt = ($alt ==0) ? 1 : 0; + }else{ + $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP)); + } + $count ++; + } + $SUBMITBUTTON = ""; + if(('preview' == $type || $preview == TRUE) && strpos(e_SELF, "viewtopic") === FALSE) + { + $SUBMITBUTTON = "[".POLLAN_30."]"; + } + + $text .= "\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_END : $POLL_NOTVOTED_END))."\n
        "; + break; + + case "voted": + + if($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php")) + { + $text = "


        ".POLLAN_39."

        ".POLLAN_40."


        "; + + } + else + { + + + $text = preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_START : $POLL_VOTED_START)); + $count = 0; + foreach($optionArray as $option) + { + $OPTION = $tp->toHTML($option, TRUE); + + $BAR = ($percentage[$count] ? "
        " : ""); + + $PERCENTAGE = $percentage[$count]."%"; + $VOTES = POLLAN_31.": ".$voteArray[$count]; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_LOOP : $POLL_VOTED_LOOP)); + $count ++; + } + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_END : $POLL_VOTED_END)); + + break; + + case "disallowed": + $text = preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_START); + foreach($optionArray as $option) + { + $MODE = $mode; /* debug */ + $OPTION = $tp->toHTML($option, TRUE); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_LOOP); + $count ++; + } + if($pollArray['poll_vote_userclass'] == 253) + { + $DISALLOWMESSAGE = POLLAN_41; + } + else if($pollArray['poll_vote_userclass'] == 254) + { + $DISALLOWMESSAGE = POLLAN_42; + } + else + { + $DISALLOWMESSAGE = POLLAN_43; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_END); + break; + } + + if(!defined("POLLRENDERED")) define("POLLRENDERED", TRUE); + $caption = (file_exists(THEME."images/poll_menu.png") ? " ".POLLAN_MENU_CAPTION : POLLAN_MENU_CAPTION); + if($type == "preview") + { + $caption = POLLAN_23; + $text = "
        \n\n\n
        \n$text\n
        "; + } + else if($type == "forum") + { + $caption = LAN_4; + } + + + + if($returnMethod) + { + return $text; + } + else + { + $ns->tablerender($caption, $text, 'poll'); + } + } + + + function renderPollForm($mode="admin") + { + /* + $mode = "admin" :: called from admin_config.php + $mode = "forum" :: called from forum_post.php + */ + global $tp; + if($mode == "forum") + { + $text = " + ".LAN_4." + + + + ".LAN_386." + + +
        ".LAN_5."
        "; + + $option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1); + $text .= " + ".LAN_391." + +
        "; + + for($count = 1; $count <= $option_count; $count++) + { + if($count != 1 && $_POST['poll_option'][($count-1)] =="") + { + break; + } + $opt = ($count==1) ? "id='pollopt'" : ""; + $text .=""; + $text .= "
        "; + } + + $text .="

        + + + + + ".POLL_506." + + ".POLL_507."   + ".POLL_508." + + + + + ".POLLAN_16." + + ".POLLAN_17."
        + ".POLLAN_18."
        + ".POLLAN_19." + + "; + + + return $text; + } + + $formgo = e_SELF.(e_QUERY && !defined("RESET") && strpos(e_QUERY, 'delete') === FALSE ? "?".e_QUERY : ""); + + $text = "
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".POLLAN_3.":
        + "; + + $option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1); + + $text .= "
        ".LAN_OPTIONS." : +
        "; + + for($count = 1; $count <= $option_count; $count++) + { + if($count != 1 && $_POST['poll_option'][($count-1)] =="") + { + break; + } + $opt = ($count==1) ? "id='pollopt'" : ""; + $text .=" post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; + $text .= "
        "; + } + + $text .="

        +
        ".POLLAN_9." + ".POLLAN_10."   + ".POLLAN_11." +
        ".POLLAN_12." + ".POLLAN_13."
        + ".POLLAN_14." +
        ".POLLAN_15."".r_userclass("pollUserclass", $_POST['pollUserclass'], "admin")."
        ".POLLAN_16." + ".POLLAN_17."
        + ".POLLAN_18."
        + ".POLLAN_19." +
        ".POLLAN_20.": + ".POLLAN_10." + ".POLLAN_11." +
        "; + + if (isset($_POST['preview'])) { + $text .= " "; + if (POLLACTION == "edit") { + $text .= " "; + } else { + $text .= " "; + } + } else { + $text .= " "; + } + if (POLLID) { + $text .= " "; + } + + $text .= "
        +
        +
        "; + + return $text; + } +} + +echo ' +'; + +?> \ No newline at end of file diff --git a/e107_plugins/poll/poll_menu.php b/e107_plugins/poll/poll_menu.php new file mode 100644 index 000000000..aa509123c --- /dev/null +++ b/e107_plugins/poll/poll_menu.php @@ -0,0 +1,52 @@ +render_poll($query, "menu", "query"); + +?> \ No newline at end of file diff --git a/e107_plugins/poll/poll_sql.php b/e107_plugins/poll/poll_sql.php new file mode 100644 index 000000000..c3ac6363e --- /dev/null +++ b/e107_plugins/poll/poll_sql.php @@ -0,0 +1,18 @@ +CREATE TABLE polls ( + poll_id int(10) unsigned NOT NULL auto_increment, + poll_datestamp int(10) unsigned NOT NULL default '0', + poll_start_datestamp int(10) unsigned NOT NULL default '0', + poll_end_datestamp int(10) unsigned NOT NULL default '0', + poll_admin_id int(10) unsigned NOT NULL default '0', + poll_title varchar(250) NOT NULL default '', + poll_options text NOT NULL, + poll_votes text NOT NULL, + poll_ip text NOT NULL, + poll_type tinyint(1) unsigned NOT NULL default '0', + poll_comment tinyint(1) unsigned NOT NULL default '1', + poll_allow_multiple tinyint(1) unsigned NOT NULL default '0', + poll_result_type tinyint(2) unsigned NOT NULL default '0', + poll_vote_userclass tinyint(3) unsigned NOT NULL default '0', + poll_storage_method tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (poll_id) +) TYPE=MyISAM; \ No newline at end of file diff --git a/e107_plugins/poll/search/search_comments.php b/e107_plugins/poll/search/search_comments.php new file mode 100644 index 000000000..eb190c69f --- /dev/null +++ b/e107_plugins/poll/search/search_comments.php @@ -0,0 +1,21 @@ + convert_date($row['comment_datestamp'], "long"); + $res['link'] = e_PLUGIN."poll/oldpolls.php?".$row['poll_id']; + $res['pre_title'] = 'Posted in reply to poll: '; + $res['title'] = $row['poll_title']; + $res['summary'] = $row['comment_comment']; + $res['detail'] = LAN_SEARCH_7.$nick.LAN_SEARCH_8.$datestamp; + return $res; +} + +?> \ No newline at end of file diff --git a/e107_plugins/poll/templates/poll_template.php b/e107_plugins/poll/templates/poll_template.php new file mode 100644 index 000000000..612b801c9 --- /dev/null +++ b/e107_plugins/poll/templates/poll_template.php @@ -0,0 +1,186 @@ + +

        +
        +{QUESTION} +

        +
        +
        +

        +
        +"; + +$POLL_NOTVOTED_LOOP = " +{OPTIONBUTTON}{OPTION} +

        "; + +$POLL_NOTVOTED_END = " +

        +
        +

        +{SUBMITBUTTON} +

        +{AUTHOR} +
        +{VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +

        +
        "; + + +/* ################################# */ +/* template for polls when user HAS voted ... */ + +$POLL_VOTED_START = " +
        +
        +{QUESTION} +
        +
        +
        +"; + +$POLL_VOTED_LOOP = " +{OPTION} +
        {BAR}

        +{VOTES} | {PERCENTAGE} +

        +"; + +$POLL_VOTED_END = " +
        +{AUTHOR} +
        +{VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        +"; + + +/* ################################# */ +/* template for polls when user CANNOT vote ... */ + + +$POLL_DISALLOWED_START = " +
        +
        +{QUESTION} +
        +
        +
        +"; + +$POLL_DISALLOWED_LOOP = " +{OPTION} +

        +"; + +$POLL_DISALLOWED_END = " +
        +{DISALLOWMESSAGE}

        +{VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        +"; + + +/* ################################# */ +/* template for forum polls when user HASN'T voted*/ + +$POLL_FORUM_NOTVOTED_START = " +
        + + + + + + + + + + + +
        +{QUESTION} +
        "; + +$POLL_FORUM_NOTVOTED_LOOP = " +{OPTIONBUTTON}{OPTION} +

        "; + +$POLL_FORUM_NOTVOTED_END = " +
        +
        +{SUBMITBUTTON} +
        +
        +
        "; + + +/* ################################# */ +/* template for forum polls when user HAS voted */ + +$POLL_FORUM_VOTED_START = " +
        + + + + + + + + + + + +
        +{QUESTION} +
        +"; + +$POLL_FORUM_VOTED_LOOP = " +{OPTION} +
        {BAR}
        +{VOTES} | {PERCENTAGE} +

        +"; + +$POLL_FORUM_VOTED_END = " +
        +
        +{VOTE_TOTAL} +
        +
        +
        +"; + +?> \ No newline at end of file diff --git a/e107_plugins/powered_by_menu/languages/English.php b/e107_plugins/powered_by_menu/languages/English.php new file mode 100644 index 000000000..318ba40c8 --- /dev/null +++ b/e107_plugins/powered_by_menu/languages/English.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/e107_plugins/powered_by_menu/powered_by_menu.php b/e107_plugins/powered_by_menu/powered_by_menu.php new file mode 100644 index 000000000..34527c955 --- /dev/null +++ b/e107_plugins/powered_by_menu/powered_by_menu.php @@ -0,0 +1,34 @@ + +
        +e107 +
        +
        +PHP +
        +
        +MySQL +
        +"; +$ns -> tablerender(POWEREDBY_L1, $text, 'powered_by'); +?> \ No newline at end of file diff --git a/e107_plugins/rss_menu/admin_prefs.php b/e107_plugins/rss_menu/admin_prefs.php new file mode 100644 index 000000000..c8cc6e595 --- /dev/null +++ b/e107_plugins/rss_menu/admin_prefs.php @@ -0,0 +1,412 @@ + db_Delete("rss", "rss_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED; + $e107cache->clear("rss"); +} + +//create rss feed +if(isset($_POST['create_rss'])){ + $message = $rss -> dbrss("create"); +} + +//update rss feed +if(isset($_POST['update_rss'])){ + $message = $rss -> dbrss("update"); +} + +//import rss feed +if(isset($_POST['import_rss'])){ + $message = $rss -> dbrssimport(); +} + +//update_limit +if(isset($_POST['update_limit'])){ + $message = $rss -> dbrsslimit(); +} +//update options +if(isset($_POST['updatesettings'])){ + $message = $rss->dboptions(); +} + +//config check +if($rss->file_check()){ + $message = RSS_LAN_ERROR_2; // space found in file. +} + + +//render message +if(isset($message)){ + $rss->show_message('', $message); +} + +//get template +if (is_readable(THEME."rss_template.php")) { + require_once(THEME."rss_template.php"); + } else { + require_once(e_PLUGIN."rss_menu/rss_template.php"); +} + +//listing +if(e_QUERY){ + $qs = explode(".", e_QUERY); + $field = (isset($qs[1])) ? $qs[1] : ""; + $sort = (isset($qs[2])) ? $qs[2] : ""; +} + + //create + if(isset($qs[0]) && $qs[0] == 'create' && !$_POST){ + $rss -> rssadmincreate(); + + //import + }elseif(isset($qs[0]) && $qs[0] == 'import'){ + $rss -> rssadminimport(); + + //options + }elseif(isset($qs[0]) && $qs[0] == 'options'){ + $rss -> rssadminoptions(); + + //list + }else{ + + $rss -> rssadminlist(); + } + +require_once(e_ADMIN."footer.php"); + +// ##### Display options -------------------------------------------------------------------------- +function admin_prefs_adminmenu(){ + global $sql, $qs; + + $act = $qs[0]; + if($act==""){$act="list";} + + $var['list']['text'] = RSS_LAN_ADMINMENU_2; + $var['list']['link'] = e_SELF."?list"; + + $var['create']['text'] = LAN_CREATE; + $var['create']['link'] = e_SELF."?create"; + + $var['import']['text'] = RSS_LAN_ADMINMENU_4; + $var['import']['link'] = e_SELF."?import"; + + $var['options']['text'] = LAN_OPTIONS; + $var['options']['link'] = e_SELF."?options"; + + show_admin_menu(RSS_LAN_ADMINMENU_1, $act, $var); + +} +// ##### End -------------------------------------------------------------------------------------- + + + + + + +class rss{ + + //check for config + function file_check(){ + $arrays = file_get_contents(e_BASE."e107_config.php"); + $arrays2 = file_get_contents(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php"); + if($arrays[0] != "<" || $arrays2[0] != "<"){ + return TRUE; + } + } + + + //admin : list : existing rss feeds + function rssadminlist(){ + global $qs, $ns, $sql, $rs, $tp, $field, $sort, $rss_shortcodes, $row, $RSS_ADMIN_LIST_HEADER, $RSS_ADMIN_LIST_TABLE, $RSS_ADMIN_LIST_FOOTER; + + $fieldstag = array('id'=>'rss_id','path'=>'rss_path','name'=>'rss_name','url'=>'rss_url','limit'=>'rss_limit'); + $order = (isset($fieldstag[$field])) ? "ORDER BY ".$fieldstag[$field]." ".$sort : "ORDER BY rss_id"; + + $query = "SELECT * FROM #rss ".$order; + if(!$sql->db_Select_gen($query)) + { + $this->show_message(LAN_ERROR, RSS_LAN_ERROR_3); + } + else + { + $text = $tp -> parseTemplate($RSS_ADMIN_LIST_HEADER, FALSE, $rss_shortcodes); + while($row=$sql->db_Fetch()) + { + $text .= $tp -> parseTemplate($RSS_ADMIN_LIST_TABLE, FALSE, $rss_shortcodes); + } + $text .= $tp -> parseTemplate($RSS_ADMIN_LIST_FOOTER, FALSE, $rss_shortcodes); + $ns->tablerender(RSS_LAN_ADMIN_1, $text); + } + } + + //create + function rssadmincreate(){ + global $ns, $qs, $rs, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_CREATE_TABLE; + + if( isset($qs[1]) && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){ + if(!$sql -> db_Select("rss", "*", "rss_id='".intval($qs[2])."' ")){ + $this->show_message(LAN_ERROR, RSS_LAN_ERROR_5); + }else{ + $row = $sql -> db_Fetch(); + + $row['rss_name'] = $tp -> toForm($row['rss_name']); + $row['rss_path'] = $tp -> toForm($row['rss_path']); + $row['rss_url'] = $tp -> toForm($row['rss_url']); + $row['rss_text'] = $tp -> toForm($row['rss_text']); + } + } + $text = $tp -> parseTemplate($RSS_ADMIN_CREATE_TABLE, FALSE, $rss_shortcodes); + $ns->tablerender(RSS_LAN_ADMIN_10, $text); + } + + //import + function rssadminimport(){ + global $sql, $ns, $i, $qs, $rs, $tp, $rss_shortcodes, $feed, $pref; + global $RSS_ADMIN_IMPORT_HEADER, $RSS_ADMIN_IMPORT_TABLE, $RSS_ADMIN_IMPORT_FOOTER; + + $sqli = new db; + $feedlist = array(); + + //news + $feed['name'] = ADLAN_0; + $feed['url'] = 'news'; //the identifier for the rss feed url + $feed['topic_id'] = ''; //the topic_id, empty on default (to select a certain category) + $feed['path'] = 'news'; //this is the plugin path location + $feed['text'] = RSS_PLUGIN_LAN_7; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $feedlist[] = $feed; + + //news categories + if($sqli -> db_Select("news_category", "*","category_id!='' ORDER BY category_name ")){ + while($rowi = $sqli -> db_Fetch()){ + $feed['name'] = ADLAN_0.' > '.$rowi['category_name']; + $feed['url'] = 'news'; + $feed['topic_id'] = $rowi['category_id']; + $feed['path'] = 'news'; + $feed['text'] = RSS_PLUGIN_LAN_10.' '.$rowi['category_name']; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $feedlist[] = $feed; + } + } + + //download + $feed['name'] = ADLAN_24; + $feed['url'] = 'download'; + $feed['topic_id'] = ''; + $feed['path'] = 'download'; + $feed['text'] = RSS_PLUGIN_LAN_8; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $feedlist[] = $feed; + + //download categories + if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order ")){ + while($rowi = $sqli -> db_Fetch()){ + $feed['name'] = ADLAN_24.' > '.$rowi['download_category_name']; + $feed['url'] = 'download'; + $feed['topic_id'] = $rowi['download_category_id']; + $feed['path'] = 'download'; + $feed['text'] = RSS_PLUGIN_LAN_11.' '.$rowi['download_category_name']; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $feedlist[] = $feed; + } + } + + //comments + $feed['name'] = RSS_PLUGIN_LAN_14; + $feed['url'] = 'comments'; + $feed['topic_id'] = ''; + $feed['path'] = 'comments'; + $feed['text'] = RSS_PLUGIN_LAN_9; + $feed['class'] = '0'; + $feed['limit'] = '9'; + $feedlist[] = $feed; + + //plugin rss feed, using e_rss.php in plugin folder + $plugin_feedlist = array(); + foreach($pref['e_rss_list'] as $val) + { + if (is_readable(e_PLUGIN.$val."/e_rss.php")) { + require_once(e_PLUGIN.$val."/e_rss.php"); + $plugin_feedlist = $eplug_rss_feed; + } + } + +/* if($sqli -> db_Select("plugin","plugin_path","plugin_installflag = '1' ORDER BY plugin_path ")){ + while($rowi = $sqli -> db_Fetch()){ + if (is_readable(e_PLUGIN.$rowi['plugin_path']."/e_rss.php")) { + require_once(e_PLUGIN.$rowi['plugin_path']."/e_rss.php"); + $plugin_feedlist = $eplug_rss_feed; + } + } + }*/ + + $feedlist = array_merge($feedlist, $plugin_feedlist); + + $render=FALSE; + $i=0; + $text = $RSS_ADMIN_IMPORT_HEADER; + foreach($feedlist as $k=>$feed){ + $feed['topic_id'] = $tp -> toDB($feed['topic_id']); + $feed['url'] = $tp -> toDB($feed['url']); + + //check if feed is not yet present + if(!$sql -> db_Select("rss", "*", "rss_path='".$feed['path']."' AND rss_url='".$feed['url']."' AND rss_topicid='".$feed['topic_id']."' ")) + { + $render=TRUE; + $text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_TABLE, FALSE, $rss_shortcodes); + $i++; + } + } + $text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_FOOTER, FALSE, $rss_shortcodes); + + if(!$render){ + $this->show_message(RSS_LAN_ADMIN_11, RSS_LAN_ERROR_6); + }else{ + $ns->tablerender(RSS_LAN_ADMIN_11, $text); + } + } + + //options + function rssadminoptions(){ + global $ns, $qs, $rs, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_OPTIONS_TABLE; + + $text = $tp -> parseTemplate($RSS_ADMIN_OPTIONS_TABLE, FALSE, $rss_shortcodes); + $ns->tablerender(LAN_OPTIONS, $text); + return; + } + + //render message + function show_message($caption='', $text=''){ + global $ns; + $ns -> tablerender($caption, "
        $text
        "); + } + + //db:create/update + function dbrss($mode='create'){ + global $qs, $sql, $ns, $rs, $tp, $e107cache; + + if($_POST['rss_name'] && $_POST['rss_url'] && $_POST['rss_path']){ + + $_POST['rss_name'] = $tp -> toDB(trim($_POST['rss_name'])); + $_POST['rss_url'] = $tp -> toDB($_POST['rss_url']); + $_POST['rss_topicid'] = $tp -> toDB($_POST['rss_topicid']); + $_POST['rss_path'] = $tp -> toDB($_POST['rss_path']); + $_POST['rss_text'] = $tp -> toDB($_POST['rss_text']); + $_POST['rss_class'] = (intval($_POST['rss_class']) ? intval($_POST['rss_class']) : '0'); + $_POST['rss_limit'] = intval($_POST['rss_limit']); + + if(isset($_POST['rss_datestamp']) && $_POST['rss_datestamp']!=''){ + $datestamp = intval($_POST['rss_datestamp']); + }else{ + $datestamp = time(); + } + + if($mode == 'create'){ + $message = ($sql -> db_Insert("rss", "'0', '".$_POST['rss_name']."', '".$_POST['rss_url']."', '".$_POST['rss_topicid']."', '".$_POST['rss_path']."', '".$_POST['rss_text']."', '".$datestamp."', '".$_POST['rss_class']."', '".$_POST['rss_limit']."' ")) ? LAN_CREATED : LAN_CREATED_FAILED; + $e107cache->clear("rss"); + + }elseif($mode == 'update'){ + $message = ($sql -> db_Update("rss", "rss_name = '".$_POST['rss_name']."', rss_url = '".$_POST['rss_url']."', rss_topicid = '".$_POST['rss_topicid']."', rss_path = '".$_POST['rss_path']."', rss_text = '".$_POST['rss_text']."', rss_datestamp = '".$datestamp."', rss_class = '".$_POST['rss_class']."', rss_limit = '".$_POST['rss_limit']."' WHERE rss_id = '".intval($_POST['rss_id'])."' ")) ? LAN_UPDATED : LAN_UPDATED_FAILED; + $e107cache->clear("rss"); + } + }else{ + $message = RSS_LAN_ERROR_7; + } + return $message; + } + + //import rss feeds + function dbrssimport(){ + global $sql, $tp; + + foreach($_POST['importid'] as $key=>$value) + { + $rss_topcid = ($_POST['topic_id'][$key] ? $tp -> toDB($_POST['topic_id'][$key]) : ''); + $rss_url = ($_POST['url'][$key] ? $tp -> toDB($_POST['url'][$key]) : ''); + $rss_path = ($_POST['path'][$key] ? $tp -> toDB($_POST['path'][$key]) : ''); + $rss_name = ($_POST['name'][$key] ? $tp -> toDB($_POST['name'][$key]) : ''); + $rss_text = ($_POST['text'][$key] ? $tp -> toDB($_POST['text'][$key]) : ''); + $rss_datestamp = time(); + $rss_class = ($_POST['class'][$key] ? intval($_POST['class'][$key]) : '0'); + $rss_limit = ($_POST['limit'][$key] ? intval($_POST['limit'][$key]) : '0'); + + $sql -> db_Insert("rss", "'0', '".$rss_name."', '".$rss_url."', '".$rss_topcid."', '".$rss_path."', '".$rss_text."', '".$rss_datestamp."', '".$rss_class."', '".$rss_limit."' "); + } + $message = count($_POST['importid'])." ".RSS_LAN_ADMIN_18; + return $message; + + } + + function dbrsslimit(){ + global $sql, $tp; + foreach($_POST['limit'] as $key=>$value) + { + $sql -> db_Update("rss", "rss_limit = '".intval($value)."' WHERE rss_id = '".intval($key)."' "); + } + header("location:".e_SELF."?r3"); + } + + //update options + function dboptions(){ + global $tp, $pref; + + $pref['rss_othernews'] = $_POST['rss_othernews']; + + save_prefs(); + return LAN_SAVED; + } + + +} //end class + + +?> diff --git a/e107_plugins/rss_menu/e_meta.php b/e107_plugins/rss_menu/e_meta.php new file mode 100644 index 000000000..70c59fb7b --- /dev/null +++ b/e107_plugins/rss_menu/e_meta.php @@ -0,0 +1,36 @@ +db_Select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name")){ + while($row=$sql->db_Fetch()){ + //wildcard topic_id's should not be listed + if(strpos($row['rss_url'], "*")===FALSE){ + $url = SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".$tp->toHTML($row['rss_url'], TRUE, 'constants, no_hook, emotes_off').".2"; + $name = $tp->toHTML($row['rss_name'], TRUE, 'no_hook, emotes_off'); + echo "\n"; + } + } + } +} +?> diff --git a/e107_plugins/rss_menu/images/rss1.png b/e107_plugins/rss_menu/images/rss1.png new file mode 100644 index 000000000..771dfb970 Binary files /dev/null and b/e107_plugins/rss_menu/images/rss1.png differ diff --git a/e107_plugins/rss_menu/images/rss2.png b/e107_plugins/rss_menu/images/rss2.png new file mode 100644 index 000000000..7c7a03c36 Binary files /dev/null and b/e107_plugins/rss_menu/images/rss2.png differ diff --git a/e107_plugins/rss_menu/images/rss3.png b/e107_plugins/rss_menu/images/rss3.png new file mode 100644 index 000000000..5c71e23d4 Binary files /dev/null and b/e107_plugins/rss_menu/images/rss3.png differ diff --git a/e107_plugins/rss_menu/images/rss4.png b/e107_plugins/rss_menu/images/rss4.png new file mode 100644 index 000000000..761ea0339 Binary files /dev/null and b/e107_plugins/rss_menu/images/rss4.png differ diff --git a/e107_plugins/rss_menu/images/rss_16.png b/e107_plugins/rss_menu/images/rss_16.png new file mode 100644 index 000000000..86a340da1 Binary files /dev/null and b/e107_plugins/rss_menu/images/rss_16.png differ diff --git a/e107_plugins/rss_menu/images/rss_32.png b/e107_plugins/rss_menu/images/rss_32.png new file mode 100644 index 000000000..b04ff96ca Binary files /dev/null and b/e107_plugins/rss_menu/images/rss_32.png differ diff --git a/e107_plugins/rss_menu/languages/English.php b/e107_plugins/rss_menu/languages/English.php new file mode 100644 index 000000000..76c319be8 --- /dev/null +++ b/e107_plugins/rss_menu/languages/English.php @@ -0,0 +1,92 @@ +
        << return to rss feed list"); +define("RSS_LAN_ERROR_2", "Your e107_config.php file or your language files contain spaces or  characters before the <? characters. You should remove this with a non-utf8 text-editor if you wish to have a valid RSS feed."); +define("RSS_LAN_ERROR_3", "No rss feeds are present yet
        please use the import feature to import available rss feeds or create a rss feed manually."); +define("RSS_LAN_ERROR_4", "No rss feeds are available yet"); +define("RSS_LAN_ERROR_5", "This rss entry does not exist"); +define("RSS_LAN_ERROR_6", "There are no rss feeds to import"); +define("RSS_LAN_ERROR_7", "Some required fields are missing."); + +define("RSS_LAN_ADMIN_1", "Existing RSS feeds"); +define("RSS_LAN_ADMIN_2", "Id"); +define("RSS_LAN_ADMIN_3", "Path"); +define("RSS_LAN_ADMIN_4", "Name"); +define("RSS_LAN_ADMIN_5", "Url"); +define("RSS_LAN_ADMIN_6", "Text"); +define("RSS_LAN_ADMIN_7", "Limit"); +define("RSS_LAN_ADMIN_8", "Visibility"); +define("RSS_LAN_ADMIN_9", "Type"); +define("RSS_LAN_ADMIN_10", "rss feed create entry"); +define("RSS_LAN_ADMIN_11", "rss feed import feeds"); +define("RSS_LAN_ADMIN_12", "Topic id"); + +define("RSS_LAN_ADMIN_13", "Include Other-news items in News Feed?"); +define("RSS_LAN_ADMIN_14", "Enable"); +define("RSS_LAN_ADMIN_15", "Tick links to mark them for import ..."); +define("RSS_LAN_ADMIN_16", "import?"); +define("RSS_LAN_ADMIN_17", "import ticked links"); +define("RSS_LAN_ADMIN_18", "rss feed(s) imported."); + +define("RSS_LAN_ADMIN_21", "active and visible in rss feed list"); +define("RSS_LAN_ADMIN_22", "active and not visible in rss feed list"); +define("RSS_LAN_ADMIN_23", "inactive"); + +define("RSS_LAN_ADMIN_26", "Check All"); +define("RSS_LAN_ADMIN_27", "Uncheck All"); + +define("RSS_LAN_ADMIN_31", "rss entries limit updated"); + +define("RSS_LAN_0", "RSS"); +define("RSS_LAN_2", "@nospam.com"); +define("RSS_LAN_3", "noauthor@nospam.com"); + +?> diff --git a/e107_plugins/rss_menu/plugin.php b/e107_plugins/rss_menu/plugin.php new file mode 100644 index 000000000..b07d13859 --- /dev/null +++ b/e107_plugins/rss_menu/plugin.php @@ -0,0 +1,111 @@ + diff --git a/e107_plugins/rss_menu/rss.php b/e107_plugins/rss_menu/rss.php new file mode 100644 index 000000000..2b10cefb2 --- /dev/null +++ b/e107_plugins/rss_menu/rss.php @@ -0,0 +1,669 @@ +e_bb)) { + require_once(e_HANDLER.'bbcode_handler.php'); + $tp->e_bb = new e_bbcode; +} + +//get language file +if (is_readable(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php")) { + include_once(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php"); +} else { + include_once(e_PLUGIN."rss_menu/languages/English.php"); +} + +//get template +if (is_readable(THEME."rss_template.php")) { + require_once(THEME."rss_template.php"); + } else { + require_once(e_PLUGIN."rss_menu/rss_template.php"); +} + +//query handler +list($content_type, $rss_type, $topic_id) = explode(".", e_QUERY); + +//list available rss feeds +if (intval($rss_type) == false) { + require_once(HEADERF); + require_once(e_PLUGIN."rss_menu/rss_template.php"); + + if(!$sql->db_Select("rss", "*", "rss_class='0' AND rss_limit>0 AND rss_topicid NOT REGEXP ('\\\*') ORDER BY rss_name")) + { + $ns->tablerender(LAN_ERROR, RSS_LAN_ERROR_4); + } + else + { + $text = $RSS_LIST_HEADER; + while($row=$sql->db_Fetch()) + { + $text .= $tp -> parseTemplate($RSS_LIST_TABLE, FALSE, $rss_shortcodes); + } + $text .= $RSS_LIST_FOOTER; + $ns->tablerender(RSS_MENU_L2, $text); + } + + require_once(FOOTERF); + exit; +} + +//conversion table for old urls ------- +$conversion[1] = "news"; +$conversion[5] = "comments"; +$conversion[10] = "bugtracker"; +$conversion[12] = "download"; +//------------------------------------- + +//convert certain old urls so we can check the db entries --------------------- +if($topic_id){ + //rss.php?1.2.14 (news, rss-2, cat=14) + if(is_numeric($content_type) && isset($conversion[$content_type]) ){ + $content_type = $conversion[$content_type]; + } +}else{ + //rss.php?1.2 (news, rss-2) --> check = news (check conversion table) + if(is_numeric($content_type) && isset($conversion[$content_type]) ){ + $content_type = $conversion[$content_type]; + } +} + +$check_topic = ($topic_id ? " AND rss_topicid = '".$topic_id."' " : ""); + +if(!$sql -> db_Select("rss", "*", "rss_class!='2' AND rss_url='".$content_type."' ".$check_topic." AND rss_limit>0 ")) +{ + //check if wildcard present for topic_id + $check_topic = ($topic_id ? " AND rss_topicid = '".str_replace($topic_id, "*", $topic_id)."' " : ""); + if(!$sql -> db_Select("rss", "*", "rss_class!='2' AND rss_url='".$content_type."' ".$check_topic." AND rss_limit>0 ")) + { + require_once(HEADERF); + $ns->tablerender("", RSS_LAN_ERROR_1); + require_once(FOOTERF); + exit; + }else{ + $row = $sql->db_Fetch(); + } +}else{ + $row = $sql->db_Fetch(); +} + +//debugging +//echo $check." - ".$content_type." - ".$rss_type." - ".$topic_id."
        "; +//exit; + +// ---------------------------------------------------------------------------- + +if($rss = new rssCreate($content_type, $rss_type, $topic_id, $row)){ + $rss_title = ($rss->contentType ? $rss->contentType : ucfirst($content_type)); + $rss->buildRss ($rss_title); +}else{ + require_once(HEADERF); + $ns->tablerender(RSS_LAN_ERROR_0, RSS_LAN_ERROR_1); + require_once(FOOTERF); + exit; +} + +class rssCreate { + + var $contentType; + var $rssType; + var $path; + var $parm; + var $rssItems; + var $rssQuery; + var $topicid; + var $offset; + var $rssNamespace; + var $rssCustomChannel; + + function rssCreate($content_type, $rss_type, $topic_id, $row) { + // constructor + $sql_rs = new db; + global $tp, $sql, $e107, $PLUGINS_DIRECTORY, $pref, $rssgen; + $this -> path = e_PLUGIN."rss_menu/"; + $this -> rssType = $rss_type; + $this -> topicid = $topic_id; + $this -> offset = $pref['time_offset'] * 3600; + $this -> limit = $row['rss_limit']; + $this -> contentType = $row['rss_name']; + + if(!is_numeric($content_type)){ + $path = e_PLUGIN.$row['rss_path']."/e_rss.php"; + } + if(strpos($row['rss_path'],'|')!==FALSE){ + $tmp = explode("|", $row['rss_path']); + $path = e_PLUGIN.$tmp[0]."/e_rss.php"; + $this -> parm = $tmp[1]; //parm is used in e_rss.php to define which feed you need to prepare + } + + switch ($content_type) { + case news: + case 1: + if($topic_id && is_numeric($topic_id)){ + $topic = " AND news_category = ".intval($topic_id); + }else{ + $topic = ''; + } + $path=''; + $render = ($pref['rss_othernews'] != 1) ? "AND n.news_render_type < 2" : ""; + + $this -> rssQuery = " + SELECT n.*, u.user_id, u.user_name, u.user_email, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") {$render} {$topic} ORDER BY news_datestamp DESC LIMIT 0,".$this -> limit; + $sql->db_Select_gen($this -> rssQuery); + $tmp = $sql->db_getList(); + $this -> rssItems = array(); + $loop=0; + foreach($tmp as $value) { + $this -> rssItems[$loop]['title'] = $value['news_title']; + $this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."news.php?item.".$value['news_id'].".".$value['news_category']; + if($value['news_summary']){ + $this -> rssItems[$loop]['description'] = $value['news_summary']; + }else{ + $this -> rssItems[$loop]['description'] = $value['news_body']; + } + $this -> rssItems[$loop]['author'] = $value['user_name']; + $this -> rssItems[$loop]['author_email'] = $value['user_email']; + $this -> rssItems[$loop]['category'] = "".$value['category_name'].""; + + if($value['news_allow_comments'] && $pref['comments_disabled'] != 1){ + $this -> rssItems[$loop]['comment'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$value['news_id']; + } + $this -> rssItems[$loop]['pubdate'] = $value['news_datestamp']; + + $loop++; + } + break; + case 2: + $path=''; + $this -> contentType = "articles"; + break; + case 3: + $path=''; + $this -> contentType = "reviews"; + break; + case 4: + $path=''; + $this -> contentType = "content"; + break; + case comments: + case 5: + $path=''; + $this -> rssQuery = "SELECT * FROM #comments ORDER BY comment_datestamp DESC LIMIT 0,".$this -> limit; + $sql->db_Select_gen($this -> rssQuery); + $tmp = $sql->db_getList(); + $this -> rssItems = array(); + $loop=0; + foreach($tmp as $value) { + $this -> rssItems[$loop]['title'] = $value['comment_subject']; + + switch ($value['comment_type']) { + case 0: + $this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$value['comment_item_id']; + break; + case 4: + $this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.poll.".$value['comment_item_id']; + break; + } + + $this -> rssItems[$loop]['description'] = $value['comment_comment']; + $this -> rssItems[$loop]['author'] = substr($value['comment_author'], (strpos($value['comment_author'], ".")+1)); + $loop++; + } + break; + + case 6: + case 7: + $path = e_PLUGIN."forum/e_rss.php"; + break; + + case 8: + if(!$this -> topicid) { + return FALSE; + } + $path = e_PLUGIN."forum/e_rss.php"; + break; + + /* + case 10: + $this -> limit = '9'; + $path=''; + $this -> contentType = "bugtracker reports"; + $sql->db_Select("bugtrack2_bugs", "*", "bugtrack2_bugs_status=0 ORDER BY bugtrack2_bugs_datestamp LIMIT 0,".$this -> limit); + $tmp = $sql->db_getList(); + $this -> rssItems = array(); + $loop=0; + foreach($tmp as $value) { + $nick = preg_replace("/[0-9]+\./", "", $value['bugtrack2_bugs_poster']); + $this -> rssItems[$loop]['author'] = $nick; + $this -> rssItems[$loop]['title'] = $value['bugtrack2_bugs_summary']; + $this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."bugtracker2/bugtracker2.php?0.bug.".$value['bugtrack2_bugs_id']; + $this -> rssItems[$loop]['description'] = $value['bugtrack2_bugs_description']; + $loop++; + } + break; + */ + + case 11: + if(!$this -> topicid) { + return FALSE; + } + $path = e_PLUGIN."forum/e_rss.php"; + break; + + case download: + case 12: + if($topic_id && is_numeric($topic_id)){ + $topic = "d.download_category='".intval($topic_id)."' AND "; + }else{ + $topic = ""; + } + $path=''; + $class_list = "0,251,252,253"; + $query = "SELECT d.*, dc.* FROM #download AS d LEFT JOIN #download_category AS dc ON d.download_category = dc.download_category_id WHERE {$topic} d.download_active > 0 AND d.download_class IN (".$class_list.") ORDER BY d.download_datestamp DESC LIMIT 0,".$this -> limit; + $sql -> db_Select_gen($query); + + // $sql->db_Select("download", "*", "{$topic} download_active > 0 AND download_class IN (".$class_list.") ORDER BY download_datestamp DESC LIMIT 0,".$this -> limit); + $tmp = $sql->db_getList(); + $this -> rssItems = array(); + $loop=0; + foreach($tmp as $value) { + if($value['download_author']){ + $nick = preg_replace("/[0-9]+\./", "", $value['download_author']); + $this -> rssItems[$loop]['author'] = $nick; + } + $this -> rssItems[$loop]['author_email'] = $value['download_author_email']; + $this -> rssItems[$loop]['title'] = $value['download_name']; + $this -> rssItems[$loop]['link'] = $e107->base_path."download.php?view.".$value['download_id']; + $this -> rssItems[$loop]['description'] = ($rss_type == 3 ? $value['download_description'] : $value['download_description']); + $this -> rssItems[$loop]['category_name'] = $value['download_category_name']; + $this -> rssItems[$loop]['category_link'] = $e107->base_path."download.php?list.".$value['download_category_id']; + $this -> rssItems[$loop]['enc_url'] = $e107->base_path."request.php?".$value['download_id']; + $this -> rssItems[$loop]['enc_leng'] = $value['download_filesize']; + $this -> rssItems[$loop]['enc_type'] = $this->getmime($value['download_url']); + $this -> rssItems[$loop]['pubdate'] = $value['download_datestamp']; + $loop++; + } + break; + } + + + if(isset($path) && $path!=''){ + + //new rss reader from e_rss.php in plugin folder + if (is_readable($path)) { + require_once($path); + foreach($eplug_rss_data as $key=>$rs){ + foreach($rs as $k=>$row){ + $this -> rssItems[$k]['author'] = $row['author']; + $this -> rssItems[$k]['author_email'] = $row['author_email']; + $this -> rssItems[$k]['title'] = $row['title']; + if($row['link']){ + if(eregi("http",$row['link'])){ + $this -> rssItems[$k]['link'] = $row['link']; + }else{ + $this -> rssItems[$k]['link'] = $e107->base_path.$PLUGINS_DIRECTORY.$row['link']; + } + } + $this -> rssItems[$k]['description'] = $row['description']; + if($row['enc_url']){ + $this -> rssItems[$k]['enc_url'] = $e107->base_path.$PLUGINS_DIRECTORY.$enc_url.$row['item_id']; + } + if($row['enc_leng']){ + $this -> rssItems[$k]['enc_leng'] = $row['enc_leng']; + } + + if($eplug_rss['enc_type']){ + $this -> rssItems[$k]['enc_type'] = $this->getmime($eplug_rss['enc_type']); + }elseif($row['enc_type']){ + $this -> rssItems[$k]['enc_type'] = $row['enc_type']; + } + + $this -> rssItems[$k]['category_name'] = $row['category_name']; + if($row['category_link']){ + if(eregi("http",$row['category_link'])){ + $this -> rssItems[$k]['category_link'] = $row['category_link']; + }else{ + $this -> rssItems[$k]['category_link'] = $e107->base_path.$PLUGINS_DIRECTORY.$row['category_link']; + } + } + if($row['datestamp']){ + $this -> rssItems[$k]['pubdate'] = $row['datestamp']; + } + } + } + } + } + + } + + function buildRss($rss_title) { + global $sql, $pref, $tp, $e107, $PLUGINS_DIRECTORY; + header('Content-type: application/xml', TRUE); + + $rss_title = $tp->toRss($pref['sitename']." : ".$rss_title); + $rss_namespace = ($this->rssNamespace) ? "xmlns:".$this->rssNamespace : ""; + $rss_custom_channel = ($this->rssCustomChannel) ? $this->rssCustomChannel : ""; + $time = time(); + switch ($this -> rssType) { + case 1: // Rss 1.0 + echo " + + + + + ".$tp->toRss($rss_title)." + ".$pref['siteurl']." + ".$tp->toRss($pref['sitedescription'])." + ".$itemdate = date("r", ($time + $this -> offset))." + http://backend.userland.com/rss092\n"; + + foreach($this -> rssItems as $value) + { + + // Multi-language rss links. + $link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link']; + + echo " + + ".$tp->toRss($value['title'])." + ".$tp->toRss(substr($value['description'],0,150))." + ".$value['author']."<".$this->nospam($value['author_email'])."> + ".$link." + "; + } + echo " + + "; + break; + + case 2: // rss 2.0 + $sitebutton = (strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON); + echo " + + + + + + ".$tp->toRss($rss_title)." + ".$pref['siteurl']." + ".$tp->toRss($pref['sitedescription'])."\n"; + + echo $tp->toRss($rss_custom_channel,TRUE)."\n"; + + echo "".CORE_LC.(defined("CORE_LC2") ? "-".CORE_LC2 : "")." + ".preg_replace("#\
        |\n|\r#si", "", SITEDISCLAIMER)."
        + ".$pref['siteadmin']." - ".$this->nospam($pref['siteadminemail'])." + ".$this->nospam($pref['siteadminemail'])." + ".date("r",($time + $this -> offset))." + ".date("r",($time + $this -> offset))." + http://backend.userland.com/rss + e107 (http://e107.org) + 60 + + ".$tp->toRss($rss_title)." + ".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)." + ".$pref['siteurl']." + 88 + 31 + ".$tp->toRss($pref['sitedescription'])." + + + Search + Search ".$tp->toRss($pref['sitename'])." + query + ".SITEURL.(substr(SITEURL, -1) == "/" ? "" : "/")."search.php + "; + foreach($this -> rssItems as $value) + { + // Multi-language rss links. + $link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link']; + $catlink = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['category_link']) : $value['category_link']; + + echo " + + ".$tp->toRss($value['title'])."\n"; + + if($link){ + echo "".$link."\n"; + } + + echo "".$tp->toRss($value['description'],TRUE)."\n"; + + if($value['category_name'] && $catlink){ + echo "".$tp -> toRss($value['category_name'])."\n"; + } + + if($value['comment']){ + //echo "".$tp->toRss($value['comment'])."\n"; + echo "".$value['comment']."\n"; + } + + if($value['author']){ + echo "".$value['author']."<".$this->nospam($value['author_email']).">\n"; + } + + // enclosure support for podcasting etc. + if($value['enc_url'] && $value['enc_leng'] && $value['enc_type']){ + echo "\n"; + } + + echo "".date("r", ($value['pubdate'] + $this -> offset))."\n"; + + if($link){ + echo "".$link."\n"; + } + + echo ""; + } + echo " +
        +
        "; + break; + + case 3: // rdf + echo " + + + + + ".$tp->toRss($rss_title)." + ".$pref['siteurl']." + ".$tp->toRss($pref['sitedescription'])." + ".CORE_LC.(defined("CORE_LC2") ? "-".CORE_LC2 : "")." + ".$this->get_iso_8601_date($time + $this -> offset). " + ".$this->nospam($pref['siteadminemail'])." + + nospam($pref['siteadminemail'])."\" /> + hourly + 1 + 2000-01-01T12:00+00:00 + + "; + + foreach($this -> rssItems as $value) + { + + // Multi-language rss links. + $link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link']; + + echo " + "; + } + + echo " + + + "; + + reset($this -> rssItems); + unset($link); + foreach($this -> rssItems as $value) + { + + // Multi-language rss links. + $link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link']; + + echo " + + ".$tp->toRss($value['title'])." + ".$link." + ".$this->get_iso_8601_date($time + $this -> offset)." + ".$value['author']." + ".$tp->toRss($value['category_name'])." + ".$tp->toRss($value['description'])." + "; + } + echo " + "; + break; + + //new feed for atom - still in development, and not yet tested + case 4: + echo "\n + \n"; + /* + \n"; + */ + + //required + echo " + ".$pref['siteurl']."\n + ".$tp->toRss($rss_title)."\n + ".$this->get_iso_8601_date($time + $this -> offset)."\n"; + + //recommended + echo " + \n + e107\n"; + //\n + echo " + http://e107.org/\n + \n + \n"; + + //optional + include(e_ADMIN."ver.php"); + echo " + \n + \n + e107\n + \n + e107\n"; + ///icon.jpg\n + echo " + ".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)."\n + ".$pref['siteadmin']." - ".$this->nospam($pref['siteadminemail'])."\n"; + if($pref['sitedescription']){ + echo " + ".$pref['sitedescription']."\n"; + } + foreach($this -> rssItems as $value) { + echo " + \n"; + + //required + echo " + ".$value['link']."\n + ".$tp->toRss($value['title'])."\n + ".$this->get_iso_8601_date($value['pubdate'] + $this -> offset)."\n"; + + //recommended + $author = ($value['author']) ? $value['author'] : "unknown"; + + echo " + \n"; + echo " + ".$author."\n"; + echo ($value['author_email']) ? "\t\t\t\t\t\t".$this->nospam($value['author_email'])."\n" : ""; + echo "\n"; + //complete story here\n + echo " + \n + ".$tp->toRss($value['description'])."\n"; + + //optional + if($value['category_name']){ + echo "\n"; + } + // + // Jane Doe + // + echo "".$this->get_iso_8601_date($value['pubdate'] + $this -> offset)."\n"; + // + // http://example.org/ + // Fourty-Two + // 2003-12-13T18:30:02Z + // 2005 Example, Inc. + // + //&copy; 2005 John Doe + echo " + \n"; + } + echo " + \n"; + + break; + } + } + + function getmime($file){ + $ext = strtolower(str_replace(".","",strrchr(basename($file), "."))); + $mime["mp3"] = "audio/mpeg"; + return $mime[$ext]; + } + + function get_iso_8601_date($int_date) { + //$int_date: current date in UNIX timestamp + $date_mod = date('Y-m-d\TH:i:s', $int_date); + $pre_timezone = date('O', $int_date); + $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); + $date_mod .= $time_zone; + return $date_mod; + } + + function nospam($text){ + $tmp = explode("@",$text); + return ($tmp[0] != "") ? $tmp[0].RSS_LAN_2 : RSS_LAN_3; + } + +} + +?> diff --git a/e107_plugins/rss_menu/rss_menu.php b/e107_plugins/rss_menu/rss_menu.php new file mode 100644 index 000000000..fa0875910 --- /dev/null +++ b/e107_plugins/rss_menu/rss_menu.php @@ -0,0 +1,81 @@ + db_Select("rss", "rss_path", " rss_path = 'comments' LIMIT 1")) { + $type = 5; + $des = RSS_MENU_L4; +} +if(strstr(e_SELF, "/forum")&& $sql -> db_Select("rss", "rss_path", " rss_path = 'forum|name' LIMIT 1") ) { + $type = 6; + $des = RSS_MENU_L5; +} +if(strstr(e_SELF, "forum_viewtopic") && $sql -> db_Select("rss", "rss_path", " rss_path = 'forum|topic' LIMIT 1")) { + $type = 7; + $des = RSS_MENU_L6; +} +if(strstr(e_SELF, "chat.php")&& $sql -> db_Select("rss", "rss_path", " rss_path = 'chatbox_menu' LIMIT 1")) { + $type = 9; + $des = RSS_MENU_L7; +} + +if(strstr(e_SELF, "/bugtracker")) { + $type = 10; + $des = RSS_MENU_L8; +} + +if(strstr(e_SELF, "download.php") && $sql -> db_Select("rss", "rss_path", " rss_path = 'download' LIMIT 1")) { + $type = 12; + $des = RSS_MENU_L9; +} + +if(!$des) { + $type = 1; + $des = RSS_MENU_L3; +} + +if(e_PAGE == "news.php" && $pref['rss_newscats']) +{ + + $qry = explode(".",e_QUERY); + if($qry[0] == "cat" || $qry[0] == "list") + { + $topic = intval($qry[1]); + } +} + +$text = " +
        +".$des.RSS_MENU_L1."
        +
        rss1.0
        +
        rss2.0
        +
        rdf
        +
        "; + +$caption = (file_exists(THEME."images/RSS_menu.png") ? " ".RSS_MENU_L2 : RSS_MENU_L2); + +$ns->tablerender($caption, $text, 'backend'); + +?> diff --git a/e107_plugins/rss_menu/rss_shortcodes.php b/e107_plugins/rss_menu/rss_shortcodes.php new file mode 100644 index 000000000..eec764f51 --- /dev/null +++ b/e107_plugins/rss_menu/rss_shortcodes.php @@ -0,0 +1,192 @@ + e_sc -> parse_scbatch(__FILE__); +/* + +SC_BEGIN RSS_FEED +global $row, $tp; +$url2 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : ''); +return "".$tp->toHTML($row['rss_name'], TRUE).""; +SC_END + +SC_BEGIN RSS_ICON +global $row, $tp; +$url2 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : ''); +return "".RSS_ICON.""; +SC_END + +SC_BEGIN RSS_TEXT +global $row, $tp; +return $tp->toHTML($row['rss_text'], TRUE, "defs"); +SC_END + +SC_BEGIN RSS_TYPES +global $row, $tp; +$url1 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".1".($row['rss_topicid'] ? ".".$row['rss_topicid'] : ''); +$url2 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : ''); +$url3 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".3".($row['rss_topicid'] ? ".".$row['rss_topicid'] : ''); +$url4 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".4".($row['rss_topicid'] ? ".".$row['rss_topicid'] : ''); + +$text = " +rss1 +rss1 +rss1 +rss1 +"; +return $text; +SC_END + + +//##### ADMIN -------------------------------------------------- + +SC_BEGIN RSS_ADMIN_CAPTION +global $sort; +list($field,$txt) = explode(",",$parm); +$txt = constant($txt); +return "".$txt."\n"; +SC_END + +SC_BEGIN RSS_ADMIN_ID +global $row; +return $row['rss_id']; +SC_END + +SC_BEGIN RSS_ADMIN_NAME +global $row; +return $row['rss_name']; +SC_END + +SC_BEGIN RSS_ADMIN_PATH +global $row; +return $row['rss_path']; +SC_END + +SC_BEGIN RSS_ADMIN_URL +global $row; +return "".$row['rss_url'].""; +SC_END + +SC_BEGIN RSS_ADMIN_TOPICID +global $row; +return $row['rss_topicid']; +SC_END + +SC_BEGIN RSS_ADMIN_LIMIT +global $row, $rs; +$id = $row['rss_id']; +return ""; +SC_END + +SC_BEGIN RSS_ADMIN_LIMITBUTTON +global $row; +return ""; +SC_END + +SC_BEGIN RSS_ADMIN_OPTIONS +global $row, $tp; +$delname = $row['rss_name']; +$delid = $row['rss_id']; +$options = " +".ADMIN_EDIT_ICON." +toJS(LAN_CONFIRMDEL ." [".RSS_LAN_ADMIN_2.": ".$delid." : ".$delname."]\\n\\n")."')\"/>"; +return $options; +SC_END + + + +SC_BEGIN RSS_ADMIN_FORM_NAME +global $row; +return "\n"; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_URL +global $row,$PLUGINS_DIRECTORY; +return SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".e_LANQRY." .{".RSS_LAN_ADMIN_9."}.{".RSS_LAN_ADMIN_12."}"; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_TOPICID +global $row; +return ""; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_PATH +global $row; +return ""; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_TEXT +global $row; +return "\n"; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_CLASS +global $row; +$vals = array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23); +$text = ""; +return $text; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_LIMIT +global $row; +return ""; +SC_END + +SC_BEGIN RSS_ADMIN_FORM_CREATEBUTTON +global $row, $qs; +if(isset($qs[1]) && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){ + $text = " + + "; +}else{ + $text = ""; +} +return $text; +SC_END + + + +SC_BEGIN RSS_ADMIN_IMPORT_CHECK +global $feed, $rs, $tp, $i; +$text = ""; +$text .= ""; +$text .= ""; +$text .= ""; +$text .= ""; +$text .= ""; +$text .= ""; +$text .= ""; +return $text; +SC_END + +SC_BEGIN RSS_ADMIN_IMPORT_PATH +global $feed; +return $feed['path']; +SC_END + +SC_BEGIN RSS_ADMIN_IMPORT_NAME +global $feed; +return $feed['name']; +SC_END + +SC_BEGIN RSS_ADMIN_IMPORT_TEXT +global $feed; +return $feed['text']; +SC_END + +SC_BEGIN RSS_ADMIN_IMPORT_URL +global $feed; +return $feed['url']; +SC_END + +SC_BEGIN RSS_ADMIN_IMPORT_TOPICID +global $feed; +return $feed['topic_id']; +SC_END + +*/ +?> \ No newline at end of file diff --git a/e107_plugins/rss_menu/rss_sql.php b/e107_plugins/rss_menu/rss_sql.php new file mode 100644 index 000000000..7d5bf8082 --- /dev/null +++ b/e107_plugins/rss_menu/rss_sql.php @@ -0,0 +1,12 @@ +CREATE TABLE rss ( + rss_id int(10) unsigned NOT NULL auto_increment, + rss_name varchar(255) NOT NULL default '', + rss_url text NOT NULL, + rss_topicid varchar(255) NOT NULL default '', + rss_path varchar(255) NOT NULL default '', + rss_text longtext NOT NULL, + rss_datestamp int(10) unsigned NOT NULL default '0', + rss_class tinyint(1) unsigned NOT NULL default '0', + rss_limit tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (rss_id) +) TYPE=MyISAM; diff --git a/e107_plugins/rss_menu/rss_template.php b/e107_plugins/rss_menu/rss_template.php new file mode 100644 index 000000000..32060a9b8 --- /dev/null +++ b/e107_plugins/rss_menu/rss_template.php @@ -0,0 +1,175 @@ + + + ".RSS_LAN_ADMIN_4." + ".RSS_PLUGIN_LAN_6." + "; +} +if(!isset($RSS_LIST_TABLE)){ + $RSS_LIST_TABLE = " + + {RSS_FEED}
        + {RSS_TEXT} + + + {RSS_TYPES} + + "; +} +if(!isset($RSS_LIST_FOOTER)){ + $RSS_LIST_FOOTER = ""; +} + +//admin : rss listing +if(!isset($RSS_ADMIN_LIST_HEADER)){ + $RSS_ADMIN_LIST_HEADER = " +
        +
        + + + + + + + + + + "; +} +if(!isset($RSS_ADMIN_LIST_TABLE)){ + $RSS_ADMIN_LIST_TABLE = " + + + + + + + + + "; +} +if(!isset($RSS_ADMIN_LIST_FOOTER)){ + $RSS_ADMIN_LIST_FOOTER = " + + + +
        {RSS_ADMIN_CAPTION=id,RSS_LAN_ADMIN_2}{RSS_ADMIN_CAPTION=name,RSS_LAN_ADMIN_4}{RSS_ADMIN_CAPTION=path,RSS_LAN_ADMIN_3}{RSS_ADMIN_CAPTION=url,RSS_LAN_ADMIN_5}".RSS_LAN_ADMIN_12."{RSS_ADMIN_CAPTION=limit,RSS_LAN_ADMIN_7}".LAN_OPTIONS."
        {RSS_ADMIN_ID}{RSS_ADMIN_NAME}{RSS_ADMIN_PATH}{RSS_ADMIN_URL}{RSS_ADMIN_TOPICID}{RSS_ADMIN_LIMIT}{RSS_ADMIN_OPTIONS}
        + {RSS_ADMIN_LIMITBUTTON} +
        +
        +
        "; +} + +//admin : rss create/edit +if(!isset($RSS_ADMIN_CREATE_TABLE)){ + $RSS_ADMIN_CREATE_TABLE = " +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".RSS_LAN_ADMIN_4."{RSS_ADMIN_FORM_NAME}
        ".RSS_LAN_ADMIN_5."{RSS_ADMIN_FORM_URL}
        ".RSS_LAN_ADMIN_12."{RSS_ADMIN_FORM_TOPICID}
        ".RSS_LAN_ADMIN_3."{RSS_ADMIN_FORM_PATH}
        ".RSS_LAN_ADMIN_6."{RSS_ADMIN_FORM_TEXT}
        ".RSS_LAN_ADMIN_7."{RSS_ADMIN_FORM_LIMIT}
        ".RSS_LAN_ADMIN_8."{RSS_ADMIN_FORM_CLASS}
        {RSS_ADMIN_FORM_CREATEBUTTON}
        +
        +
        "; +} + +//admin : rss options +if(!isset($RSS_ADMIN_OPTIONS_TABLE)){ + $RSS_ADMIN_OPTIONS_TABLE = " +
        +
        + + + + + + + + + + + + +
        ".LAN_OPTIONS."".RSS_LAN_ADMIN_14."
        ".RSS_LAN_ADMIN_13." + +
        + +
        +
        +
        "; +} + +//admin : rss import +if(!isset($RSS_ADMIN_IMPORT_HEADER)){ + $RSS_ADMIN_IMPORT_HEADER = " +
        +
        + + + + + + + + + "; +} +if(!isset($RSS_ADMIN_IMPORT_TABLE)){ + $RSS_ADMIN_IMPORT_TABLE = " + + + + + + + "; +} + +if(!isset($RSS_ADMIN_IMPORT_FOOTER)){ + $RSS_ADMIN_IMPORT_FOOTER = " + + + +
        ".RSS_LAN_ADMIN_15."
        ".RSS_LAN_ADMIN_16."".RSS_LAN_ADMIN_3."".RSS_LAN_ADMIN_4."".RSS_LAN_ADMIN_5."".RSS_LAN_ADMIN_12."
        {RSS_ADMIN_IMPORT_CHECK}{RSS_ADMIN_IMPORT_PATH}{RSS_ADMIN_IMPORT_NAME}
        {RSS_ADMIN_IMPORT_TEXT}
        {RSS_ADMIN_IMPORT_URL}{RSS_ADMIN_IMPORT_TOPICID}
        + +
        +
        +
        "; +} + +?> \ No newline at end of file diff --git a/e107_plugins/search_menu/images/search.png b/e107_plugins/search_menu/images/search.png new file mode 100644 index 000000000..dd353930b Binary files /dev/null and b/e107_plugins/search_menu/images/search.png differ diff --git a/e107_plugins/search_menu/images/search_32.png b/e107_plugins/search_menu/images/search_32.png new file mode 100644 index 000000000..328e2d455 Binary files /dev/null and b/e107_plugins/search_menu/images/search_32.png differ diff --git a/e107_plugins/search_menu/languages/English.php b/e107_plugins/search_menu/languages/English.php new file mode 100644 index 000000000..360d1e54a --- /dev/null +++ b/e107_plugins/search_menu/languages/English.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/e107_plugins/search_menu/search_menu.php b/e107_plugins/search_menu/search_menu.php new file mode 100644 index 000000000..4d54e2d02 --- /dev/null +++ b/e107_plugins/search_menu/search_menu.php @@ -0,0 +1,78 @@ +"; +} else { + $search_button = ""; +} + +if (isset($custom_query[5]) && $custom_query[5]) { + $value_text = "value='".$custom_query[5]."' onclick=\"this.value=''\""; +} else { + $value_text = "value=''"; +} + +$text = "
        +
        + + "; + + if (isset($custom_query[4]) && $custom_query[4] != '') { + $text .= ""; + } + + $text .= $search_button." +
        +
        "; +if (isset($searchflat) && $searchflat) { + echo $text; +} else { + $ns->tablerender(LAN_180." ".SITENAME, "
        ".$text."
        ", 'search'); +} +?> \ No newline at end of file diff --git a/e107_plugins/sitebutton_menu/languages/English.php b/e107_plugins/sitebutton_menu/languages/English.php new file mode 100644 index 000000000..71012f576 --- /dev/null +++ b/e107_plugins/sitebutton_menu/languages/English.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/e107_plugins/sitebutton_menu/sitebutton_menu.php b/e107_plugins/sitebutton_menu/sitebutton_menu.php new file mode 100644 index 000000000..423d2b2a5 --- /dev/null +++ b/e107_plugins/sitebutton_menu/sitebutton_menu.php @@ -0,0 +1,22 @@ +tablerender(SITEBUTTON_MENU_L1, "
        \n".SITEBUTTON_MENU_L1."\n
        ", 'sitebutton'); +?> \ No newline at end of file diff --git a/e107_plugins/trackback/admin_config.php b/e107_plugins/trackback/admin_config.php new file mode 100644 index 000000000..7f1a5b062 --- /dev/null +++ b/e107_plugins/trackback/admin_config.php @@ -0,0 +1,77 @@ +toDB($_POST['trackbackString']); + save_prefs(); + $message = TRACKBACK_L4; +} + + +if (isset($message)) { + $ns->tablerender("", "
        ".$message."
        "); +} + + +$text = " +
        +
        + + + + + + + + + + + + + + +
        ".TRACKBACK_L7." + ".TRACKBACK_L5."   + ".TRACKBACK_L6." +
        ".TRACKBACK_L8." + +
        + +
        +
        +
        +"; + + + +$ns->tablerender(TRACKBACK_L10, $text); + +require_once(e_ADMIN."footer.php"); +?> \ No newline at end of file diff --git a/e107_plugins/trackback/e_meta.php b/e107_plugins/trackback/e_meta.php new file mode 100644 index 000000000..81cbc2eea --- /dev/null +++ b/e107_plugins/trackback/e_meta.php @@ -0,0 +1,21 @@ +"; +} + +?> + diff --git a/e107_plugins/trackback/images/trackback_16.png b/e107_plugins/trackback/images/trackback_16.png new file mode 100644 index 000000000..35f1145b7 Binary files /dev/null and b/e107_plugins/trackback/images/trackback_16.png differ diff --git a/e107_plugins/trackback/images/trackback_32.png b/e107_plugins/trackback/images/trackback_32.png new file mode 100644 index 000000000..ce65ea71d Binary files /dev/null and b/e107_plugins/trackback/images/trackback_32.png differ diff --git a/e107_plugins/trackback/languages/English.php b/e107_plugins/trackback/languages/English.php new file mode 100644 index 000000000..89dedb1b4 --- /dev/null +++ b/e107_plugins/trackback/languages/English.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/e107_plugins/trackback/modtrackback.php b/e107_plugins/trackback/modtrackback.php new file mode 100644 index 000000000..cd102ab73 --- /dev/null +++ b/e107_plugins/trackback/modtrackback.php @@ -0,0 +1,72 @@ +db_Delete("trackback", "trackback_id='$cid' "); + } + } + $ns->tablerender("", "
        ".TRACKBACK_L15."
        "); +} + +$text = "
        +
        +"; + +if (e_QUERY=='all') { + $res=$sql->db_Select("trackback", "*"); +} else { + $res=$sql->db_Select("trackback", "*", "trackback_pid=".intval(e_QUERY)); +} + +if (!$res) +{ + $text .= "
        ".TRACKBACK_L12.".
        "; +} +else +{ + $tbArray = $sql -> db_getList(); + foreach($tbArray as $trackback) + { + extract($trackback); + $text .= " + $trackback_title + $trackback_excerpt + $trackback_blogname + ".TRACKBACK_L14." + \n"; + } + $text .= ""; +} + +$ns->tablerender(TRACKBACK_L13, $text); + +require_once(e_ADMIN."footer.php"); + +?> \ No newline at end of file diff --git a/e107_plugins/trackback/plugin.php b/e107_plugins/trackback/plugin.php new file mode 100644 index 000000000..26d240a1d --- /dev/null +++ b/e107_plugins/trackback/plugin.php @@ -0,0 +1,85 @@ + 0, +"trackbackString" => "".TRACKBACK_L11."" +); + +// List of table names ----------------------------------------------------------------------------------------------- +$eplug_table_names = array( +"trackback"); + +// List of sql requests to create tables ----------------------------------------------------------------------------- +$eplug_tables = array( +"CREATE TABLE ".MPREFIX."trackback ( + trackback_id int(10) unsigned NOT NULL auto_increment, + trackback_pid int(10) unsigned NOT NULL default '0', + trackback_title varchar(200) NOT NULL default '', + trackback_excerpt varchar(250) NOT NULL default '', + trackback_url varchar(150) NOT NULL default '', + trackback_blogname varchar(150) NOT NULL default '', + PRIMARY KEY (trackback_id), + KEY trackback_pid (trackback_pid) +) TYPE=MyISAM;"); + +// Create a link in main menu (yes=TRUE, no=FALSE) ------------------------------------------------------------- +$eplug_link = FALSE; +$eplug_link_name = ""; +$ec_dir = ""; +$eplug_link_url = ""; + + +// Text to display after plugin successfully installed ------------------------------------------------------------------ +$eplug_done = TRACKBACK_L3; +$upgrade_alter_tables = array( + "ALTER TABLE ".MPREFIX."trackback ADD INDEX (trackback_pid);" +); + +?> diff --git a/e107_plugins/trackback/trackback.php b/e107_plugins/trackback/trackback.php new file mode 100644 index 000000000..390ac1211 --- /dev/null +++ b/e107_plugins/trackback/trackback.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/e107_plugins/trackback/trackbackClass.php b/e107_plugins/trackback/trackbackClass.php new file mode 100644 index 000000000..42557583f --- /dev/null +++ b/e107_plugins/trackback/trackbackClass.php @@ -0,0 +1,177 @@ +base_path.$permLink)); + $query_string = "title=".$title."&url=".$permLink."&blog_name=".$blog_name."&excerpt=".$excerpt; + + if (strstr($pingUrl, '?')) + { + $pingUrl .= "&".$query_string; + $fp = fopen($pingUrl, 'r'); + $response = fread($fp, 4096); + fclose($fp); + } + else + { + + $trackback_url = parse_url($pingUrl); + + if ((isset($trackback_url["query"])) && ($trackback_url["query"] != "")) + { + $trackback_url["query"] = "?" . $trackback_url["query"]; + } + else + { + $trackback_url["query"] = ""; + } + + if ((isset($trackback_url["port"]) && !is_numeric($trackback_url["port"])) || (!isset($trackback_url["port"]))) + { + $trackback_url["port"] = 80; + } + + $header = 'POST ' . $trackback_url['path'] . $trackback_url['query'] . " HTTP/1.0\r\n"; + $header .= 'Host: '.$trackback_url['host']."\r\n"; + $header .= 'Content-Type: application/x-www-form-urlencoded'."\r\n"; + $header .= 'Content-Length: '.strlen($query_string)."\r\n"; + $header .= "\r\n"; + $header .= $query_string; + + $socket = fsockopen($trackback_url["host"], $trackback_url["port"]); + + if (!is_resource($socket)) { + return "$trackbackClass -> sendTrackback: Unable to connect to $pingUrl."; + } + + fputs($socket, $header); + + $response = ""; + while (!feof($socket)) { + $response .= fgets($socket, 4096); + } + fclose($socket); + + } + + if(strstr($response, "0")) + { + return FALSE; + } + else + { + if(preg_match("#\(.*?)\<\/message\>#", $response, $match)) + { + return $match[0]; + } + else + { + return "No error returned."; + } + } + + } + + function respondTrackback () + { + global $sql, $pref, $tp; + $errorMessage = ""; + if(!$pref['trackbackEnabled']) + { + $errorMessage = "This site does not allow trackbacks."; + } + + $pid = (isset($_GET['pid']) ? intval($_GET['pid']) : intval($_POST['pid'])); + $permLink = (isset($_GET['url']) ? $_GET['url'] : $_POST['url']); + $permLink = $tp -> toDB($permLink); + $blog_name = (isset($_GET['blog_name']) ? $_GET['blog_name'] : $_POST['blog_name']); + $blog_name = $tp -> toDB($blog_name); + $title = (isset($_GET['title']) ? $_GET['title'] : $_POST['title']); + $title = $tp -> toDB($title); + $excerpt = (isset($_GET['excerpt']) ? $_GET['excerpt'] : $_POST['excerpt']); + $excerpt = $tp -> toDB($excerpt); + + /* debug */ + /* + $debug_str = "Query string: ".e_TBQS."\n"; + $debug_str .= "GET INFO: \n"; + foreach($_GET as $key => $get) + { + $debug_str .= "$key => $get\n"; + } + $debug_str .= "POST INFO: \n"; + foreach($_POST as $key => $get) + { + $debug_str .= "$key => $get\n"; + } + $sql -> db_Insert("debug", "0, '".time()."', '$debug_str' "); + */ + /* end debug */ + + + if(!$pid) + { + $errorMessage = "No permanent ID sent."; + } + + if(!isset($pid) || !is_numeric($pid)) + { + $errorMessage = "No known item with that pid (pid sent as ".$pid.")."; + } + + $excerpt = ($excerpt ? strip_tags($excerpt) : "I found your news item interesting, I've added a trackback to it on my website :)"); + $title = ($title ? $title : "Trackbacking your news item ..."); + $blog_name = ($blog_name ? $blog_name : "Anonymous site"); + + if(!$errorMessage) + { + if(!$sql -> db_Insert("trackback", "0, $pid, '$title', '$excerpt', '$permLink', '$blog_name' ")) + { + $errorMessage = "Unable to enter your trackback information into the database -> 0, $pid, '$title', '$excerpt', '$permLink', '$blog_name'"; + } + } + + if($errorMessage) + { + echo '\n"; + echo "\n"; + echo "1\n"; + echo "".$errorMessage."\n"; + echo ""; + } + else + { + echo '\n"; + echo "\n"; + echo "0\n"; + echo ""; + } + } +} \ No newline at end of file diff --git a/e107_plugins/tree_menu/config.php b/e107_plugins/tree_menu/config.php new file mode 100644 index 000000000..d63cbc32d --- /dev/null +++ b/e107_plugins/tree_menu/config.php @@ -0,0 +1,80 @@ + $value) { + if ($value != TREE_L2) { + $menu_pref[$key] = $value; + } + } + + $tmp = addslashes(serialize($menu_pref)); + $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); + $ns->tablerender("", "
        ".TREE_L3."
        "); +} + +$text = " +
        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".TREE_L6."
        ".TREE_L7."
        ".TREE_L8."
        ".TREE_L9." + ".TREE_L4."   + ".TREE_L5." +
        +
        + "; +$ns->tablerender(TREE_L1, $text); + +require_once(e_ADMIN."footer.php"); + +?> \ No newline at end of file diff --git a/e107_plugins/tree_menu/languages/English.php b/e107_plugins/tree_menu/languages/English.php new file mode 100644 index 000000000..e6e81cc40 --- /dev/null +++ b/e107_plugins/tree_menu/languages/English.php @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/e107_plugins/tree_menu/tree_menu.php b/e107_plugins/tree_menu/tree_menu.php new file mode 100644 index 000000000..693c4f482 --- /dev/null +++ b/e107_plugins/tree_menu/tree_menu.php @@ -0,0 +1,188 @@ + db_Select_gen($query); +$linkArray = $sql->db_getList(); + +// all main links now held in array, we now need to loop through them and assign the sublinks to the correct parent links ... + +$mainLinkArray = array(); +foreach($linkArray as $links) { + +// Updated to stop using the deprecated method of splitting the link-name in 3. +// Now uses uses the link parent to determine the 'tree'. + + extract ($links); + if ($link_parent == 0) + { + // main link - add to main array ... + $mainLinkArray[$link_id]['id'] = $link_id; + $mainLinkArray[$link_id]['name'] = $tp->toHtml(strip_tags($link_name),"","defs"); + $mainLinkArray[$link_id]['url'] = $link_url; + $mainLinkArray[$link_id]['description'] = $link_description; + $mainLinkArray[$link_id]['image'] = $link_button; + $mainLinkArray[$link_id]['openMethod'] = $link_open; + $mainLinkArray[$link_id]['class'] = $link_class; + } + else + { + // submenu - add to parent's array entry ... + $tmp = explode(".", $link_name); + $submenu_name = ($tmp[2]) ? $tmp[2] : $link_name; + + $mainLinkArray[$link_parent]['sublink'][$link_id]['parent_name'] = $link_parent; + $mainLinkArray[$link_parent]['sublink'][$link_id]['id'] = $link_id; + $mainLinkArray[$link_parent]['sublink'][$link_id]['name'] = $tp->toHtml(strip_tags($submenu_name)); + $mainLinkArray[$link_parent]['sublink'][$link_id]['url'] = $link_url; + $mainLinkArray[$link_parent]['sublink'][$link_id]['description'] = $links['link_description']; + $mainLinkArray[$link_parent]['sublink'][$link_id]['image'] = $link_button; + $mainLinkArray[$link_parent]['sublink'][$link_id]['openMethod'] = $link_open; + $mainLinkArray[$link_parent]['sublink'][$link_id]['class'] = $link_class; + } + +} + +// ok, now all mainlinks and sublinks are held in the array, now we have to loop through and build the text to send to screen ... + +$text = ""; +foreach($mainLinkArray as $links) { + extract ($links); + if (array_key_exists("sublink", $links) && $links['name'] != "") { + // sublinks found ... + + $url = "javascript:void(0);"; + $spanName = $id; + $image = ($image ? "" : "»"); + $plink = "".$image.setLink($name, $url, $openMethod, $description)."\n"; + $text .= ($menu_pref['tm_spacer'] ? "
        \n".$plink."\n
        \n" : $plink); + } else { + // no sublinks found ... + if($links['name']) + { + $linkName = $url; + $spanName = ""; + $image = ($image ? "" : "·"); + $plink = "".$image.setLink($name, $url, $openMethod, $description).""; + $text .= ($menu_pref['tm_spacer'] ? "
        \n".$plink."\n
        \n" : $plink); + } + } + + $c = 0; + if (array_key_exists("sublink", $links) && $links['name'] != "" ) { + + $text .= "\n\n"; + foreach($sublink as $link) { + extract($link); + $image = ($image ? " " : "· "); + $spanName = $parent_name; + + $plink = $image.setLink($name, $url, $openMethod, $description)."
        \n"; + $text .=($menu_pref['tm_class3'] ? "".$plink."
        \n\n" : $plink); + } + $text .= "\n"; + } + +} + +function setlink($link_name, $link_url, $link_open, $link_description) { + global $tp; + switch ($link_open) { + case 1: + $link_append = "rel='external'"; + break; + case 2: + $link_append = ""; + break; + case 3: + $link_append = ""; + break; + default: + $link_append = ''; + } + + if (!strstr($link_url, "http:") && !strstr($link_url, "void") && strpos($link_url, "mailto:") !== 0) { + $link_url = e_BASE.$link_url; + } + $link_url = $tp->replaceConstants($link_url, $nonrelative = TRUE, $all = false); + + if ($link_open == 4) { + $link = "".$link_name."\n"; + } else { + $link = "".$link_name."\n"; + } + return $link; +} + +(isset($_COOKIE["treemenustatus"]) && $_COOKIE["treemenustatus"]) ? $treemenustatus = $_COOKIE["treemenustatus"] : $treemenustatus = "0"; +$text .= " + + "; +$ns->tablerender(LAN_SITELINKS_183, $text, 'tree_menu'); + +?> \ No newline at end of file diff --git a/e107_plugins/userlanguage_menu/languages/English.php b/e107_plugins/userlanguage_menu/languages/English.php new file mode 100644 index 000000000..528678c7b --- /dev/null +++ b/e107_plugins/userlanguage_menu/languages/English.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/e107_plugins/userlanguage_menu/userlanguage_menu.php b/e107_plugins/userlanguage_menu/userlanguage_menu.php new file mode 100644 index 000000000..f1a3b8500 --- /dev/null +++ b/e107_plugins/userlanguage_menu/userlanguage_menu.php @@ -0,0 +1,47 @@ +get_dirs(e_LANGUAGEDIR); + sort($lanlist); + + $action = (e_QUERY && !$_GET['elan']) ? e_SELF."?".e_QUERY : e_SELF; + $text = "
        +
        + "; + $text .= "

        "; + $text .= "
        "; + +$ns->tablerender(UTHEME_MENU_L2, $text, 'user_lan'); + +?> \ No newline at end of file diff --git a/e107_plugins/usertheme_menu/languages/English.php b/e107_plugins/usertheme_menu/languages/English.php new file mode 100644 index 000000000..341982580 --- /dev/null +++ b/e107_plugins/usertheme_menu/languages/English.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/e107_plugins/usertheme_menu/usertheme_menu.php b/e107_plugins/usertheme_menu/usertheme_menu.php new file mode 100644 index 000000000..fdfe2b027 --- /dev/null +++ b/e107_plugins/usertheme_menu/usertheme_menu.php @@ -0,0 +1,69 @@ +db_Select("user", "user_prefs", "user_prefs REGEXP('sitetheme') "); + + while ($row = $sql->db_Fetch()) { + $up = unserialize($row['user_prefs']); + if (isset($themecount[$up['sitetheme']])) { $themecount[$up['sitetheme']]++; } + } + + $defaultusers = $sql->db_Count("user") - $totalct; + $themecount[$defaulttheme] += $defaultusers; + + $text = "
        +
        + +

        + +
        "; + + $ns->tablerender(LAN_351, $text, 'usertheme'); +} +?> \ No newline at end of file diff --git a/e107_themes/crahan/images/bullet2.gif b/e107_themes/crahan/images/bullet2.gif new file mode 100644 index 000000000..bdb060645 Binary files /dev/null and b/e107_themes/crahan/images/bullet2.gif differ diff --git a/e107_themes/crahan/images/logo1.png b/e107_themes/crahan/images/logo1.png new file mode 100644 index 000000000..f36413a1d Binary files /dev/null and b/e107_themes/crahan/images/logo1.png differ diff --git a/e107_themes/crahan/images/logo2.png b/e107_themes/crahan/images/logo2.png new file mode 100644 index 000000000..fd64610f7 Binary files /dev/null and b/e107_themes/crahan/images/logo2.png differ diff --git a/e107_themes/crahan/images/logo3.png b/e107_themes/crahan/images/logo3.png new file mode 100644 index 000000000..64bd81392 Binary files /dev/null and b/e107_themes/crahan/images/logo3.png differ diff --git a/e107_themes/crahan/images/logo4.png b/e107_themes/crahan/images/logo4.png new file mode 100644 index 000000000..d5ed532af Binary files /dev/null and b/e107_themes/crahan/images/logo4.png differ diff --git a/e107_themes/crahan/index.html b/e107_themes/crahan/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/crahan/languages/English.php b/e107_themes/crahan/languages/English.php new file mode 100644 index 000000000..845d221ff --- /dev/null +++ b/e107_themes/crahan/languages/English.php @@ -0,0 +1,28 @@ +jalist, based on the theme by CraHan at his homepage n00.be"); +define("LAN_THEME_2", "Comments are turned off for this item"); +define("LAN_THEME_3", "comment(s): "); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); +define("LAN_THEME_6", "Comment by"); + + +?> diff --git a/e107_themes/crahan/preview.jpg b/e107_themes/crahan/preview.jpg new file mode 100644 index 000000000..b773bccc9 Binary files /dev/null and b/e107_themes/crahan/preview.jpg differ diff --git a/e107_themes/crahan/style.css b/e107_themes/crahan/style.css new file mode 100644 index 000000000..072e03cf0 --- /dev/null +++ b/e107_themes/crahan/style.css @@ -0,0 +1,493 @@ + +/* info: default stylesheet file for 'CraHan' theme */ + +body { + background: #ccc; + color: #000; + font-family: verdana, arial, "lucida grande", sans-serif; + text-align: center; +} + +#wrapper { + margin: 10px auto; + width: 700px; +} + +#menu { + float: right; + width: 181px; + text-align: right; +} + +.content { + border: #444 2px solid; + padding: 15px; + font-size: 11px; + background: #fff; + color: #000; + text-align: left; +} + +.fixfuckedie { + width: 100% +} + +#main { + width: 504px; + text-align: left; +} + +#sitebanner { + border: #444 2px solid; + padding: 0px; + font-size: 11px; + background: #fff; + margin-bottom: 6px; + color: #000; + text-align: left; +} +#sitebanner img { + display: block; + border-bottom: #444 1px solid; +} + +#navbar { + padding-right: 15px; + padding-left: 15px; + font-size: 11px; + padding-bottom: 7px; + padding-top: 7px; +} + +#navbar a { + color: #000; + text-decoration: none; +} +#navbar a:active { + text-decoration: none; +} +#navbar a:visited { + text-decoration: none; +} +#navbar a:hover { + color: #000; text-decoration: + underline; +} +ul, ol { + margin-top: 0; + margin-bottom: 0; +} + +#logo1 { + position: relative; + height: 90px; + width: 500px; + background-image: url('images/logo1.png'); + background-repeat: no-repeat; +} + +#logo2 { + position: relative; + height: 90px; + width: 500px; + background-image: url('images/logo2.png'); + background-repeat: no-repeat; +} + +#logo3 { + position: relative; + height: 90px; + width: 500px; + background-image: url('images/logo3.png'); + background-repeat: no-repeat; +} + +#logo4 { + position: relative; + height: 90px; + width: 500px; + background-image: url('images/logo4.png'); + background-repeat: no-repeat; +} + +.header { + padding-right: 0px; + padding-left: 0px; + font-weight: bold; + font-size: 11px; + padding-bottom: 3px; + margin: 0px 0px 10px; + color: #444; + padding-top: 0px; + border-bottom: #444 1px dashed; +} + + +h3 { + color: #444; + font-weight: bold; + margin-bottom: 2px; +} + +.left { + float: left; + text-align: left; +} +.right { + text-align: right; + font-weight: normal; +} + +.newssmalltext { + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} + + + + + + + + + + + + + +img { + vertical-align: middle; +} +.linkspage_button{ + vertical-align: middle; + border:0px; +} + + + + +hr { + border: 1px dotted #bbb; + height: 1px; + width: 92%; + text-align:center; +} + +.smalltext { + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.bodytable { + padding: 2px; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color: #444; +} + +.button { + border: #000 1px solid; + color: #000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} + +.button a { + color: #000; +} +.button a:hover { + color: #0085b0; +} + + +a { + color: #416eab; + text-decoration: none; +} +a:active { + text-decoration: none; +} +a:visited { + text-decoration: none; +} +a:hover { + color: #416eab; + text-decoration: underline; +} + +.smallblacktext { + background: none; + font: 10px tahoma, verdana, arial, helvetica, sans-serif; + color:#000; +} +.indent{ + padding: 10px 10px 10px 10px; + margin: 5px; + font: 9px verdana, tahoma, arial, sans-serif; + color: #838387; + border: 1px solid #d6d6d6; +} +.defaulttext { + background: none; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} + +td { + font: 11px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; + padding: 0px; + text-align:left; +} + +blockquote { + font-family: verdana, tahoma, arial, helvetica, sans-serif; + color:#7e96ac; + border: 1px solid #d6d6d6; +} +.mediumtext { + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} + +.tbox{ + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} + +.nextprev{ + background-color: #eaeef2; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + padding : 2px; + text-align: right; +} + +form { + margin: 2px 0px 0px 0px; +} +.spacer { + padding: 2px 0 2px 0; +} + +.cspacer { + padding: 6px 0 6px 0; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.border { + border: #999 1px solid; + background-color: #F0F1F1; + padding: 2px; +} + + +p { + margin-top: 0px +} + +.fborder { + border: #c1c1c1 1px solid; +} +.forumheader{ + background-color: #ced6db; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: 1px solid #ececf2; +} + +.forumheader2{ + background-color: #EFEFEF; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} + +.forumheader3{ + background-color: #f3f3f7; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #ececf2 1px solid; +} + +.forumborder{ + border: #000080 1px solid; +} + +.fcaption { + border: #f0f2f4 1px solid; + padding: 2px 0 2px 0; + background-color: #f9fafb; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#616060; +} + +.finfobar{ + background-color: #CCC8C8; + color:#000; + padding: 4px; + border: 1px solid #C3BDBD; + font-style:normal; + font-variant:normal; + font-weight:normal; + font-size:11px; + font-family:verdana, tahoma, arial, helvetica, sans-serif +} + +.helpbox { + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + border: 0px none red; + background-color: transparent; +} + +.nforumholder { + border: 1px solid #345487; + padding: 0px; + background-color: #fff; +} + +.nforumcaption { + background-image: url(images/nforumcaption.png); + padding: 8px 4px 8px 4px; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color: #fff; +} + +.nforumcaption2 { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; + font-weight: bold; +} + +.nforumcaption3 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread { + border: 1px solid #fff; + padding: 4px; + background-color: #EEF2F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread2 { + border: 1px solid #fff; + padding: 4px; + background-color: #D1DCEB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreplycaption { + border: 1px solid #fff; + padding: 4px; + background-color: #E2EDF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply { + border: 1px solid #fff; + padding: 4px; + background-color: #EDF4F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply2 { + border: 1px solid #fff; + padding: 4px; + background-color: #CFE0EB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +.nforumdisclaimer { + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.nforumview1 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview2 { + border: 1px solid #fff; + padding: 4px; + background-color: #DFE6EF; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview3 { + padding: 4px; + background-color: #BCD0ED; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #263448; +} + +.nforumview4 { + padding: 4px; + background-color: #E4EAF2; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color: #3A4F6C; +} + +a.forumlink{ + color: #fff; + text-decoration: none; +} + +a.forumlink:hover { + color: #bbb; + text-decoration: underline; +} + +.treeclass1 { + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding: 2px 0px 2px 2px; +} + +.treeclass2 { + background-color: #F4F7FA; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding: 2px 0px 2px 2px; +} + +.treeclass3 { + background-color: #F4F7FA; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding: 1px; + width: 100%; +} + + +#marqueecontainer{ + position: relative; + height: 200px; + overflow: hidden; +} \ No newline at end of file diff --git a/e107_themes/crahan/theme.php b/e107_themes/crahan/theme.php new file mode 100644 index 000000000..728bbdae2 --- /dev/null +++ b/e107_themes/crahan/theme.php @@ -0,0 +1,134 @@ +n00.be, design used with permission."; +define("STANDARDS_MODE", TRUE); +$xhtmlcompliant = TRUE; +$csscompliant = TRUE; +define("IMODE", "lite"); +define("THEME_DISCLAIMER", "
        ".LAN_THEME_1.""); + +$logo = "logo".rand(1, 4); + +// [layout] + +$layout = "_default"; + +$HEADER = " +
        + +
        +
        +
        {SITENAME} 
        + +
        +
        +
        +"; + +$FOOTER = " +
        +
        +
        +
        +
        {SITEDISCLAIMER}
        +
        +
        +"; + +$NEWSSTYLE = " +
        +
        {STICKY_ICON} {NEWSTITLE}
        +
        {NEWSDATE}
        +
        +
        +{NEWSBODY} +{EXTENDED} +
        +
        +
        [ {NEWSAUTHOR} :: {NEWSCOMMENTS}{TRACKBACK} ]
        +
        +
        "; + +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", LAN_THEME_3); +define("COMMENTOFFSTRING", LAN_THEME_2); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " :: "); + + +// [linkstyle] + +define('PRELINK', ""); +define('POSTLINK', " ::"); +define('LINKSTART', ":: "); +define('LINKSTART_HILITE', ":: "); +define('LINKEND', ""); +define('LINKDISPLAY', 1); +define('LINKALIGN', "left"); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode) +{ + echo "
        {$caption}
        \n{$text}\n

        \n"; +} + +$COMMENTSTYLE = " +
        {COMMENT} {COMMENTEDIT}

        +
        [ ".LAN_THEME_6." {USERNAME} :: {TIMEDATE} ]
        +
        +

        +"; + + +$CHATBOXSTYLE = " + +{USERNAME} +
        +{MESSAGE} +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/e107v4a/forum_template.php b/e107_themes/e107v4a/forum_template.php new file mode 100644 index 000000000..dc97024ba --- /dev/null +++ b/e107_themes/e107v4a/forum_template.php @@ -0,0 +1,295 @@ +"; +$sc_style['ANON_IP']['post'] = ""; +$location_tpl = (array_key_exists('user_location', $currentUser) ? "{USER_EXTENDED=location.text}: {USER_EXTENDED=location.value}" : ""); + +$FORUMSTART = " + + + + + + + +
        {BACKLINK}
        + + + + + +
        {NEXTPREV} {TRACK} 
        +
        +
        + + + + + + +
        {THREADNAME}

        {GOTOPAGES}
        {BUTTONS}
        + + + + +\n + +
        \n".LAN_402."\n\n".LAN_403."\n
        "; + +$FORUMTHREADSTYLE = " +
        + + + + + + + + + + + + + +
        \n{NEWFLAG}\n{POSTER}\n{ANON_IP} + + + + + +
        \n{THREADDATESTAMP}\n\n{EMAILITEM} {PRINTITEM} {REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n
        +
        \n{AVATAR}\n
        \n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{$location_tpl}
        \n{POSTS}\n
        \n
        {POLL}\n{POST}\n{SIGNATURE}\n
        \n\n{TOP}\n\n + + + + + +
        \n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n\n{MODOPTIONS}\n
        +
        +
        "; + +$FORUMREPLYSTYLE = " +
        + + + + + + + + + + + + + +
        \n{NEWFLAG}\n{POSTER}\n{ANON_IP} + + + + + +
        \n{THREADDATESTAMP}\n\n{EMAILITEM} {PRINTITEM} {REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n
        +
        \n{AVATAR}\n\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{$location_tpl}
        \n{POSTS}\n
        \n
        \n{POST}\n{SIGNATURE}\n
        \n\n{TOP}\n\n + + + + + +
        \n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n\n{MODOPTIONS}\n
        +
        +
        "; + +$FORUMEND = " +
        +
        +{GOTOPAGES} +
        +
        + + + + + +
        {MODERATORS}
        {FORUMJUMP}
        {BUTTONS}
        +
        +
        + + + + +
        +{QUICKREPLY} +
        +
        Powered by e107 Forum System
        +
        "; + + +$FORUM_MAIN_START = "
        "; + +$FORUM_MAIN_PARENT = "
        \n\n\n\n +\n\n\n\n\n\n"; + +$FORUM_MAIN_PARENT_END = "
        {PARENTNAME} {PARENTSTATUS}
        {FORUMTITLE}{THREADTITLE}{REPLYTITLE}{LASTPOSTITLE}
        "; + +$FORUM_MAIN_FORUM = "\n{NEWFLAG}\n{FORUMNAME}
        {FORUMDESCRIPTION}{FORUMSUBFORUMS}\n{THREADS}\n{REPLIES}\n{LASTPOST}\n"; + +$FORUM_MAIN_END = "
        \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
        {INFOTITLE}
        {LOGO}{USERINFO}
        {INFO}
        {FORUMINFO}
        {USERLIST}
        \n
        \n
        \n\n\n\n\n\n\n
        {ICONKEY}{SEARCH}{PERMS}\n
        \n
        \n
        Powered by e107 Forum System
        "; + + + +$FORUM_VIEW_START = " + + + + +{SUBFORUMS} +
        {BREADCRUMB}
        + + + + + +
        {FORUMTITLE} Forum
        {THREADPAGES}
        +{NEWTHREADBUTTON} +
        + + + + + + + + + +"; + + +$FORUM_VIEW_START_CONTAINER = " +
         {THREADTITLE}{STARTERTITLE}{REPLYTITLE}{VIEWTITLE}{LASTPOSTITLE}
        + + + +{SUBFORUMS} +
        {BREADCRUMB}
        +"; + +$sc_style['PAGES']['pre'] = ""; +$sc_style['PAGES']['post'] = ""; + +$FORUM_VIEW_FORUM = " + +{ICON} + + + + + + + +
        {THREADNAME} {PAGES}{ADMIN_ICONS}
        + + +{POSTER}
        {THREADDATE}
        +{REPLIES} +{VIEWS} +{LASTPOST} +"; + +$sc_style['THREADPAGES']['pre'] = ""; +$sc_style['THREADPAGES']['post'] = ""; + +$FORUM_VIEW_END = " + + + + + + +
        {THREADPAGES} +{FORUMJUMP} + +{NEWTHREADBUTTON} +
        + + +
        + + + + + + + + + + +
        {MODERATORS}{BROWSERS}
        {ICONKEY}{PERMS}

        {SEARCH} +
        +
        + +
        Powered by e107 Forum System
        "; + + + +$FORUM_VIEW_END_CONTAINER = " + + + + +
        +
        {FORUMJUMP} +
        +
        Powered by e107 Forum System
        +"; + + + +$FORUM_VIEW_SUB_START = " + + + + + + + + + +"; + +$FORUM_VIEW_SUB = " + + + + + + +"; + +$FORUM_VIEW_SUB_END = " +
        ".FORLAN_20."".FORLAN_21."".LAN_55."".FORLAN_22."
        {SUB_FORUMTITLE}
        {SUB_DESCRIPTION}
        {SUB_THREADS}{SUB_REPLIES}{SUB_LASTPOST}
        + + +"; + + +?> \ No newline at end of file diff --git a/e107_themes/e107v4a/images/bar.jpg b/e107_themes/e107v4a/images/bar.jpg new file mode 100644 index 000000000..09b4da58f Binary files /dev/null and b/e107_themes/e107v4a/images/bar.jpg differ diff --git a/e107_themes/e107v4a/images/bar.png b/e107_themes/e107v4a/images/bar.png new file mode 100644 index 000000000..28b298b5c Binary files /dev/null and b/e107_themes/e107v4a/images/bar.png differ diff --git a/e107_themes/e107v4a/images/barl.png b/e107_themes/e107v4a/images/barl.png new file mode 100644 index 000000000..c2e53a46d Binary files /dev/null and b/e107_themes/e107v4a/images/barl.png differ diff --git a/e107_themes/e107v4a/images/barr.png b/e107_themes/e107v4a/images/barr.png new file mode 100644 index 000000000..0bdc2a1cf Binary files /dev/null and b/e107_themes/e107v4a/images/barr.png differ diff --git a/e107_themes/e107v4a/images/blank.gif b/e107_themes/e107v4a/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_themes/e107v4a/images/blank.gif differ diff --git a/e107_themes/e107v4a/images/bottom.png b/e107_themes/e107v4a/images/bottom.png new file mode 100644 index 000000000..9b98cff27 Binary files /dev/null and b/e107_themes/e107v4a/images/bottom.png differ diff --git a/e107_themes/e107v4a/images/bottomleft.png b/e107_themes/e107v4a/images/bottomleft.png new file mode 100644 index 000000000..bc2e56fde Binary files /dev/null and b/e107_themes/e107v4a/images/bottomleft.png differ diff --git a/e107_themes/e107v4a/images/bottomright.png b/e107_themes/e107v4a/images/bottomright.png new file mode 100644 index 000000000..ac0a62d62 Binary files /dev/null and b/e107_themes/e107v4a/images/bottomright.png differ diff --git a/e107_themes/e107v4a/images/bullet2.gif b/e107_themes/e107v4a/images/bullet2.gif new file mode 100644 index 000000000..238cf44ea Binary files /dev/null and b/e107_themes/e107v4a/images/bullet2.gif differ diff --git a/e107_themes/e107v4a/images/bullet3.png b/e107_themes/e107v4a/images/bullet3.png new file mode 100644 index 000000000..0c8b5f373 Binary files /dev/null and b/e107_themes/e107v4a/images/bullet3.png differ diff --git a/e107_themes/e107v4a/images/button.png b/e107_themes/e107v4a/images/button.png new file mode 100644 index 000000000..31ac8e71b Binary files /dev/null and b/e107_themes/e107v4a/images/button.png differ diff --git a/e107_themes/e107v4a/images/button2.png b/e107_themes/e107v4a/images/button2.png new file mode 100644 index 000000000..165444ae1 Binary files /dev/null and b/e107_themes/e107v4a/images/button2.png differ diff --git a/e107_themes/e107v4a/images/button3.png b/e107_themes/e107v4a/images/button3.png new file mode 100644 index 000000000..cc0ec9271 Binary files /dev/null and b/e107_themes/e107v4a/images/button3.png differ diff --git a/e107_themes/e107v4a/images/cap1.png b/e107_themes/e107v4a/images/cap1.png new file mode 100644 index 000000000..1fe69d48f Binary files /dev/null and b/e107_themes/e107v4a/images/cap1.png differ diff --git a/e107_themes/e107v4a/images/capdark.png b/e107_themes/e107v4a/images/capdark.png new file mode 100644 index 000000000..2598da2b4 Binary files /dev/null and b/e107_themes/e107v4a/images/capdark.png differ diff --git a/e107_themes/e107v4a/images/capleft.png b/e107_themes/e107v4a/images/capleft.png new file mode 100644 index 000000000..e8e47baa1 Binary files /dev/null and b/e107_themes/e107v4a/images/capleft.png differ diff --git a/e107_themes/e107v4a/images/caplight.png b/e107_themes/e107v4a/images/caplight.png new file mode 100644 index 000000000..c7ac94d51 Binary files /dev/null and b/e107_themes/e107v4a/images/caplight.png differ diff --git a/e107_themes/e107v4a/images/capright.png b/e107_themes/e107v4a/images/capright.png new file mode 100644 index 000000000..0e542e547 Binary files /dev/null and b/e107_themes/e107v4a/images/capright.png differ diff --git a/e107_themes/e107v4a/images/captransition.png b/e107_themes/e107v4a/images/captransition.png new file mode 100644 index 000000000..cd067f551 Binary files /dev/null and b/e107_themes/e107v4a/images/captransition.png differ diff --git a/e107_themes/e107v4a/images/fcap.png b/e107_themes/e107v4a/images/fcap.png new file mode 100644 index 000000000..5ff23677b Binary files /dev/null and b/e107_themes/e107v4a/images/fcap.png differ diff --git a/e107_themes/e107v4a/images/fcap2.png b/e107_themes/e107v4a/images/fcap2.png new file mode 100644 index 000000000..4075d8448 Binary files /dev/null and b/e107_themes/e107v4a/images/fcap2.png differ diff --git a/e107_themes/e107v4a/images/header.png b/e107_themes/e107v4a/images/header.png new file mode 100644 index 000000000..8497effdc Binary files /dev/null and b/e107_themes/e107v4a/images/header.png differ diff --git a/e107_themes/e107v4a/images/left.png b/e107_themes/e107v4a/images/left.png new file mode 100644 index 000000000..219618d0a Binary files /dev/null and b/e107_themes/e107v4a/images/left.png differ diff --git a/e107_themes/e107v4a/images/logo.png b/e107_themes/e107v4a/images/logo.png new file mode 100644 index 000000000..0f738d12c Binary files /dev/null and b/e107_themes/e107v4a/images/logo.png differ diff --git a/e107_themes/e107v4a/images/nforumcaption.png b/e107_themes/e107v4a/images/nforumcaption.png new file mode 100644 index 000000000..89276e879 Binary files /dev/null and b/e107_themes/e107v4a/images/nforumcaption.png differ diff --git a/e107_themes/e107v4a/images/nforumcaption2.png b/e107_themes/e107v4a/images/nforumcaption2.png new file mode 100644 index 000000000..535a8271b Binary files /dev/null and b/e107_themes/e107v4a/images/nforumcaption2.png differ diff --git a/e107_themes/e107v4a/images/right.png b/e107_themes/e107v4a/images/right.png new file mode 100644 index 000000000..acaf98bf8 Binary files /dev/null and b/e107_themes/e107v4a/images/right.png differ diff --git a/e107_themes/e107v4a/images/search.png b/e107_themes/e107v4a/images/search.png new file mode 100644 index 000000000..b693bbb11 Binary files /dev/null and b/e107_themes/e107v4a/images/search.png differ diff --git a/e107_themes/e107v4a/images/temp.png b/e107_themes/e107v4a/images/temp.png new file mode 100644 index 000000000..2dcbc7c87 Binary files /dev/null and b/e107_themes/e107v4a/images/temp.png differ diff --git a/e107_themes/e107v4a/images/top.png b/e107_themes/e107v4a/images/top.png new file mode 100644 index 000000000..40d575677 Binary files /dev/null and b/e107_themes/e107v4a/images/top.png differ diff --git a/e107_themes/e107v4a/images/topleft.png b/e107_themes/e107v4a/images/topleft.png new file mode 100644 index 000000000..909ffc685 Binary files /dev/null and b/e107_themes/e107v4a/images/topleft.png differ diff --git a/e107_themes/e107v4a/images/topright.png b/e107_themes/e107v4a/images/topright.png new file mode 100644 index 000000000..eb6340814 Binary files /dev/null and b/e107_themes/e107v4a/images/topright.png differ diff --git a/e107_themes/e107v4a/index.html b/e107_themes/e107v4a/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/e107v4a/languages/English.php b/e107_themes/e107v4a/languages/English.php new file mode 100644 index 000000000..feff69d2c --- /dev/null +++ b/e107_themes/e107v4a/languages/English.php @@ -0,0 +1,27 @@ +jalist"); + +?> diff --git a/e107_themes/e107v4a/newsfeed_template.php b/e107_themes/e107v4a/newsfeed_template.php new file mode 100644 index 000000000..f2c6559d9 --- /dev/null +++ b/e107_themes/e107v4a/newsfeed_template.php @@ -0,0 +1,64 @@ +\n"; + +$NEWSFEED_LIST = " + +{FEEDNAME} +{FEEDDESCRIPTION} +\n"; + +$NEWSFEED_LIST_END = " +\n"; + +$NEWSFEED_MAIN_START = " + + + + + + + + + + + + + + + +
        {FEEDIMAGE} {FEEDTITLE}
        +
          \n"; + +$NEWSFEED_MAIN = " +
        • {FEEDITEMLINK} {FEEDITEMCREATOR}
          {FEEDITEMTEXT}
        • \n"; + + +$NEWSFEED_MAIN_END = " +
        +
        {FEEDCOPYRIGHT} | {FEEDLASTBUILDDATE}
        {BACKLINK}
        \n"; + + +?> \ No newline at end of file diff --git a/e107_themes/e107v4a/preview.jpg b/e107_themes/e107v4a/preview.jpg new file mode 100644 index 000000000..5f98f43e2 Binary files /dev/null and b/e107_themes/e107v4a/preview.jpg differ diff --git a/e107_themes/e107v4a/style.css b/e107_themes/e107v4a/style.css new file mode 100644 index 000000000..19896d8e1 --- /dev/null +++ b/e107_themes/e107v4a/style.css @@ -0,0 +1,377 @@ +body { + color: #000; + font: 12px tahoma, verdana, arial, sans-serif; + background-color: #E7E7E7; + margin:0px; + text-align:left; + padding: 0px; +} +a { + color: #716d6d; + text-decoration: underline; +} +a:hover { + color: #2a3236; + text-decoration: underline; +} + +#header { + background-image : url(images/header.png); + background-repeat: repeat-x; + border-bottom: #000 1px solid; + height: 80px; +} + +ul, ol { + margin-top: 0; + margin-bottom: 0; +} + +.fcaption a { + color: #ffffcc; + text-decoration: underline; +} +.fcaption a:hover { + color: #cccc99; + text-decoration: underline; +} +.smalltext { + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} +.smallblacktext { + font: normal 7pt verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} +.indent{ + padding: 3px; + margin: 5px; + font: 9px verdana, tahoma, arial, sans-serif; + color: #000060; + border: 1px solid; + background-color: #E3E2D7; + border-bottom: #FFFFFF 1px solid; + border-left: #000 1px solid; + border-right: #FFFFFF 1px solid; + border-top: #000 1px solid; +} +.defaulttext { + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} +td { + font:10px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 0px; + text-align:left; +} + +blockquote { + font: italic 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#7e96ac; +} +.mediumtext { + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} +.captiontext { + font: 14px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} +.tbox{ + background-color: #eaeef2; + border: #5e5d63 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} +.nextprev{ + background-color: #eaeef2; + border: 1px solid #696C6C; + color: #000; + font: normal 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + padding : 2px; + background-image : url(images/button.png); +} +.button{ + background-color: #eaeef2; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} +.np{ + background-color: #eaeef2; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + padding : 2px; +} +form { + margin: 2px 0px 0px 0px; +} +.spacer{ + padding: 2px 0px 2px 0px; +} +hr { + border-top: #666 1px solid; + border-bottom: #eee 1px solid; + height: 2px; + width: 92%; + text-align:center; +} +.border { + border: #000 1px solid; +} +.border2 { + border: #D5D5D5 1px solid; +} + +.border3 { + border: #000 1px solid; +} +.helpbox { + border: 0px; + background-color: transparent; + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; +} +.caption { + padding: 0px 4px 0px 4px; + border-bottom: #363A44 1px solid; + border-left: #8A96B3 1px solid; + border-right: #363A44 1px solid; + border-top: #8A96B3 1px solid; + background-color: #E1DFDF; + color: #000; + font: 13px tahoma, arial, verdana, helvetica, sans-serif; + background-image : url(images/cap1.png); +} +.caption2 { + padding: 0px 4px 0px 4px; + color: #243B3B; + font: 15px tahoma, arial, verdana, helvetica, sans-serif; + text-align:center; +} +.caption3 { + padding: 0px 4px 0px 4px; + border-bottom: #C7C3C3 1px solid; + border-left: #fff 1px solid; + border-right: transparent; + border-top: #fff 1px solid; + background-color: #D5D5D5; + color: #000; + font: 13px tahoma, arial, verdana, helvetica, sans-serif; +} +.bodytable { + padding: 8px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} +.bodytable2 { + border: #D5D5D5 1px solid; + padding: 8px; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color: #404040; +} +.bodytable3 { + padding: 8px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} +p { + margin-top: 0px; + margin-bottom: 0px +} +.fborder { + border: #000000 1px solid; + background-color: #fff; + +} +.forumheader{ + background-color: #EBEFF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + background-image : url(images/cap1.png); + border: #C3BDBD 1px solid; +} +.forumheader2{ + background-color: #E4EAF2; + font: 14px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} +.forumheader3{ + background-color: #DFE6EF; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} +.forumborder{ + border: #000080 1px solid; +} +.fcaption { + border: #000 1px solid; + padding: 2px 0px 2px 8px; + background-color: #C9C7C7; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + background-image : url(images/fcap.png); + color:#fff; +} +.captiontopleft{ width: 24px; background-image: url(images/topleft.png); } +.captiontopmiddle{ width: 100%; background-repeat: repeat-x; background-image: url(images/top.png); } +.captiontopright{ width: 11px; background-image: url(images/topright.png); } +.captionleft{ width: 24px; background-image: url(images/capleft.png); } +.captionbar{ background-repeat: repeat-x; padding-right:10px; font-size: 10px; color: #fff; font-family: verdana, tahoma, arial, sans-serif; background-image: url(images/capdark.png);} +.captionend{ width: 12px; background-image: url(images/captransition.png); } +.captionmain{ width: 100%; background-repeat: repeat-x; background-image: url(images/caplight.png); } +.captionright{ width: 11px; background-image: url(images/capright.png); } +.bodyleft{ width: 3px; background-repeat: repeat-y; background-image: url(images/left.png); } +.bodymain{ width: 100%; background: #DAE7F3; padding: 4px 5px 5px 4px; font-size: 10px; color: #000; font-family: verdana, tahoma, arial, sans-serif; vertical-align:top; } +.bodyright{ width: 3px; background-repeat: repeat-y; background-image: url(images/right.png); } +.bottomleft{ width: 10px; background-image: url(images/bottomleft.png); } +.bottommain{ width: 100%; background-repeat: repeat-x; background-image: url(images/bottom.png);} +.bottomright{ width: 10px; background-image: url(images/bottomright.png); } +.finfobar{ + background-color: #DBE5F5; + font: 15px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; + background-image : url(forum/finfobar.png); +} + +a.forumlink{ + color: #fff; + text-decoration: underline; +} + +.topborder { + border-bottom: #000 1px solid; +} + +.bottomborder { + border-top: #000 1px solid; + border-bottom: #000 1px solid; +} +.alttd{ + background-color: #C8DDEE; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} +.code{ + border: #9F9F9F 1px solid; + padding: 8px; + background-color: #EEECEC; + font: 12px courier, arial, verdana, tahoma, helvetica, sans-serif; + color:#000040; +} + +.nforumholder { + border: 1px solid #345487; + padding: 0px; + background-color: #fff; +} + +.nforumcaption { + background-image: url(images/nforumcaption.png); + padding: 8px 4px 8px 4px; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color: #fff; +} + +.nforumcaption2 { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; + font-weight: bold; +} + +.nforumcaption3 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread { + border: 1px solid #fff; + padding: 4px; + background-color: #EEF2F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread2 { + border: 1px solid #fff; + padding: 4px; + background-color: #D1DCEB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreplycaption { + border: 1px solid #fff; + padding: 4px; + background-color: #E2EDF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply { + border: 1px solid #fff; + padding: 4px; + background-color: #EDF4F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply2 { + border: 1px solid #fff; + padding: 4px; + background-color: #CFE0EB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +.nforumdisclaimer { + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.nforumview1 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview2 { + border: 1px solid #fff; + padding: 4px; + background-color: #DFE6EF; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview3 { + padding: 4px; + background-color: #BCD0ED; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #263448; +} + +.nforumview4 { + padding: 4px; + background-color: #E4EAF2; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color: #3A4F6C; +} + +.linkspage_button{ + border:0px; +} \ No newline at end of file diff --git a/e107_themes/e107v4a/theme.php b/e107_themes/e107v4a/theme.php new file mode 100644 index 000000000..4dccd6e96 --- /dev/null +++ b/e107_themes/e107v4a/theme.php @@ -0,0 +1,270 @@ +".LAN_THEME_6.""); + +// [layout] + +$layout = "_default"; +$logo = THEME_ABS."images/bullet3.gif"; + +$HEADER .= +" + + + + + +
        +{CUSTOM=clock} + +{CUSTOM=search+".THEME_ABS."images/search.png+18+19} +
        + + + + + + + + + + + + + + + + + +
        +{SITELINKS=menu} +{MENU=1} +"; + +$FOOTER = +" +{MENU=2} +
        + +{SITEDISCLAIMER} +
        +{THEMEDISCLAIMER} +
        +
        + + + + + + +
        +  +{MENU=3} + +{MENU=4} + +  +{MENU=5} +
        +
        "; + + + +function rand_tag(){ + $tags = file(e_BASE."files/taglines.txt"); + return stripslashes(htmlspecialchars($tags[rand(0, count($tags))])); +} + +// [newsstyle] + +$NEWSSTYLE = " +
        + + + + + + +
        + + + + + + + + +
        +{STICKY_ICON}{NEWSTITLE} +
        + + + + + + +
        +{NEWSBODY} +{EXTENDED} +
        +".LAN_THEME_4." {NEWSAUTHOR} ".LAN_THEME_5." {NEWSDATE} + | +{NEWSCOMMENTS} + | +{EMAILICON} +{PRINTICON} +{PDFICON} +
        +
        + + + + + + +
        +
        "; + + + +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", LAN_THEME_1); +define("COMMENTOFFSTRING", LAN_THEME_2); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_3); +define("POST_EXTENDEDSTRING", " ]
        "); + + + +// [linkstyle] + +define(PRELINK, ""); +define(POSTLINK, ""); +define(LINKSTART, "bullet "); +define(LINKSTART_HILITE, "bullet "); +define(LINKEND, "
        "); +define(LINKDISPLAY, 2); +define(LINKALIGN, "left"); + + +// [tablestyle] + +function tablestyle($caption, $text){ + global $style; + + + echo " +
        + + + + + + +
        + + + + + + + + +
        ".$caption."
        + + + + + + +
        ".$text."
        + + + + + + +
        +
        +"; + +} + + +$COMMENTSTYLE = " +
        + + + + + + + + +
        +{SUBJECT} + +{USERNAME} + + | + {TIMEDATE} +
        +
        +{AVATAR} +
        + +{LEVEL} +{COMMENTS} +
        +{JOINED} +
        +{REPLY} +
        +
        +{COMMENT} {COMMENTEDIT} +
        +
        +
        "; + + + +?> \ No newline at end of file diff --git a/e107_themes/human_condition/images/bg.png b/e107_themes/human_condition/images/bg.png new file mode 100644 index 000000000..1f056fa88 Binary files /dev/null and b/e107_themes/human_condition/images/bg.png differ diff --git a/e107_themes/human_condition/images/bullet.png b/e107_themes/human_condition/images/bullet.png new file mode 100644 index 000000000..d84be213c Binary files /dev/null and b/e107_themes/human_condition/images/bullet.png differ diff --git a/e107_themes/human_condition/images/bullet2.gif b/e107_themes/human_condition/images/bullet2.gif new file mode 100644 index 000000000..e22be35cc Binary files /dev/null and b/e107_themes/human_condition/images/bullet2.gif differ diff --git a/e107_themes/human_condition/images/bullet2.png b/e107_themes/human_condition/images/bullet2.png new file mode 100644 index 000000000..d31d3800e Binary files /dev/null and b/e107_themes/human_condition/images/bullet2.png differ diff --git a/e107_themes/human_condition/images/comment.png b/e107_themes/human_condition/images/comment.png new file mode 100644 index 000000000..824cc8093 Binary files /dev/null and b/e107_themes/human_condition/images/comment.png differ diff --git a/e107_themes/human_condition/images/footer.png b/e107_themes/human_condition/images/footer.png new file mode 100644 index 000000000..d7264ebb7 Binary files /dev/null and b/e107_themes/human_condition/images/footer.png differ diff --git a/e107_themes/human_condition/images/header.png b/e107_themes/human_condition/images/header.png new file mode 100644 index 000000000..be6e46e64 Binary files /dev/null and b/e107_themes/human_condition/images/header.png differ diff --git a/e107_themes/human_condition/images/titlebar.png b/e107_themes/human_condition/images/titlebar.png new file mode 100644 index 000000000..bbc407c50 Binary files /dev/null and b/e107_themes/human_condition/images/titlebar.png differ diff --git a/e107_themes/human_condition/index.html b/e107_themes/human_condition/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/human_condition/languages/English.php b/e107_themes/human_condition/languages/English.php new file mode 100644 index 000000000..949a2691a --- /dev/null +++ b/e107_themes/human_condition/languages/English.php @@ -0,0 +1,28 @@ +jalist, based on the Wordpress theme, http://wordpress.org."); +define("LAN_THEME_2", "Comments are turned off for this item"); +define("LAN_THEME_3", "comment(s): "); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); +define("LAN_THEME_6", "Comment by"); + + +?> diff --git a/e107_themes/human_condition/newforumpost.php b/e107_themes/human_condition/newforumpost.php new file mode 100644 index 000000000..6aec1e0a1 --- /dev/null +++ b/e107_themes/human_condition/newforumpost.php @@ -0,0 +1,30 @@ +\n
          \n"; + +$NEWFORUMPOSTSTYLE_MAIN = "
        • {THREAD} ".NFPM_LAN_7." {POSTER} [ ".NFPM_LAN_3.": {VIEWS}, ".NFPM_LAN_4.": {REPLIES}, ".NFPM_LAN_5.": {LASTPOST} ]\n\n
        • \n"; + +$NEWFORUMPOSTSTYLE_FOOTER = "

          \n
        ".NFPM_LAN_6.": {TOTAL_TOPICS} | ".NFPM_LAN_4.": {TOTAL_REPLIES} | ".NFPM_LAN_3.": {TOTAL_VIEWS}"; + + +?> \ No newline at end of file diff --git a/e107_themes/human_condition/preview.jpg b/e107_themes/human_condition/preview.jpg new file mode 100644 index 000000000..31152831f Binary files /dev/null and b/e107_themes/human_condition/preview.jpg differ diff --git a/e107_themes/human_condition/style.css b/e107_themes/human_condition/style.css new file mode 100644 index 000000000..886e3b470 --- /dev/null +++ b/e107_themes/human_condition/style.css @@ -0,0 +1,422 @@ +body, html { + margin: 0 auto; + background: #E4F2FF url(images/bg.png) repeat-y center; + width: 767px; + font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif; + text-align: center; +} + +a:link { + color: #3F729E; + text-decoration: none; + page-break-after: always; +} + +a:visited { + color: #093860; + text-decoration: none; +} + +a:hover, a:active { + color: #093860; +} + +#rap { + margin-left: auto; + margin-right: auto; + width: 749px; +} + +#header { + background: url(images/header.png) repeat-x; + height: 80px; + width: 747px; + margin: 0 auto; + text-align: left; +} + +#header a { + text-decoration: none; + font-size: 18pt; + position: relative; + top: 45px; + left: 10px; + font-family: verdana, arial, helvetica, geneva, sans-serif; +} + +#header a:visited { + color: #3F729E; +} + +#header a:hover { + color: #093860; +} + +.wrapper { + width: 100%; + margin-left: auto; + margin-right: auto; +} + +#menu { + width: 170px; + margin-left: 575px; + text-align: left; + margin-top: 7px; + margin-bottom: 20px; +} + +#menu a { + text-decoration: none; + font-family: verdana, arial, helvetica, geneva, sans-serif; +} + +#menu a:visited { + color: #3F729E; +} + +#menu a:hover { + color: #093860; +} + +#menu input, textarea { + font-family: verdana, arial, helvetica, geneva, sans-serif; + font-size: .9em; + font-weight: normal; +} + +ul, ol { + margin-top: 0; + margin-bottom: 0; +} + +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} + +.menubox { + color: #242424; + font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif; + font-size: 8pt; + margin-top: 15px; + padding: 5px; + border: 1px solid #D7D7D7; + background: #EAEAEA; + width: 150px; +/* margin-left: 20px;*/ +} + +.post { + width: 540px; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + float: left; + padding: 10px; + text-align: left; +} + +.textstyle1 { + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color: #888; +} + +.textstyle2 { + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +.textstyle4 { + font-size: 13px; + margin: 5px 0 0 0; +} + +.textstyle4 a:link { + color: #000; +} + +.textstyle4 a:visited { + color: #000; + text-decoration: none; +} + +.textstyle4 a:hover, a:active { + color: #093860; +} + +.post .textstyle3 { + font-size: 10px; + border-left: 1px solid #ddd; + padding-left: 5px; + text-align: justify; + } + +.textstyle3 a:hover { + background: #EFF8FF; +} + +.postinfo { + font-size: 9px; + width: 541px; + background: #eee; + padding: 2px 0 2px 2px; +} + +.postinfo a:link { + color: #606060; +} + +.postinfo a:hover { + color: #093860; +} + + +#titlebar2{ + width: 500px; + font-size: .7em; +} + +#sitedisclaimer { + clear: both; + width: 747px; + margin: 0 auto; + font-size: .6em; + line-height: 2.4em; + text-align: center; +} + +.date { + width: 543px; + font-size: .8em; + background: url(images/titlebar.png) no-repeat; + height: 23px; + margin: 0; + padding-top: 4px; + padding-left: 5px; + color: #0E2E4A; +} + +.smalltext { + background: none; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 9px; + font-style: normal; + color:#5d6e75; +} +.smallblacktext { + background: none; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 10px; + font-style: normal; + color:#000; +} +.indent{ + padding: 10px 10px 10px 10px; + margin: 5px; + font: 9px verdana, tahoma, arial, sans-serif; + color: #000060; + border: 1px solid #cfcdcd; + background-color: #efefef; +} +.defaulttext { + background: none; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 10px; + font-style: normal; + color:#000; +} + +td { + background: none; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 11px; + font-style: normal; + color:#5d6e75; + padding-bottom: 0px; + padding-left: 0px; + padding-right: 0px; + padding-top: 0px; + text-align:left; +} + +blockquote { + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-style: italic; + color:#7e96ac; +} +.mediumtext { + background: none; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 11px; + font-style: normal; + color:#000; +} +.captiontext { + background: none; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 18px; + color:#000080; +} +.tbox{ + background-color: #F4F7FA; + border-bottom: #5e5d63 1px solid; + border-left: #5e5d63 1px solid; + border-right: #5e5d63 1px solid; + border-top: #5e5d63 1px solid; + color: #000000; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 10px; +} +.button{ + color: #fff; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 10px; + text-align:center; + background-color: #4F5974; + border-bottom: #333A4B 1px solid; + border-left: #7180A6 1px solid; + border-right: #333A4B 1px solid; + border-top: #7180A6 1px solid; + letter-spacing: 0.1em; + cursor:pointer +} + +.button a{ + color: #FFF; + } +.button a:hover{ + color: #CFCFDF; + text-decoration: none; +} + +.nextprev{ + width: 535px; + font-size: .8em; + background: url(images/titlebar.png) no-repeat; + height: 23px; + margin: 0; + padding-top: 6px; + padding-left: 5px; + color: #0E2E4A; + padding-right: 10px; +} + +form { + margin: 2px 0px 0px 0px; +} +.spacer{ + padding-bottom : 2px; + padding-left : 0px; + padding-right : 0px; + padding-top : 2px; +} +hr { + border-top: #666 1px solid; + border-bottom: #eee 1px solid; + height: 2px; + width: 92%; + text-align:center; + border-style: dotted; +} +.border { + border: #999 1px solid; + background-color: #F0F1F1; + padding: 2px; +} + +.bodytable { + padding: 2px; + background-color: transparent; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 10px; + font-style: normal; + color: #000; +} + +p { + margin-top: 0px +} + +.fborder { + border: 1px solid #c3bdbd; + background-color: #fff; + +} +.forumheader{ + background-color: #EBEFF2; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 11px; + color:#000; + padding: 4px; + border: 1px solid #C3BDBD; +} + +.forumheader2{ + background-color: #EFEFEF; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 14px; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} + +.forumheader3{ + background-color: #eaeaea; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 11px; + color:#000; + padding: 4px; + border: #c3bdbd 1px solid; +} + +.forumborder{ + border-bottom: #000080 1px solid; + border-left: #000080 1px solid; + border-right: #000080 1px solid; + border-top: #000080 1px solid; + background-color: transparent; +} + +.fcaption { + border: #c3bdbd 1px solid; + padding-bottom: 2px; + padding-left: 8px; + padding-right: 0px; + padding-top: 2px; + background-color: #dcdada; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 12px; + color:#616060; +} + +.topbar { + background-image : url('images/topbar.png'); +} +.leftbar { + background-image : url('images/leftbar.png'); +} + +.finfobar{ + background-color: #CCC8C8; + color:#000; + padding: 4px; + border: 1px solid #C3BDBD; + font-style:normal; font-variant:normal; + font-weight:normal; font-size:11px; + font-family:verdana, tahoma, arial, helvetica, sans-serif +} + +a.forumlink{ + color: #616060; + text-decoration: underline; +} + +.helpbox { + border: 0px none red; + background-color: transparent; + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; +} +.linkspage_button{ + border:0px; +} \ No newline at end of file diff --git a/e107_themes/human_condition/theme.php b/e107_themes/human_condition/theme.php new file mode 100644 index 000000000..d013df399 --- /dev/null +++ b/e107_themes/human_condition/theme.php @@ -0,0 +1,188 @@ +http://wordpress.org"; +define("STANDARDS_MODE", TRUE); +$xhtmlcompliant = TRUE; +$csscompliant = TRUE; +define("IMODE", "lite"); +define("THEME_DISCLAIMER", "

        ".LAN_THEME_1.""); + +// [layout] + +$layout = "_default"; + +$HEADER = " +
        +

        ".$pref['sitename']."

        +
        +{SETSTYLE=post} +"; + + +$FOOTER = " +{SETSTYLE=default} +
        + +
        + +"; + +define("TP_commenticon", ""); + +$NEWSSTYLE = " +
        {STICKY_ICON}{NEWSTITLE}
        + +
        {NEWSBODY}
        +\n
        \n"; +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " | "); + + +define("DATEHEADERCLASS", "button"); +// define("DATEHEADERCLASS", "nextprev"); // uncomment this line for a different style of news date header + +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", LAN_THEME_3); +define("COMMENTOFFSTRING", LAN_THEME_2); + +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); + + +// [linkstyle] + +define(PRELINK, ""); +define(POSTLINK, ""); +define(LINKSTART, "bullet "); +define(LINKSTART_HILITE, "bullet "); +define(LINKEND, "
        "); +define(LINKDISPLAY, 2); // 1 - along top, 2 - in left or right column +define(LINKALIGN, "left"); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode="") +{ + global $style; + + if($style == "post") + { + + if(!$caption) + { + echo "
        $text
        \n"; + } + else if(!$text) + { + echo "
        $caption
        \n"; + } + else + { + echo "
        $caption
        \n$text\n
        \n"; + } + } + else + { + if(!$caption) + { + echo "
        $text
        \n"; + } + + else if(!$text) + { + echo "
        $caption
        \n"; + } + else + { + echo "
        "; + } + } +} + +$COMMENTSTYLE = " + + + + + + + + +
        +{SUBJECT} + +{USERNAME} + +| +{TIMEDATE} +
        +
        +{AVATAR} +
        + +{COMMENTS} +
        +{JOINED} +
        +
        +{REPLY} +
        +{COMMENT} {COMMENTEDIT} +
        +
        "; + +$POLLSTYLE = <<< EOF +Poll: {QUESTION} +

        +{OPTIONS=
        OPTION
        BAR
        PERCENTAGE VOTES
        \n} +
        {AUTHOR}
        {VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        +EOF; + +$CHATBOXSTYLE = " +bullet +{USERNAME}
        {TIMEDATE} +
        +{MESSAGE} +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/index.html b/e107_themes/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/interfectus/images/background.jpg b/e107_themes/interfectus/images/background.jpg new file mode 100644 index 000000000..45d6bbfde Binary files /dev/null and b/e107_themes/interfectus/images/background.jpg differ diff --git a/e107_themes/interfectus/images/bar.png b/e107_themes/interfectus/images/bar.png new file mode 100644 index 000000000..f7b04ac68 Binary files /dev/null and b/e107_themes/interfectus/images/bar.png differ diff --git a/e107_themes/interfectus/images/barl.png b/e107_themes/interfectus/images/barl.png new file mode 100644 index 000000000..32c0f8ae1 Binary files /dev/null and b/e107_themes/interfectus/images/barl.png differ diff --git a/e107_themes/interfectus/images/barr.png b/e107_themes/interfectus/images/barr.png new file mode 100644 index 000000000..7e51c824f Binary files /dev/null and b/e107_themes/interfectus/images/barr.png differ diff --git a/e107_themes/interfectus/images/blank.gif b/e107_themes/interfectus/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_themes/interfectus/images/blank.gif differ diff --git a/e107_themes/interfectus/images/bottomcol.png b/e107_themes/interfectus/images/bottomcol.png new file mode 100644 index 000000000..785ccfd6e Binary files /dev/null and b/e107_themes/interfectus/images/bottomcol.png differ diff --git a/e107_themes/interfectus/images/bottomleftcol.png b/e107_themes/interfectus/images/bottomleftcol.png new file mode 100644 index 000000000..59bff97c9 Binary files /dev/null and b/e107_themes/interfectus/images/bottomleftcol.png differ diff --git a/e107_themes/interfectus/images/bottomrightcol.png b/e107_themes/interfectus/images/bottomrightcol.png new file mode 100644 index 000000000..76c5c712d Binary files /dev/null and b/e107_themes/interfectus/images/bottomrightcol.png differ diff --git a/e107_themes/interfectus/images/bullet1.gif b/e107_themes/interfectus/images/bullet1.gif new file mode 100644 index 000000000..0dced4fdc Binary files /dev/null and b/e107_themes/interfectus/images/bullet1.gif differ diff --git a/e107_themes/interfectus/images/bullet2.gif b/e107_themes/interfectus/images/bullet2.gif new file mode 100644 index 000000000..d9231bd48 Binary files /dev/null and b/e107_themes/interfectus/images/bullet2.gif differ diff --git a/e107_themes/interfectus/images/button.png b/e107_themes/interfectus/images/button.png new file mode 100644 index 000000000..e64099898 Binary files /dev/null and b/e107_themes/interfectus/images/button.png differ diff --git a/e107_themes/interfectus/images/cap1.png b/e107_themes/interfectus/images/cap1.png new file mode 100644 index 000000000..7f3a9c7ef Binary files /dev/null and b/e107_themes/interfectus/images/cap1.png differ diff --git a/e107_themes/interfectus/images/caption.png b/e107_themes/interfectus/images/caption.png new file mode 100644 index 000000000..6360ee0cb Binary files /dev/null and b/e107_themes/interfectus/images/caption.png differ diff --git a/e107_themes/interfectus/images/fcap.png b/e107_themes/interfectus/images/fcap.png new file mode 100644 index 000000000..bf4a4d208 Binary files /dev/null and b/e107_themes/interfectus/images/fcap.png differ diff --git a/e107_themes/interfectus/images/fcap2.png b/e107_themes/interfectus/images/fcap2.png new file mode 100644 index 000000000..2c98c82d7 Binary files /dev/null and b/e107_themes/interfectus/images/fcap2.png differ diff --git a/e107_themes/interfectus/images/footer.png b/e107_themes/interfectus/images/footer.png new file mode 100644 index 000000000..47515855c Binary files /dev/null and b/e107_themes/interfectus/images/footer.png differ diff --git a/e107_themes/interfectus/images/header.png b/e107_themes/interfectus/images/header.png new file mode 100644 index 000000000..de01ad644 Binary files /dev/null and b/e107_themes/interfectus/images/header.png differ diff --git a/e107_themes/interfectus/images/leftcol.png b/e107_themes/interfectus/images/leftcol.png new file mode 100644 index 000000000..a8b9e730e Binary files /dev/null and b/e107_themes/interfectus/images/leftcol.png differ diff --git a/e107_themes/interfectus/images/link1.png b/e107_themes/interfectus/images/link1.png new file mode 100644 index 000000000..3b8c0544e Binary files /dev/null and b/e107_themes/interfectus/images/link1.png differ diff --git a/e107_themes/interfectus/images/link2.png b/e107_themes/interfectus/images/link2.png new file mode 100644 index 000000000..123d70d34 Binary files /dev/null and b/e107_themes/interfectus/images/link2.png differ diff --git a/e107_themes/interfectus/images/menubottom.png b/e107_themes/interfectus/images/menubottom.png new file mode 100644 index 000000000..e0c59805a Binary files /dev/null and b/e107_themes/interfectus/images/menubottom.png differ diff --git a/e107_themes/interfectus/images/menubottom2.png b/e107_themes/interfectus/images/menubottom2.png new file mode 100644 index 000000000..c703f558f Binary files /dev/null and b/e107_themes/interfectus/images/menubottom2.png differ diff --git a/e107_themes/interfectus/images/menutop.png b/e107_themes/interfectus/images/menutop.png new file mode 100644 index 000000000..426c355f3 Binary files /dev/null and b/e107_themes/interfectus/images/menutop.png differ diff --git a/e107_themes/interfectus/images/menutop2.png b/e107_themes/interfectus/images/menutop2.png new file mode 100644 index 000000000..4df791377 Binary files /dev/null and b/e107_themes/interfectus/images/menutop2.png differ diff --git a/e107_themes/interfectus/images/pagefooter.png b/e107_themes/interfectus/images/pagefooter.png new file mode 100644 index 000000000..8effef159 Binary files /dev/null and b/e107_themes/interfectus/images/pagefooter.png differ diff --git a/e107_themes/interfectus/images/pageheader.png b/e107_themes/interfectus/images/pageheader.png new file mode 100644 index 000000000..6ffa9fade Binary files /dev/null and b/e107_themes/interfectus/images/pageheader.png differ diff --git a/e107_themes/interfectus/images/rightcol.png b/e107_themes/interfectus/images/rightcol.png new file mode 100644 index 000000000..a7b1e91f7 Binary files /dev/null and b/e107_themes/interfectus/images/rightcol.png differ diff --git a/e107_themes/interfectus/images/search.png b/e107_themes/interfectus/images/search.png new file mode 100644 index 000000000..598a25f25 Binary files /dev/null and b/e107_themes/interfectus/images/search.png differ diff --git a/e107_themes/interfectus/images/topleftcol.png b/e107_themes/interfectus/images/topleftcol.png new file mode 100644 index 000000000..dac7e9d78 Binary files /dev/null and b/e107_themes/interfectus/images/topleftcol.png differ diff --git a/e107_themes/interfectus/images/toprightcol.png b/e107_themes/interfectus/images/toprightcol.png new file mode 100644 index 000000000..1c8620ad3 Binary files /dev/null and b/e107_themes/interfectus/images/toprightcol.png differ diff --git a/e107_themes/interfectus/index.html b/e107_themes/interfectus/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/interfectus/languages/English.php b/e107_themes/interfectus/languages/English.php new file mode 100644 index 000000000..f2a9e32ae --- /dev/null +++ b/e107_themes/interfectus/languages/English.php @@ -0,0 +1,26 @@ +jalist"); +define("LAN_THEME_2", "Read/Post Comment: "); +define("LAN_THEME_3", "Comments are turned off for this item"); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); + +?> diff --git a/e107_themes/interfectus/preview.jpg b/e107_themes/interfectus/preview.jpg new file mode 100644 index 000000000..b5b2c93fd Binary files /dev/null and b/e107_themes/interfectus/preview.jpg differ diff --git a/e107_themes/interfectus/style.css b/e107_themes/interfectus/style.css new file mode 100644 index 000000000..f36c70b90 --- /dev/null +++ b/e107_themes/interfectus/style.css @@ -0,0 +1,424 @@ +body { + background-image: url(images/background.jpg); color: #ffffff; background-color: #333333; text-align: left; font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; color: #555; margin: 12px 0 0 0; +} + +.maintable { + width: 759px; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +#logo { + background-image: url(images/header.png); + width: 759px; + height: 108px; +} + +#sitename { + margin-left: 24px; + margin-top: 50px; + text-align: left; + font: 10pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ffb432; +} + +#infoleft { + width: 365px; + text-align: left; + background-color: #000; +} + +#inforight { + width: 366px; + text-align: right; + background-color: #000; +} + +.padder { + padding: 0 4px 0 4px; +} + +.spacer{ + padding: 2px 0px 2px 0px; +} + +ul, ol { + margin-top: 0; + margin-bottom: 0; +} + + +#collefttop { + background-image: url(images/topleftcol.png); + width: 14px; + height: 34px; +} + +#colrighttop { + background-image: url(images/toprightcol.png); + width: 14px; + height: 34px; +} + +#colleft { + background-image: url(images/leftcol.png); + width: 14px; + height: 100%; + background-repeat: repeat-y; +} + +#colright { + background-image: url(images/rightcol.png); + width: 14px; + height: 100%; + background-repeat: repeat-y; +} + +.button { + border: 1px solid #000; + color: #000; + font: 7pt verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} + +.cbdate { + color: #686868; +} + +#colbotleft { + background-image: url(images/bottomleftcol.png); + width: 14px; + height: 14px; +} + +#colbot { + background-image: url(images/bottomcol.png); + height: 14px; + width: 100%; + background-repeat: repeat-x; +} + +#colbotright { + background-image: url(images/bottomrightcol.png); + width: 14px; + height: 14px; +} + + + +#contentarea { + background-color: #000; + width: 599px; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ffb432; + vertical-align:top; +} + +#fullcontentarea { + background-color: #000; + width: 759px; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ffb432; + vertical-align:top; +} + +#menuarea { + background-color: #000; + width: 160px; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ffb432; + vertical-align:top; + text-align: left; +} + +.tablewrapper { + width: 100%; +} + +.searchbar { + background-color: #000; + margin-left: auto; + margin-right: auto; + text-align: center; +} + + +/* menu definitions */ + +.menutable{ + width: 160px; +} + +.menuwrapper { + width: 160px; + margin-left: auto; + margin-right: auto; +} + +.menutop { + background-image: url(images/menutop.png); + width: 100%; + background-repeat: repeat-x; + height: 5px; +} + +.menubody { + background-color: #3e3e3e; + width: 100%; + font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #bbb; + vertical-align:top; + text-align: left; +} + +.menubottom { + background-image: url(images/menubottom.png); + width: 100%; + background-repeat: repeat-x; + height: 12px; +} + +.menutop2 { + background-image: url(images/menutop2.png); + width: 100%; + background-repeat: repeat-x; + height: 5px; +} + +.menubody2 { + background-color: #3e3e3e; + width: 100%; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ffb432; + padding: 4px 5px 5px 4px; + vertical-align:top; + text-align: left; +} + +.menubottom2 { + background-image: url(images/menubottom2.png); + width: 100%; + background-repeat: repeat-x; + height: 12px; +} + +/* end menu layout */ + +img { + vertical-align: middle; +} +.linkspage_button{ + vertical-align: middle; + border:0px; +} + +.smalltext { + font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif; +} + +.pageheader { + background-image: url(images/pageheader.png); + width: 100%; + background-repeat: repeat-x; + height: 25px; +} + +.pagebody { + background-color: #333; + width: 100%; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ddd; + padding: 4px 5px 5px 4px; + vertical-align:top; + text-align: left; +} + +.pagefooter { + background-image: url(images/pagefooter.png); + width: 100%; + background-repeat: repeat-x; + height: 14px; +} + + +a { + color: #999; + text-decoration: none; +} +a:hover { + color: #ddd; + text-decoration: underline; +} + +a.link2:link { + color: #999; + text-decoration: none; +} + +a.link2:hover { + color: #ffb432; + text-decoration: none; +} + + +/* captions */ + +.caption { + background-image: url(images/cap1.png); + width: 100%; + background-repeat: repeat-x; + height: 16px; + font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-weight: bold; + color: #fff; +} + +.captionpadder { + padding: 2px 0 0 4px; +} + +.captiontext { + font: 9pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ffb432; +} + + +.testborder { + border: 1px solid red; +} + +.link1 { + background-image: url(images/link1.png); + background-repeat: no-repeat; + width: 159%; + height: 21px; + font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #fff; + padding-left: 4px; +} + +.link2 { + background-image: url(images/link2.png); + background-repeat: no-repeat; + width: 159%; + height: 21px; + font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #fff; + padding-left: 4px; +} + +.linktext { + padding-top: 6px; +} + + +form { + margin: 2px 0px 0px 0px; +} + +p { + margin: 0px; +} + +.tbox { + background-color: #000; + border: 1px solid #3e3e3e; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; color: #777; +} + +.tbox.search { + background-color: #000; + border: 1px solid #3e3e3e; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + color: #ccc; +} + +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} + +.helpbox { + color:#aaa; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + border: 0px none red; + background-color: transparent; +} + + +/* forum */ + +.fborder { + border: #1d1d1d 1px solid; +} +.forumheader{ + background-color: #333; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#ffa939; + padding: 4px; + + border: 1px solid #1d1d1d; + text-align: left; +} + +.forumheader2{ + background-color: #333; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#9f9f9f; + padding: 4px; + border: #2a2a2a 1px solid; + text-align: left; +} + +.forumheader3{ + background-color: #333; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#9f9f9f; + padding: 4px; + border: #2a2a2a 1px solid; + text-align: left; +} + +.forumborder{ + border: #000080 1px solid; +} + +.fcaption { + background-image : url(images/fcap.png); + border: 1px solid #1d1d1d; + padding: 2px 0 2px 0; + background-color: #f9fafb; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#ffa939; + text-align: left; +} + +.finfobar{ + background-color: #393939; + color:#000; + padding: 4px; + border: 1px solid #2a2a2a; + font-size: 7pt; font-family:verdana, tahoma, arial, helvetica, sans-serif; + text-align: left; +} + +.smallblacktext { + font: 10px tahoma, verdana, arial, helvetica, sans-serif; + color:#b47716; +} + +td { + text-align: left; +} + +.nextprev { + font: 7pt tahoma, verdana, arial, helvetica, sans-serif; + color:#b47716; +} + +#Clock { +color: #ffb432; +} diff --git a/e107_themes/interfectus/theme.php b/e107_themes/interfectus/theme.php new file mode 100644 index 000000000..e0304c429 --- /dev/null +++ b/e107_themes/interfectus/theme.php @@ -0,0 +1,296 @@ +".LAN_THEME_1.""); +define("IMODE", "dark"); + +// [layout] + +$layout = "_default"; + +$HEADER = " + + + + +
        + + + + + + + +
        +
        +{CUSTOM=search+".THEME_ABS."images/search.png} +
        +
        +
        +{CUSTOM=clock} +
        +
        + + + + + + +
        + + + + + +
        +
        + + + + +
        +{SETSTYLE=main} + +"; + +$FOOTER = " +
        +
        +
        +
        + + + + + + +
        + +
        {SITEDISCLAIMER}
        {THEMEDISCLAIMER}
        + +"; + + +/* + + + + + + + + + + + +*/ + + +$CUSTOMHEADER = " + + + + +
        + + + + + + + +
        +
        +{CUSTOM=search+".THEME_ABS."images/search.png} +
        +
        +
        +{CUSTOM=clock} +
        +
        + + + + + + +
        + + + + +
        +
        + + + + +
        +{SETSTYLE=main} + +"; + +$CUSTOMFOOTER = " + +
        +
        +
        +
        + + + + + + +
        + +"; + + +$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php user.php submitnews.php download.php links.php stats.php usersettings.php signup.php"; + + + + +$NEWSSTYLE = " +
        {NEWSTITLE}
        +{NEWSBODY} +{EXTENDED} +
        +{NEWSAUTHOR} +on +{NEWSDATE} +
        +{NEWSCOMMENTS}{TRACKBACK} +
        +
        "; + +define("ICONSTYLE", ""); +define("COMMENTLINK", LAN_THEME_2); +define("COMMENTOFFSTRING", LAN_THEME_3); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " | "); + + +// [linkstyle] + +define('PRELINK', ""); +define('POSTLINK', ""); +define('LINKSTART', "
          "); +define("LINKSTART_HILITE", "
          "); +define('LINKEND', "
        "); +define('LINKDISPLAY', 1); +define('LINKALIGN', "left"); + + + + +// [tablestyle] + +function tablestyle($caption, $text) +{ + global $style; + + if($style == "menu1") + { + echo "
        $caption

        $text

        "; + } + else if($style == "menu2") + { + echo " + + + +"; + } + else + { + echo "
        $caption
        $text
        "; + } +} + +$COMMENTSTYLE = "

        +
        {USERNAME} | {TIMEDATE}
        +{COMMENT} {COMMENTEDIT}
        +{REPLY}{IPADDRESS} +"; + + + +$CHATBOXSTYLE = " +
        {USERNAME} | {TIMEDATE}
        +
        +{MESSAGE} +
        +
        "; + + + + + + + + + + + +?> \ No newline at end of file diff --git a/e107_themes/jayya/admin_template.php b/e107_themes/jayya/admin_template.php new file mode 100644 index 000000000..666d5ed50 --- /dev/null +++ b/e107_themes/jayya/admin_template.php @@ -0,0 +1,173 @@ + parseTemplate('{ADMIN_HELP}'); + +$style = "rightmenu"; +$pre_admin_menu = $tp -> parseTemplate('{ADMIN_MENU=pre}'); +$preright = $tp -> parseTemplate('{ADMIN_STATUS=request}'); +$preright .= $tp -> parseTemplate('{ADMIN_LATEST=request}'); +$preright .= $tp -> parseTemplate('{ADMIN_PRESET}'); +$preright .= $tp -> parseTemplate('{ADMIN_LOG=request}'); +$style = "default"; + +// [layout] + +$ADMIN_HEADER = " + + + +
        + + + + + + + + +
        +{ADMIN_LOGO} + +
        +{ADMIN_LOGGED} +{ADMIN_SEL_LAN} +{ADMIN_USERLAN} +
        +{SITELINKS=flat} +
        +
        +{ADMIN_ICON} +
        +
        "; + +if (ADMIN) { + $ADMIN_HEADER .= "{ADMIN_ALT_NAV}"; +} else { + if (file_exists(THEME.'admin_nav.js')) { + $ADMIN_HEADER .= ""; + } else { + $ADMIN_HEADER .= ""; + } + + $ADMIN_HEADER .= "
        + + +
        + +
        "; +} + +$ADMIN_HEADER .= " + + +"; + +if ($pre_admin_menu || $preright) { + $ADMIN_FOOTER .= ""; +} + +$ADMIN_FOOTER .= " +
        + + +
        +{SETSTYLE=leftmenu} +{ADMIN_LANG} +{ADMIN_PWORD} +{ADMIN_MSG} +{ADMIN_PLUGINS}"; + +if (!ADMIN) { + $style='leftmenu'; + $ADMIN_HEADER .= $ns -> tablerender('Welcome', '', '', TRUE); + $style='default'; +} + +if ($prehelp!='') { + $ADMIN_HEADER .= $prehelp; +} else { + $ADMIN_HEADER .= "{ADMIN_SITEINFO}"; +} + +$ADMIN_HEADER .= "
        +
        +
        +{SETSTYLE=default} +"; + +$ADMIN_FOOTER = "
        +
        + + +
        + {SETSTYLE=rightmenu} + {ADMIN_MENU} + ".$preright." +
        +
        +
        +
        +
        +{SITEDISCLAIMER} +

        +{ADMIN_CREDITS} +
        +
        +
        +"; + + +// [admin button style] + +$BUTTONS_START = ""; + +$BUTTON = ""; + +$BUTTON_OVER = ""; + +$BUTTONS_END = "
        "; + +$SUB_BUTTONS_START = " + +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/jayya/canvas.css b/e107_themes/jayya/canvas.css new file mode 100644 index 000000000..321fcb035 --- /dev/null +++ b/e107_themes/jayya/canvas.css @@ -0,0 +1,316 @@ +/* info: alternative stylesheet */ + +/* Core Classes */ +body { + background-color: #e1e4e8; +} + +body, td { + margin: 0px; + padding: 0px; + text-align: left; + color: #000; +} + +body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext, +.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar { + font: normal 11px verdana, tahoma, arial, sans-serif; + color: #000; +} + +.fcaption { + font: bold 11px verdana, tahoma, arial, sans-serif; + color: #566782; +} + +.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox { + font: normal 10px verdana, tahoma, arial, sans-serif; + color: #000; +} + +a { + color: #1A4487; +} + +a:hover { + color: #003300; +} + +img { + border: 0px; +} + +.linkspage_button { + border: 0px; +} + +form { + margin: 0px; +} + +.tbox { + border: #9E9E9E 1px solid; + background-color: #fff; +} + +.indent { + border: #999 1px dashed; + padding: 5px; + margin: 5px; + background-color: #f7f7f9; +} + +.button, .button:hover { + border: 1px solid #9E9E9E; +} + +.button { + background-image : url(images/button.png); +} + +.button:hover { + background-image : url(images/buttonover.png); +} + +.nextprev { + border: 0px; + text-align: center; + padding: 2px; + background-color: #f7f7f9; +} + +.spacer{ + padding: 5px 0px; +} + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 5px; + background-color: #fff; + border: 1px solid #B5B5B5; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #fbfbfd; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #f7f7f9; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.searchhighlight { + text-decoration: underline; + color: #ff0000; + font-weight: bold; +} + +ul { + margin-top: 0px; + margin-bottom: 0px; +} + +.helpbox { + border: 0px; +} + +/* Theme Specific Classes */ + +.page_container { + width: 100%; + border-collapse: collapse; + border-spacing: 0px; +} + +.top_section, .main_section { + width: 100%; + background-color: #fff; + border-collapse: collapse; + border-spacing: 0px; +} + +.top_section_left { + vertical-align: middle; +} + +.top_section_mid { + vertical-align: bottom; + text-align: right; + padding: 5px; + background-image: url(images/top_mid_back.jpg); + background-repeat: no-repeat; + background-color: #E9EAF2; +} + +.top_section_right { + vertical-align: middle; + text-align: center; + background-image: url(images/top_right_back.jpg); + background-repeat: no-repeat; + background-position: center; + background-color: #f3f3f7; +} + +.menus_container { + width: 170px; + border-collapse: collapse; + border-spacing: 0px; +} + +.default_menu { + vertical-align: top; +} + +.left_menu, .right_menu { + width: 170px; + vertical-align: top; + background-color: #F5F5F7; +} + +.main_caption, .left_caption, .right_caption { + font: bold 12px verdana, tahoma, arial, sans-serif; + color: #566782; + white-space: nowrap; + padding: 5px 7px 3px 7px; +} + +.cont { + border-collapse: collapse; + border-spacing: 0px; + width: 100%; +} + +.menu_content { + padding: 5px 7px; + background-color: #fff; +} + +.menu_content.non_default { + background-color: transparent; +} + +.news_info { + width: *; + background-color: #f7f7f9; + border-collapse: collapse; + border-spacing: 0px; +} + +/* Nav Menu Classes */ + +div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem { + font: normal 11px arial, verdana, tahoma, sans-serif; + color: #000; +} + +div.menuBar { + background-color: #F7F9FA; + background-image: url(images/s_nav.png); + background-repeat: repeat-x; + border-top: 1px solid #fff; + padding: 4px 0px; + text-align: left; +} + +div.emenuBar { + background-color: #F7F9FA; + border-top: 1px solid #fff; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid; + border-color: transparent !important; + border-color: #fff #F8FAFB #F0F2F3 #F8FAFB; + cursor: default; + left: 0px; + margin: 0px; + padding: 2px 4px 2px 22px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: transparent; + border-color: #fff #a5a5a5 #a5a5a5 #fff !important; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover { + background-color: #fff; + border-color: #a5a5a5 #fff #fff #a5a5a5 !important; + left: 1px; + top: 1px; +} + +div.menu { + background-color: #FCFDFF; + border: 1px solid; + border-color: #fff #a5a5a5 #a5a5a5 #fff; + left: 0px; + padding: 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + cursor: default; + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #F2F4FF; +} + +div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #fff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} + +/* button style */ + +.emenuBar.link_button, .menuButton.link_button { + background-color: transparent; + border: 0px; +} + +.menuButton_over.link_button { + background-color: #fff; + border: 0px; +} \ No newline at end of file diff --git a/e107_themes/jayya/forum/admin.png b/e107_themes/jayya/forum/admin.png new file mode 100644 index 000000000..bb16864a6 Binary files /dev/null and b/e107_themes/jayya/forum/admin.png differ diff --git a/e107_themes/jayya/forum/admin_delete.png b/e107_themes/jayya/forum/admin_delete.png new file mode 100644 index 000000000..3e9d75c75 Binary files /dev/null and b/e107_themes/jayya/forum/admin_delete.png differ diff --git a/e107_themes/jayya/forum/admin_edit.png b/e107_themes/jayya/forum/admin_edit.png new file mode 100644 index 000000000..9005d76ad Binary files /dev/null and b/e107_themes/jayya/forum/admin_edit.png differ diff --git a/e107_themes/jayya/forum/admin_lock.png b/e107_themes/jayya/forum/admin_lock.png new file mode 100644 index 000000000..775d29b0d Binary files /dev/null and b/e107_themes/jayya/forum/admin_lock.png differ diff --git a/e107_themes/jayya/forum/admin_move.png b/e107_themes/jayya/forum/admin_move.png new file mode 100644 index 000000000..da223155e Binary files /dev/null and b/e107_themes/jayya/forum/admin_move.png differ diff --git a/e107_themes/jayya/forum/admin_stick.png b/e107_themes/jayya/forum/admin_stick.png new file mode 100644 index 000000000..68bd3985c Binary files /dev/null and b/e107_themes/jayya/forum/admin_stick.png differ diff --git a/e107_themes/jayya/forum/admin_unlock.png b/e107_themes/jayya/forum/admin_unlock.png new file mode 100644 index 000000000..23bf25a45 Binary files /dev/null and b/e107_themes/jayya/forum/admin_unlock.png differ diff --git a/e107_themes/jayya/forum/admin_unstick.png b/e107_themes/jayya/forum/admin_unstick.png new file mode 100644 index 000000000..836b40967 Binary files /dev/null and b/e107_themes/jayya/forum/admin_unstick.png differ diff --git a/e107_themes/jayya/forum/announce.png b/e107_themes/jayya/forum/announce.png new file mode 100644 index 000000000..aca9f89d1 Binary files /dev/null and b/e107_themes/jayya/forum/announce.png differ diff --git a/e107_themes/jayya/forum/closed_small.png b/e107_themes/jayya/forum/closed_small.png new file mode 100644 index 000000000..775d29b0d Binary files /dev/null and b/e107_themes/jayya/forum/closed_small.png differ diff --git a/e107_themes/jayya/forum/delete.png b/e107_themes/jayya/forum/delete.png new file mode 100644 index 000000000..3c2f97fe0 Binary files /dev/null and b/e107_themes/jayya/forum/delete.png differ diff --git a/e107_themes/jayya/forum/e.png b/e107_themes/jayya/forum/e.png new file mode 100644 index 000000000..70171ddb0 Binary files /dev/null and b/e107_themes/jayya/forum/e.png differ diff --git a/e107_themes/jayya/forum/edit.png b/e107_themes/jayya/forum/edit.png new file mode 100644 index 000000000..4af1b7f76 Binary files /dev/null and b/e107_themes/jayya/forum/edit.png differ diff --git a/e107_themes/jayya/forum/email.png b/e107_themes/jayya/forum/email.png new file mode 100644 index 000000000..c13cbf776 Binary files /dev/null and b/e107_themes/jayya/forum/email.png differ diff --git a/e107_themes/jayya/forum/fcap.png b/e107_themes/jayya/forum/fcap.png new file mode 100644 index 000000000..fce6646ab Binary files /dev/null and b/e107_themes/jayya/forum/fcap.png differ diff --git a/e107_themes/jayya/forum/fcap2.png b/e107_themes/jayya/forum/fcap2.png new file mode 100644 index 000000000..ba339ba12 Binary files /dev/null and b/e107_themes/jayya/forum/fcap2.png differ diff --git a/e107_themes/jayya/forum/fcap2orig.png b/e107_themes/jayya/forum/fcap2orig.png new file mode 100644 index 000000000..3d82038b1 Binary files /dev/null and b/e107_themes/jayya/forum/fcap2orig.png differ diff --git a/e107_themes/jayya/forum/finfobar.png b/e107_themes/jayya/forum/finfobar.png new file mode 100644 index 000000000..292688b66 Binary files /dev/null and b/e107_themes/jayya/forum/finfobar.png differ diff --git a/e107_themes/jayya/forum/forum_icons_template.php b/e107_themes/jayya/forum/forum_icons_template.php new file mode 100644 index 000000000..9f1885adf --- /dev/null +++ b/e107_themes/jayya/forum/forum_icons_template.php @@ -0,0 +1,71 @@ +"); +define("IMAGE_new", "".LAN_199.""); +define("IMAGE_nonew", ""); +define("IMAGE_new_small", "".FORLAN_11.""); +define("IMAGE_nonew_small", "".FORLAN_12.""); +define("IMAGE_new_popular", "".FORLAN_13.""); +define("IMAGE_nonew_popular", "".FORLAN_14.""); +define("IMAGE_new_popular_small", "".FORLAN_13.""); +define("IMAGE_nonew_popular_small", "".FORLAN_14.""); +define("IMAGE_sticky", "".FORLAN_15.""); +define("IMAGE_stickyclosed", "".FORLAN_16.""); +define("IMAGE_sticky_small", "".FORLAN_16.""); +define("IMAGE_stickyclosed_small", "".FORLAN_16.""); +define("IMAGE_announce", "".FORLAN_17.""); +define("IMAGE_announce_small", "".FORLAN_17.""); +define("IMAGE_closed_small", "".FORLAN_18.""); +define("IMAGE_closed", "".FORLAN_18.""); +define("IMAGE_profile", "".LAN_398.""); +define("IMAGE_email", "".LAN_397.""); +define("IMAGE_pm", "".LAN_399.""); +define("IMAGE_website", "".LAN_396.""); +define("IMAGE_edit", "".LAN_400.""); +define("IMAGE_quote", "".LAN_401.""); +define("IMAGE_admin_edit", "".LAN_406.""); +define("IMAGE_admin_move", "".LAN_402.""); +define("IMAGE_admin_move2", "".LAN_408.""); +define("IMAGE_post", ""); +define("IMAGE_post2", ""); +define("IMAGE_report", "".LAN_413.""); + +// Admin Icons + +define("IMAGE_admin_delete", "src='".img_path('admin_delete.png')."' alt='".LAN_435."' title='".LAN_435."' style='border:0' "); +define("IMAGE_admin_unstick", "src='".img_path('admin_unstick.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' "); +define("IMAGE_admin_stick", "src='".img_path('admin_stick.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' "); +define("IMAGE_admin_lock", "src='".img_path('admin_lock.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' "); +define("IMAGE_admin_unlock", "src='".img_path('admin_unlock.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' "); + +// Multi Language Images + +define("IMAGE_newthread", "".FORLAN_10.""); +define("IMAGE_reply", ""); +define("IMAGE_rank_moderator_image", ""); +define("IMAGE_rank_main_admin_image", ""); +define("IMAGE_rank_admin_image", ""); + +?> \ No newline at end of file diff --git a/e107_themes/jayya/forum/main_admin.png b/e107_themes/jayya/forum/main_admin.png new file mode 100644 index 000000000..3d64ca22b Binary files /dev/null and b/e107_themes/jayya/forum/main_admin.png differ diff --git a/e107_themes/jayya/forum/moderator.png b/e107_themes/jayya/forum/moderator.png new file mode 100644 index 000000000..92e31a13f Binary files /dev/null and b/e107_themes/jayya/forum/moderator.png differ diff --git a/e107_themes/jayya/forum/new.png b/e107_themes/jayya/forum/new.png new file mode 100644 index 000000000..6fffc4936 Binary files /dev/null and b/e107_themes/jayya/forum/new.png differ diff --git a/e107_themes/jayya/forum/new_popular.gif b/e107_themes/jayya/forum/new_popular.gif new file mode 100644 index 000000000..4cfb26565 Binary files /dev/null and b/e107_themes/jayya/forum/new_popular.gif differ diff --git a/e107_themes/jayya/forum/new_small.png b/e107_themes/jayya/forum/new_small.png new file mode 100644 index 000000000..4a10d6b9b Binary files /dev/null and b/e107_themes/jayya/forum/new_small.png differ diff --git a/e107_themes/jayya/forum/newthread.png b/e107_themes/jayya/forum/newthread.png new file mode 100644 index 000000000..66731b4b5 Binary files /dev/null and b/e107_themes/jayya/forum/newthread.png differ diff --git a/e107_themes/jayya/forum/nonew.png b/e107_themes/jayya/forum/nonew.png new file mode 100644 index 000000000..11a894d43 Binary files /dev/null and b/e107_themes/jayya/forum/nonew.png differ diff --git a/e107_themes/jayya/forum/nonew_popular.gif b/e107_themes/jayya/forum/nonew_popular.gif new file mode 100644 index 000000000..ac4226d7e Binary files /dev/null and b/e107_themes/jayya/forum/nonew_popular.gif differ diff --git a/e107_themes/jayya/forum/nonew_small.png b/e107_themes/jayya/forum/nonew_small.png new file mode 100644 index 000000000..4f8686df8 Binary files /dev/null and b/e107_themes/jayya/forum/nonew_small.png differ diff --git a/e107_themes/jayya/forum/post.png b/e107_themes/jayya/forum/post.png new file mode 100644 index 000000000..cbb26ea90 Binary files /dev/null and b/e107_themes/jayya/forum/post.png differ diff --git a/e107_themes/jayya/forum/profile.png b/e107_themes/jayya/forum/profile.png new file mode 100644 index 000000000..964f6abb5 Binary files /dev/null and b/e107_themes/jayya/forum/profile.png differ diff --git a/e107_themes/jayya/forum/quote.png b/e107_themes/jayya/forum/quote.png new file mode 100644 index 000000000..dfa764737 Binary files /dev/null and b/e107_themes/jayya/forum/quote.png differ diff --git a/e107_themes/jayya/forum/reply.png b/e107_themes/jayya/forum/reply.png new file mode 100644 index 000000000..882822591 Binary files /dev/null and b/e107_themes/jayya/forum/reply.png differ diff --git a/e107_themes/jayya/forum/report.png b/e107_themes/jayya/forum/report.png new file mode 100644 index 000000000..cda3ad3b3 Binary files /dev/null and b/e107_themes/jayya/forum/report.png differ diff --git a/e107_themes/jayya/forum/sticky.png b/e107_themes/jayya/forum/sticky.png new file mode 100644 index 000000000..57b955cf0 Binary files /dev/null and b/e107_themes/jayya/forum/sticky.png differ diff --git a/e107_themes/jayya/forum/stickyclosed.png b/e107_themes/jayya/forum/stickyclosed.png new file mode 100644 index 000000000..6a3ab85d6 Binary files /dev/null and b/e107_themes/jayya/forum/stickyclosed.png differ diff --git a/e107_themes/jayya/forum/website.png b/e107_themes/jayya/forum/website.png new file mode 100644 index 000000000..273ca6aba Binary files /dev/null and b/e107_themes/jayya/forum/website.png differ diff --git a/e107_themes/jayya/images/arrow.png b/e107_themes/jayya/images/arrow.png new file mode 100644 index 000000000..064e5f466 Binary files /dev/null and b/e107_themes/jayya/images/arrow.png differ diff --git a/e107_themes/jayya/images/bar.jpg b/e107_themes/jayya/images/bar.jpg new file mode 100644 index 000000000..09b4da58f Binary files /dev/null and b/e107_themes/jayya/images/bar.jpg differ diff --git a/e107_themes/jayya/images/blank.gif b/e107_themes/jayya/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_themes/jayya/images/blank.gif differ diff --git a/e107_themes/jayya/images/bullet2.gif b/e107_themes/jayya/images/bullet2.gif new file mode 100644 index 000000000..f31df614b Binary files /dev/null and b/e107_themes/jayya/images/bullet2.gif differ diff --git a/e107_themes/jayya/images/button.png b/e107_themes/jayya/images/button.png new file mode 100644 index 000000000..4e09c6e3f Binary files /dev/null and b/e107_themes/jayya/images/button.png differ diff --git a/e107_themes/jayya/images/buttonover.png b/e107_themes/jayya/images/buttonover.png new file mode 100644 index 000000000..d5b52291f Binary files /dev/null and b/e107_themes/jayya/images/buttonover.png differ diff --git a/e107_themes/jayya/images/comments_16.png b/e107_themes/jayya/images/comments_16.png new file mode 100644 index 000000000..d40ae5552 Binary files /dev/null and b/e107_themes/jayya/images/comments_16.png differ diff --git a/e107_themes/jayya/images/computer.jpg b/e107_themes/jayya/images/computer.jpg new file mode 100644 index 000000000..ca54f9889 Binary files /dev/null and b/e107_themes/jayya/images/computer.jpg differ diff --git a/e107_themes/jayya/images/computer_pepper.jpg b/e107_themes/jayya/images/computer_pepper.jpg new file mode 100644 index 000000000..f3780d54f Binary files /dev/null and b/e107_themes/jayya/images/computer_pepper.jpg differ diff --git a/e107_themes/jayya/images/email_16.png b/e107_themes/jayya/images/email_16.png new file mode 100644 index 000000000..503e87ff1 Binary files /dev/null and b/e107_themes/jayya/images/email_16.png differ diff --git a/e107_themes/jayya/images/on.png b/e107_themes/jayya/images/on.png new file mode 100644 index 000000000..b59882b53 Binary files /dev/null and b/e107_themes/jayya/images/on.png differ diff --git a/e107_themes/jayya/images/polls.png b/e107_themes/jayya/images/polls.png new file mode 100644 index 000000000..82141276b Binary files /dev/null and b/e107_themes/jayya/images/polls.png differ diff --git a/e107_themes/jayya/images/postedby_16.png b/e107_themes/jayya/images/postedby_16.png new file mode 100644 index 000000000..cfa279899 Binary files /dev/null and b/e107_themes/jayya/images/postedby_16.png differ diff --git a/e107_themes/jayya/images/print_16.png b/e107_themes/jayya/images/print_16.png new file mode 100644 index 000000000..728d047e7 Binary files /dev/null and b/e107_themes/jayya/images/print_16.png differ diff --git a/e107_themes/jayya/images/s_body.png b/e107_themes/jayya/images/s_body.png new file mode 100644 index 000000000..93fc31f81 Binary files /dev/null and b/e107_themes/jayya/images/s_body.png differ diff --git a/e107_themes/jayya/images/s_body_.png b/e107_themes/jayya/images/s_body_.png new file mode 100644 index 000000000..93fc31f81 Binary files /dev/null and b/e107_themes/jayya/images/s_body_.png differ diff --git a/e107_themes/jayya/images/s_left_bevel.png b/e107_themes/jayya/images/s_left_bevel.png new file mode 100644 index 000000000..6e7a92f60 Binary files /dev/null and b/e107_themes/jayya/images/s_left_bevel.png differ diff --git a/e107_themes/jayya/images/s_left_bevel_.png b/e107_themes/jayya/images/s_left_bevel_.png new file mode 100644 index 000000000..6b7e4f8df Binary files /dev/null and b/e107_themes/jayya/images/s_left_bevel_.png differ diff --git a/e107_themes/jayya/images/s_left_cap.png b/e107_themes/jayya/images/s_left_cap.png new file mode 100644 index 000000000..929c1adf7 Binary files /dev/null and b/e107_themes/jayya/images/s_left_cap.png differ diff --git a/e107_themes/jayya/images/s_left_cap_.png b/e107_themes/jayya/images/s_left_cap_.png new file mode 100644 index 000000000..4798a7c03 Binary files /dev/null and b/e107_themes/jayya/images/s_left_cap_.png differ diff --git a/e107_themes/jayya/images/s_main_cap.png b/e107_themes/jayya/images/s_main_cap.png new file mode 100644 index 000000000..c5d9b9d34 Binary files /dev/null and b/e107_themes/jayya/images/s_main_cap.png differ diff --git a/e107_themes/jayya/images/s_main_cap_.png b/e107_themes/jayya/images/s_main_cap_.png new file mode 100644 index 000000000..5f8e2879d Binary files /dev/null and b/e107_themes/jayya/images/s_main_cap_.png differ diff --git a/e107_themes/jayya/images/s_nav.png b/e107_themes/jayya/images/s_nav.png new file mode 100644 index 000000000..1845caac4 Binary files /dev/null and b/e107_themes/jayya/images/s_nav.png differ diff --git a/e107_themes/jayya/images/s_nav_.png b/e107_themes/jayya/images/s_nav_.png new file mode 100644 index 000000000..1845caac4 Binary files /dev/null and b/e107_themes/jayya/images/s_nav_.png differ diff --git a/e107_themes/jayya/images/screen.png b/e107_themes/jayya/images/screen.png new file mode 100644 index 000000000..a57edefc4 Binary files /dev/null and b/e107_themes/jayya/images/screen.png differ diff --git a/e107_themes/jayya/images/top_mid_back.jpg b/e107_themes/jayya/images/top_mid_back.jpg new file mode 100644 index 000000000..823b41d30 Binary files /dev/null and b/e107_themes/jayya/images/top_mid_back.jpg differ diff --git a/e107_themes/jayya/images/top_mid_back_pepper.jpg b/e107_themes/jayya/images/top_mid_back_pepper.jpg new file mode 100644 index 000000000..f3780d54f Binary files /dev/null and b/e107_themes/jayya/images/top_mid_back_pepper.jpg differ diff --git a/e107_themes/jayya/images/top_right_back.jpg b/e107_themes/jayya/images/top_right_back.jpg new file mode 100644 index 000000000..73923fc1b Binary files /dev/null and b/e107_themes/jayya/images/top_right_back.jpg differ diff --git a/e107_themes/jayya/images/top_right_back_pepper.png b/e107_themes/jayya/images/top_right_back_pepper.png new file mode 100644 index 000000000..a57edefc4 Binary files /dev/null and b/e107_themes/jayya/images/top_right_back_pepper.png differ diff --git a/e107_themes/jayya/index.html b/e107_themes/jayya/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/jayya/languages/English.php b/e107_themes/jayya/languages/English.php new file mode 100644 index 000000000..aa97333dc --- /dev/null +++ b/e107_themes/jayya/languages/English.php @@ -0,0 +1,28 @@ + diff --git a/e107_themes/jayya/nav_menu.css b/e107_themes/jayya/nav_menu.css new file mode 100644 index 000000000..416516f3a --- /dev/null +++ b/e107_themes/jayya/nav_menu.css @@ -0,0 +1,110 @@ +div.menuBar, +div.menuBar a.menuButton, div.menuButton, div.menuButton_over, +div.menu, +div.menu a.menuItem { + font-family: arial, sans-serif; + font-size: 11px; + font-style: normal; + font-weight: normal; + color: #000000; +} + +div.menuBar { + background-color: #F7F9FA; + background-image: url(images/s_nav.png); + background-repeat: repeat-x; + border-top: 1px solid #ffffff; + border-bottom: 0px solid #000; + padding: 4px 0px 4px 0px; + text-align: left; +} + +div.emenuBar { + background-color: #F7F9FA; + border-top: 1px solid #ffffff; + border-bottom: 0px solid #000; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid #F7F9FA; + color: #000000; + cursor: default; + left: 0px; + margin: 0px; + padding: 2px 4px 2px 22px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: transparent; + border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff; + color: #000000; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, +div.menuBar a.menuButtonActive:hover { + background-color: #ffffff; + border-color: #a5a5a5 #ffffff #ffffff #a5a5a5; + color: #000; + left: 1px; + top: 1px; +} + +div.menu { + background-color: #FCFDFF; + border: 1px solid; + border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff; + left: 0px; + padding: 1px 1px 1px 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + color: #000000; + cursor: default; + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #F0F6FF; + color: #000000; +} + +div.menu a.menuItem span.menuItemBuffer { + padding: 0px 2px 0px 2px; + color: #ffffff; +} + +div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px 0px 2px; + color: #000000; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #ffffff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/jayya/pepper.css b/e107_themes/jayya/pepper.css new file mode 100644 index 000000000..3f94b68d8 --- /dev/null +++ b/e107_themes/jayya/pepper.css @@ -0,0 +1,335 @@ +/* info: alternative stylesheet */ + +/* Core Classes */ +body { + background-color: #fdfdfd; +} + +body, td { + margin: 0px; + padding: 0px; + text-align: left; + color: #000; +} + +body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext, +.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar { + font: normal 11px arial, verdana, tahoma, sans-serif; + color: #000; +} + +.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox { + font: normal 10px arial, verdana, tahoma, sans-serif; + color: #000; +} + +a { + color: #cc3300; +} + +a:hover { + color: #003300; +} + +img { + border: 0px; +} + +.linkspage_button { + border: 0px; +} + +form { + margin: 0px; +} + +.tbox { + border: #A5ACB2 1px solid; + background-color: #fff; +} + +.indent { + border: #999 1px dashed; + padding: 5px; + margin: 5px; + background-color: #fcf9f9; +} + +.button, .button:hover { + border: 1px solid #000; +} + +.button { + background-image : url(images/button.png); +} + +.button:hover { + background-image : url(images/buttonover.png); +} + +.nextprev { + border: 0px; + text-align: center; + padding: 2px; + background-color: #f9f7f7; +} + +.spacer{ + padding: 5px 0px; +} + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 4px; + background-color: #fff; + border: 1px solid #000; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #fdfbfb; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #f9f7f7; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.searchhighlight { + text-decoration: underline; + color: #ff0000; + font-weight: bold; +} + +ul { + margin-top: 0px; + margin-bottom: 0px; +} + +.helpbox { + border: 0px; +} + +/* Theme Specific Classes */ + +.page_container { + width: 100%; + border-collapse: collapse; + border-spacing: 0px; +} + +.top_section, .main_section { + width: 100%; + background-color: #fff; + border-bottom: 1px solid #000; + border-collapse: collapse; + border-spacing: 0px; +} + +.top_section_left { + vertical-align: middle; +} + +.top_section_mid { + vertical-align: bottom; + text-align: right; + padding: 3px 5px 3px 0px; + border-left: 1px solid #000; + background-image: url(images/top_mid_back_pepper.jpg); + background-repeat: no-repeat; + background-color: #F3EDED; +} + +.top_section_right { + vertical-align: middle; + text-align: center; + border-left: 1px solid #000; + background-image: url(images/top_right_back_pepper.png); + background-repeat: no-repeat; + background-position: center; + background-color: #F3EDED; +} + +.menus_container { + width: 170px; + border-collapse: collapse; + border-spacing: 0px; +} + +.default_menu { + vertical-align: top; +} + +.left_menu, .right_menu { + width: 170px; + vertical-align: top; + background-color: #F9f7f7; +} + +.left_menu { + border-right: 1px solid #000; +} + +.right_menu { + border-left: 1px solid #000; +} + +.cap_border { + border-top: 1px solid #000; + border-bottom: 1px solid #fff; +} + +.cap_border.button_menu { + border-bottom: 0px; + text-align: left; +} + +.main_caption, .left_caption, .right_caption { + white-space: nowrap; + padding: 3px 5px; + border-top: #e9efff 1px solid; + border-bottom: 1px solid #000; + background-repeat: no-repeat; + background-position: left; + color: #fff; +} + +.main_caption { + background-color: #587D82; +} + +.left_caption, .right_caption { + background-color: #173E4F; +} + +.cont { + border-collapse: collapse; + border-spacing: 0px; + width: 100%; +} + +.menu_content { + padding: 5px; + background-color: #fff; +} + +.menu_content.non_default { + background-color: transparent; +} + +.menu_content.buttons { + padding: 0px; +} + +.news_info { + width: *; + background-color: #F3F0F0; + border-collapse: collapse; + border-spacing: 0px; +} + +td.link_button { + border-bottom: 1px solid #000; +} + +/* Nav Menu Classes */ + +div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem { + font: normal 11px arial, verdana, tahoma, sans-serif; + color: #000; +} + +div.menuBar { + background-color: #FFF8D9; + border-top: 1px solid #fff; + padding: 4px 0px; + text-align: left; +} + +div.emenuBar { + background-color: #FFF8D9; + border-top: 1px solid #fff; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid #FFF8D9; + cursor: default; + left: 0px; + margin: 0px; + padding: 2px 4px 2px 22px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: transparent; + border-color: #fff #a5a5a5 #a5a5a5 #fff; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover { + background-color: #ffffef; + border-color: #a5a5a5 #fff #fff #a5a5a5; + left: 1px; + top: 1px; +} + +div.menu { + background-color: #FFF8D9; + border: 1px solid; + border-color: #fff #a5a5a5 #a5a5a5 #fff; + left: 0px; + padding: 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + cursor: default; + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #ffffef; +} + +div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #fff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/jayya/preview.jpg b/e107_themes/jayya/preview.jpg new file mode 100644 index 000000000..345a65b39 Binary files /dev/null and b/e107_themes/jayya/preview.jpg differ diff --git a/e107_themes/jayya/style.css b/e107_themes/jayya/style.css new file mode 100644 index 000000000..a816ee1ec --- /dev/null +++ b/e107_themes/jayya/style.css @@ -0,0 +1,354 @@ +/* Core Classes */ +body { + background-color: #e1e4e8; +} + +body, td { + margin: 0px; + padding: 0px; + text-align: left; + color: #000; +} + +body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext, +.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar { + font: normal 10px verdana, tahoma, arial, sans-serif; + color: #000; +} + +.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox { + font: normal 9px verdana, tahoma, arial, sans-serif; + color: #000; +} + +a { + color: #1A4487; +} + +a.visit:visited { + color: #444; +} + +a:hover, a.visit:hover { + color: #000000; +} + +img { + border: 0px; +} + +.linkspage_button { + border: 0px; +} + +form { + margin: 0px; +} + +.tbox { + border: #A5ACB2 1px solid; + background-color: #fff; +} + +.indent { + border: #999 1px dashed; + padding: 5px; + margin: 5px; + background-color: #f7f7f9; +} + +.button, .button:hover { + border: 1px solid #A5ACB2; +} + +.button { + background-image : url(images/button.png); +} + +.button:hover { + background-image : url(images/buttonover.png); +} + +.nextprev { + border: 0px; + text-align: center; + padding: 2px; + background-color: #f7f7f9; +} + +.spacer{ + padding: 5px 0px; +} + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 4px; + background-color: #fff; + border: 1px solid #878787; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #fbfbfd; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #f7f7f9; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.searchhighlight { + text-decoration: underline; + color: #ff0000; + font-weight: bold; +} + +ul { + margin-top: 0px; + margin-bottom: 0px; +} + +.helpbox { + border: 0px; +} + +/* Theme Specific Classes */ + +.page_container { + width: 100%; + border-collapse: collapse; + border-spacing: 0px; +} + +.top_section, .main_section { + width: 100%; + background-color: #fff; + border-bottom: 1px solid #878787; + border-collapse: collapse; + border-spacing: 0px; +} + +.top_section_left { + vertical-align: middle; +} + +.top_section_mid { + vertical-align: bottom; + text-align: right; + padding: 3px 5px 3px 0px; + border-left: 1px solid #878787; + background-image: url(images/top_mid_back.jpg); + background-repeat: no-repeat; + background-color: #E9EAF2; +} + +.top_section_right { + vertical-align: middle; + text-align: center; + border-left: 1px solid #878787; + background-image: url(images/top_right_back.jpg); + background-repeat: no-repeat; + background-position: center; + background-color: #f3f3f7; +} + +.menus_container { + width: 170px; + border-collapse: collapse; + border-spacing: 0px; +} + +.default_menu { + vertical-align: top; +} + +.left_menu, .right_menu { + width: 170px; + vertical-align: top; + background-image: url(images/s_body.png); + background-repeat: repeat-y; + background-color: #f0f1f2; +} + +.left_menu { + border-right: 1px solid #878787; +} + +.right_menu { + border-left: 1px solid #878787; +} + +.cap_border { + border-top: 1px solid #878787; + border-bottom: 1px solid #fff; +} + +.cap_border.button_menu { + border-bottom: 0px; + text-align: left; +} + +.main_caption, .left_caption, .right_caption { + white-space: nowrap; + padding: 3px 5px; + border-top: #e9efff 1px solid; + border-bottom: 1px solid #878787; + background-repeat: no-repeat; + background-position: left; +} + +.main_caption { + background-image: url(images/s_main_cap.png); + background-color: #e1e4e8; +} + +.left_caption, .right_caption { + background-image: url(images/s_left_cap.png); + background-color: #d2d5d9; +} + +.bevel { + background-image: url(images/s_left_bevel.png); + background-repeat: no-repeat; + background-position: right; +} + +.cont { + border-collapse: collapse; + border-spacing: 0px; + width: 100%; +} + +.menu_content { + padding: 5px; + background-color: #fff; +} + +.menu_content.non_default { + background-color: transparent; +} + +.menu_content.buttons { + padding: 0px; +} + +.news_info { + width: auto; + background-color: #f7f7f9; + border-collapse: collapse; + border-spacing: 0px; +} + +td.link_button { + border-bottom: 1px solid #000; +} + +b { + color: #232930; +} + +/* Nav Menu Classes */ + +div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem { + font: normal 11px arial, verdana, tahoma, sans-serif; + color: #000; +} + +div.menuBar { + background-color: #F7F9FA; + background-image: url(images/s_nav.png); + background-repeat: repeat-x; + border-top: 1px solid #fff; + padding: 4px 0px; + text-align: left; +} + +div.emenuBar { + background-color: #F7F9FA; + border-top: 1px solid #fff; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid; + border-color: transparent !important; + border-color: #fff #F8FAFB #F0F2F3 #F8FAFB; + cursor: default; + left: 0px; + margin: 0px; + padding: 2px 4px 2px 22px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: transparent; + border-color: #fff #a5a5a5 #a5a5a5 #fff !important; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover { + background-color: #fff; + border-color: #a5a5a5 #fff #fff #a5a5a5 !important; + left: 1px; + top: 1px; +} + +div.menu { + background-color: #FCFDFF; + border: 1px solid; + border-color: #fff #a5a5a5 #a5a5a5 #fff; + left: 0px; + padding: 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + cursor: default; + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #F2F4FF; +} + +div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #fff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/jayya/theme.php b/e107_themes/jayya/theme.php new file mode 100644 index 000000000..312c6b7da --- /dev/null +++ b/e107_themes/jayya/theme.php @@ -0,0 +1,271 @@ + + + + + + + + + + + +
        +{LOGO} + +{BANNER} + +{CUSTOM=search+default} +
        + +
        +{SITELINKS_ALT=".THEME_ABS."images/arrow.png+noclick} +
        + + + + + + + + + + + + + + +
        + + +{SETSTYLE=default} +{WMESSAGE} +"; + +$FOOTER = "
        +
        + +
        +
        +
        +{SITEDISCLAIMER} +

        +
        + + + +"; + + +// [linkstyle] + +define('PRELINK', ''); +define('POSTLINK', ''); +define('LINKSTART', ''); +define('LINKEND', ''); +define('LINKDISPLAY', 1); +define('LINKALIGN', 'left'); + + +// [newsstyle] + +$sc_style['NEWSIMAGE']['pre'] = ""; +$sc_style['NEWSIMAGE']['post'] = ""; + +$NEWSSTYLE = "
        +{STICKY_ICON}{NEWSTITLE} +
        + +"; + +define('ICONMAIL', 'email_16.png'); +define('ICONPRINT', 'print_16.png'); +define('ICONSTYLE', 'border: 0px'); +define('COMMENTLINK', LAN_THEME_2); +define('COMMENTOFFSTRING', LAN_THEME_1); +define('PRE_EXTENDEDSTRING', '

        [ '); +define('EXTENDEDSTRING', LAN_THEME_3); +define('POST_EXTENDEDSTRING', ' ]
        '); +define('TRACKBACKSTRING', LAN_THEME_4); +define('TRACKBACKBEFORESTRING', ' | '); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode){ + global $style; + $caption = $caption ? $caption : ' '; + if ((isset($mode['style']) && $mode['style'] == 'button_menu') || (isset($mode) && ($mode == 'menus_config'))) { + $menu = ' buttons'; + $bodybreak = ''; + $but_border = ' button_menu'; + } else { + $menu = ''; + $bodybreak = '
        '; + $but_border = ''; + } + + $menu .= ($style && $style != 'default') ? ' non_default' : ''; + + echo "
        "; + if ($style == 'leftmenu') { + echo "
        ".$caption."
        "; + } else if ($style == 'rightmenu') { + echo "
        ".$caption."
        "; + } else { + echo "
        ".$caption."
        "; + } + echo "
        "; + if ($text != "") { + echo "
        "; + } +} + + +// chatbox post style +$CHATBOXSTYLE = " + +{USERNAME}
        {TIMEDATE}
        {MESSAGE}

        "; + + +// comment post style +$sc_style['REPLY']['pre'] = ""; +$sc_style['REPLY']['post'] = ""; + +$sc_style['SUBJECT']['pre'] = ""; +$sc_style['SUBJECT']['post'] = ""; + +$sc_style['COMMENTEDIT']['pre'] = ""; +$sc_style['COMMENTEDIT']['post'] = ""; + +$sc_style['JOINED']['post'] = "
        "; + +$sc_style['LOCATION']['post'] = "
        "; + +$sc_style['RATING']['post'] = "

        "; + +$sc_style['RATING']['post'] = "
        "; + +$COMMENTSTYLE = "
        + + + +{REPLY}{SUBJECT} + + + + +{COMMENTEDIT} +
        ".LAN_THEME_5." {USERNAME} ".LAN_THEME_6." {TIMEDATE} +
        +
        +{AVATAR} +
        +{LEVEL}{JOINED}{COMMENTS}{LOCATION}{IPADDRESS} +
        +{COMMENT} +{RATING} +{SIGNATURE} +
        +
        "; + + +// poll style +$POLLSTYLE = " {QUESTION} +

        +{OPTIONS= OPTION
        BAR
        PERCENTAGE VOTES

        } +
        {AUTHOR}
        {VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/khatru/download_template.php b/e107_themes/khatru/download_template.php new file mode 100644 index 000000000..8ed8a7c67 --- /dev/null +++ b/e107_themes/khatru/download_template.php @@ -0,0 +1,239 @@ +
        + + + + + +
        {DOWNLOAD_CAT_MAIN_ICON}

        {DOWNLOAD_CAT_MAIN_NAME}

        +

        + + + + + + +"; + +$DOWNLOAD_CAT_CHILD_TABLE .= " + + + + + +"; + +$DOWNLOAD_CAT_TABLE_END = " + +
        CategoryFiles
        {DOWNLOAD_CAT_SUB_ICON}{DOWNLOAD_CAT_SUB_NAME}{DOWNLOAD_CAT_SUB_COUNT} ({DOWNLOAD_CAT_SUB_SIZE})
        ".LAN_dl_6." {DOWNLOAD_CAT_SUB_DOWNLOADED}
        {DOWNLOAD_CAT_SEARCH}
        +
        \n"; + +// ##### ------------------------------------------------------------------------------------------ + + + +// ##### LIST TABLE ------------------------------------------------------------------------------- + + +$DOWNLOAD_LIST_TABLE_START = " + +

        + + + + + +
        {DOWNLOAD_CATEGORY_ICON}

        {DOWNLOAD_CATEGORY}

        +

        + +
        +
        + + + + + + + + + + + + +"; + + +$DOWNLOAD_LIST_TABLE .= " + + + + + + + + + +"; + +$DOWNLOAD_LIST_TABLE_END = " + +
        +".LAN_dl_37." + +  +".LAN_dl_38." + +  +".LAN_dl_39." + +  + +
        ".LAN_dl_28."".LAN_dl_22."".LAN_dl_24."".LAN_dl_21."".LAN_dl_29."".LAN_dl_12."".LAN_dl_8."
        {DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME}{DOWNLOAD_LIST_DATESTAMP}{DOWNLOAD_LIST_AUTHOR}{DOWNLOAD_LIST_FILESIZE}{DOWNLOAD_LIST_REQUESTED}{DOWNLOAD_LIST_RATING}{DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON}
        {DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}
        +
        +
        +"; + +// ##### ------------------------------------------------------------------------------------------ + + +// ##### VIEW TABLE ------------------------------------------------------------------------------- + +$DOWNLOAD_VIEW_TABLE_START = " +
        + +"; + +$DOWNLOAD_VIEW_TABLE .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + +$DOWNLOAD_VIEW_TABLE_END = " +
        +{DOWNLOAD_VIEW_NAME} +
        {DOWNLOAD_VIEW_AUTHOR_LAN}{DOWNLOAD_VIEW_AUTHOR}
        {DOWNLOAD_VIEW_AUTHOREMAIL_LAN}{DOWNLOAD_VIEW_AUTHOREMAIL}
        {DOWNLOAD_VIEW_AUTHORWEBSITE_LAN}{DOWNLOAD_VIEW_AUTHORWEBSITE}
        {DOWNLOAD_VIEW_DESCRIPTION_LAN}{DOWNLOAD_VIEW_DESCRIPTION}
        {DOWNLOAD_VIEW_IMAGE_LAN}{DOWNLOAD_VIEW_IMAGE}
        {DOWNLOAD_VIEW_FILESIZE_LAN}{DOWNLOAD_VIEW_FILESIZE}
        {DOWNLOAD_VIEW_REQUESTED_LAN}{DOWNLOAD_VIEW_REQUESTED}
        {DOWNLOAD_VIEW_LINK_LAN}{DOWNLOAD_VIEW_LINK}
        {DOWNLOAD_VIEW_RATING_LAN}{DOWNLOAD_VIEW_RATING}
        +
        +"; + +// ##### ------------------------------------------------------------------------------------------ + +// ##### MIRROR LIST ------------------------------------------------------------------------------- + + +$DOWNLOAD_MIRROR_START = " +
        + + + + + + + + + + +"; + +$DOWNLOAD_MIRROR = " + + + + + + +"; + +$DOWNLOAD_MIRROR_END = " +
        {DOWNLOAD_MIRROR_REQUEST}
        {DOWNLOAD_MIRROR_HOST_LAN}{DOWNLOAD_MIRROR_DESCRIPTION_LAN}{DOWNLOAD_MIRROR_LOCATION_LAN}{DOWNLOAD_MIRROR_GET_LAN}
        {DOWNLOAD_MIRROR_IMAGE}

        {DOWNLOAD_MIRROR_REQUESTS}
        {DOWNLOAD_TOTAL_MIRROR_REQUESTS}
        {DOWNLOAD_MIRROR_DESCRIPTION}
        {DOWNLOAD_MIRROR_LOCATION}
        {DOWNLOAD_MIRROR_LINK} {DOWNLOAD_MIRROR_FILESIZE}
        +
        +"; + +// ##### ------------------------------------------------------------------------------------------ +?> \ No newline at end of file diff --git a/e107_themes/khatru/forum_post_template.php b/e107_themes/khatru/forum_post_template.php new file mode 100644 index 000000000..2326b09c9 --- /dev/null +++ b/e107_themes/khatru/forum_post_template.php @@ -0,0 +1,114 @@ + +".LAN_61." + + + +"; + +$subjectbox = " +".LAN_62." + + + +"; + +// the poll is optional, be careful when changing the values here, only change if you know what you're doing ... + +require_once(e_PLUGIN."poll/poll_class.php"); +$pollo = new poll; +$poll = $pollo -> renderPollForm("forum"); + +// finally, file attach is optional, again only change this if you know what you're doing ... + +$fileattach = "".($pref['image_post'] ? LAN_390 : LAN_416)." +".LAN_392." +".LAN_393." | ".$allowed_filetypes." |
        ".LAN_394."
        ".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))." +
        + +
        + +
        + + + + +"; + + +// ------------ + + +$FORUMPOST = " +{FORMSTART} +".BOXOPEN."{BACKLINK}".BOXMAIN." + +
        + +{USERBOX} +{SUBJECTBOX} + + + + +{POLL} +{FILEATTACH} + +
        {POSTTYPE} +{POSTBOX}
        {EMAILNOTIFY}
        {POSTTHREADAS} +
        +{BUTTONS} +
        +{FORMEND} +
        +{FORUMJUMP}".BOXCLOSE; + + +$FORUMTHREADPOSTED = +BOXOPEN.LAN_133.BOXMAIN." + + + +
        ".IMAGE_e."  +
        ".LAN_324."
        +".LAN_325."
        +".LAN_326."


        +
        ".BOXCLOSE; + + +$FORUMREPLYPOSTED = +BOXOPEN.LAN_133.BOXMAIN." + + + +
        ".IMAGE_e."  +
        ".LAN_324."
        +".LAN_325."
        +".LAN_326."


        +
        ".BOXCLOSE; + + + +?> \ No newline at end of file diff --git a/e107_themes/khatru/forum_posted_template.php b/e107_themes/khatru/forum_posted_template.php new file mode 100644 index 000000000..cb1e021d0 --- /dev/null +++ b/e107_themes/khatru/forum_posted_template.php @@ -0,0 +1,58 @@ + + +".IMAGE_e."  + +
        ".LAN_413."
        +".LAN_414."
        +".LAN_326."


        +".BOXCLOSE; + +$FORUMTHREADPOSTED = +BOXOPEN.LAN_133.BOXMAIN." + + + +
        ".IMAGE_e."  +
        ".LAN_324."
        +".(defined("F_MESSAGE") ? F_MESSAGE."
        " : "")." +".LAN_325."
        +".LAN_326."


        +
        ".BOXCLOSE; + + +$FORUMREPLYPOSTED = +BOXOPEN.LAN_133.BOXMAIN." + + + +
        ".IMAGE_e."  +
        ".LAN_415."
        +".(defined("F_MESSAGE") ? F_MESSAGE."
        " : "")." +".LAN_325."
        +".LAN_326."


        +
        ".BOXCLOSE; + +?> \ No newline at end of file diff --git a/e107_themes/khatru/forum_preview_template.php b/e107_themes/khatru/forum_preview_template.php new file mode 100644 index 000000000..c5321aff2 --- /dev/null +++ b/e107_themes/khatru/forum_preview_template.php @@ -0,0 +1,31 @@ + +".$poster." + +
        ".IMAGE_post2." ".LAN_322.$postdate."

        ".$tpost." + +"; + +?> \ No newline at end of file diff --git a/e107_themes/khatru/forum_template.php b/e107_themes/khatru/forum_template.php new file mode 100644 index 000000000..658f4eeec --- /dev/null +++ b/e107_themes/khatru/forum_template.php @@ -0,0 +1,74 @@ +{PARENTNAME} {PARENTSTATUS}".BOXMAIN." + + + + + + + +"; + + +$FORUM_MAIN_PARENT_END = " +
        {FORUMTITLE}{THREADTITLE}{REPLYTITLE}{LASTPOSTITLE}
        ".BOXCLOSE; + +$FORUM_MAIN_FORUM = "\n{NEWFLAG}\n{FORUMNAME}
        {FORUMDESCRIPTION}{FORUMSUBFORUMS}\n{THREADS}\n{REPLIES}\n{LASTPOST}\n"; + + +$FORUM_MAIN_END = +BOXOPEN."{INFOTITLE}".BOXMAIN." + +\n\n\n\n\n\n\n\n\n\n\n\n\n
        {LOGO}{USERINFO}
        {INFO}
        {FORUMINFO}
        {USERLIST}
        {STATLINK}
        \n
        \n
        \n\n\n\n\n\n\n
        {ICONKEY}{SEARCH}{PERMS}\n
        Powered by e107 Forum System
        ".BOXCLOSE; + + +$FORUM_NEWPOSTS_START = "
        \n
        \n\n\n\n\n\n"; + + + +$FORUM_NEWPOSTS_MAIN .= "\n\n\n\n"; + + + +$FORUM_NEWPOSTS_END .= "
         {NEWTHREADTITLE}{POSTEDTITLE}
        {NEWIMAGE}{NEWSPOSTNAME}{STARTERTITLE}
        "; + + + +$FORUM_TRACK_START = "
        \n
        \n\n\n\n\n"; + + +$FORUM_TRACK_MAIN = " + + + +"; + + + +$FORUM_TRACK_END = "
        {TRACKTITLE}
        {NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
        \n
        \n
        "; + + + +?> \ No newline at end of file diff --git a/e107_themes/khatru/forum_viewforum_template.php b/e107_themes/khatru/forum_viewforum_template.php new file mode 100644 index 000000000..fa10e64ea --- /dev/null +++ b/e107_themes/khatru/forum_viewforum_template.php @@ -0,0 +1,136 @@ + + +
        {FORUMTITLE} Forum
        {THREADPAGES} + +{NEWTHREADBUTTON} + + + + + + + + + + + + + + + +"; + + + +$FORUM_VIEW_FORUM = " + + + + + + + + +"; + + $FORUM_VIEW_END = " +
         {THREADTITLE}{STARTERTITLE}{REPLYTITLE}{VIEWTITLE}{LASTPOSTITLE}
        {ICON} + + + + + + +
        {THREADNAME} {PAGES}{ADMIN_ICONS}
        +
        {POSTER}
        {THREADDATE}
        {REPLIES}{VIEWS}{LASTPOST}
        + + + + + +
        {THREADPAGES} +{FORUMJUMP} + +{NEWTHREADBUTTON} +
        +". +BOXCLOSE.BOXOPEN2." + + + + + + + + + + +
        {MODERATORS}{BROWSERS}
        {ICONKEY}{PERMS}

        {SEARCH} +
        + + +
        +".LAN_431." +".LAN_432." +".LAN_433." +
        +
        Powered by e107 Forum System".BOXCLOSE2."
        "; + + +$FORUM_VIEW_SUB_START = " + + + + + + + + + +"; + +$FORUM_VIEW_SUB = " + + + + + + +"; + +$FORUM_VIEW_SUB_END = " +
        ".FORLAN_20."".FORLAN_21."".LAN_55."".FORLAN_22."
        {SUB_FORUMTITLE}
        {SUB_DESCRIPTION}
        {SUB_THREADS}{SUB_REPLIES}{SUB_LASTPOST}
        + + +"; + + ?> \ No newline at end of file diff --git a/e107_themes/khatru/forum_viewtopic_template.php b/e107_themes/khatru/forum_viewtopic_template.php new file mode 100644 index 000000000..a6a76fdac --- /dev/null +++ b/e107_themes/khatru/forum_viewtopic_template.php @@ -0,0 +1,151 @@ + + +{NEXTPREV} + {TRACK}  + + + + + + + + +
        {THREADNAME}

        {GOTOPAGES}
        {BUTTONS}
        + + + + +\n + +
        \n".LAN_402."\n\n".LAN_403."\n
        + + +"; + +$FORUMEND = " + +
        +{GOTOPAGES} +
        + + + + + +
        {MODERATORS}
        {FORUMJUMP}
        {BUTTONS}
        +
        +
        + +
        {QUICKREPLY}
        + + +
        +".LAN_431." +".LAN_432." +".LAN_433." +
        + +
        Powered by e107 Forum System
        +".BOXCLOSE; + + + + + + + + + +$FORUMTHREADSTYLE = " +
        + + + + + + + + + + + + + +
        \n{NEWFLAG}\n{POSTER}\n + + + + + +
        \n{THREADDATESTAMP}\n\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n
        +
        \n{AVATAR}\n\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n\n{POLL}\n{POST}\n{SIGNATURE}\n
        \n\n{TOP}\n\n + + + + + +
        \n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n\n{MODOPTIONS}\n
        +
        +
        "; + + +$FORUMREPLYSTYLE = " +
        + + + + + + + + + + + + + +
        \n{NEWFLAG}\n{POSTER}\n + + + + + +
        \n{THREADDATESTAMP}\n\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n
        +
        \n{AVATAR}\n\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n\n{POST}\n{SIGNATURE}
        \n\n{TOP}\n\n + + + + + +
        \n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n\n{MODOPTIONS}\n
        +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/khatru/images/background.png b/e107_themes/khatru/images/background.png new file mode 100644 index 000000000..14a6eb918 Binary files /dev/null and b/e107_themes/khatru/images/background.png differ diff --git a/e107_themes/khatru/images/blank.gif b/e107_themes/khatru/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_themes/khatru/images/blank.gif differ diff --git a/e107_themes/khatru/images/bottom.png b/e107_themes/khatru/images/bottom.png new file mode 100644 index 000000000..10dd94b24 Binary files /dev/null and b/e107_themes/khatru/images/bottom.png differ diff --git a/e107_themes/khatru/images/bottomleft.png b/e107_themes/khatru/images/bottomleft.png new file mode 100644 index 000000000..64e4c93c9 Binary files /dev/null and b/e107_themes/khatru/images/bottomleft.png differ diff --git a/e107_themes/khatru/images/bottomright.png b/e107_themes/khatru/images/bottomright.png new file mode 100644 index 000000000..524c8c0b2 Binary files /dev/null and b/e107_themes/khatru/images/bottomright.png differ diff --git a/e107_themes/khatru/images/bullet.png b/e107_themes/khatru/images/bullet.png new file mode 100644 index 000000000..f65b6f29f Binary files /dev/null and b/e107_themes/khatru/images/bullet.png differ diff --git a/e107_themes/khatru/images/bullet2.gif b/e107_themes/khatru/images/bullet2.gif new file mode 100644 index 000000000..5aaa2a792 Binary files /dev/null and b/e107_themes/khatru/images/bullet2.gif differ diff --git a/e107_themes/khatru/images/button.png b/e107_themes/khatru/images/button.png new file mode 100644 index 000000000..4e58e14dd Binary files /dev/null and b/e107_themes/khatru/images/button.png differ diff --git a/e107_themes/khatru/images/icon.png b/e107_themes/khatru/images/icon.png new file mode 100644 index 000000000..001b63fdd Binary files /dev/null and b/e107_themes/khatru/images/icon.png differ diff --git a/e107_themes/khatru/images/left.png b/e107_themes/khatru/images/left.png new file mode 100644 index 000000000..4527d49fa Binary files /dev/null and b/e107_themes/khatru/images/left.png differ diff --git a/e107_themes/khatru/images/logo1.png b/e107_themes/khatru/images/logo1.png new file mode 100644 index 000000000..6e2ac3bec Binary files /dev/null and b/e107_themes/khatru/images/logo1.png differ diff --git a/e107_themes/khatru/images/logo2.png b/e107_themes/khatru/images/logo2.png new file mode 100644 index 000000000..b6d92ea25 Binary files /dev/null and b/e107_themes/khatru/images/logo2.png differ diff --git a/e107_themes/khatru/images/logo3.png b/e107_themes/khatru/images/logo3.png new file mode 100644 index 000000000..ecbfbe84c Binary files /dev/null and b/e107_themes/khatru/images/logo3.png differ diff --git a/e107_themes/khatru/images/menubg.png b/e107_themes/khatru/images/menubg.png new file mode 100644 index 000000000..d4732fdb8 Binary files /dev/null and b/e107_themes/khatru/images/menubg.png differ diff --git a/e107_themes/khatru/images/menubg2.png b/e107_themes/khatru/images/menubg2.png new file mode 100644 index 000000000..12d6da7c8 Binary files /dev/null and b/e107_themes/khatru/images/menubg2.png differ diff --git a/e107_themes/khatru/images/nforumcaption.png b/e107_themes/khatru/images/nforumcaption.png new file mode 100644 index 000000000..4988f367d Binary files /dev/null and b/e107_themes/khatru/images/nforumcaption.png differ diff --git a/e107_themes/khatru/images/nforumcaption2.png b/e107_themes/khatru/images/nforumcaption2.png new file mode 100644 index 000000000..80a845f34 Binary files /dev/null and b/e107_themes/khatru/images/nforumcaption2.png differ diff --git a/e107_themes/khatru/images/right.png b/e107_themes/khatru/images/right.png new file mode 100644 index 000000000..d528618db Binary files /dev/null and b/e107_themes/khatru/images/right.png differ diff --git a/e107_themes/khatru/images/top.png b/e107_themes/khatru/images/top.png new file mode 100644 index 000000000..132b76d08 Binary files /dev/null and b/e107_themes/khatru/images/top.png differ diff --git a/e107_themes/khatru/images/top2.png b/e107_themes/khatru/images/top2.png new file mode 100644 index 000000000..f9cab1f4b Binary files /dev/null and b/e107_themes/khatru/images/top2.png differ diff --git a/e107_themes/khatru/images/topleft.png b/e107_themes/khatru/images/topleft.png new file mode 100644 index 000000000..baad1c3f2 Binary files /dev/null and b/e107_themes/khatru/images/topleft.png differ diff --git a/e107_themes/khatru/images/topleft2.png b/e107_themes/khatru/images/topleft2.png new file mode 100644 index 000000000..12688abc1 Binary files /dev/null and b/e107_themes/khatru/images/topleft2.png differ diff --git a/e107_themes/khatru/images/topright.png b/e107_themes/khatru/images/topright.png new file mode 100644 index 000000000..fc512fda1 Binary files /dev/null and b/e107_themes/khatru/images/topright.png differ diff --git a/e107_themes/khatru/images/topright2.png b/e107_themes/khatru/images/topright2.png new file mode 100644 index 000000000..9b2bb268b Binary files /dev/null and b/e107_themes/khatru/images/topright2.png differ diff --git a/e107_themes/khatru/index.html b/e107_themes/khatru/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/khatru/languages/English.php b/e107_themes/khatru/languages/English.php new file mode 100644 index 000000000..f52519c8e --- /dev/null +++ b/e107_themes/khatru/languages/English.php @@ -0,0 +1,27 @@ +jalist"); +define("LAN_THEME_2", "Comments are turned off for this item"); +define("LAN_THEME_3", "comment: "); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); + + +?> diff --git a/e107_themes/khatru/newforumpost.php b/e107_themes/khatru/newforumpost.php new file mode 100644 index 000000000..6059637fd --- /dev/null +++ b/e107_themes/khatru/newforumpost.php @@ -0,0 +1,13 @@ +\n
          \n"; + +$NEWFORUMPOSTSTYLE_MAIN = "
        • {THREAD} by {POSTER} [ views: {VIEWS}, replies: {REPLIES}, lastpost: {LASTPOST} ]\n\n
        • \n"; + +$NEWFORUMPOSTSTYLE_FOOTER = "
        \n

        \n".NFPM_LAN_6.": {TOTAL_TOPICS} | ".NFPM_LAN_4.": {TOTAL_REPLIES} | ".NFPM_LAN_3.": {TOTAL_VIEWS}"; + + +?> \ No newline at end of file diff --git a/e107_themes/khatru/news_template.php b/e107_themes/khatru/news_template.php new file mode 100644 index 000000000..1b59ca789 --- /dev/null +++ b/e107_themes/khatru/news_template.php @@ -0,0 +1,31 @@ + + +{ITEMS1} + +{ITEMS2} + + +"; + + +?> \ No newline at end of file diff --git a/e107_themes/khatru/poll_template.php b/e107_themes/khatru/poll_template.php new file mode 100644 index 000000000..fdc539ac7 --- /dev/null +++ b/e107_themes/khatru/poll_template.php @@ -0,0 +1,157 @@ + +

        +{QUESTION} +

        +
        +

        +
        +"; + +$POLL_NOTVOTED_LOOP = " +{OPTIONBUTTON}{OPTION} +

        "; + +$POLL_NOTVOTED_END = " +

        +
        +

        +{SUBMITBUTTON} +

        +{AUTHOR} +
        +{VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +

        +
        "; + +/* ################################# */ +/* template for polls when user HAS voted ... */ + +$POLL_VOTED_START = " +
        +{QUESTION} +
        +
        +"; + +$POLL_VOTED_LOOP = " +{OPTION} +
        {BAR}

        +{VOTES} | {PERCENTAGE} +

        +"; + +$POLL_VOTED_END = " +
        +{AUTHOR} +
        +{VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        +"; + + +/* ################################# */ +/* template for polls when user CANNOT vote ... */ + + +$POLL_DISALLOWED_START = " +
        +{QUESTION} +
        +
        +"; + +$POLL_DISALLOWED_LOOP = " +{OPTION} +

        +"; + +$POLL_DISALLOWED_END = " +
        +{DISALLOWMESSAGE}

        +{VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        +"; + + +/* ################################# */ +/* template for forum polls when user HASN'T voted*/ + +$POLL_FORUM_NOTVOTED_START = " +
        + + + + + + + + + + + +
        +
        {QUESTION}
        +
        "; + +$POLL_FORUM_NOTVOTED_LOOP = " +{OPTIONBUTTON}{OPTION} +

        "; + +$POLL_FORUM_NOTVOTED_END = " +
        +
        +{SUBMITBUTTON} +
        +
        +
        "; + + +/* ################################# */ +/* template for forum polls when user HAS voted */ + +$POLL_FORUM_VOTED_START = " +
        + + + + + + + + + + + +
        +
        {QUESTION}
        +
        +"; + +$POLL_FORUM_VOTED_LOOP = " +{OPTION} +
        {BAR}
        +{VOTES} | {PERCENTAGE} +

        +"; + +$POLL_FORUM_VOTED_END = " +
        +
        +{VOTE_TOTAL} +
        +
        +
        +"; + +?> \ No newline at end of file diff --git a/e107_themes/khatru/preview.png b/e107_themes/khatru/preview.png new file mode 100644 index 000000000..035d2ab8d Binary files /dev/null and b/e107_themes/khatru/preview.png differ diff --git a/e107_themes/khatru/style.css b/e107_themes/khatru/style.css new file mode 100644 index 000000000..245bccb96 --- /dev/null +++ b/e107_themes/khatru/style.css @@ -0,0 +1,481 @@ + +body { + background: #ffffff url(images/background.png) no-repeat; text-align: left; margin: 12px; + font: 7pt Verdana, Tahoma, Arial, Helvetica, sans-serif; + margin: 5px; + padding: 5px; +} + +/* Header / logo ... */ +#header { + height: 124px; + width: 100%; + background: url(images/logo2.png) repeat-x; + float: left; +} + +#logo1 { + position: absolute; + left:10px; + top:10px; + width: 192px; + height: 124px; + background: url(images/logo1.png) no-repeat; +} + +#headerr { + position: absolute; + right:10px; + top:10px; + height: 124px; + width: 8px; + background-repeat: no-repeat; + background: url(images/logo3.png) no-repeat; +} + +#banner { + position: absolute; + right:26px; + top:40px; +} + +/* end */ + +/* main layout ... */ + +#mainbox { + width: 100%; + margin: 0; padding: 0; +} + + +#leftcontent { + position: absolute; + top: 136px; + left: 10px; + width: 18%; + margin:0; padding:0; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +#rightcontent { + position: absolute; + top: 136px; + right: 10px; + width: 18%; + margin:0; padding:0; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + +} + +#centercontent { + font: 9px Verdana, Tahoma, Arial, Helvetica, sans-serif; + margin-left: 20%; + width: 60%; +} + +#footer { + text-align: center; + + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.clear { + clear: both; +} + + + + + + + +.dcaption { + width: 100%; +} + +.dcaption .left { background: url('images/topleft.png') no-repeat; float: left; height: 26px; width: 9px; margin-right: -3px; } +.dcaption .right { background: url('images/topright.png') no-repeat; float: right; height: 26px; width: 9px; margin-left: -3px; } +.dcaption .center {background-image: url('images/top.png'); color: #111; font: 10px Verdana, Tahoma, Arial, Helvetica, sans-serif; height: 26px; line-height: 26px; } + +.dbody { + width: 100%; +} + +.dbody .leftwrapper { + margin:0; padding:0; + background: url("images/left.png") left repeat-y; +} +.dbody .rightwrapper { + margin:0; padding:0; + background: url("images/right.png") right repeat-y; +} +.dbody .leftcontent { + float:left; + width:9px; + margin:0; padding:0; +} +.dbody .rightcontent { + float:right; + width:9px; + margin:0; padding:0; +} +.dbody .dcenter { + background: #EEE url('images/menubg.png'); + margin: 0 5px; +} +.dbody .dinner { + color: #222; + font: 9px Verdana, Tahoma, Arial, Helvetica, sans-serif; + padding: 4px; +} + +.dbottom .left { background: url('images/bottomleft.png') no-repeat; float: left; height: 8px; width: 9px; font-size: 1px; margin-right: -3px;} +.dbottom .right { background: url('images/bottomright.png') no-repeat; float: right; height: 8px; width: 9px; font-size: 1px; margin-left: -3px;} +.dbottom .center {background-image: url('images/bottom.png');height: 8px; font-size: 1px; } + +.dntop { + border-bottom: 1px solid #a9a9a9; + width: 99%; + margin-left: auto; + margin-right: auto; +} + +/* end */ + + + +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} + + +a { + color: #00006e; + font-family: verdana, arial, sans-serif; + text-decoration: none; +} +a:hover { + color: #ec5800; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} + + +.smalltext { + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; +} + +form { + display: inline; +} +.spacer { + padding: 2px 0 2px 0; +} + +#wm { + voice-family: "\"}\""; + voice-family: inherit; + background: #f3eded url(images/wblogo.png) bottom right no-repeat; + border: 1px solid #ede3e3; + padding: 10px 150px 10px 10px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.button { + border: #b7b5b5 1px solid; + color: #000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} + +h1 { + font-size: 1.4em; + font-weight: bold; + margin-top: 0em; + margin-bottom: 0em; + color: #ec5800; +} + +h2 { + font-size: 1.2em; + font-weight: bold; + margin-top: 0em; + margin-bottom: 0em; + color: #ec5800; +} + +.newstext { + font-size: 8pt; + line-height: 120%; + color: black; + text-align: left; + font: 7pt verdana, tahoma, arial, helvetica, sans-serif; +} + +.newheadline { + font-size: 13px; + color: #ec5800; +} + +.newsinfo { + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.newsinfo a { + background: transparent; + color: #5d6e75; +} + +.newsinfo a:hover { + color: #ec5800; + text-decoration: underline; +} + + + + + +#pollquestion { + font: 8pt Verdana, Tahoma, Arial, Helvetica, sans-serif; +} + +.helpbox { + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + border: 0px none red; + background-color: transparent; +} + +.nforumholder { + border: 1px solid #345487; + padding: 0px; + background: transparent; +} + +.nforumcaption { + background-image: url(images/nforumcaption.png); + padding: 8px 4px 8px 4px; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color: #fff; +} + +.nforumcaption2 { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +.nforumcaption3 { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png); + font: 11px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg2.png); + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread2 { + border: 1px solid #fff; + padding: 4px; + background-color: #D1DCEB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreplycaption { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg2.png); + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg2.png); + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply2 { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png); + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +.nforumdisclaimer { + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.nforumview1 { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png); + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview2 { + border: 1px solid #fff; + padding: 4px; + background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png); + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview3 { + padding: 4px; + background-color: #BCD0ED; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #263448; +} + +.nforumview4 { + padding: 4px; + background-color: #E4EAF2; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color: #3A4F6C; +} + +a.forumlink{ + color: #4943c1; + text-decoration: none; +} + +a.forumlink:hover { + color: #bbb; + text-decoration: underline; +} + +td { + text-align: left; +} + +.smallblacktext { + font: 10px tahoma, verdana, arial, helvetica, sans-serif; + color:#000; + line-height: 120%; +} + +.tbox{ + background-color: #fff; + border: #b7b5b5 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.forumheader{ + background: transparent; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + background-image: url(images/nforumcaption2.png); +} + +.forumheader2{ + background: transparent; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; +} + +.forumheader3{ + background: transparent; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; +} + +.forumborder{ + border: #000080 1px solid; +} + +.chatb { + font-size: 12px; +} + +.chatb a { + background: transparent; + color: #ec5800; +} + +.chatb a:hover { + color: #616060; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} + +p { + margin-top: 0px +} + +.indent{ + padding: 10px 10px 10px 10px; + margin: 5px; + font: 9px verdana, tahoma, arial, sans-serif; + color: #838387; + border: 1px solid #d6d6d6; +} + +.nextprev{ + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding : 2px; + text-align: right; +} + +ul { + padding-left: 12px; +} + +.commentinfo { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +.commentinfo a { + background: transparent; + color: #ec5800; +} + +.commentinfo a:hover { + color: #616060; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} + +.mediumtext { + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +.fcaption { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +hr { + border-top: #666 1px solid; + border-bottom: #fff 1px solid; + height: 2px; + width: 99%; + text-align:center; +} + +.linkspage_button{ + vertical-align: middle; + border:0px; +} \ No newline at end of file diff --git a/e107_themes/khatru/theme.php b/e107_themes/khatru/theme.php new file mode 100644 index 000000000..afbe74415 --- /dev/null +++ b/e107_themes/khatru/theme.php @@ -0,0 +1,237 @@ +".LAN_THEME_1.""); + +// [layout] + +$layout = "_default"; + + +define("BOXOPEN", " +
        +
        +
        +
        +
        "); + +define("BOXMAIN", " +
        +
        +
        +
        +
        +
        +
        +
        +"); + +define("BOXCLOSE", " +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        "); + +define("BOXOPEN2", " +
        +
        +
        +
        +
        +
        +
        +
        +"); + +define("BOXCLOSE2", " +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +"); + + + +$HEADER = " + + + +
        +
        +
        + {SITELINKS} + {MENU=1} +
        +
        + {MENU=2} +
        +
        +"; + + +$FOOTER = " +
        +
        + +
        +"; + + + +function tablestyle($caption, $text) +{ + echo " +
        +
        +
        +
        $caption
        +
        +
        +
        +
        +
        +
        +
        $text
        +
        +
        +
        +
        +
        +
        +
        +
        +"; +} + +// [linkstyle] + +define('PRELINK', ""); +define('POSTLINK', ""); +define('LINKSTART', ""); +define("LINKSTART_HILITE", ""); +define('LINKEND', "
        "); +define('LINKDISPLAY', 2); +define('LINKALIGN', "left"); +define("BULLET", "bullet.png"); +define("bullet", "bullet.png"); + +$NEWSSTYLE = " +
        +{NEWSTITLE} +
        +
        +{NEWSAUTHOR} +, +{NEWSDATE} + // +{NEWSCOMMENTS}{TRACKBACK} +
        +
        +
        +{NEWSBODY} +{EXTENDED} +
        +

        "; +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", LAN_THEME_3); +define("COMMENTOFFSTRING", LAN_THEME_2); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", ", "); + +$CHATBOXSTYLE = " +
        + +{USERNAME} +
        +{TIMEDATE}
        +
        +{MESSAGE} +

        "; + +$COMMENTSTYLE = " + + + + + + + + +
        +{SUBJECT} + +{USERNAME} + + | +{TIMEDATE} +
        +
        +{AVATAR} +
        + +{COMMENTS} +
        +{JOINED} +
        +
        +{REPLY} +
        +{COMMENT} +
        {IPADDRESS}
        +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/kubrick/images/01_linkbg1.gif b/e107_themes/kubrick/images/01_linkbg1.gif new file mode 100644 index 000000000..d971439c2 Binary files /dev/null and b/e107_themes/kubrick/images/01_linkbg1.gif differ diff --git a/e107_themes/kubrick/images/01_linkbg2.gif b/e107_themes/kubrick/images/01_linkbg2.gif new file mode 100644 index 000000000..c7f875075 Binary files /dev/null and b/e107_themes/kubrick/images/01_linkbg2.gif differ diff --git a/e107_themes/kubrick/images/bar.jpg b/e107_themes/kubrick/images/bar.jpg new file mode 100644 index 000000000..09b4da58f Binary files /dev/null and b/e107_themes/kubrick/images/bar.jpg differ diff --git a/e107_themes/kubrick/images/bullet2.gif b/e107_themes/kubrick/images/bullet2.gif new file mode 100644 index 000000000..cb7cb2b9c Binary files /dev/null and b/e107_themes/kubrick/images/bullet2.gif differ diff --git a/e107_themes/kubrick/images/kubrickbg.jpg b/e107_themes/kubrick/images/kubrickbg.jpg new file mode 100644 index 000000000..ca66cdc27 Binary files /dev/null and b/e107_themes/kubrick/images/kubrickbg.jpg differ diff --git a/e107_themes/kubrick/images/kubrickbgcolor.jpg b/e107_themes/kubrick/images/kubrickbgcolor.jpg new file mode 100644 index 000000000..b6875ba48 Binary files /dev/null and b/e107_themes/kubrick/images/kubrickbgcolor.jpg differ diff --git a/e107_themes/kubrick/images/kubrickbgwide.jpg b/e107_themes/kubrick/images/kubrickbgwide.jpg new file mode 100644 index 000000000..c8d04ed80 Binary files /dev/null and b/e107_themes/kubrick/images/kubrickbgwide.jpg differ diff --git a/e107_themes/kubrick/images/kubrickfooter.jpg b/e107_themes/kubrick/images/kubrickfooter.jpg new file mode 100644 index 000000000..d47c7a645 Binary files /dev/null and b/e107_themes/kubrick/images/kubrickfooter.jpg differ diff --git a/e107_themes/kubrick/images/kubrickheader.jpg b/e107_themes/kubrick/images/kubrickheader.jpg new file mode 100644 index 000000000..806b363e6 Binary files /dev/null and b/e107_themes/kubrick/images/kubrickheader.jpg differ diff --git a/e107_themes/kubrick/images/tileage.jpg b/e107_themes/kubrick/images/tileage.jpg new file mode 100644 index 000000000..7985fffdd Binary files /dev/null and b/e107_themes/kubrick/images/tileage.jpg differ diff --git a/e107_themes/kubrick/index.html b/e107_themes/kubrick/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/kubrick/languages/English.php b/e107_themes/kubrick/languages/English.php new file mode 100644 index 000000000..edef542b1 --- /dev/null +++ b/e107_themes/kubrick/languages/English.php @@ -0,0 +1,27 @@ +jalist & Que, Based on original theme by Michael Heilemann (http://binarybonsai.com/kubrick/. )."); +define("LAN_THEME_2", "Comments are turned off for this item"); +define("LAN_THEME_3", "comment: "); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); + + +?> diff --git a/e107_themes/kubrick/preview.jpg b/e107_themes/kubrick/preview.jpg new file mode 100644 index 000000000..161e88d39 Binary files /dev/null and b/e107_themes/kubrick/preview.jpg differ diff --git a/e107_themes/kubrick/style.css b/e107_themes/kubrick/style.css new file mode 100644 index 000000000..32946ba68 --- /dev/null +++ b/e107_themes/kubrick/style.css @@ -0,0 +1,463 @@ +/* + Kubrick v1.2.5 for e107 + http://binarybonsai.com/kubrick/ + This theme was designed and built by Michael Heilemann, + whose blog you will find at http://binarybonsai.com/ + The CSS, XHTML and design is released under GPL: + http://www.opensource.org/licenses/gpl-license.php + Maintainer: William Moffett [Que~] +*/ + +/* BEGIN TYPOGRAPHY & COLORS */ +body { + margin: 0; + padding: 0; + font-size: 62.5%; /* Resets 1em to 10px */ + font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; + color: #333; + text-align: center; + background:#d5d6d7 url("images/kubrickbgcolor.jpg"); +} + +a { + color: #06c; + text-decoration: none; +} + +a:hover { + color: #147; + text-decoration: none; +} + +h1 { + font-size: 4em; +} + +h2 { + font-size: 1.6em; + color: #333; +} + +h3 { + font-size: 1.3em; +} + +h1, h2, h3 { + font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; + font-weight: bold; +} + +td { + background: none; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 10px; + font-style: normal; + color:#5d6e75; + padding: 0px; + text-align:left; +} + +acronym, abbr, span.caps { + cursor: help; + } + +acronym, abbr { + border-bottom: 1px dashed #999; + } + +blockquote { + margin: 15px 30px 0 10px; + padding-left: 20px; + border-left: 5px solid #ddd; + } + +blockquote cite { + margin: 5px 0 0; + display: block; + } + +hr { + display: none; + } + +a img { + border: none; + } + +.linkspage_button{ + border:0px; +} + +.hidden{ + display:none; +} + +/* BEGIN LAYOUT */ + +#page { + margin: 20px auto; + padding: 0; + width: 760px; + border: 1px solid #959596; + text-align: left; + background:white url("images/kubrickbg.jpg") repeat-y top; border: none; +} + +#page2 { + margin: 20px auto; + padding: 0; + width: 760px; + border: 1px solid #959596; + text-align: left; + background:white url("images/kubrickbgwide.jpg") repeat-y top; border: none; +} + +#header { + position:relative; + padding: 0; + margin: 0 auto; + height: 200px; + width: 100%; + background: #73a0c5 url("images/kubrickheader.jpg") no-repeat bottom center; +} + +#header h1{ + position:absolute; + top:50px; + left:0px; + width: 100%; + padding: 0; + margin: 0 auto; + font-size: 4em; + text-align: center; +} + +#header h1 a, #header h1 a:hover{ + color:white; +} + +#header h2 { + position:absolute; + top:100px; + left:0px; + width: 100%; + padding: 0; + margin: 0 auto; + font-size: 1.2em; + text-align: center; + color: #ffffff; +} + +/* UL NAVIGATION ADDED BY QUE~ */ + +#navigation{ + font-size: 11px; + width: 694px; + height: 22px; + position: absolute; + top: 178px; + left: 13px; + list-style: none; +} + +#navigation li{ + background: none; + display: inline; +} + +/* END UL NAVIGATION */ + +#content { + margin-top:22px; + font-size: 1.2em +} + +#sidebar{ + +} + +#sidebar { + margin:22px 0px 0px 545px; + padding: 20px 0 10px 0; + width: 190px; + font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif; +} + +.narrowcolumn { + float: left; + padding: 0 0 20px 45px; + margin: 0px 0 0; + width: 450px; +} + +.widecolumn { + padding: 10px 0 10px 0; + margin: 5px 0 0 5px; + width: 700px; + margin-left: auto; + margin-right: auto; +} + +.narrowcolumn .entry, .widecolumn .entry { + line-height: 1.4em; +} + +.widecolumn { + line-height: 1.6em; +} + +#footer { + padding: 0; + margin: 0 auto; + width: 760px; + clear: both; + background:transparent url("images/kubrickfooter.jpg") bottom left no-repeat; +} + +#footer p { + margin: 0; + padding: 10px 0; + text-align: center; +} + +/* END LAYOUT */ + + +/* BEGIN E107 CORE CLASSES MAINTAINER QUE~ */ + +.button{ + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 10px; + text-align:center; +} + +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} + +.spacer { + padding: 2px 0 2px 0; +} + + +.indent{ + padding:4px; + border: 1px solid #06c; +} + +.smalltext { + font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif; +} + +.mediumtext { + font: 12px 'Lucida Grande', Verdana, Arial, Sans-Serif; +} + +.tbox{ + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.helpbox { + border: 0px; + background-color: transparent; + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; +} + +.fborder { + border: #ededed 1px solid; + background-color: #fff; + +} + +.forumheader{ + background-color: #EBEFF2; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 11px; + color:#000; + padding: 4px; + border: 1px solid #ededed; +} + +.forumheader2{ + background-color: #fff; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 10px; + color:#000; + padding: 4px; + border: #ededed 1px solid; +} + +.forumheader3{ + background-color: #fff; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #ededed 1px solid; + +} + +.forumborder{ + border: #000080 1px solid; + background-color: transparent; +} + +.fcaption { + height:35px; + border: #ededed 1px solid; + padding: 2px 0 2px 8px; + background-color: #68ADE5; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#fff; + font-weight:bold; + background-image: url("images/tileage.jpg"); + +} +.fcaption a{ + padding-right:4px; + color:#fff; + +} + +/* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. + It won't be a stylish marriage, I can't afford a carriage. + But you'll look sweet upon the seat of a bicycle built for two." */ + + +/* START NAVIGATION */ + +/* THIS PART IS FOR THE NAVIGATION LINKS */ +.nav1 a:link, .nav1 a:visited, .nav2 a:link, .nav2 a:visited, .nav3 a:link, .nav3 a:visited, .nav4 a:link, .nav4 a:visited, .nav5 a:link, .nav5 a:visited, .nav6 a:link, .nav6 a:visited, .nav7 a:link, .nav7 a:visited, .nav8 a:link, .nav8 a:visited{ + color: #4E4E4E; + width: 80px; + height: 20px; + line-height: 20px; + background: url(images/01_linkbg2.gif) top repeat-y; + padding: 0; + text-align:center; +} + +.nav1_onpage a:link, .nav1_onpage a:visited, .nav2_onpage a:link, .nav2_onpage a:visited, .nav3_onpage a:link, .nav3_onpage a:visited, .nav4_onpage a:link, .nav4_onpage a:visited, .nav5_onpage a:link, .nav5_onpage a:visited, .nav6_onpage a:link, .nav6_onpage a:visited, .nav7_onpage a:link, .nav7_onpage a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{ + color: #4E4E4E; + width: 80px; + height: 20px; + line-height: 20px; + background: url(images/01_linkbg2.gif) top repeat-y; + padding: 0; + text-align:center; +} + +.nav1 a:link, .nav1 a:visited, .nav1_onpage a:link, .nav1_onpage a:visited{ + position: absolute; + top: 2px; + left: 14px; +} + +.nav2 a:link, .nav2 a:visited, .nav2_onpage a:link, .nav2_onpage a:visited{ + position: absolute; + top: 2px; + left: 96px; +} +.nav3 a:link, .nav3 a:visited, .nav3_onpage a:link, .nav3_onpage a:visited{ + position: absolute; + top: 2px; + left: 178px; +} + +.nav4 a:link, .nav4 a:visited, .nav4_onpage a:link, .nav4_onpage a:visited{ + position: absolute; + top: 2px; + left: 260px; +} + +.nav5 a:link, .nav5 a:visited, .nav5_onpage a:link, .nav5_onpage a:visited{ + position: absolute; + top: 2px; + left: 342px; +} + +.nav6 a:link, .nav6 a:visited, .nav6_onpage a:link, .nav6_onpage a:visited{ + position: absolute; + top: 2px; + left: 424px; +} + +.nav7 a:link, .nav7 a:visited, .nav7_onpage a:link, .nav7_onpage a:visited{ + position: absolute; + top: 2px; + left: 506px; +} + +.nav8 a:link, .nav8 a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{ + position: absolute; + top: 2px; + left: 588px; +} + +/* HOVER EFFECTS */ + +.nav1 a:hover, .nav1 a:active, +.nav2 a:hover, .nav2 a:active, +.nav3 a:hover, .nav3 a:active, +.nav4 a:hover, .nav4 a:active, +.nav5 a:hover, .nav5 a:active, +.nav6 a:hover, .nav6 a:active, +.nav7 a:hover, .nav7 a:active, +.nav8 a:hover, .nav8 a:active{ + background: url(images/01_linkbg1.gif) top repeat-y; + margin: 1px 0 0 0; +} + +/* USE A DIFFERENT COLOR WHEN USER IS ON THAT PAGE */ + +.nav1_onpage a:link, .nav1_onpage a:visited, +.nav2_onpage a:link, .nav2_onpage a:visited, +.nav3_onpage a:link, .nav3_onpage a:visited, +.nav4_onpage a:link, .nav4_onpage a:visited, +.nav5_onpage a:link, .nav5_onpage a:visited, +.nav6_onpage a:link, .nav6_onpage a:visited, +.nav7_onpage a:link, .nav7_onpage a:visited, +.nav8_onpage a:link, .nav8_onpage a:visited{ + background: url(images/01_linkbg1.gif) top repeat-y; +} + +/* END NAVIGATION */ + +/* NICETITLE ADDED BY QUE~*/ + +.nicetitle { + font-weight: bold; + color: #3C3C3C; + text-align: left; + position: absolute; + left: 0; + top: 0; + width: 35em; + z-index: 20; + max-width: 60%; +} +.nicetitle-content{ + overflow: hidden; + background: white; + border: 1px solid #333; + padding: 7px; + opacity: 0.9; +} +.nicetitle p{ + margin: 0; + line-height: 120%; +} +.nicetitle p.destination { + font-weight: normal; + font-size: 10px; + color: #5E7743; +} +div.nicetitle p span.accesskey { + color: #FF7200; +} + diff --git a/e107_themes/kubrick/theme.js b/e107_themes/kubrick/theme.js new file mode 100644 index 000000000..a96349038 --- /dev/null +++ b/e107_themes/kubrick/theme.js @@ -0,0 +1,348 @@ +// from http://www.kryogenix.org +// by Scott Andrew - http://scottandrew.com +// add an eventlistener to browsers that can do it somehow. +function addEvent(obj, evType, fn) + { + if (obj.addEventListener) + { + obj.addEventListener(evType, fn, false); + return true; + } + else if (obj.attachEvent) + { + var r = obj.attachEvent('on'+evType, fn); + return r; + } + else + { + return false; + } + } + + +// Force IE not to show alternate text as tooltip +function noAltTooltip() + { + images = document.getElementsByTagName('img'); + for (var i = 0; i < images.length; i++) + { + var title = images[i].getAttribute('title'); + var alt = images[i].getAttribute('alt'); + if ((document.all) && (alt) && (!title)) + { + images[i].setAttribute('title', ''); + } + } + } + +// Nice Titles + +// original code by Stuart Langridge 2003-11 +// with additions to the code by other good people +// http://www.kryogenix.org/code/browser/nicetitle/ +// thank you, sir + +// modified by Peter Janes 2003-03-25 +// http://peterjanes.ca/blog/archives/2003/03/25/nicetitles-for-ins-and-del +// added in ins and del tags + +// modified by Dunstan Orchard 2003-11-18 +// http://1976design.com/blog/ +// added in accesskey information +// tried ever-so-hard, but couldn't work out how to do what Ethan did + +// final genius touch by by Ethan Marcotte 2003-11-18 +// http://www.sidesh0w.com/ +// worked out how to delay showing the popups to make them more like the browser's own + +// set the namespace +var XHTMLNS = 'http://www.w3.org/1999/xhtml'; +var CURRENT_NICE_TITLE; + +// browser sniff +var browser = new Browser(); + +// determine browser and version. +function Browser() + { + var ua, s, i; + + this.isIE = false; + this.isNS = false; + this.version = null; + + ua = navigator.userAgent; + + s = 'MSIE'; + if ((i = ua.indexOf(s)) >= 0) + { + this.isIE = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + + s = 'Netscape6/'; + if ((i = ua.indexOf(s)) >= 0) + { + this.isNS = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + + // treat any other 'Gecko' browser as NS 6.1. + s = 'Gecko'; + if ((i = ua.indexOf(s)) >= 0) + { + this.isNS = true; + this.version = 6.1; + return; + } + } + +// 2003-11-19 sidesh0w +// set delay vars to emulate normal hover delay +var delay; +var interval = 0.60; + +// this function runs on window load +// it runs through all the links on the page as starts listening for actions +function makeNiceTitles() + { + if (!document.createElement || !document.getElementsByTagName) return; + if (!document.createElementNS) + { + document.createElementNS = function(ns, elt) + { + return document.createElement(elt); + } + } + + // do regular links + if (!document.links) + { + document.links = document.getElementsByTagName('a'); + } + for (var ti=0; ti STD_WIDTH) + { + w = h_pixels; + } + else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels)) + { + w = t_pixels; + } + else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels)) + { + w = h_pixels; + } + else + { + w = STD_WIDTH; + } + + d.style.width = w + 'px'; + + mpos = findPosition(lnk); + mx = mpos[0]; + my = mpos[1]; + + d.style.left = (mx+15) + 'px'; + d.style.top = (my+35) + 'px'; + + if (window.innerWidth && ((mx+w) > window.innerWidth)) + { + d.style.left = (window.innerWidth - w - 25) + 'px'; + } + if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth)) + { + d.style.left = (document.body.scrollWidth - w - 25) + 'px'; + } + + document.getElementsByTagName('body')[0].appendChild(d); + + CURRENT_NICE_TITLE = d; + } + +function hideNiceTitle(e) + { + // 2003-11-19 sidesh0w + // clearTimeout + if (delay) clearTimeout(delay); + if (!document.getElementsByTagName) return; + if (CURRENT_NICE_TITLE) + { + document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE); + CURRENT_NICE_TITLE = null; + } + } +addEvent(window, "load", noAltTooltip); +addEvent(window, "load", makeNiceTitles); + diff --git a/e107_themes/kubrick/theme.php b/e107_themes/kubrick/theme.php new file mode 100644 index 000000000..2eac637de --- /dev/null +++ b/e107_themes/kubrick/theme.php @@ -0,0 +1,150 @@ +This theme is intended for minimilist blog sites."; +define("STANDARDS_MODE", TRUE); +$xhtmlcompliant = TRUE; +$csscompliant = TRUE; +define("IMODE", "lite"); +define("THEME_DISCLAIMER", "
        ".LAN_THEME_1.""); + +if(!defined("e_THEME")){ exit; } +$page=substr(strrchr($_SERVER['PHP_SELF'], "/"), 1); +define("e_PAGE", $page); + +$register_sc[]= "UL"; // register shortcode ul.sc for inclusion. + +// [layout] + +$layout = "_default"; + +$HEADER = "
        + +
        "; + +$FOOTER = " +
        + +
        + +
        +"; + +$CUSTOMHEADER = "
        + +
        "; + + +$CUSTOMFOOTER = " +
        +
        + +
        +"; + +$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php user.php submitnews.php download.php links.php stats.php usersettings.php signup.php"; + +$NEWSSTYLE = " +

        {NEWSTITLE}

        +on {NEWSDATE} | by {NEWSAUTHOR} +
        +{NEWSBODY} +{EXTENDED} +
        +
        +{NEWSCOMMENTS}{TRACKBACK} +
        +
        "; +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", LAN_THEME_3); +define("COMMENTOFFSTRING", LAN_THEME_2); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " | "); + + +// [linkstyle] + +define('PRELINK', ""); +define('POSTLINK', ""); +define('LINKSTART', ""); +define('LINKEND', ""); +define('LINKDISPLAY', 1); +define('LINKALIGN', "left"); +define('LINKCLASS', ""); + +// [tablestyle] + +function tablestyle($caption, $text, $mode) +{ + echo "

        $caption

        \n
        $text

        \n"; +} + +$COMMENTSTYLE = " + + + + + +
        {USERNAME}
        {TIMEDATE}
        {AVATAR}{REPLY}
        {COMMENT} {COMMENTEDIT}
        "; + + +$CHATBOXSTYLE = " + +{USERNAME} +
        +{MESSAGE} +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/kubrick/ul.sc b/e107_themes/kubrick/ul.sc new file mode 100644 index 000000000..ea98eaf4c --- /dev/null +++ b/e107_themes/kubrick/ul.sc @@ -0,0 +1,33 @@ +global $sql, $page, $link_class; +$sql -> db_Select('links', '*', "link_category = 1 and link_name NOT REGEXP('submenu') and link_name NOT REGEXP('child') and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC"); +$ulmenu = ""; +return $ulmenu; + diff --git a/e107_themes/lamb/alt_style.css b/e107_themes/lamb/alt_style.css new file mode 100644 index 000000000..4c4e6daf4 --- /dev/null +++ b/e107_themes/lamb/alt_style.css @@ -0,0 +1,491 @@ + +/* info: this alternative stylesheet uses pure css for layout, no tables, but cross browser issues mean it isn't as stable as the layout that uses tables. To use you have to rename alt_theme.php to theme.php */ + +.intwrapper { + width: 100%; +} + +#mainleft { + margin:0; padding:0; + background: #fff url("images/left.png") top left repeat-y; +} +#mainright { + margin:0; padding:0; + background:url("images/right.png") top right repeat-y; +} +#leftcontent { + float:left; + width:180px; + margin:0; padding:0; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +#rightcontent { + float:right; + width:180px; + margin:0; padding:0; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.menuwrapper { + width: 98%; + margin-left: auto; + margin-right: auto; +} + +#centercontent { + margin:0 180px; + background:#fff; +} +.columnwrap { + margin:0; padding:0.5em 1em; +} +.cleaner { + clear:both; + height:1px; + font-size:1px; + border:none; + margin:0; padding:0; + background:transparent; +} + +#header { + height: 80px; + width: 100%; + background-repeat: repeat-x; + background-image: url(images/logobg.png); + border-bottom: 1px solid black; +} + +#logo { + position: absolute; + left:0px; + top:0px; + height: 80px; + width: 216px; + background-image: url(images/logo.png); + background-repeat: no-repeat; +} + +#quote { + position: absolute; + left:6px; + top:60px; + color: #176f8f; +} + +#banner { + position: absolute; + right:6px; + top:10px; +} + +#wm { + voice-family: "\"}\""; + voice-family: inherit; + background: #f3eded url(images/wblogo.png) bottom right no-repeat; + border: 1px solid #ede3e3; + padding: 10px 150px 10px 10px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +#bqtop { + width: 252px; + padding-top: 7px; + background: url(images/boxtop.png) top left no-repeat; + margin-bottom: 15px; +} + +#lbqtop { + width: 450px; + padding-top: 7px; + background: url(images/lboxtop.png) top left no-repeat; + margin-bottom: 15px; +} + +#bqbottom { + background: url(images/boxbottom.png) bottom left no-repeat; + padding-bottom: 7px; + width: 100%; +} + +#lbqbottom { + background: url(images/lboxbottom.png) bottom left no-repeat; + padding-bottom: 7px; + width: 100%; +} + +#bglefright { + padding: 11px 14px 12px 15px; + border-left: 1px solid #DADADA; + border-right: 1px solid #DADADA; +} + +#centre { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +#bqcontent { + margin-left: 4px; +} + +#bqtext { + font-size: 10px; + color: #666; +} + +ul{ + list-style: square; +} + + +#footer { + border-top: 1px solid #000; + width: 100%; +} + +h1 { + font-size: 1.4em; + font-weight: bold; + margin-top: 0em; + margin-bottom: 0em; + color: #ec5800; +} + +h2 { + font: 12px arial, verdana, tahoma, helvetica, sans-serif; + color: #bbb; + text-transform: uppercase; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; +} + +h3 { + font: 12px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; +} + +h4 { + font: 12px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; + background-color: #eae6e6; + padding: 2px; +} + +img { + vertical-align: middle; +} + +.dlmain { + font: 20px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; +} + +.dlcat { + font: 14px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; + padding: 2px; +} + + + + +hr { + border: 1px dotted #bbb; + height: 1px; + width: 92%; + text-align:center; +} + +.smalltext { + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.bodytable { + padding: 2px; + font: 0.8em verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +.button { + border: #000 1px solid; + color: #000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} + +.button a { + color: #000; +} +.button a:hover { + color: #0085b0; +} + +body { + font-size: 12px; + color: #000; + font-family: tahoma, verdana, arial, sans-serif; + background-color: #fff; + margin:0px; + text-align:left +} +a { + color: #0085b0; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} +a:hover { + color: #616060; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} + +.smallblacktext { + background: none; + font: 10px tahoma, verdana, arial, helvetica, sans-serif; + color:#000; +} +.indent{ + padding: 10px 10px 10px 10px; + margin: 5px; + font: 9px verdana, tahoma, arial, sans-serif; + color: #838387; + border: 1px solid #d6d6d6; +} +.defaulttext { + background: none; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} + +td { + font: 11px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; + padding: 0px; + text-align:left; +} + +blockquote { + font-family: verdana, tahoma, arial, helvetica, sans-serif; + color:#7e96ac; + border: 1px solid #d6d6d6; +} +.mediumtext { + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} + +.tbox{ + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nextprev{ + background-color: #eaeef2; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + padding : 2px; + text-align: right; +} + +form { + margin: 2px 0px 0px 0px; +} +.spacer { + padding: 2px 0 2px 0; +} + +.cspacer { + padding: 6px 0 6px 0; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.border { + border: #999 1px solid; + background-color: #F0F1F1; + padding: 2px; +} + + +p { + margin-top: 0px +} + +.fborder { + border: #c1c1c1 1px solid; +} +.forumheader{ + background-color: #f3f3f7; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + background-image : url('../e107_images/forum/fcap2.png'); + border: 1px solid #ececf2; +} + +.forumheader2{ + background-color: #EFEFEF; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} + +.forumheader3{ + background-color: #f3f3f7; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #ececf2 1px solid; +} + +.forumborder{ + border: #000080 1px solid; +} + +.fcaption { + border: #f0f2f4 1px solid; + padding: 2px 0 2px 0; + background-color: #f9fafb; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#616060; +} + +.finfobar{ + background-color: #CCC8C8; + color:#000; + padding: 4px; + border: 1px solid #C3BDBD; + background-image : url('../e107_images/forum/finfobar.png');font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif +} + +.helpbox { + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + border: 0px none red; + background-color: transparent; +} + +.nforumholder { + border: 1px solid #345487; + padding: 0px; + background-color: #fff; +} + +.nforumcaption { + background-image: url(images/nforumcaption.png); + padding: 8px 4px 8px 4px; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color: #fff; +} + +.nforumcaption2 { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; + font-weight: bold; +} + +.nforumcaption3 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread { + border: 1px solid #fff; + padding: 4px; + background-color: #EEF2F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread2 { + border: 1px solid #fff; + padding: 4px; + background-color: #D1DCEB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreplycaption { + border: 1px solid #fff; + padding: 4px; + background-color: #E2EDF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply { + border: 1px solid #fff; + padding: 4px; + background-color: #EDF4F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply2 { + border: 1px solid #fff; + padding: 4px; + background-color: #CFE0EB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +.nforumdisclaimer { + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.nforumview1 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview2 { + border: 1px solid #fff; + padding: 4px; + background-color: #DFE6EF; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview3 { + padding: 4px; + background-color: #BCD0ED; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #263448; +} + +.nforumview4 { + padding: 4px; + background-color: #E4EAF2; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color: #3A4F6C; +} + +a.forumlink{ + color: #fff; + text-decoration: none; +} + +a.forumlink:hover { + color: #bbb; + text-decoration: underline; +} diff --git a/e107_themes/lamb/alt_theme.php b/e107_themes/lamb/alt_theme.php new file mode 100644 index 000000000..66476452d --- /dev/null +++ b/e107_themes/lamb/alt_theme.php @@ -0,0 +1,163 @@ + + + + +
        +
        +
        +
        +{SITELINKS} +{MENU=1} +
        +
        +
        +
        +{MENU=2} +
        +
        +
        + +
         
        +
        +
        +
        + +"; + +$NEWSSTYLE = " +

        +{STICKY_ICON} +{NEWSTITLE} +

        +
        +{NEWSBODY} +{EXTENDED} +
        +
        +{NEWSAUTHOR} +on +{NEWSDATE} +
        + +{NEWSCOMMENTS}{TRACKBACK} +
        + | Submit a news item +
        +
        "; +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", "Read/Post Comment: "); +define("COMMENTOFFSTRING", "Comments are turned off for this item"); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", "Read the rest ..."); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", "Trackbacks: "); +define("TRACKBACKBEFORESTRING", " | "); + + +// [linkstyle] + +define('PRELINK', ""); +define('POSTLINK', ""); +define('LINKSTART', " "); +define("LINKSTART_HILITE", " "); +define('LINKEND', "
        "); +define('LINKDISPLAY', 2); +define('LINKALIGN', "left"); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode) +{ + echo "

        $caption

        \n
        \n$text\n

        \n"; +} + +$COMMENTSTYLE = " + + + + + +
        {USERNAME} @ {TIMEDATE}
        {AVATAR}{REPLY}
        +
        +
        +
        +
        +
        +
        +{COMMENT} {COMMENTEDIT} +
        +
        +
        +
        +
        +
        +
        +"; + +$POLLSTYLE = <<< EOF +Poll: {QUESTION} +

        +{OPTIONS=OPTION
        BAR
        PERCENTAGE VOTES
        \n} +
        {AUTHOR}
        {VOTE_TOTAL} {COMMENTS} +
        +{OLDPOLLS} +
        +EOF; + +$CHATBOXSTYLE = " + +{USERNAME} +
        +{MESSAGE} +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/lamb/chat_template.php b/e107_themes/lamb/chat_template.php new file mode 100644 index 000000000..f4d043394 --- /dev/null +++ b/e107_themes/lamb/chat_template.php @@ -0,0 +1,18 @@ +\n
        \nbullet \n{CHAT_TABLE_NICK}\n".CHATBOX_L22." {CHAT_TABLE_DATESTAMP}
        \n
        {CHAT_TABLE_MESSAGE}
        \n
        \n\n"; +} +if(!$CHAT_TABLE_END){ + $CHAT_TABLE_END = ""; +} +// ##### ------------------------------------------------------------------------------------------ + + +?> \ No newline at end of file diff --git a/e107_themes/lamb/download_template.php b/e107_themes/lamb/download_template.php new file mode 100644 index 000000000..61f9cbecb --- /dev/null +++ b/e107_themes/lamb/download_template.php @@ -0,0 +1,208 @@ + ".LAN_dl_18."\n +

        +"; + + + +$DOWNLOAD_CAT_PARENT_TABLE .= " +

        {DOWNLOAD_CAT_MAIN_ICON} {DOWNLOAD_CAT_MAIN_NAME}

        +"; + + +$DOWNLOAD_CAT_CHILD_TABLE .= " +{DOWNLOAD_CAT_SUB_ICON} +{DOWNLOAD_CAT_SUB_NEW_ICON} {DOWNLOAD_CAT_SUB_NAME} + +{DOWNLOAD_CAT_SUB_DESCRIPTION} + +"; + +$DOWNLOAD_CAT_CHILD_TABLE .= " +
        +{DOWNLOAD_CAT_SUBSUB_NAME} + + +{DOWNLOAD_CAT_SUBSUB_DESCRIPTION} +
        +{DOWNLOAD_CAT_SUBSUB} +
        +"; + +$DOWNLOAD_CAT_SUBSUB_TABLE .= " +     {DOWNLOAD_CAT_SUBSUB_NEW_ICON} {DOWNLOAD_CAT_SUBSUB_NAME} +"; + +$DOWNLOAD_CAT_TABLE_END = " +



        +{DOWNLOAD_CAT_SEARCH} +"; + +// ##### ------------------------------------------------------------------------------------------ + +// ##### LIST TABLE ------------------------------------------------------------------------------- +$DOWNLOAD_LIST_TABLE_RENDERPLAIN = TRUE; +if(!$DOWNLOAD_LIST_TABLE_START){ + + $DOWNLOAD_LIST_TABLE_START = " + ".LAN_dl_18.": {DOWNLOAD_CATEGORY}

        {DOWNLOAD_CATEGORY_DESCRIPTION}

        + +
        +

        +".LAN_dl_38." +    + +".LAN_dl_37." + +  + +  +".LAN_dl_39." + +  + + + + +

        +

        +\n + + + + + + + + +"; + +} + +if(!$DOWNLOAD_LIST_TABLE){ + $DOWNLOAD_LIST_TABLE .= " + + + + + + + +\n"; +} + +if(!$DOWNLOAD_LIST_TABLE_END){ + $DOWNLOAD_LIST_TABLE_END = "
        ".LAN_dl_28."".LAN_dl_24."".LAN_dl_21."".LAN_dl_29."".LAN_dl_12."".LAN_dl_8."
        {DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME}{DOWNLOAD_LIST_AUTHOR}{DOWNLOAD_LIST_FILESIZE}{DOWNLOAD_LIST_REQUESTED}{DOWNLOAD_LIST_RATING}{DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON}
        \n


        +
        {DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}
        \n"; +} +// ##### ------------------------------------------------------------------------------------------ + + +// ##### VIEW TABLE ------------------------------------------------------------------------------- +$DOWNLOAD_VIEW_TABLE_RENDERPLAIN = TRUE; +if(!$DOWNLOAD_VIEW_TABLE_START){ + $DOWNLOAD_VIEW_TABLE_START = " + + ".LAN_dl_18.": {DOWNLOAD_CATEGORY}


        \n"; +} + +if(!$DOWNLOAD_VIEW_TABLE){ + $DOWNLOAD_VIEW_TABLE .= " +
        {DOWNLOAD_VIEW_NAME_LINKED}
        +{DOWNLOAD_VIEW_AUTHOR_LAN}: {DOWNLOAD_VIEW_AUTHOR} ( {DOWNLOAD_VIEW_AUTHOREMAIL} ) ( {DOWNLOAD_VIEW_AUTHORWEBSITE} )

        +{DOWNLOAD_VIEW_DESCRIPTION}

        + + "; + + + + $DOWNLOAD_VIEW_TABLE .= " +
        {DOWNLOAD_VIEW_IMAGE}
        | "; + + + $DOWNLOAD_VIEW_TABLE .= " + {DOWNLOAD_VIEW_FILESIZE_LAN}: {DOWNLOAD_VIEW_FILESIZE} | {DOWNLOAD_VIEW_REQUESTED_LAN}: {DOWNLOAD_VIEW_REQUESTED} | {DOWNLOAD_REPORT_LINK} +
        {DOWNLOAD_VIEW_RATING}


        +"; +} + +if(!$DOWNLOAD_VIEW_TABLE_END){ + $DOWNLOAD_VIEW_TABLE_END = "\n"; +} +// ##### ------------------------------------------------------------------------------------------ + +if(!$DOWNLOAD_MIRROR_START) +{ + $DOWNLOAD_MIRROR_START = " +
        + + + + + + + + + + + "; +} + +if(!$DOWNLOAD_MIRROR) +{ + $DOWNLOAD_MIRROR = " + + + + + + + "; +} + +if(!$DOWNLOAD_MIRROR_END) +{ + $DOWNLOAD_MIRROR_END = " +
        {DOWNLOAD_MIRROR_REQUEST}
        {DOWNLOAD_MIRROR_HOST_LAN}{DOWNLOAD_MIRROR_DESCRIPTION_LAN}{DOWNLOAD_MIRROR_LOCATION_LAN}{DOWNLOAD_MIRROR_GET_LAN}
        {DOWNLOAD_MIRROR_IMAGE}

        {DOWNLOAD_MIRROR_REQUESTS}
        {DOWNLOAD_TOTAL_MIRROR_REQUESTS}
        {DOWNLOAD_MIRROR_DESCRIPTION}
        {DOWNLOAD_MIRROR_LOCATION}
        {DOWNLOAD_MIRROR_LINK} {DOWNLOAD_MIRROR_FILESIZE}
        +
        + "; +} + +?> \ No newline at end of file diff --git a/e107_themes/lamb/forum_post_template.php b/e107_themes/lamb/forum_post_template.php new file mode 100644 index 000000000..a192fb19d --- /dev/null +++ b/e107_themes/lamb/forum_post_template.php @@ -0,0 +1,120 @@ + +".LAN_61." + + + +"; + +$subjectbox = " +".LAN_62." + + + +"; + +// the poll is optional, be careful when changing the values here, only change if you know what you're doing ... + +require_once(e_PLUGIN."poll/poll_class.php"); +$pollo = new poll; +$poll = $pollo -> renderPollForm("forum"); + +// finally, file attach is optional, again only change this if you know what you're doing ... + +$fileattach = "".($pref['image_post'] ? LAN_390 : LAN_416)." +".LAN_392." +".LAN_393." | ".$allowed_filetypes." |
        ".LAN_394."
        ".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))." +
        + +
        + +
        + + + + +"; + + +// ------------ + +$FORUMPOST = " +
        +{FORMSTART} + + + + +{USERBOX} +{SUBJECTBOX} + + + + + +{POLL} + +{FILEATTACH} + + +
        {BACKLINK} +
        {POSTTYPE} +{POSTBOX}
        {EMAILNOTIFY}
        {POSTTHREADAS} +
        +{BUTTONS} +
        +{FORMEND} +
        +{FORUMJUMP} +"; + +$FORUMTHREADPOSTED = " + + + + + +
        ".LAN_133."
        ".IMAGE_e."  +
        ".LAN_324."
        +".LAN_325."
        +".LAN_326."


        +
        "; + + +$FORUMREPLYPOSTED = " + + + + + +
        ".LAN_133."
        ".IMAGE_e."  +
        ".LAN_324."
        +".LAN_325."
        +".LAN_326."


        +
        "; + + + +?> \ No newline at end of file diff --git a/e107_themes/lamb/forum_posted_template.php b/e107_themes/lamb/forum_posted_template.php new file mode 100644 index 000000000..cfadbb838 --- /dev/null +++ b/e107_themes/lamb/forum_posted_template.php @@ -0,0 +1,61 @@ + + +".LAN_133." + +".IMAGE_e."  + +
        ".LAN_413."
        +".LAN_414."
        +".LAN_326."


        +"; + +$FORUMTHREADPOSTED = " + + + + + +
        ".LAN_133."
        ".IMAGE_e."  +
        ".LAN_324."
        +".(defined("F_MESSAGE") ? F_MESSAGE."
        " : "")." +".LAN_325."
        +".LAN_326."


        +
        "; + + +$FORUMREPLYPOSTED = " + + + + + +
        ".LAN_133."
        ".IMAGE_e."  +
        ".LAN_415."
        +".(defined("F_MESSAGE") ? F_MESSAGE."
        " : "")." +".LAN_325."
        +".LAN_326."


        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/lamb/forum_preview_template.php b/e107_themes/lamb/forum_preview_template.php new file mode 100644 index 000000000..f0cbd6b98 --- /dev/null +++ b/e107_themes/lamb/forum_preview_template.php @@ -0,0 +1,35 @@ + + + +" : " ( ".LAN_62.$tsubject." )")." + + + + +
        ".LAN_323. +($action != "nt" ? "
        ".$poster." +
        ".IMAGE_post2." ".LAN_322.$postdate."
        ".$tpost."
        +"; + +?> \ No newline at end of file diff --git a/e107_themes/lamb/forum_template.php b/e107_themes/lamb/forum_template.php new file mode 100644 index 000000000..886de9b88 --- /dev/null +++ b/e107_themes/lamb/forum_template.php @@ -0,0 +1,61 @@ +"; + +$FORUM_MAIN_PARENT = "
        \n\n\n\n +\n\n\n\n\n\n"; + +//$FORUM_MAIN_PARENT_END = "
        {PARENTNAME} {PARENTSTATUS}
        {FORUMTITLE}{THREADTITLE}{REPLYTITLE}{LASTPOSTITLE}
        "; + +$FORUM_MAIN_FORUM = "\n{NEWFLAG}\n{FORUMNAME}
        {FORUMDESCRIPTION}{FORUMSUBFORUMS}\n{THREADS}\n{REPLIES}\n{LASTPOST}\n"; + +$FORUM_MAIN_END = "\n
        \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
        {INFOTITLE}
        {LOGO}{USERINFO}
        {INFO}
        {FORUMINFO}
        {USERLIST}
        {STATLINK}
        \n
        \n
        \n\n\n\n\n\n\n
        {ICONKEY}{SEARCH}{PERMS}\n
        \n
        \n"; + + if(!$FORUM_NEWPOSTS_START){ + $FORUM_NEWPOSTS_START = "
        \n
        \n\n\n\n\n\n"; + } + + if(!$FORUM_NEWPOSTS_MAIN){ + $FORUM_NEWPOSTS_MAIN .= "\n\n\n\n"; + } + + if(!$FORUM_NEWPOSTS_END){ + $FORUM_NEWPOSTS_END .= "
         {NEWTHREADTITLE}{POSTEDTITLE}
        {NEWIMAGE}{NEWSPOSTNAME}{STARTERTITLE}
        "; + } + + if(!$FORUM_TRACK_START){ + $FORUM_TRACK_START = "
        \n
        \n\n\n\n\n"; + + if(!$FORUM_TRACK_MAIN){ + $FORUM_TRACK_MAIN = " + + + + "; + } + } + + if(!$FORUM_TRACK_END){ + $FORUM_TRACK_END = "
        {TRACKTITLE}
        {NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
        \n
        \n
        "; + } + + +?> \ No newline at end of file diff --git a/e107_themes/lamb/forum_viewforum_template.php b/e107_themes/lamb/forum_viewforum_template.php new file mode 100644 index 000000000..71b4c0ff6 --- /dev/null +++ b/e107_themes/lamb/forum_viewforum_template.php @@ -0,0 +1,134 @@ + + +{BREADCRUMB} + +{SUBFORUMS} + + + + + + +
        {FORUMTITLE} Forum
        {THREADPAGES}
        +{NEWTHREADBUTTON} +
        + + + + + + + + + +"; + + +$FORUM_VIEW_FORUM = " + + + + + + + + +"; + + $FORUM_VIEW_END = " +
         {THREADTITLE}{STARTERTITLE}{REPLYTITLE}{VIEWTITLE}{LASTPOSTITLE}
        {ICON} + + + + + + +
        {THREADNAME} {PAGES}{ADMIN_ICONS}
        +
        {POSTER}
        {THREADDATE}
        {REPLIES}{VIEWS}{LASTPOST}
        + + + + + +
        {THREADPAGES} +{FORUMJUMP} + +{NEWTHREADBUTTON} +
        + + +
        + + + + + + + + + + +
        {MODERATORS}{BROWSERS}
        {ICONKEY}{PERMS}

        {SEARCH} +
        +
        + +
        +".LAN_431." +".LAN_432." +".LAN_433." +
        +
        Powered by e107 Forum System
        "; + + +$FORUM_VIEW_SUB_START = " + + + + + + + + + +"; + +$FORUM_VIEW_SUB = " + + + + + + +"; + +$FORUM_VIEW_SUB_END = " +
        ".FORLAN_20."".FORLAN_21."".LAN_55."".FORLAN_22."
        {SUB_FORUMTITLE}
        {SUB_DESCRIPTION}
        {SUB_THREADS}{SUB_REPLIES}{SUB_LASTPOST}
        + + +"; + + ?> \ No newline at end of file diff --git a/e107_themes/lamb/forum_viewtopic_template.php b/e107_themes/lamb/forum_viewtopic_template.php new file mode 100644 index 000000000..32295b844 --- /dev/null +++ b/e107_themes/lamb/forum_viewtopic_template.php @@ -0,0 +1,144 @@ + + +{BACKLINK} + + + + + + + + +
        {NEXTPREV} {TRACK} 
        + + + +
        + + + + + + +
        {THREADNAME}

        {GOTOPAGES}
        {BUTTONS}
        + + + + +\n + +
        \n".LAN_402."\n\n".LAN_403."\n
        "; + $FORUMTHREADSTYLE = " +
        + + + + + + + + + + + + + +
        \n{NEWFLAG}\n{POSTER}\n + + + + + +
        \n{THREADDATESTAMP}\n\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n
        +
        \n{AVATAR}\n\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n\n{POLL}\n{POST}\n{SIGNATURE}\n
        \n\n{TOP}\n\n + + + + + +
        \n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n\n{MODOPTIONS}\n
        +
        +
        "; + $FORUMEND = " +
        +{GOTOPAGES} +
        + + + + + +
        {MODERATORS}
        {FORUMJUMP}
        {BUTTONS}
        + +
        + + + + +
        {QUICKREPLY}
        + +
        +".LAN_431." +".LAN_432." +".LAN_433." +
        + +
        Powered by e107 Forum System
        +
        "; + $FORUMREPLYSTYLE = " +
        + + + + + + + + + + + + + +
        \n{NEWFLAG}\n{POSTER}\n + + + + + +
        \n{THREADDATESTAMP}\n\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n
        +
        \n{AVATAR}\n\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n\n{POST}\n{SIGNATURE}
        \n\n{TOP}\n\n + + + + + +
        \n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n\n{MODOPTIONS}\n
        +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/lamb/images/bar.jpg b/e107_themes/lamb/images/bar.jpg new file mode 100644 index 000000000..3ed7e6eb2 Binary files /dev/null and b/e107_themes/lamb/images/bar.jpg differ diff --git a/e107_themes/lamb/images/bg.png b/e107_themes/lamb/images/bg.png new file mode 100644 index 000000000..ae565a121 Binary files /dev/null and b/e107_themes/lamb/images/bg.png differ diff --git a/e107_themes/lamb/images/bluearrow.png b/e107_themes/lamb/images/bluearrow.png new file mode 100644 index 000000000..3fcbb4559 Binary files /dev/null and b/e107_themes/lamb/images/bluearrow.png differ diff --git a/e107_themes/lamb/images/bluearrow_greybg.png b/e107_themes/lamb/images/bluearrow_greybg.png new file mode 100644 index 000000000..9eff61443 Binary files /dev/null and b/e107_themes/lamb/images/bluearrow_greybg.png differ diff --git a/e107_themes/lamb/images/boxbottom.png b/e107_themes/lamb/images/boxbottom.png new file mode 100644 index 000000000..3cdfdb285 Binary files /dev/null and b/e107_themes/lamb/images/boxbottom.png differ diff --git a/e107_themes/lamb/images/boxtop.png b/e107_themes/lamb/images/boxtop.png new file mode 100644 index 000000000..35ad76aca Binary files /dev/null and b/e107_themes/lamb/images/boxtop.png differ diff --git a/e107_themes/lamb/images/bullet2.gif b/e107_themes/lamb/images/bullet2.gif new file mode 100644 index 000000000..bdb060645 Binary files /dev/null and b/e107_themes/lamb/images/bullet2.gif differ diff --git a/e107_themes/lamb/images/button.png b/e107_themes/lamb/images/button.png new file mode 100644 index 000000000..c2367c1fa Binary files /dev/null and b/e107_themes/lamb/images/button.png differ diff --git a/e107_themes/lamb/images/comment.png b/e107_themes/lamb/images/comment.png new file mode 100644 index 000000000..c7053dd09 Binary files /dev/null and b/e107_themes/lamb/images/comment.png differ diff --git a/e107_themes/lamb/images/download.png b/e107_themes/lamb/images/download.png new file mode 100644 index 000000000..746c5623d Binary files /dev/null and b/e107_themes/lamb/images/download.png differ diff --git a/e107_themes/lamb/images/email.png b/e107_themes/lamb/images/email.png new file mode 100644 index 000000000..e0cb28edc Binary files /dev/null and b/e107_themes/lamb/images/email.png differ diff --git a/e107_themes/lamb/images/greyarrow.png b/e107_themes/lamb/images/greyarrow.png new file mode 100644 index 000000000..5e0f98cf1 Binary files /dev/null and b/e107_themes/lamb/images/greyarrow.png differ diff --git a/e107_themes/lamb/images/lboxbottom.png b/e107_themes/lamb/images/lboxbottom.png new file mode 100644 index 000000000..64dc3a3f3 Binary files /dev/null and b/e107_themes/lamb/images/lboxbottom.png differ diff --git a/e107_themes/lamb/images/lboxtop.png b/e107_themes/lamb/images/lboxtop.png new file mode 100644 index 000000000..6498d7938 Binary files /dev/null and b/e107_themes/lamb/images/lboxtop.png differ diff --git a/e107_themes/lamb/images/left.png b/e107_themes/lamb/images/left.png new file mode 100644 index 000000000..5b704b1ca Binary files /dev/null and b/e107_themes/lamb/images/left.png differ diff --git a/e107_themes/lamb/images/link.png b/e107_themes/lamb/images/link.png new file mode 100644 index 000000000..19f9f2387 Binary files /dev/null and b/e107_themes/lamb/images/link.png differ diff --git a/e107_themes/lamb/images/logo.png b/e107_themes/lamb/images/logo.png new file mode 100644 index 000000000..6fbb1a898 Binary files /dev/null and b/e107_themes/lamb/images/logo.png differ diff --git a/e107_themes/lamb/images/logo_template.png b/e107_themes/lamb/images/logo_template.png new file mode 100644 index 000000000..1b624838b Binary files /dev/null and b/e107_themes/lamb/images/logo_template.png differ diff --git a/e107_themes/lamb/images/logobg.png b/e107_themes/lamb/images/logobg.png new file mode 100644 index 000000000..0d6524ae8 Binary files /dev/null and b/e107_themes/lamb/images/logobg.png differ diff --git a/e107_themes/lamb/images/nforumcaption.png b/e107_themes/lamb/images/nforumcaption.png new file mode 100644 index 000000000..4988f367d Binary files /dev/null and b/e107_themes/lamb/images/nforumcaption.png differ diff --git a/e107_themes/lamb/images/nforumcaption2.png b/e107_themes/lamb/images/nforumcaption2.png new file mode 100644 index 000000000..815a3d447 Binary files /dev/null and b/e107_themes/lamb/images/nforumcaption2.png differ diff --git a/e107_themes/lamb/images/right.png b/e107_themes/lamb/images/right.png new file mode 100644 index 000000000..c63664c0f Binary files /dev/null and b/e107_themes/lamb/images/right.png differ diff --git a/e107_themes/lamb/index.html b/e107_themes/lamb/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/lamb/languages/English.php b/e107_themes/lamb/languages/English.php new file mode 100644 index 000000000..a5734072f --- /dev/null +++ b/e107_themes/lamb/languages/English.php @@ -0,0 +1,27 @@ +jalist"); +define("LAN_THEME_2", "Comments are turned off for this item"); +define("LAN_THEME_3", "comment: "); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); + + +?> diff --git a/e107_themes/lamb/newforumpost.php b/e107_themes/lamb/newforumpost.php new file mode 100644 index 000000000..dd002be5e --- /dev/null +++ b/e107_themes/lamb/newforumpost.php @@ -0,0 +1,13 @@ +\n
          \n"; + +$NEWFORUMPOSTSTYLE_MAIN = "
        • {THREAD} ".NFPM_LAN_7." {POSTER} [ ".NFPM_LAN_3.": {VIEWS}, ".NFPM_LAN_4.": {REPLIES}, ".NFPM_LAN_5.": {LASTPOST} ]\n\n
        • \n"; + +$NEWFORUMPOSTSTYLE_FOOTER = "
        \n

        \n".NFPM_LAN_6.": {TOTAL_TOPICS} | ".NFPM_LAN_4.": {TOTAL_REPLIES} | ".NFPM_LAN_3.": {TOTAL_VIEWS}"; + + +?> \ No newline at end of file diff --git a/e107_themes/lamb/news_template.php b/e107_themes/lamb/news_template.php new file mode 100644 index 000000000..647bc71eb --- /dev/null +++ b/e107_themes/lamb/news_template.php @@ -0,0 +1,31 @@ + + +{ITEMS1} + +{ITEMS2} + + +"; + + +?> \ No newline at end of file diff --git a/e107_themes/lamb/preview.jpg b/e107_themes/lamb/preview.jpg new file mode 100644 index 000000000..88c7f3801 Binary files /dev/null and b/e107_themes/lamb/preview.jpg differ diff --git a/e107_themes/lamb/style.css b/e107_themes/lamb/style.css new file mode 100644 index 000000000..ae88e68c8 --- /dev/null +++ b/e107_themes/lamb/style.css @@ -0,0 +1,513 @@ + +#mainleft { + margin:0; padding:0; + background: #fff url("images/left.png") top left repeat-y; +} +#mainright { + margin:0; padding:0; + background:url("images/right.png") top right repeat-y; +} +#leftcontent { + width:180px; + margin:0; padding:0; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + background: #f6f4f4; + vertical-align: top; + border-right: 1px solid #000; +} +#rightcontent { + width:180px; + margin:0; padding:0; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + background: #f6f4f4; + vertical-align: top; + border-left: 1px solid #000; +} + +#centercontent { + vertical-align: top; +} + +.menuwrapper { + width: 180px; + margin-left: auto; + margin-right: auto; +} + +.intwrapper { + overflow: scroll; +} + +.columnwrap { + margin:0; padding:0.5em 1em; +} + + +#header { + height: 80px; + width: 100%; + background-repeat: repeat-x; + background-image: url(images/logobg.png); + border-bottom: 1px solid black; +} + +#quote { + position: absolute; + left:6px; + top:60px; + color: #176f8f; +} + +#banner { + position: absolute; + right:6px; + top:10px; +} + +#wm { + voice-family: "\"}\""; + voice-family: inherit; + background: #f3eded url(images/wblogo.png) bottom right no-repeat; + border: 1px solid #ede3e3; + padding: 10px 150px 10px 10px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +#bqtop { + width: 252px; + padding-top: 7px; + background: url(images/boxtop.png) top left no-repeat; + margin-bottom: 15px; +} + +#lbqtop { + width: 450px; + padding-top: 7px; + background: url(images/lboxtop.png) top left no-repeat; + margin-bottom: 15px; +} + +#bqbottom { + background: url(images/boxbottom.png) bottom left no-repeat; + padding-bottom: 7px; + width: 100%; +} + +#lbqbottom { + background: url(images/lboxbottom.png) bottom left no-repeat; + padding-bottom: 7px; + width: 100%; +} + +#bglefright { + padding: 11px 14px 12px 15px; + border-left: 1px solid #DADADA; + border-right: 1px solid #DADADA; +} + +#centre { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +#bqcontent { + margin-left: 4px; +} + +#bqtext { + font-size: 10px; + color: #666; +} + +ul{ + list-style: square; +} + + +#footer { + border-top: 1px solid #000; + width: 100%; +} + +h1 { + font-size: 1.4em; + font-weight: bold; + margin-top: 0em; + margin-bottom: 0em; + color: #ec5800; +} + +h2 { + font: 12px arial, verdana, tahoma, helvetica, sans-serif; + color: #bbb; + text-transform: uppercase; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; +} + +h3 { + font: 12px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; +} + +h4 { + font: 12px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; + background-color: #eae6e6; + padding: 2px; +} + +img { + vertical-align: middle; +} + +.linkspage_button{ + vertical-align: middle; + border:0px; +} + +.dlmain { + font: 20px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; +} + +.dlcat { + font: 14px tahoma, verdana, helvetica, arial, sans-serif; + color: #000; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; + padding: 2px; +} + + + + +hr { + border: 1px dotted #bbb; + height: 1px; + width: 92%; + text-align:center; +} + +.smalltext { + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.bodytable { + padding: 2px; + font: 0.8em verdana, tahoma, arial, helvetica, sans-serif; + color: #000; +} + +.button { + border: #000 1px solid; + color: #000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} + +.button a { + color: #000; +} +.button a:hover { + color: #0085b0; +} + +body { + font-size: 12px; + color: #000; + font-family: tahoma, verdana, arial, sans-serif; + background-color: #fff; + margin:0px; + padding:0px; + text-align:left +} +a { + color: #0085b0; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} +a:hover { + color: #616060; + font-family: verdana, arial, sans-serif; + text-decoration: underline; +} + +.smallblacktext { + background: none; + font: 10px tahoma, verdana, arial, helvetica, sans-serif; + color:#000; +} +.indent{ + padding: 10px 10px 10px 10px; + margin: 5px; + font: 9px verdana, tahoma, arial, sans-serif; + color: #838387; + border: 1px solid #d6d6d6; +} +.defaulttext { + background: none; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} + +td { + font: 11px tahoma, verdana, arial, helvetica, sans-serif; + color:#5d6e75; + padding: 0px; + text-align:left; +} + +blockquote { + font-family: verdana, tahoma, arial, helvetica, sans-serif; + color:#7e96ac; + border: 1px solid #d6d6d6; +} +.mediumtext { + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; +} + +.tbox{ + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.tbox.chatbox{ + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + width: 90%; +} + +.nextprev{ + background-color: #eaeef2; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + padding : 2px; + text-align: right; +} + +form { + margin: 2px 0px 0px 0px; +} +.spacer { + padding: 2px 0 2px 0; +} + +.cspacer { + padding: 6px 0 6px 0; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.border { + border: #999 1px solid; + background-color: #F0F1F1; + padding: 2px; +} + + +p { + margin-top: 0px +} + +.fborder { + border: #c1c1c1 1px solid; +} +.forumheader{ + background-color: #f3f3f7; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: 1px solid #ececf2; +} + +.forumheader2{ + background-color: #EFEFEF; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} + +.forumheader3{ + background-color: #f3f3f7; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #ececf2 1px solid; +} + +.forumborder{ + border: #000080 1px solid; +} + +.fcaption { + border: #f0f2f4 1px solid; + padding: 2px 0 2px 0; + background-color: #f9fafb; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#616060; +} + +.finfobar{ + background-color: #CCC8C8; + color:#000; + padding: 4px; + border: 1px solid #C3BDBD; + font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif +} + +.helpbox { + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + border: 0px none red; + background-color: transparent; +} + +.nforumholder { + border: 1px solid #345487; + padding: 0px; + background-color: #fff; +} + +.nforumcaption { + background-image: url(images/nforumcaption.png); + padding: 8px 4px 8px 4px; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color: #fff; +} + +.nforumcaption2 { + background-image: url(images/nforumcaption2.png); + padding: 8px 0px 8px 4px; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #000; + font-weight: bold; +} + +.nforumcaption3 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread { + border: 1px solid #fff; + padding: 4px; + background-color: #EEF2F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumthread2 { + border: 1px solid #fff; + padding: 4px; + background-color: #D1DCEB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreplycaption { + border: 1px solid #fff; + padding: 4px; + background-color: #E2EDF2; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply { + border: 1px solid #fff; + padding: 4px; + background-color: #EDF4F7; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumreply2 { + border: 1px solid #fff; + padding: 4px; + background-color: #CFE0EB; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} +.nforumdisclaimer { + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color:#5d6e75; +} + +.nforumview1 { + border: 1px solid #fff; + padding: 4px; + background-color: #E4EAF2; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview2 { + border: 1px solid #fff; + padding: 4px; + background-color: #DFE6EF; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; +} + +.nforumview3 { + padding: 4px; + background-color: #BCD0ED; + font: 10px verdana, tahoma, arial, helvetica, sans-serif; + color: #263448; +} + +.nforumview4 { + padding: 4px; + background-color: #E4EAF2; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + color: #3A4F6C; +} + +a.forumlink{ + color: #fff; + text-decoration: none; +} + +a.forumlink:hover { + color: #bbb; + text-decoration: underline; +} + +.treeclass1 { + background-color: #F4F7FA; + border: #5e5d63 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding: 2px 0px 2px 2px; +} + +.treeclass2 { + background-color: #F4F7FA; + border: #000 1px solid; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding: 2px 0px 2px 2px; +} + +.treeclass3 { + background-color: #F4F7FA; + color: #000000; + font: 9px verdana, tahoma, arial, helvetica, sans-serif; + padding: 1px; + width: 100%; +} \ No newline at end of file diff --git a/e107_themes/lamb/theme.php b/e107_themes/lamb/theme.php new file mode 100644 index 000000000..a757a67d1 --- /dev/null +++ b/e107_themes/lamb/theme.php @@ -0,0 +1,168 @@ +".LAN_THEME_1.""); + +// [layout] + +$layout = "_default"; + +$HEADER = " + + + + + + + +
        + + +
        +"; + +$FOOTER = " +
        +
        + +
        + +"; + +$NEWSSTYLE = " +

        +{STICKY_ICON} +{NEWSICON}  +{NEWSTITLE} +

        +
        +{NEWSBODY} +{EXTENDED} +
        +
        +{NEWSAUTHOR} +on +{NEWSDATE} +
        + +{NEWSCOMMENTS}{TRACKBACK} +
        +
        "; +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", LAN_THEME_3); +define("COMMENTOFFSTRING", LAN_THEME_2); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " | "); + + +// [linkstyle] + +define('PRELINK', ""); +define('POSTLINK', ""); +define('LINKSTART', " "); +define("LINKSTART_HILITE", " "); +define('LINKEND', "
        "); +define('LINKDISPLAY', 2); +define('LINKALIGN', "left"); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode) +{ + echo "

        {$caption}

        \n
        + {$text} +

        \n"; +} + +$COMMENTSTYLE = " + + + + + +
        {USERNAME} @ {TIMEDATE}
        {AVATAR}{REPLY}
        +
        +
        +
        +
        +
        +
        +{COMMENT} {COMMENTEDIT} +
        {IPADDRESS}
        +
        +
        +
        +
        +
        +
        +
        +"; + +$CHATBOXSTYLE = " + +{USERNAME} +
        +{MESSAGE} +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/leaf/bluehigh.ttf b/e107_themes/leaf/bluehigh.ttf new file mode 100644 index 000000000..14d45c5a1 Binary files /dev/null and b/e107_themes/leaf/bluehigh.ttf differ diff --git a/e107_themes/leaf/fontstyles/large.css b/e107_themes/leaf/fontstyles/large.css new file mode 100644 index 000000000..43cf6d620 --- /dev/null +++ b/e107_themes/leaf/fontstyles/large.css @@ -0,0 +1,11 @@ +/*THIS IS THE STYLESHEET FOR LARGE SIZED TEXT SIZE*/ +/*Increase font sizes +2px from original CSS*/ +body, h4, .formfield, .formbutton{ + font-size: 13px; +} +h3{ + font-size: 16px; +} +#credits, .c_commentinfo{ + font-size: 12px; +} \ No newline at end of file diff --git a/e107_themes/leaf/fontstyles/medium.css b/e107_themes/leaf/fontstyles/medium.css new file mode 100644 index 000000000..5664c5fb3 --- /dev/null +++ b/e107_themes/leaf/fontstyles/medium.css @@ -0,0 +1,11 @@ +/*THIS IS THE STYLESHEET FOR MEDIUM SIZED TEXT SIZE*/ +/*Increase font sizes +1px from original CSS*/ +body, h4, .formfield, .formbutton{ + font-size: 12px; +} +h3{ + font-size: 15px; +} +#credits, .c_commentinfo{ + font-size: 11px; +} \ No newline at end of file diff --git a/e107_themes/leaf/images/01_bg.gif b/e107_themes/leaf/images/01_bg.gif new file mode 100644 index 000000000..93421f38a Binary files /dev/null and b/e107_themes/leaf/images/01_bg.gif differ diff --git a/e107_themes/leaf/images/01_bodybg.jpg b/e107_themes/leaf/images/01_bodybg.jpg new file mode 100644 index 000000000..a830c54ce Binary files /dev/null and b/e107_themes/leaf/images/01_bodybg.jpg differ diff --git a/e107_themes/leaf/images/01_font1.gif b/e107_themes/leaf/images/01_font1.gif new file mode 100644 index 000000000..a39ef10bf Binary files /dev/null and b/e107_themes/leaf/images/01_font1.gif differ diff --git a/e107_themes/leaf/images/01_font2.gif b/e107_themes/leaf/images/01_font2.gif new file mode 100644 index 000000000..941a2ed2c Binary files /dev/null and b/e107_themes/leaf/images/01_font2.gif differ diff --git a/e107_themes/leaf/images/01_font3.gif b/e107_themes/leaf/images/01_font3.gif new file mode 100644 index 000000000..b30fbe5d1 Binary files /dev/null and b/e107_themes/leaf/images/01_font3.gif differ diff --git a/e107_themes/leaf/images/01_footer.jpg b/e107_themes/leaf/images/01_footer.jpg new file mode 100644 index 000000000..f45ced7df Binary files /dev/null and b/e107_themes/leaf/images/01_footer.jpg differ diff --git a/e107_themes/leaf/images/01_hdot.gif b/e107_themes/leaf/images/01_hdot.gif new file mode 100644 index 000000000..ec4c9d49b Binary files /dev/null and b/e107_themes/leaf/images/01_hdot.gif differ diff --git a/e107_themes/leaf/images/01_header01.jpg b/e107_themes/leaf/images/01_header01.jpg new file mode 100644 index 000000000..dfeec0c9d Binary files /dev/null and b/e107_themes/leaf/images/01_header01.jpg differ diff --git a/e107_themes/leaf/images/01_header02.jpg b/e107_themes/leaf/images/01_header02.jpg new file mode 100644 index 000000000..1d6a134c5 Binary files /dev/null and b/e107_themes/leaf/images/01_header02.jpg differ diff --git a/e107_themes/leaf/images/01_header03.jpg b/e107_themes/leaf/images/01_header03.jpg new file mode 100644 index 000000000..b63d2f3e3 Binary files /dev/null and b/e107_themes/leaf/images/01_header03.jpg differ diff --git a/e107_themes/leaf/images/01_header04.jpg b/e107_themes/leaf/images/01_header04.jpg new file mode 100644 index 000000000..2e5baa394 Binary files /dev/null and b/e107_themes/leaf/images/01_header04.jpg differ diff --git a/e107_themes/leaf/images/01_item1.gif b/e107_themes/leaf/images/01_item1.gif new file mode 100644 index 000000000..a5b34fe32 Binary files /dev/null and b/e107_themes/leaf/images/01_item1.gif differ diff --git a/e107_themes/leaf/images/01_item2.gif b/e107_themes/leaf/images/01_item2.gif new file mode 100644 index 000000000..2780947fb Binary files /dev/null and b/e107_themes/leaf/images/01_item2.gif differ diff --git a/e107_themes/leaf/images/01_item3.gif b/e107_themes/leaf/images/01_item3.gif new file mode 100644 index 000000000..c4ce0043b Binary files /dev/null and b/e107_themes/leaf/images/01_item3.gif differ diff --git a/e107_themes/leaf/images/01_linkbg1.gif b/e107_themes/leaf/images/01_linkbg1.gif new file mode 100644 index 000000000..d971439c2 Binary files /dev/null and b/e107_themes/leaf/images/01_linkbg1.gif differ diff --git a/e107_themes/leaf/images/01_linkbg2.gif b/e107_themes/leaf/images/01_linkbg2.gif new file mode 100644 index 000000000..c7f875075 Binary files /dev/null and b/e107_themes/leaf/images/01_linkbg2.gif differ diff --git a/e107_themes/leaf/images/01_logo.gif b/e107_themes/leaf/images/01_logo.gif new file mode 100644 index 000000000..2f2d9f342 Binary files /dev/null and b/e107_themes/leaf/images/01_logo.gif differ diff --git a/e107_themes/leaf/images/01_m_comment.gif b/e107_themes/leaf/images/01_m_comment.gif new file mode 100644 index 000000000..37320df98 Binary files /dev/null and b/e107_themes/leaf/images/01_m_comment.gif differ diff --git a/e107_themes/leaf/images/01_m_default.gif b/e107_themes/leaf/images/01_m_default.gif new file mode 100644 index 000000000..ca2598b33 Binary files /dev/null and b/e107_themes/leaf/images/01_m_default.gif differ diff --git a/e107_themes/leaf/images/01_m_news.gif b/e107_themes/leaf/images/01_m_news.gif new file mode 100644 index 000000000..27682bcc5 Binary files /dev/null and b/e107_themes/leaf/images/01_m_news.gif differ diff --git a/e107_themes/leaf/images/01_mountaintop2.gif b/e107_themes/leaf/images/01_mountaintop2.gif new file mode 100644 index 000000000..cb312fc37 Binary files /dev/null and b/e107_themes/leaf/images/01_mountaintop2.gif differ diff --git a/e107_themes/leaf/images/01_quote.gif b/e107_themes/leaf/images/01_quote.gif new file mode 100644 index 000000000..fd48515a0 Binary files /dev/null and b/e107_themes/leaf/images/01_quote.gif differ diff --git a/e107_themes/leaf/images/01_s_about.gif b/e107_themes/leaf/images/01_s_about.gif new file mode 100644 index 000000000..e5a52e902 Binary files /dev/null and b/e107_themes/leaf/images/01_s_about.gif differ diff --git a/e107_themes/leaf/images/01_s_categories.gif b/e107_themes/leaf/images/01_s_categories.gif new file mode 100644 index 000000000..72c9fb7b6 Binary files /dev/null and b/e107_themes/leaf/images/01_s_categories.gif differ diff --git a/e107_themes/leaf/images/01_s_chatbox.gif b/e107_themes/leaf/images/01_s_chatbox.gif new file mode 100644 index 000000000..455920f8a Binary files /dev/null and b/e107_themes/leaf/images/01_s_chatbox.gif differ diff --git a/e107_themes/leaf/images/01_s_default.gif b/e107_themes/leaf/images/01_s_default.gif new file mode 100644 index 000000000..f8be0904e Binary files /dev/null and b/e107_themes/leaf/images/01_s_default.gif differ diff --git a/e107_themes/leaf/images/01_s_latestcomment.gif b/e107_themes/leaf/images/01_s_latestcomment.gif new file mode 100644 index 000000000..b13403681 Binary files /dev/null and b/e107_themes/leaf/images/01_s_latestcomment.gif differ diff --git a/e107_themes/leaf/images/01_s_links.gif b/e107_themes/leaf/images/01_s_links.gif new file mode 100644 index 000000000..eaec2038c Binary files /dev/null and b/e107_themes/leaf/images/01_s_links.gif differ diff --git a/e107_themes/leaf/images/01_s_login.gif b/e107_themes/leaf/images/01_s_login.gif new file mode 100644 index 000000000..a6aa07500 Binary files /dev/null and b/e107_themes/leaf/images/01_s_login.gif differ diff --git a/e107_themes/leaf/images/01_s_online.gif b/e107_themes/leaf/images/01_s_online.gif new file mode 100644 index 000000000..fbcf003ce Binary files /dev/null and b/e107_themes/leaf/images/01_s_online.gif differ diff --git a/e107_themes/leaf/images/01_s_search.gif b/e107_themes/leaf/images/01_s_search.gif new file mode 100644 index 000000000..965d1f412 Binary files /dev/null and b/e107_themes/leaf/images/01_s_search.gif differ diff --git a/e107_themes/leaf/images/bullet2.gif b/e107_themes/leaf/images/bullet2.gif new file mode 100644 index 000000000..f81aee1f0 Binary files /dev/null and b/e107_themes/leaf/images/bullet2.gif differ diff --git a/e107_themes/leaf/index.html b/e107_themes/leaf/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/leaf/languages/English.php b/e107_themes/leaf/languages/English.php new file mode 100644 index 000000000..bb811a131 --- /dev/null +++ b/e107_themes/leaf/languages/English.php @@ -0,0 +1,30 @@ + diff --git a/e107_themes/leaf/links.sc b/e107_themes/leaf/links.sc new file mode 100644 index 000000000..45b05e28c --- /dev/null +++ b/e107_themes/leaf/links.sc @@ -0,0 +1,15 @@ + +$links =""; + +return $links; diff --git a/e107_themes/leaf/preview.png b/e107_themes/leaf/preview.png new file mode 100644 index 000000000..b65d5bdfd Binary files /dev/null and b/e107_themes/leaf/preview.png differ diff --git a/e107_themes/leaf/style.css b/e107_themes/leaf/style.css new file mode 100644 index 000000000..8b299a5e5 --- /dev/null +++ b/e107_themes/leaf/style.css @@ -0,0 +1,743 @@ +/*This is the LEAF skin, made by Ivan for Nucleus CMS*/ +/*I am not a pro in CSS - If you are one and if you think it can be done better, by all means go ahead and adjust to your needs*/ +/*I've tried my best to comment on most of the styles*/ + +/*BASIC STUFF*/ +a:link, a:visited{ + color: #23598C; + text-decoration: none; +} +a:hover, a:active{ + color: black; +} + +img{ + border: none; +} + +.linkspage_button{ + border:0px; +} + +td{ + text-align:left; +} + +/*This is used for hidden stuff, stuff that you don't want people to see with CSS enabled*/ +/*Try disabling CSS and you'll see some messages that you don't see with CSS enabled*/ +.hidden{ + display: none; +} + +/*Use this to centerize any image/text*/ +.centerize{ + text-align: center; +} + +/* MAIN STRUCTURE */ +/*Don't edit if you know what's good for you*/ +body{ + color: #4C4C4C; + font-size: 11px; + font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif; + background: #123454 url(images/01_bg.gif) top repeat-x; + padding: 20px 0 20px 0; + text-align: center; +} +#wrapper{ + width: 700px; + margin: auto; + background: white url(images/01_bodybg.jpg) repeat-y; + text-align: left; +} + +/*The header image*/ +#header{ + position: relative; + width: 700px; + height: 151px; + margin: auto; + background: url(images/01_header01.jpg) no-repeat; +} + +/*The container - edit "230" to your desired width for the sidebar (lines 55, 58, 62)*/ +#container{ + /* width: 100%; */ + float: left; + margin-right: -230px; + width: 670px; +} +#content{ + margin-right: 230px; + padding: 25px 0; +} +#sidebar{ + width: 230px; + float: right; + padding: 25px 0; + text-align: left; +} +#footer{ + width: 700px; + margin: auto; + padding: 20px 0 0 0; + background: url(images/01_footer.jpg) top no-repeat; +} + +/* The container - custom page layout. resize adjustments for full screen */ +#container_full{ + /* width: 100%; */ + float: left; + margin-right: 0px; + /* -230 */ + width: 700px; +} +#content_full{ + /* margin-right: 230px; */ + padding: 25px 0; +} +#sidebar_full{ + width: 230px; + float: right; + padding: 25px 0; + text-align: left; + display:none; +} + +/*Credits part is where the copyrights/xhtml/css validation stuff will be*/ +#credits{ + font-size: 10px; + text-align: center; + color: #F7F7F7; +} +#credits a:link, #credits a:visited{ + color: #CFE6FD; +} +#credits a:hover, #credits a:active{ + color: white; +} +/*Ignore this*/ +.clearing{ + height: 0; + clear: both; +} +.smalltext{ + color:#fff; +} +#wrapper .smalltext{ + color:#000; +} + +/*THE MAIN TITLE - YOUR BLOG NAME ON TOP OF THE HEADER*/ +#header h1{ + position: absolute; + top: 16px; + left: 24px; + height:35px; + font-size: 20px; + line-height: 20px; + margin: 0; + text-indent: 35px; + background: url(images/01_logo.gif) bottom left no-repeat; + + + +} + +/*THE NAVIGATION - More detailed stuff in NAVIGATION LINKS section*/ +#navigation{ + font-size: 11px; + width: 694px; + height: 22px; + position: absolute; + top: 129px; + left: 3px; + list-style: none; +} +#navigation ul{ + list-style: none; + padding: 0; + margin: 0; +} +#navigation li{ + background: none; + display: inline; +} + +/* THE DEFAULT HEADERS (h2: Main titles, h3: Blog and Sidebar titles, h4: Comment names/userlinks)*/ +h2{ + color: #3E565F; + margin: 0 0 3px 0; + font-size: 16px; + height: 23px; + margin: 0 0 5px 0; +} +h3{ + color: #3E565F; + margin: 0 0 8px 0; + font-size: 14px; +} +h4{ + font-size: 11px; +} + +/*Sub structure - To create the margins of the body (where text will be placed)*/ +.contentdiv{ + margin: 0 15px 0 22px; +} +.sidebardiv{ + margin: 0 22px 0 15px; +} + + +/* THE STYLING OF THE BODY OF CONTENTS AND SIDEBAR */ +.contentbody{ + margin: 0; + padding: 0 0 0 0; + text-align: justify; +} +.sidebarbody{ + margin: 0 0 20px 0; + padding: 0; +} + +/* THIS PART IS THE SIDEBAR'S INDIVIDUAL DIVS */ +/* Note that it doesn't have any styling, but it's here in case you want to add some styles */ +.sidebarin{ + padding: 0; + margin: 0; +} + +/*MAIN TITLES*/ +h2{ + height: 23px; + text-indent: 20px; + margin: 0 0 5px 0; + background: url(images/01_m_default.gif) no-repeat; +} + +/*You can remove all parts here if you do not wish to use images as your main titles*/ +h2.news{ + text-indent: -9999px; + background: url(images/01_m_news.gif) no-repeat; +} +h2.comment{ + text-indent: -9999px; + background: url(images/01_m_comment.gif) no-repeat; +} + +/* THIS PART IS TO STYLE THE BACKGROUND IMAGES (THE QUOTE ON THE LEFT) */ +/* You can create different image on your on, but only if you know what you're doing should you edit this part */ +/* +.divweblog .contentbody, .divarchives .contentbody, .divarchivelist .contentbody, .diverror .contentbody, .divmemberinfo .contentbody, +.divsendmessage .contentbody, .divcommentitem .contentbody, .divsearch .contentbody{ + background: url(images/01_quote.gif) 0 3px no-repeat; +} +*/ + +/* comments page is special */ +.divcomment{ + margin: 0; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} + +/* content pages */ +.divcontent .contentbody{ + margin: 0; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} +.divcontent_manager .contentbody{ + margin: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} + +/* special e107 page */ +.divcvs .contentbody{ + margin: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_cvs.gif) 0 3px no-repeat; */ +} + +/* downloads */ +.divdownload .contentbody{ + margin: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_download.gif) 0 3px no-repeat; */ +} + +/* forums */ +.divforum .contentbody{ + margin: 0; + /* padding: 0 0 10px 10px; */ + text-align: justify; + /* background: url(images/01_forum.gif) 0 3px no-repeat; */ +} +.divforum_viewforum .contentbody{ + margin: 0; + /* padding: 0 0 10px 10px; */ + text-align: justify; + /* background: url(images/01_forum.gif) 0 3px no-repeat; */ +} + +.divforum_viewtopic .contentbody{ + margin: 0; + /* padding: 0 0 10px 10px; */ + text-align: justify; + /* background: url(images/01_forum.gif) 0 3px no-repeat; */ +} + +/* links */ +.divlinks .contentbody{ + margin: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} + +.divnews .contentbody{ + margin: 0; + padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; +} + +.divsubmitnews .contentbody{ + margin: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} +/* user pages */ +.divuser .contentbody{ + margin: 0; + padding: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} +.divusersettings .contentbody{ + margin: 0; + text-align: justify; + /* padding: 0 0 30px 43px; + text-align: justify; + background: url(images/01_quote.gif) 0 3px no-repeat; */ +} + + + +/* Add comment form's background */ +.divaddcomment .contentbody{ + /* background: url(images/01_quote3.gif) 0 3px no-repeat; */ +} + +/*MORE DETAILED STUFF - Item details of your blog items */ +.itemdetails{ + text-align: right; + padding: 5px 0 0 0; + background: url(images/01_hdot.gif) top repeat-x; +} + +/* used in the newsstyle */ +/* Posted by */ +.item1{ + padding: 0 0 0 13px; + margin: 0 0 0 12px; + background: url(images/01_item1.gif) 0 1px no-repeat; +} +/* Category */ +.item2{ + padding: 0 0 0 13px; + margin: 0 0 0 12px; + background: url(images/01_item2.gif) 0 3px no-repeat; +} +/* Comments */ +.item3{ + padding: 0 0 0 15px; + margin: 0 0 0 12px; + background: url(images/01_item3.gif) 0 3px no-repeat; +} +.item4{ + padding: 0 0 0 15px; + margin: 0 0 0 12px; +} +.item5{ + padding: 0 0 0 15px; + margin: 0 0 0 12px; +} +/*FORM STYLING*/ +form{ + margin: 0; + text-align: center; +} +form p{ + padding: 1em; + text-align: left; +} +/*Styling for all form fields*/ + +/*Form fields on focus effect (when user click on that input field)*/ +.formfield:focus{ + border: 1px solid black; +} +/*Form's buttons*/ +.formbutton{ + font-size: 11px; + font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif; + margin: 1px 0 0 0; + padding: 1px 10px; + color: #494949; + background: white; + border-top: 1px solid #D4D2CF; + border-left: 1px solid #D4D2CF; + border-bottom: 1px solid #868686; + border-right: 1px solid #868686; +} +/* Don't show textarea scrollbar on IE */ +textarea{ + overflow: hidden; +} + + +/* STYLING OF MENU TITLES */ + +h3{ /* default styleing for menu items, do not remove */ + height: 23px; + text-indent: 17px; + margin: 0 0 2px 0; + background: url(images/01_m_default.gif) no-repeat; +} + +h3.news{ /* remove background image from h3 in news posts */ + background: none; +} + + +/* You can remove all parts here if you do not wish to use images as your side titles */ + +h3.about { + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_about.gif) no-repeat; +} + +h3.login{ + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_login.gif) no-repeat; +} + +h3.categories { + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_categories.gif) no-repeat; +} +h3.search{ + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_search.gif) no-repeat; +} + +h3.links{ + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_links.gif) no-repeat; +} + +h3.online { + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_online.gif) no-repeat; +} + +h3.chatbox { + height: 23px; + text-indent: -9999px; + margin: 0 0 2px 0; + background: url(images/01_s_chatbox.gif) no-repeat; +} + +.compliance{ + +} + + + + +/* Sidbar menu content styles */ + +.defaultform{ + width: 174px; + background: #E2EDF0 url(images/01_mountaintop2.gif) top no-repeat; + padding:4px; +} + +/*THE LIST STYLES*/ +ul{ + list-style: none; + padding: 0; + margin: 0; +} +li{ + padding: 0 0 0 9px; + margin: 0 0 2px 0; + background: url(images/01_arrow.gif) 0 6px no-repeat; +} + +/*THE SEARCH HIGHLIGHT*/ +.highlight{ + font-weight: bold; + text-decoration: underline; +} + +/* NAVIGATION LINKS */ +.nav1 a:link, .nav1 a:visited, .nav2 a:link, .nav2 a:visited, .nav3 a:link, .nav3 a:visited, .nav4 a:link, .nav4 a:visited, .nav5 a:link, .nav5 a:visited, .nav6 a:link, .nav6 a:visited, .nav7 a:link, .nav7 a:visited, .nav8 a:link, .nav8 a:visited{ + color: #4E4E4E; + width: 80px; + height: 20px; + line-height: 20px; + background: url(images/01_linkbg2.gif) top repeat-y; + padding: 0; +} +.nav1_onpage a:link, .nav1_onpage a:visited, .nav2_onpage a:link, .nav2_onpage a:visited, .nav3_onpage a:link, .nav3_onpage a:visited, .nav4_onpage a:link, .nav4_onpage a:visited, .nav5_onpage a:link, .nav5_onpage a:visited, .nav6_onpage a:link, .nav6_onpage a:visited, .nav7_onpage a:link, .nav7_onpage a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{ + color: #4E4E4E; + width: 80px; + height: 20px; + line-height: 20px; + background: url(images/01_linkbg2.gif) top repeat-y; + padding: 0; +} +.nav1 a:link, .nav1 a:visited, .nav1_onpage a:link, .nav1_onpage a:visited{ + position: absolute; + top: 2px; + left: 14px; +} +.nav2 a:link, .nav2 a:visited, .nav2_onpage a:link, .nav2_onpage a:visited{ + position: absolute; + top: 2px; + left: 96px; +} +.nav3 a:link, .nav3 a:visited, .nav3_onpage a:link, .nav3_onpage a:visited{ + position: absolute; + top: 2px; + left: 178px; +} +.nav4 a:link, .nav4 a:visited, .nav4_onpage a:link, .nav4_onpage a:visited{ + position: absolute; + top: 2px; + left: 260px; +} +.nav5 a:link, .nav5 a:visited, .nav5_onpage a:link, .nav5_onpage a:visited{ + position: absolute; + top: 2px; + left: 342px; +} +.nav6 a:link, .nav6 a:visited, .nav6_onpage a:link, .nav6_onpage a:visited{ + position: absolute; + top: 2px; + left: 424px; +} +.nav7 a:link, .nav7 a:visited, .nav7_onpage a:link, .nav7_onpage a:visited{ + position: absolute; + top: 2px; + left: 506px; +} +.nav8 a:link, .nav8 a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{ + position: absolute; + top: 2px; + left: 588px; +} + +/*HOVER EFFECTS*/ +.nav1 a:hover, .nav1 a:active, +.nav2 a:hover, .nav2 a:active, +.nav3 a:hover, .nav3 a:active, +.nav4 a:hover, .nav4 a:active, +.nav5 a:hover, .nav5 a:active, +.nav6 a:hover, .nav6 a:active, +.nav7 a:hover, .nav7 a:active, +.nav8 a:hover, .nav8 a:active{ + background: url(images/01_linkbg1.gif) top repeat-y; + margin: 1px 0 0 0; +} + +/*USE A DIFFERENT COLOR WHEN USER IS ON THAT PAGE*/ + +.nav1_onpage a:link, .nav1_onpage a:visited, +.nav2_onpage a:link, .nav2_onpage a:visited, +.nav3_onpage a:link, .nav3_onpage a:visited, +.nav4_onpage a:link, .nav4_onpage a:visited, +.nav5_onpage a:link, .nav5_onpage a:visited, +.nav6_onpage a:link, .nav6_onpage a:visited, +.nav7_onpage a:link, .nav7_onpage a:visited, +.nav8_onpage a:link, .nav8_onpage a:visited{ + background: url(images/01_linkbg1.gif) top repeat-y; +} + +/*THE FOLLOWING PART IS FOR THE FONT CONTROL*/ +#fontcontrol{ + background: none; + width: 66px; + height: 18px; + position: absolute; + top: 18px; + left: 615px; +} +#fontcontrol ul{ + background: none; + list-style: none; + padding: 0; + margin: 0; +} +#fontcontrol li{ + background: none; +} +#fontcontrol i{ + display: block; + visibility: hidden; +} +.font1 a:link, .font1 a:visited{ + width: 18px; + height: 18px; + position: absolute; + top: 0; + left: 0; + background: url(images/01_font1.gif) no-repeat; +} +.font2 a:link, .font2 a:visited{ + width: 18px; + height: 18px; + position: absolute; + top: 0; + left: 22px; + background: url(images/01_font2.gif) no-repeat; +} +.font3 a:link, .font3 a:visited{ + width: 18px; + height: 18px; + position: absolute; + top: 0; + left: 44px; + background: url(images/01_font3.gif) no-repeat; +} +.font1 a:hover, .font1 a:active{ + background-position: 0 -18px; +} +.font2 a:hover, .font2 a:active{ + background-position: 0 -18px; +} +.font3 a:hover, .font3 a:active{ + background-position: 0 -18px; +} +/*END NAVIGATION LINKS*/ + +/*Nice Titles*/ +.nicetitle { + font-weight: bold; + color: #3C3C3C; + text-align: left; + position: absolute; + left: 0; + top: 0; + width: 25em; + z-index: 20; + max-width: 50%; +} +.nicetitle-content{ + overflow: hidden; + background: white; + border: 1px solid #333; + padding: 5px; + opacity: 0.9; +} +.nicetitle p{ + margin: 0; + line-height: 120%; +} +.nicetitle p.destination { + font-weight: normal; + font-size: 10px; + color: #5E7743; +} +div.nicetitle p span.accesskey { + color: #FF7200; +} + +/* e107 core style */ +.tbox, .helpbox{ + /* width: 80%; */ + font-size: 11px; + font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif; + margin: 0 0 2px 0; + color: #494949; + border-top: 1px solid #868686; + border-left: 1px solid #868686; + border-bottom: 1px solid #D4D2CF; + border-right: 1px solid #D4D2CF; +} +.button{ + font-size: 11px; + font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif; + margin: 1px 0 0 0; + padding: 1px 10px; + color: #494949; + background: white; + border-top: 1px solid #D4D2CF; + border-left: 1px solid #D4D2CF; + border-bottom: 1px solid #868686; + border-right: 1px solid #868686; +} +#commentform .tbox, #commentform .helpbox{ + /* width: 400px; + background-color:#000; */ +} + + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 4px; + background-color: #fff; + border: 1px solid #D4DCDE; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #E2EDF0; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #fff; +} + +table { + margin-left: auto; + margin-right: auto; +} + + diff --git a/e107_themes/leaf/theme.js b/e107_themes/leaf/theme.js new file mode 100644 index 000000000..161b24548 --- /dev/null +++ b/e107_themes/leaf/theme.js @@ -0,0 +1,524 @@ +function setActiveStyleSheet(title) { + var i, a, main; + for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { + a.disabled = true; + if(a.getAttribute("title") == title) a.disabled = false; + } + } +} + +function getActiveStyleSheet() { + var i, a; + for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); + } + return null; +} + +function getPreferredStyleSheet() { + var i, a; + for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("rel").indexOf("alt") == -1 + && a.getAttribute("title") + ) return a.getAttribute("title"); + } + return null; +} + +function createCookie(name,value,days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + } + else expires = ""; + document.cookie = name+"="+value+expires+"; path=/"; +} + +function readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return null; +} + +window.onload = function(e) { + var cookie = readCookie("style"); + var title = cookie ? cookie : getPreferredStyleSheet(); + setActiveStyleSheet(title); +} + +window.onunload = function(e) { + var title = getActiveStyleSheet(); + createCookie("style", title, 365); +} + +var cookie = readCookie("style"); +var title = cookie ? cookie : getPreferredStyleSheet(); +setActiveStyleSheet(title); + + + +// from http://www.kryogenix.org +// by Scott Andrew - http://scottandrew.com +// add an eventlistener to browsers that can do it somehow. +function addEvent(obj, evType, fn) + { + if (obj.addEventListener) + { + obj.addEventListener(evType, fn, false); + return true; + } + else if (obj.attachEvent) + { + var r = obj.attachEvent('on'+evType, fn); + return r; + } + else + { + return false; + } + } + +function floatImages() + { + // adapted from http://www.dithered.com/javascript/browser_detect/ + //**************************************************************// + // sniff user agent + var userAgent = navigator.userAgent.toLowerCase(); + + // if Mozilla 1.4 then quit + if ((userAgent.indexOf('gecko') != -1) && (userAgent.indexOf('gecko/') + 14 == userAgent.length) && (parseFloat(userAgent.substring(userAgent.indexOf('rv:') + 3)) == '1.4')) return; + + // if Opera then quit + if (document.all && window.Event) return; + //**************************************************************// + + // check this browser can cope with what we want to do + if (!document.getElementById) return; + var blogDiv = document.getElementById('blog'); + if (!blogDiv) return; + if (!blogDiv.offsetWidth) return; + + blogDiv.className = (blogDiv.offsetWidth >= 500) ? "float-images" : "block-images"; + } + +// Blockquote citations + +// Simon Willison's work: +// http://simon.incutio.com/archive/2002/12/20/#blockquoteCitations + +// Also Dunstan Orchard's work: +// http://1976design.com/blog/archive/2003/11/10/updates/ +function blockquoteCite() + { + if (!document.createElementNS) + { + document.createElementNS = function(ns, elt) + { + return document.createElement(elt); + } + } + quotes = document.getElementsByTagName('blockquote'); + for (i = 0; i < quotes.length; i++) + { + var cite = quotes[i].getAttribute('cite'); + // value of cite attribute should only contain URI, not any other + if ((cite) && (cite != '')) + { + newlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); + newlink.setAttribute('href', cite); + newlink.className = 'cite-link'; + newlink.appendChild(document.createTextNode(cite)); + newdiv = document.createElementNS('http://www.w3.org/1999/xhtml', 'cite'); + newdiv.className = 'blockquote-cite'; + newdiv.appendChild(document.createTextNode('Source: ')); + newdiv.appendChild(newlink); + quotes[i].appendChild(newdiv); + quotes[i].removeAttribute('cite'); + } + } + } + +// Ins and Del tags citations +function insdelCite() + { + if (!document.createElementNS) + { + document.createElementNS = function(ns, elt) + { + return document.createElement(elt); + } + } + var insdel = new Array(2); + insdel[0] = document.getElementsByTagName('ins'); + insdel[1] = document.getElementsByTagName('del'); + for (var i=0; i= 0) + { + this.isIE = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + + s = 'Netscape6/'; + if ((i = ua.indexOf(s)) >= 0) + { + this.isNS = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + + // treat any other 'Gecko' browser as NS 6.1. + s = 'Gecko'; + if ((i = ua.indexOf(s)) >= 0) + { + this.isNS = true; + this.version = 6.1; + return; + } + } + +// 2003-11-19 sidesh0w +// set delay vars to emulate normal hover delay +var delay; +var interval = 0.60; + +// this function runs on window load +// it runs through all the links on the page as starts listening for actions +function makeNiceTitles() + { + if (!document.createElement || !document.getElementsByTagName) return; + if (!document.createElementNS) + { + document.createElementNS = function(ns, elt) + { + return document.createElement(elt); + } + } + + // do regular links + if (!document.links) + { + document.links = document.getElementsByTagName('a'); + } + for (var ti=0; ti STD_WIDTH) + { + w = h_pixels; + } + else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels)) + { + w = t_pixels; + } + else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels)) + { + w = h_pixels; + } + else + { + w = STD_WIDTH; + } + + d.style.width = w + 'px'; + + mpos = findPosition(lnk); + mx = mpos[0]; + my = mpos[1]; + + d.style.left = (mx+15) + 'px'; + d.style.top = (my+35) + 'px'; + + if (window.innerWidth && ((mx+w) > window.innerWidth)) + { + d.style.left = (window.innerWidth - w - 25) + 'px'; + } + if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth)) + { + d.style.left = (document.body.scrollWidth - w - 25) + 'px'; + } + + document.getElementsByTagName('body')[0].appendChild(d); + + CURRENT_NICE_TITLE = d; + } + +function hideNiceTitle(e) + { + // 2003-11-19 sidesh0w + // clearTimeout + if (delay) clearTimeout(delay); + if (!document.getElementsByTagName) return; + if (CURRENT_NICE_TITLE) + { + document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE); + CURRENT_NICE_TITLE = null; + } + } + +addEvent(window, "load", floatImages); +addEvent(window, "resize", floatImages); +addEvent(window, "load", blockquoteCite); +addEvent(window, "load", insdelCite); +addEvent(window, "load", noAltTooltip); +addEvent(window, "load", makeNiceTitles); + +// I'm very poor in JavaScript. Please correct me if I'm wrong. + + + + + + + + + diff --git a/e107_themes/leaf/theme.php b/e107_themes/leaf/theme.php new file mode 100644 index 000000000..3e6f6726d --- /dev/null +++ b/e107_themes/leaf/theme.php @@ -0,0 +1,259 @@ +Que, based on the nucleus cms theme by Ivan Fong aka Stanch."; +$xhtmlcompliant = TRUE; +$csscompliant = TRUE; +$no_core_css = TRUE; +$admin_logo = "1"; +$logo = rand(1, 4); + +// [layout] +$layout = "_default"; + +// [theme settings] +define("STANDARDS_MODE", TRUE); +define("IMODE", "lite"); +define("THEME_DISCLAIMER", "
        ".$themeinfo.""); + +// [page defines used for css controll on per page basis] +define("e_PAGE", substr(strrchr($_SERVER['PHP_SELF'], "/"), 1)); +define("e_PAGECLASS", str_replace(substr(strrchr(e_PAGE, "."), 0), "", e_PAGE)); + +// [navigation] +$register_sc[] = 'UL'; + +// [credit links] +$register_sc[] = 'LINKS'; + +// [colorstyle] Used for sidbar menus and forum header background color custimization. +$colorstyle ="E2EDF0"; + + +// [header function] +function theme_head() { + global $logo, $colorstyle; + return " + + + "; +} + + +$HEADER = " + +
        +
        +
        +
        +
        + + ".(e_PAGECLASS == "news" ? "

        ".LAN_THEME_7."

        " : "").""; + + +$FOOTER = " +
        +
        +
        +
        + + +
         
        +
        + +"; + +$CUSTOMHEADER = " + +
        +
        +
        +
        +
        + "; + + +$CUSTOMFOOTER = " +
        +
        +
        +
        +
         
        +
        + +"; + +$CUSTOMPAGES = "content_manager.php signup.php fpw.php forum.php forum_viewforum.php forum_viewtopic.php theme.php usersettings.php submitnews.php"; + +// [newsstyle] +function news_style($news) { + + $mydate = strftime("%d/%m :", $news['news_datestamp']); + $NEWSSTYLE = "
        +

        $mydate  {NEWSTITLE}

        + {NEWSICON} {STICKY_ICON}  + {NEWSBODY} + {EXTENDED} +

        +
        + {NEWSAUTHOR}  + {NEWSCATEGORY}  + {NEWSCOMMENTS}  + {EMAILICON}  + {PRINTICON}  + {PDFICON}  +
        +
        "; + return $NEWSSTYLE; +} + +// [newsliststyle] +$NEWSLISTSTYLE = ""; + +define("ICONSTYLE", "border:0"); +define("COMMENTLINK", LAN_THEME_1); +define("COMMENTOFFSTRING", LAN_THEME_2); +define("EXTENDEDSTRING", LAN_THEME_4); + +// [linkstyle] +define(PRELINK, ""); +define(POSTLINK, ""); +define(LINKSTART, ""); +define(LINKEND, ""); +define(LINKDISPLAY, ""); // 1 - along top, 2 - in left or right column + +// [tablestyle] +function tablestyle($caption, $text, $mode=""){ + global $style; + if(ADMIN){ + // echo "Style: ".$style.", Mode: ".$mode; + } + if($style == "sidebar"){ // sidebar styles + + echo "
        "; + + if($mode){ + if($caption != ""){ + echo "

        ".$caption."

        "; + if($text != ""){ + echo "
        ".$text."
        \n"; + } + }else{ + echo "
        ".$text."
        \n"; + } + }else{ + if($caption != ""){ + echo "

        ".$caption."

        "; + if($text != ""){ + echo "
        ".$text."
        \n"; + } + }else{ + echo "
        ".$text."
        \n"; + } + } + echo "
        \n"; + }else{ + echo "

        ".$caption."

        +
        ".$text."
        "; + } +} + +// [commentstyle] +$COMMENTSTYLE = ""; + +// [chatboxstyle] +$CHATBOXSTYLE = ""; + +?> diff --git a/e107_themes/leaf/ul.sc b/e107_themes/leaf/ul.sc new file mode 100644 index 000000000..1b77be428 --- /dev/null +++ b/e107_themes/leaf/ul.sc @@ -0,0 +1,34 @@ +global $sql, $link_class, $page,$tp; + +$sql -> db_Select('links', '*', "link_category = 1 and link_parent =0 and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC"); +$ulmenu = PRELINK."
          "; +$r="1"; +while($row = $sql -> db_Fetch()){ + if($r <= "8"){ + extract($row); + $link_url = $tp->replaceConstants($link_url,TRUE); + if(!preg_match("#(http:|mailto:|ftp:|https:)#",$link_url)){ + $link_url = e_HTTP.$link_url; + } + if(strpos($link_url, e_PAGE) !== FALSE){ $ulclass = '_onpage'; } else { $ulclass = ''; } + switch ($link_open) { + case 1: + $link_append = " onclick=\"window.open('$link_url'); return false;\""; + break; + case 2: + $link_append = " target=\"_parent\""; + break; + case 3: + $link_append = " target=\"_top\""; + break; + default: + unset($link_append); + } + $lname = (defined(trim($link_name))) ? constant(trim($link_name)) : $link_name; + $ulmenu .= ""; + } + $r++; + +} +$ulmenu .= "
        \n".POSTLINK; +return $ulmenu; \ No newline at end of file diff --git a/e107_themes/newsroom/images/bar.jpg b/e107_themes/newsroom/images/bar.jpg new file mode 100644 index 000000000..ee7cb6164 Binary files /dev/null and b/e107_themes/newsroom/images/bar.jpg differ diff --git a/e107_themes/newsroom/images/bullet2.gif b/e107_themes/newsroom/images/bullet2.gif new file mode 100644 index 000000000..a86d7c146 Binary files /dev/null and b/e107_themes/newsroom/images/bullet2.gif differ diff --git a/e107_themes/newsroom/images/logo_bg.png b/e107_themes/newsroom/images/logo_bg.png new file mode 100644 index 000000000..b5b78745d Binary files /dev/null and b/e107_themes/newsroom/images/logo_bg.png differ diff --git a/e107_themes/newsroom/images/logo_text.png b/e107_themes/newsroom/images/logo_text.png new file mode 100644 index 000000000..e04ee8339 Binary files /dev/null and b/e107_themes/newsroom/images/logo_text.png differ diff --git a/e107_themes/newsroom/index.html b/e107_themes/newsroom/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/newsroom/preview.jpg b/e107_themes/newsroom/preview.jpg new file mode 100644 index 000000000..8546c95b2 Binary files /dev/null and b/e107_themes/newsroom/preview.jpg differ diff --git a/e107_themes/newsroom/style.css b/e107_themes/newsroom/style.css new file mode 100644 index 000000000..720338117 --- /dev/null +++ b/e107_themes/newsroom/style.css @@ -0,0 +1,369 @@ +body { + color: #000; + background-color: #FFFFFF; + margin:0px; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 10px; + font-style: normal; +} + +.header_setup { + margin-left:0px; + margin-right:auto; + padding-left:3px; + padding-right:3px; + width:770px; + background-color:#6A6A6A; + border:1px solid black +} + +a.languagelink:link, a.languagelink:visited { + color:white; +} + +a.languagelink_active:link, a.languagelink_active:visited { + color:white; + text-decoration:underline; +} + +.newscat{ + + +} + +.newscat_table { + width:100%; + margin-bottom:3px +} + +.newscat_link { + text-align:left; + font-size:12px; + color:#fff +} + +.othernews2 { + padding:3px; + background-color:#6A6A6A +} + +td { + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 10px; + font-style: normal; +} + +a:link { + color: #333333; + font-weight: bold; + text-decoration: none; + } + +a:visited { + color: #333333; + font-weight: bold; + text-decoration: none; +} + +a:hover { + color: #333333; + font-weight: bold; + text-decoration: underline; +} + + +a.forumlink{ + color: #fff; + text-decoration: underline; +} + +a.forumlink:visited{ + color: #fff; + text-decoration: underline; +} + +#clock { + font-family: arial, "ms sans serif", sans-serif; +} + +.newsroom { + background-color: #333333; + color: #fff; + cursor: pointer; +} +.newsroom A:link, .newsroom A:visited { + color: #fff; +} +.newsroom A:link, TR .newsroom A:visited { + text-decoration: none; +} + +.newsroomHilite { + background-color: #c00; + color: #fff; + cursor: pointer; +} +.newsroomHilite A:link, .newsroomHilite A:visited { + color: #fff; +} +.newsroomHilite A:link, .newsroomHilite A:visited { + text-decoration: none; +} + + + +.leftcap { + background-color: #ddd; + background-image : url(images/fheader.png); + color: #000; + border-bottom:1px solid black; + border-top:1px solid white; + padding:3px +} + + + + +.newsroomRow { + vertical-align: middle; + border: 1px solid; + border-color: #666666 #003 #003; +} + +.dent { + background-color: #464545; + border-right: none; +} + + + +.newsroomHiliteRow { + vertical-align: middle; + border: 1px solid; + border-color: #f66 #600 #600; +} + +.denthi { + background-color: #f66; + border-right: none; +} + + + + +h3 { + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 16px; + margin: 10px; + line-height: 18px; + padding-left: 5px; + color: #e9ffe9; + } + + + +.smalltext { + background: none; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 10px; + font-style: normal; + color:#000; + text-align: right; +} +.smallblacktext { + background: none; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 10px; + font-style: normal; + color:#000; +} +.defaulttext { + background: none; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 12px; + font-style: normal; + color:#000; +} +.defaultwhitetext { + background: none; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 12px; + font-style: normal; + color:#ffffff; +} +.defaultblacktext { + background: none; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 12px; + font-style: normal; + color:#000; +} +.mediumtext { + background: none; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 11px; + font-style: normal; + color:#000; +} +.captiontext { + background: none; + letter-spacing: 0.4em; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 18px; + color:#5a6f5a; +} +.tbox{ + background-color: #666666; + border: #666666 1px inset; + color: #ffffff; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 10px; +} +.button{ + background-color: #333333; + border: #666666 1px outset; + color: #ffffff; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 9px; + text-align:center; +} +form { + margin: 0px 0px 0px 0px; +} +.spacer{ + padding-bottom : 2px; + padding-left : 0px; + padding-right : 2px; + padding-top : 2px; +} +hr { + border-top: #666 1px solid; + border-bottom: #eee 1px solid; + height: 2px; + width: 92%; + text-align:center; +} +.border { + border-bottom: #000000 1px solid; + border-left: #000000 1px solid; + border-right: #000000 1px solid; + border-top: #000000 1px solid; +} +.caption { + border-bottom: #000000 1px solid; + letter-spacing: 0.2em; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + padding-top: 2px; + background-color: #333333; + color: white; + text-align:left; + text-transform:uppercase; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 11px; +} + +.caption2 { + border-bottom: #000000 1px solid; + letter-spacing: 0.2em; + padding-bottom: 2px; + padding-left: 2px; + padding-right: 2px; + padding-top: 2px; + background-color: #333333; + color: #ffffff; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 10px; +} + +.bodytable { + width:100%; + background-color: #ffffff; + border-bottom: #cccccc 1px solid; + border-left: #cccccc 1px solid; + border-right: #cccccc 1px solid; + border-top: #cccccc 1px solid; + font-family: verdana, arial, "ms sans serif", sans-serif; + font-size: 12px; + font-style: normal; + color:#000; + +} + +.nextprev { + background-color: #E3E1E1; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 11px; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; + text-align:right; +} + +.fborder { + border-bottom: #000000 1px solid; + border-left: #000000 1px solid; + border-right: #000000 1px solid; + border-top: #000000 1px solid; + background-color: #fff; +} + +.forumheader{ + background-color: #EBEFF2; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 14px; + color:#000; + padding: 4px; + background-image : url(images/fheader.png); + border: #C3BDBD 1px solid; +} + +.forumheader2{ + background-color: #EFEFEF; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 14px; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} + +.forumheader3{ + background-color: #E3E1E1; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 11px; + color:#000; + padding: 4px; + border: #C3BDBD 1px solid; +} + + + +.fcaption { + text-align:left; + border: #000 1px solid; + padding-bottom: 2px; + padding-left: 8px; + padding-right: 0px; + padding-top: 2px; + background-color: #C9C7C7; + font-family: verdana, tahoma, arial, helvetica, sans-serif; + font-size: 12px; + color:#fff; +} + + +.helpbox { + border-bottom: #fff 1px solid; + border-left: #fff 1px solid; + border-right: #fff 1px solid; + border-top: #fff 1px solid; + color:#000; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + font-size: 9px; +} + +.linkspage_button{ + vertical-align: middle; + border:0px; +} \ No newline at end of file diff --git a/e107_themes/newsroom/theme.php b/e107_themes/newsroom/theme.php new file mode 100644 index 000000000..a63afcd84 --- /dev/null +++ b/e107_themes/newsroom/theme.php @@ -0,0 +1,477 @@ +For best results, create news items with a 'news-image' of 65x50 pixels.
        To place these items in the top right area, choose 'othernews2' for the rendertype of the news item.
        'othernews' may be used for the simple bullet listing below it.
        This theme may be used freely under the GPL license providing the 'e107 newsroom' image is replaced."; +$xhtmlcompliant = TRUE; +$csscompliant = TRUE; +define("THEME_DISCLAIMER", "
        NewsRoom theme v1.01 by CaMer0n"); +define("IMODE", "dark"); + +// [layout] + +$layout = "_default"; + +$HEADER = " +
        + +
        + +
        +
        {LANGUAGELINKS}
        + + + + + +
        + \"newsroom\" + + +
        + {SEARCH=news} +
        +
        +
        +{CUSTOM=clock} +
        + +
        + + + + + + + + +"; + +$FOOTERBASE = " + + + + +
        +
        + {SITELINKS=flat} +
        + {SETSTYLE=leftmenu} + {PLUGIN=login_menu} + {MENU=1} + {SETSTYLE=default} +
        + +"; +$CUSTOMHEADER = $HEADER."
        "; +$HEADER .= "
        "; +$CUSTOMPAGES = "user.php usersettings.php forum_viewforum.php forum.php forum_viewtopic.php forum_post.php"; + +$FOOTER = " +
        + {NEWS_CATEGORIES} +
        +
        + +
        + {SETSTYLE=othernews} + {PLUGIN=other_news_menu/other_news2_menu} + {SETSTYLE=rightmenu} + {MENU=2} +
        + + + + + + +
        + + {SETSTYLE=bottom} + {PLUGIN=powered_by_menu} + + + + {PLUGIN=compliance_menu} + + + + {PLUGIN=sitebutton_menu} + +
        +
        + + + + + + + + +\n + +
        + +
        + + + + + + + + + +
          + ".SITENAME." + + {CUSTOM=language} + + e107.org + + e107coders.org + e107themes.org
        +
        + +
        + + + + +
        +{SITEDISCLAIMER} + +{SITETAG} +
        +
        + + + +
        +
        \n"; +// this part just saves us duplicating the html in the footer section. +$CUSTOMFOOTER = " +".$FOOTERBASE; + +$FOOTER .= $FOOTERBASE; + + +$NEWSSTYLE = " +
        + + + + +
        + {NEWSTITLE} +
        + + + + + +
        + {NEWSBODY} + {EXTENDED} +
        +
        + + + + +
        Posted on + {NEWSDATE} + | + {EMAILICON} + {PRINTICON} + {PDFICON} + {ADMINOPTIONS} + +

        + +"; + +// the style of the items in news.php?cat and news.php?all +$NEWSLISTSTYLE = " + + + + +
        + {NEWSTHUMBNAIL} + + {NEWSTITLELINK} +
        + {NEWSSUMMARY} +
        "; + + +// You can customize the news-category bullet listing here. + +$NEWSCAT = "\n\n\n\n\n\n\n\n +
        +
        + {NEWSCATICON} +   + {NEWSCATEGORY} + +
        +
        + {NEWSCAT_ITEM} +
        +
        +"; + +/* +$NEWSCAT_ITEM = " +
        + + +
        •  + {NEWSCATICON} + {NEWSTITLELINK}
        +";*/ + + + + +$OTHERNEWS_STYLE = "
        +
        +• +
        {NEWSTITLELINK}
        +
        "; + + +$OTHERNEWS2_STYLE = " + + + + + +
        + {NEWSCATEGORY} +
        + {NEWSTITLELINK} +
        + {NEWSSUMMARY} +
        + {NEWSTHUMBNAIL} +
        +"; + +// [News] +define("ICONSTYLE", "float: left; border:0"); +define("COMMENTLINK", "Comments"); +define("COMMENTOFFSTRING", "Comments Off"); +define("PRE_EXTENDEDSTRING", " "); +define("EXTENDEDSTRING", "

        FULL STORY"); +define("POST_EXTENDEDSTRING", "

        "); +define("ICONMAIL", "iconmail.png"); // Usable since e107v615 +define("ICONPRINT", "iconprint.png"); // Usable since e107v615 + +// [News List by Category] +define("NEWSLIST_ITEMLINK","font-weight:bold"); +define("NEWSLIST_THUMB","border:1px dotted black"); +define("NEWSLIST_CATICON","border:1px solid white"); + +// [news categories] +define("NEWSCAT_CATLINK","font-weight:bold;font-size:12px;text-decoration:none;color:black"); +define("NEWSCAT_ITEMLINK","font-size:12px;color:#fff"); +define("NEWSCAT_STYLE","width:100%;margin-bottom:3px"); +define("NEWSCAT_AMOUNT",3); +define("NEWSCAT_COLS",2); +define("NEWSCAT_THUMB","border:1px solid black"); +// define("NEWSCAT_CATICON","border:1px solid red"); + +// [other news] +define("OTHERNEWS_CATLINK","text-decoration:none;"); +define("OTHERNEWS_ITEMLINK","color:black;font-weight:bold;text-decoration:underline"); +define("OTHERNEWS_LIMIT",3); + +// [other news 2] +define("OTHERNEWS2_CATLINK","color:white;text-decoration:none;"); +define("OTHERNEWS2_ITEMLINK","color:#cccccc;text-transform:uppercase;font-weight:bold;text-decoration:none;"); +define("OTHERNEWS2_LIMIT",4); + +// [linkstyle] + +function linkstyle($linkstyle){ + + $style['prelink'] = "
        "; + $style['postlink'] = "
        "; + $style['linkstart'] = " 
        "; + $style['linkstart_hilite'] = " 
        "; + $style['linkend'] = "
        "; + $style['linkdisplay'] = 1; + $style['linkalign'] = "left"; + $style['linkclass'] = ""; + + return $style; +} + + +function tablestyle($caption, $text){ + global $style; + +switch ($style) { + case "leftmenu": + echo "
        + + +
        +
        + {$caption} +
        +
        {$text}
        +
        "; + break; + + case "rightmenu": + echo " +
        + + + + +
        ".$caption."
        + + + + + +
        ".$text."
        +
        "; + break; + + case "highlight": + echo "
        +
        ".$caption."
        +
        ".$text."
        +
        "; + break; + + case "othernews": + echo "
        +
        ".$text."
        +
        "; + break; + + case "bottom": + echo "
        + {$caption} +
        {$text}
        "; + break; + + default: + echo "
        + + +
        +
        + $caption +
        +
        {$text}
        +
        "; + + break; + } +} + + +// for testing the news parser. + +/*$NEWSSTYLE = " +NEWSTITLE = +{NEWSTITLE} +
        +
        + +NEWSBODY = +{NEWSBODY} +
        +
        +

        +NEWSICON = {NEWSICON} +
        +
        +
        +
        +NEWSHEADER = +{NEWSHEADER} +
        +
        +NEWSCATEGORY = +{NEWSCATEGORY} +
        +
        +NEWSAUTHOR = +{NEWSAUTHOR} +
        +
        + +NEWSDATE = +{NEWSDATE} +
        +
        +NEWSCOMMENTS = +{NEWSCOMMENTS} +
        +
        +EMAILICON = +{EMAILICON} +
        +
        +PRINTICON = +{PRINTICON} +
        +
        +NEWSID = +{NEWSID} +
        +
        +ADMINOPTIONS = +{ADMINOPTIONS} +
        +
        +EXTENDED = +{EXTENDED} +
        +
        +CAPTIONCLASS = +{CAPTIONCLASS} +
        +
        +ADMINCAPTION = +{ADMINCAPTION} +
        +
        +ADMINBODY = +{ADMINBODY} +
        +
        +NEWSSUMMARY = +{NEWSSUMMARY} +
        +
        +NEWSTHUMBNAIL = +{NEWSTHUMBNAIL} +
        +
        +STICKYICON = +{STICKY_ICON} +
        +
        +NEWSTITLELINK = +{NEWSTITLELINK} +
        +
        + + +"; +*/ + +?> \ No newline at end of file diff --git a/e107_themes/reline/admin_style.css b/e107_themes/reline/admin_style.css new file mode 100644 index 000000000..46e23aeac --- /dev/null +++ b/e107_themes/reline/admin_style.css @@ -0,0 +1,517 @@ +/* Core Classes */ +/*----------------------------------------------------------------------------*/ + +body { + background-color: #fff; +} + +body, td { + margin: 0px; + padding: 0px; + text-align: left; + color: #000; +} + +body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext, +.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar { + font: normal 11px arial, verdana, tahoma, sans-serif; +} + +.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox { + font: normal 10px arial, verdana, tahoma, arial, sans-serif; +} + +a { + color: #1A4487; +} + +a:hover { + color: #000; +} + +img { + border: 0px; +} + +form { + margin: 0px; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.tbox { + border: #777 1px solid; +} + +.indent { + border: #999 1px dashed; + padding: 5px; + margin: 5px; + background-color: #f7f7f9; +} + +.button { + border: 1px solid #A5ACB2; + background-image : url(images/button.png); +} + +.button:hover { + background-image : url(images/buttonover.png); +} + +.nextprev { + border: 0px; + text-align: center; + padding: 2px; + background-color: #f7f7f9; +} + +.spacer{ + padding: 5px 0px; +} + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 5px; + background-color: #fff; + border-bottom: 1px solid #bbb; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #fbfbfd; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #f7f7f7; +} + +.searchhighlight { + text-decoration: underline; + color: #ff0000; + font-weight: bold; +} + +.helpbox { + border: 0px; +} + +.news_image { + float: right; + padding: 0px 0px 7px 7px; +} + +.logo { + display: block; +} + + +/* Theme Specific Classes */ +/*----------------------------------------------------------------------------*/ + +.container { + width: 100%; + border-collapse: collapse; + border-spacing: 0px; + border-bottom: 1px solid #126CA3; +} + +.top_section { + background-image: url(images/header.jpg); + background-repeat: no-repeat; + background-position: top left; +} + +.left_section { + vertical-align: top; + width: 160px; + border-right: 1px solid #126CA3; + background-color: #CCDCF9; +} + +.top_bar { + background-color: #126CA3; + text-align: right; + padding-right: 5px; + width: 100%; + height: 23px; +} + +.main_container { + vertical-align: top; +} + +.top_inner_container { + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 10px; + width: 100%; +} + +.bottom_inner_container { + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 12px; + width: 100%; +} + +.right_section { + border-left: 1px solid #126CA3; + text-align: center; + vertical-align: top; + width: 160px; +} + +.main_nav { + vertical-align: top; +} + +.main_section { + vertical-align: top; + padding: 10px; +} + +.main_caption, .menu_caption { + font-weight: bold; + color: #0B4366; + margin-bottom: 7px; +} + +.main_caption { + font-size: 13px; +} + +.tablerender { + margin-bottom: 12px; +} + +.top_left_menu_container { + border-collapse: collapse; + border-spacing: 0px; + width: 100%; +} + +.top_left_menu { + background-color: #126CA3; + font-weight: bold; + padding: 12px 7px; + color: #fff; +} + +.top_left_menu a { + color: #fff; +} + +.top_left_menu a:hover { + color: #ddd; +} + +.top_left_menu_caption { + font-size: 12px; + padding-bottom: 10px; +} + +.bottom_left_menu_area { + vertical-align: top; + padding-bottom: 10px; +} + +.menu_caption { + border-bottom: 1px solid #222; + font-size: 12px; +} + +.menu_container { + width: 160px; + border-collapse: collapse; + border-spacing: 0px; +} + +.menu_inner_container { + padding: 10px 7px; +} + +.disclaimer { + text-align: center; + width: 100%; + padding: 12px 0px; +} + + +.menuButton_menu { + margin: 0px; + padding: 2px 4px 2px 4px; + text-decoration: none; + cursor: pointer; +} + +.menuButton_menu_over { + margin: 0px; + padding: 2px 4px 2px 4px; + text-decoration: none; + background-color: #efefef; + cursor: pointer; +} + + +/* Theme Specific Classes: News Style */ + +.news_info_top { + padding: 2px; +} + +.news_info_bottom { + width: 100%; + background-color: #f7f7f9; + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 12px; +} + +.news_info_bottom_left { + padding: 2px; +} + +.news_info_bottom_middle { + padding: 2px; + width: 100%; +} + +.news_info_bottom_right { + padding: 2px; + white-space: nowrap +} + +.news_comments_icon { + width: 16px; + height: 16px; + vertical-align: middle; +} + + +/* Theme Specific Classes: Cube Logo Graphic */ + +.cube_container { + position: relative; + left: 0; + top: 0; +} + +.cube_image { + position: absolute; + top: -76px; + left: -49px; + width: 96px; + height: 108px; + display: block; +} + + +/* Theme Specific Classes: Advanced Content Management Graphic */ + +.advanced_image { + width: 145px; + height: 90px; + display: block; + margin-left: 14px; +} + + +/* Theme Specific Classes: Paperclipped Notes Menu */ + +.paperclip_container { + text-align: center; + width: 160px; + margin-left: auto; + margin-right: auto; +} + +.paperclip_inner_container { + border-collapse: collapse; + border-spacing: 0px; + width: 130px; + height: 175px; +} + +.paperclip_caption { + padding: 6px 0px; + text-align: right; +} + +.paperclip { + font-weight: bold; + font-size: 12px; + padding: 34px 20px 0px 20px; + text-align: left; + background-image: url(images/paperclip.png); + background-repeat: no-repeat; + background-position: top center; + margin-bottom: 5px; + vertical-align: top; +} + + +/* Theme Specific Classes: Post It Note Menu */ + +.post_it_container { + text-align: center; + margin-bottom: 9px; + margin-top: 7px; + width: 160px; + margin-left: auto; + margin-right: auto; + font-weight: bold; + font-size: 12px; +} + +.post_it_top { + background-image: url(images/post_it_top.png); + background-repeat: no-repeat; + background-position: top center; +} + +.post_it_back { + text-align: left; + background-image: url(images/post_it_middle.png); + background-repeat: repeat-y; + background-position: center; + width: 120px; + margin-left: auto; + margin-right: auto; +} + +.post_it_bottom { + background-image: url(images/post_it_bottom.png); + background-repeat: no-repeat; + background-position: bottom center; + padding: 12px 7px; +} + +.post_it_caption { + padding-bottom: 5px; +} + + +/* Theme Specific Classes: Admin Area Header */ + +.admin_header { + width: 100%; + border-collapse: collapse; + border-spacing: 0px; +} + +.admin_header_right { + text-align: right; + padding: 0px 12px; +} + + +/* Brainjar Nav Menu Classes {SITELINS_ALT} */ +/* +If you do not use {SITELINS_ALT} and switch to the standard {SITELINKS} instead, +all of the below can be deleted. +*/ +/*----------------------------------------------------------------------------*/ + +div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem { + font: normal 11px arial, verdana, tahoma, sans-serif; + color: #000; +} + +div.menuBar { + background-color: #F7F9FA; + background-image: url(images/s_nav.png); + background-repeat: repeat-x; + border-top: 1px solid #fff; + padding: 4px 0px 4px 47px; + text-align: left; +} + +div.emenuBar { + background-color: #F7F9FA; + border-top: 1px solid #fff; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid; + border-color: transparent !important; + border-color: #fff #F8FAFB #F0F2F3 #F8FAFB; + cursor: default; + left: 0px; + margin: 0px; + padding: 2px 4px 2px 22px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: transparent; + border-color: #fff #a5a5a5 #a5a5a5 #fff !important; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover { + background-color: #fff; + border-color: #a5a5a5 #fff #fff #a5a5a5 !important; + left: 1px; + top: 1px; +} + +div.menu { + background-color: #FCFDFF; + border: 1px solid; + border-color: #fff #a5a5a5 #a5a5a5 #fff; + left: 0px; + padding: 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + cursor: default; + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #F2F4FF; +} + +div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #fff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/reline/admin_template.php b/e107_themes/reline/admin_template.php new file mode 100644 index 000000000..7b1567f96 --- /dev/null +++ b/e107_themes/reline/admin_template.php @@ -0,0 +1,178 @@ + parseTemplate('{ADMIN_HELP}'); + +$style = "right_menu"; +$pre_admin_menu = $tp -> parseTemplate('{ADMIN_MENU=pre}'); +$preright = $tp -> parseTemplate('{ADMIN_STATUS=request}'); +$preright .= $tp -> parseTemplate('{ADMIN_LATEST=request}'); +$preright .= $tp -> parseTemplate('{ADMIN_PRESET}'); +$preright .= $tp -> parseTemplate('{ADMIN_LOG=request}'); +$style = "default"; + +// [layout] + +$ADMIN_HEADER = " + + + + + + + + + + + +
        + + + + + + + + + +
        +{ADMIN_LOGO} + +{ADMIN_ICON} +
        +{ADMIN_SEL_LAN} +{ADMIN_USERLAN} +
        + +
        + + + +
        +{SETSTYLE=top_left_menu} +{PLUGIN=login_menu} +
        +{SETSTYLE=bottom_left_menu} +{ADMIN_LANG} +{ADMIN_PWORD} +{ADMIN_MSG} +{ADMIN_PLUGINS}"; + +if ($prehelp!='') { + $ADMIN_HEADER .= $prehelp; +} else { + $ADMIN_HEADER .= "{ADMIN_SITEINFO}"; +} + +$ADMIN_HEADER .= "
        + +
        + + + + + + + + + +
        +{SEARCH} +
        + +{SETSTYLE=default} + + + +"; + +if ($pre_admin_menu || $preright) { + $ADMIN_FOOTER .= ""; +} + +$ADMIN_FOOTER .= " +
        "; + + + + +$ADMIN_FOOTER = " + {SETSTYLE=right_menu} + {ADMIN_MENU} + ".$preright." +
        + +
        + +
        +{SITELINKS=flat} +
        +{SITEDISCLAIMER} +

        +{ADMIN_CREDITS} +
        "; + + +// [admin button style] + +$BUTTONS_START = ""; + +$BUTTON = ""; + +$BUTTON_OVER = ""; + +$BUTTONS_END = "
        +
        +
        "; + +$SUB_BUTTONS_START = " + +
        +
        "; + +?> \ No newline at end of file diff --git a/e107_themes/reline/cube.sc b/e107_themes/reline/cube.sc new file mode 100644 index 000000000..cd38f1e14 --- /dev/null +++ b/e107_themes/reline/cube.sc @@ -0,0 +1,13 @@ +parse_str($parm); +$top = isset($top) ? $top : '-76px'; +$left = isset($left) ? $left : '-49px'; + +return "
        + +
        "; + +// {CUBE=top=-76px&left=-49px} +// Register custom theme shortcodes + +// $register_sc[] = 'CUBE'; // use as {CUBE} in your templates (e107_themes/your_theme/cube.sc) + diff --git a/e107_themes/reline/full_width.css b/e107_themes/reline/full_width.css new file mode 100644 index 000000000..ec8bb4110 --- /dev/null +++ b/e107_themes/reline/full_width.css @@ -0,0 +1,490 @@ +/* Non-Admin Area Stylesheet */ +/* info: Reline in full screen mode */ + +/* Core Classes */ +/*----------------------------------------------------------------------------*/ + +body { + background-color: #fff; +} + +body, td { + margin: 0px; + padding: 0px; + text-align: left; + color: #000; +} + +body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext, +.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar { + font: normal 11px arial, verdana, tahoma, sans-serif; +} + +.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox { + font: normal 10px arial, verdana, tahoma, arial, sans-serif; +} + +a { + color: #1A4487; +} + +a:hover { + color: #000; +} + +img { + border: 0px; +} + +form { + margin: 0px; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.tbox { + border: #777 1px solid; +} + +.indent { + border: #999 1px dashed; + padding: 5px; + margin: 5px; + background-color: #f7f7f9; +} + +.button { + border: 1px solid #A5ACB2; + background-image : url(images/button.png); +} + +.button:hover { + background-image : url(images/buttonover.png); +} + +.nextprev { + border: 0px; + text-align: center; + padding: 2px; + background-color: #f7f7f9; +} + +.spacer{ + padding: 5px 0px; +} + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 5px; + background-color: #fff; + border-bottom: 1px solid #bbb; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #fbfbfd; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #f7f7f7; +} + +.searchhighlight { + text-decoration: underline; + color: #ff0000; + font-weight: bold; +} + +.helpbox { + border: 0px; +} + +.news_image { + float: right; + padding: 0px 0px 7px 7px; +} + +.logo { + display: block; +} + + +/* Theme Specific Classes */ +/*----------------------------------------------------------------------------*/ + +.container { + width: 100%; + border-collapse: collapse; + border-spacing: 0px; + border-bottom: 1px solid #126CA3; +} + +.top_section { + background-image: url(images/header.jpg); + background-repeat: no-repeat; + background-position: top left; +} + +.left_section { + vertical-align: top; + width: 160px; + border-right: 1px solid #126CA3; + background-color: #CCDCF9; +} + +.top_bar { + background-color: #126CA3; + text-align: right; + padding-right: 5px; + width: 100%; + height: 23px; +} + +.main_container { + vertical-align: top; +} + +.top_inner_container { + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 10px; + width: 100%; +} + +.bottom_inner_container { + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 12px; + width: 100%; +} + +.right_section { + border-left: 1px solid #126CA3; + text-align: center; + vertical-align: top; + width: 160px; +} + +.main_nav { + padding-right: 5px; + vertical-align: top; +} + +.main_section { + vertical-align: top; + padding: 10px; +} + +.main_caption, .menu_caption { + font-weight: bold; + color: #0B4366; + margin-bottom: 7px; +} + +.main_caption { + font-size: 13px; +} + +.tablerender { + margin-bottom: 12px; +} + +.top_left_menu_container { + border-collapse: collapse; + border-spacing: 0px; + width: 100%; +} + +.top_left_menu { + background-color: #126CA3; + font-weight: bold; + padding: 12px 7px; + color: #fff; +} + +.top_left_menu a { + color: #fff; +} + +.top_left_menu a:hover { + color: #ddd; +} + +.top_left_menu_caption { + font-size: 12px; + padding-bottom: 10px; +} + +.bottom_left_menu_area { + vertical-align: top; + padding-bottom: 10px; +} + +.menu_caption { + border-bottom: 1px solid #222; + font-size: 12px; +} + +.menu_container { + width: 160px; + border-collapse: collapse; + border-spacing: 0px; +} + +.menu_inner_container { + padding: 10px 7px; +} + +.disclaimer { + text-align: center; + width: 100%; + padding: 12px 0px; +} + + +/* Theme Specific Classes: News Style */ + +.news_info_top { + padding: 2px; +} + +.news_info_bottom { + width: 100%; + background-color: #f7f7f9; + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 12px; +} + +.news_info_bottom_left { + padding: 2px; +} + +.news_info_bottom_middle { + padding: 2px; + width: 100%; +} + +.news_info_bottom_right { + padding: 2px; + white-space: nowrap +} + +.news_comments_icon { + width: 16px; + height: 16px; + vertical-align: middle; +} + + +/* Theme Specific Classes: Cube Logo Graphic */ + +.cube_container { + position: relative; + left: 0; + top: 0; +} + +.cube_image { + position: absolute; + top: -76px; + left: -49px; + width: 96px; + height: 108px; + display: block; +} + + +/* Theme Specific Classes: Advanced Content Management Graphic */ + +.advanced_image { + width: 145px; + height: 90px; + display: block; + margin-left: 14px; +} + + +/* Theme Specific Classes: Paperclipped Notes Menu */ + +.paperclip_container { + text-align: center; + width: 160px; + margin-left: auto; + margin-right: auto; +} + +.paperclip_inner_container { + border-collapse: collapse; + border-spacing: 0px; + width: 130px; + height: 175px; +} + +.paperclip_caption { + padding: 6px 0px; + text-align: right; +} + +.paperclip { + font-weight: bold; + font-size: 12px; + padding: 34px 20px 0px 20px; + text-align: left; + background-image: url(images/paperclip.png); + background-repeat: no-repeat; + background-position: top center; + margin-bottom: 5px; + vertical-align: top; +} + + +/* Theme Specific Classes: Post It Note Menu */ + +.post_it_container { + text-align: center; + margin-bottom: 9px; + margin-top: 7px; + width: 160px; + margin-left: auto; + margin-right: auto; + font-weight: bold; + font-size: 12px; +} + +.post_it_top { + background-image: url(images/post_it_top.png); + background-repeat: no-repeat; + background-position: top center; +} + +.post_it_back { + text-align: left; + background-image: url(images/post_it_middle.png); + background-repeat: repeat-y; + background-position: center; + width: 120px; + margin-left: auto; + margin-right: auto; +} + +.post_it_bottom { + background-image: url(images/post_it_bottom.png); + background-repeat: no-repeat; + background-position: bottom center; + padding: 12px 7px; +} + +.post_it_caption { + padding-bottom: 5px; +} + + +/* Brainjar Nav Menu Classes {SITELINS_ALT} */ +/* +If you do not use {SITELINS_ALT} and switch to the standard {SITELINKS} instead, +all of the below can be deleted. +*/ +/*----------------------------------------------------------------------------*/ + +div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem { + font: bold 12px arial, verdana, arial, tahoma, sans-serif; + color: #126CA3; + text-align: left; +} + +div.menuBar { + background-color: #fff; + border-top: 1px solid #fff; + padding: 4px 0px; + text-align: right; +} + +div.emenuBar { + background-color: #F7F9FA; + border-top: 1px solid #fff; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid; + border-color: transparent !important; + border-color: #fff #fff #fff #fff; + left: 0px; + margin: 0px; + padding: 2px 6px 2px 6px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: #126CA3; + border-color: #fff #fff #fff #fff !important; + color: #fff; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover { + background-color: #126CA3; + border-color: #fff #fff #fff #fff !important; + left: 1px; + top: 1px; + color: #fff; +} + +div.menu { + background-color: #FCFDFF; + border: 1px solid; + border-color: #fff #a5a5a5 #a5a5a5 #fff; + left: 0px; + padding: 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #F2F4FF; +} + +div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #fff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/reline/images/arrow.png b/e107_themes/reline/images/arrow.png new file mode 100644 index 000000000..064e5f466 Binary files /dev/null and b/e107_themes/reline/images/arrow.png differ diff --git a/e107_themes/reline/images/bar.jpg b/e107_themes/reline/images/bar.jpg new file mode 100644 index 000000000..09b4da58f Binary files /dev/null and b/e107_themes/reline/images/bar.jpg differ diff --git a/e107_themes/reline/images/blank.gif b/e107_themes/reline/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_themes/reline/images/blank.gif differ diff --git a/e107_themes/reline/images/bullet2.gif b/e107_themes/reline/images/bullet2.gif new file mode 100644 index 000000000..a21e4a399 Binary files /dev/null and b/e107_themes/reline/images/bullet2.gif differ diff --git a/e107_themes/reline/images/button.png b/e107_themes/reline/images/button.png new file mode 100644 index 000000000..4e09c6e3f Binary files /dev/null and b/e107_themes/reline/images/button.png differ diff --git a/e107_themes/reline/images/buttonover.png b/e107_themes/reline/images/buttonover.png new file mode 100644 index 000000000..d5b52291f Binary files /dev/null and b/e107_themes/reline/images/buttonover.png differ diff --git a/e107_themes/reline/images/comments_16.png b/e107_themes/reline/images/comments_16.png new file mode 100644 index 000000000..d40ae5552 Binary files /dev/null and b/e107_themes/reline/images/comments_16.png differ diff --git a/e107_themes/reline/images/cube.png b/e107_themes/reline/images/cube.png new file mode 100644 index 000000000..52c2cf88b Binary files /dev/null and b/e107_themes/reline/images/cube.png differ diff --git a/e107_themes/reline/images/e_adminlogo.png b/e107_themes/reline/images/e_adminlogo.png new file mode 100644 index 000000000..37e5fdb4e Binary files /dev/null and b/e107_themes/reline/images/e_adminlogo.png differ diff --git a/e107_themes/reline/images/e_logo.png b/e107_themes/reline/images/e_logo.png new file mode 100644 index 000000000..e23e010a2 Binary files /dev/null and b/e107_themes/reline/images/e_logo.png differ diff --git a/e107_themes/reline/images/email_16.png b/e107_themes/reline/images/email_16.png new file mode 100644 index 000000000..503e87ff1 Binary files /dev/null and b/e107_themes/reline/images/email_16.png differ diff --git a/e107_themes/reline/images/header.jpg b/e107_themes/reline/images/header.jpg new file mode 100644 index 000000000..c38d69543 Binary files /dev/null and b/e107_themes/reline/images/header.jpg differ diff --git a/e107_themes/reline/images/header.png b/e107_themes/reline/images/header.png new file mode 100644 index 000000000..63c070345 Binary files /dev/null and b/e107_themes/reline/images/header.png differ diff --git a/e107_themes/reline/images/loggedin.png b/e107_themes/reline/images/loggedin.png new file mode 100644 index 000000000..9544f48c8 Binary files /dev/null and b/e107_themes/reline/images/loggedin.png differ diff --git a/e107_themes/reline/images/logo.png b/e107_themes/reline/images/logo.png new file mode 100644 index 000000000..e23e010a2 Binary files /dev/null and b/e107_themes/reline/images/logo.png differ diff --git a/e107_themes/reline/images/paperclip.png b/e107_themes/reline/images/paperclip.png new file mode 100644 index 000000000..055f953c8 Binary files /dev/null and b/e107_themes/reline/images/paperclip.png differ diff --git a/e107_themes/reline/images/polls.png b/e107_themes/reline/images/polls.png new file mode 100644 index 000000000..82141276b Binary files /dev/null and b/e107_themes/reline/images/polls.png differ diff --git a/e107_themes/reline/images/post_it_bottom.png b/e107_themes/reline/images/post_it_bottom.png new file mode 100644 index 000000000..ba768ce12 Binary files /dev/null and b/e107_themes/reline/images/post_it_bottom.png differ diff --git a/e107_themes/reline/images/post_it_middle.png b/e107_themes/reline/images/post_it_middle.png new file mode 100644 index 000000000..630262474 Binary files /dev/null and b/e107_themes/reline/images/post_it_middle.png differ diff --git a/e107_themes/reline/images/post_it_top.png b/e107_themes/reline/images/post_it_top.png new file mode 100644 index 000000000..028c2ae7b Binary files /dev/null and b/e107_themes/reline/images/post_it_top.png differ diff --git a/e107_themes/reline/images/postedby_16.png b/e107_themes/reline/images/postedby_16.png new file mode 100644 index 000000000..cfa279899 Binary files /dev/null and b/e107_themes/reline/images/postedby_16.png differ diff --git a/e107_themes/reline/images/print_16.png b/e107_themes/reline/images/print_16.png new file mode 100644 index 000000000..728d047e7 Binary files /dev/null and b/e107_themes/reline/images/print_16.png differ diff --git a/e107_themes/reline/images/s_nav.png b/e107_themes/reline/images/s_nav.png new file mode 100644 index 000000000..1845caac4 Binary files /dev/null and b/e107_themes/reline/images/s_nav.png differ diff --git a/e107_themes/reline/images/search.png b/e107_themes/reline/images/search.png new file mode 100644 index 000000000..1cf33f593 Binary files /dev/null and b/e107_themes/reline/images/search.png differ diff --git a/e107_themes/reline/index.html b/e107_themes/reline/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/reline/languages/English.php b/e107_themes/reline/languages/English.php new file mode 100644 index 000000000..ca0dc479b --- /dev/null +++ b/e107_themes/reline/languages/English.php @@ -0,0 +1,29 @@ + diff --git a/e107_themes/reline/preview.jpg b/e107_themes/reline/preview.jpg new file mode 100644 index 000000000..72f851584 Binary files /dev/null and b/e107_themes/reline/preview.jpg differ diff --git a/e107_themes/reline/style.css b/e107_themes/reline/style.css new file mode 100644 index 000000000..af13560fd --- /dev/null +++ b/e107_themes/reline/style.css @@ -0,0 +1,492 @@ +/* Core Classes */ +/*----------------------------------------------------------------------------*/ + +body { + background-color: #fff; +} + +body, td { + margin: 0px; + padding: 0px; + text-align: left; + color: #000; +} + +body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext, +.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar { + font: normal 11px arial, verdana, tahoma, sans-serif; +} + +.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox { + font: normal 10px arial, verdana, tahoma, arial, sans-serif; +} + +a { + color: #1A4487; +} + +a:hover { + color: #000; +} + +img { + border: 0px; +} +.linkspage_button{ + border:0px; +} + +form { + margin: 0px; +} + +table { + margin-left: auto; + margin-right: auto; +} + +.tbox { + border: #777 1px solid; +} + +.indent { + border: #999 1px dashed; + padding: 5px; + margin: 5px; + background-color: #f7f7f9; +} + +.button { + border: 1px solid #A5ACB2; + background-image : url(images/button.png); +} + +.button:hover { + background-image : url(images/buttonover.png); +} + +.nextprev { + border: 0px; + text-align: center; + padding: 2px; + background-color: #f7f7f9; +} + +.spacer{ + padding: 5px 0px; +} + +.fborder, .border{ + border-collapse: collapse; + border-spacing: 0px; +} + +.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar { + padding: 5px; + background-color: #fff; + border-bottom: 1px solid #bbb; +} + +.forumheader, .forumheader4, .finfobar { + background-color: #fbfbfd; +} + +.forumheader5 { + cursor: pointer; +} + +.fcaption, .forumheader5 { + background-color: #f7f7f7; +} + +.searchhighlight { + text-decoration: underline; + color: #ff0000; + font-weight: bold; +} + +.helpbox { + border: 0px; +} + +.news_image { + float: right; + padding: 0px 0px 7px 7px; +} + +.logo { + display: block; +} + + +/* Theme Specific Classes */ +/*----------------------------------------------------------------------------*/ + +.container { + width: 755px; + border-collapse: collapse; + border-spacing: 0px; + border-right: 1px solid #126CA3; + border-bottom: 1px solid #126CA3; + margin-left: 0px; +} + +.top_section { + background-image: url(images/header.jpg); + background-repeat: no-repeat; + background-position: top left; +} + +.left_section { + vertical-align: top; + width: 160px; + border-right: 1px solid #126CA3; + background-color: #CCDCF9; +} + +.top_bar { + background-color: #126CA3; + text-align: right; + padding-right: 5px; + width: 100%; + height: 23px; +} + +.main_container { + vertical-align: top; +} + +.top_inner_container { + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 10px; + width: 100%; +} + +.bottom_inner_container { + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 12px; + width: 100%; +} + +.right_section { + border-left: 1px solid #126CA3; + text-align: center; + vertical-align: top; + width: 160px; +} + +.main_nav { + padding-right: 5px; + vertical-align: top; +} + +.main_section { + vertical-align: top; + padding: 10px; +} + +.main_caption, .menu_caption { + font-weight: bold; + color: #0B4366; + margin-bottom: 7px; +} + +.main_caption { + font-size: 13px; +} + +.tablerender { + margin-bottom: 12px; +} + +.top_left_menu_container { + border-collapse: collapse; + border-spacing: 0px; + width: 100%; +} + +.top_left_menu { + background-color: #126CA3; + font-weight: bold; + padding: 12px 7px; + color: #fff; +} + +.top_left_menu a { + color: #fff; +} + +.top_left_menu a:hover { + color: #ddd; +} + +.top_left_menu_caption { + font-size: 12px; + padding-bottom: 10px; +} + +.bottom_left_menu_area { + vertical-align: top; + padding-bottom: 10px; +} + +.menu_caption { + border-bottom: 1px solid #222; + font-size: 12px; +} + +.menu_container { + width: 160px; + border-collapse: collapse; + border-spacing: 0px; +} + +.menu_inner_container { + padding: 10px 7px; +} + +.disclaimer { + text-align: center; + width: 755px; + padding: 12px 0px; +} + + +/* Theme Specific Classes: News Style */ + +.news_info_top { + padding: 2px; +} + +.news_info_bottom { + width: 100%; + background-color: #f7f7f9; + border-collapse: collapse; + border-spacing: 0px; + margin-bottom: 12px; +} + +.news_info_bottom_left { + padding: 2px; +} + +.news_info_bottom_middle { + padding: 2px; + width: 100%; +} + +.news_info_bottom_right { + padding: 2px; + white-space: nowrap +} + +.news_comments_icon { + width: 16px; + height: 16px; + vertical-align: middle; +} + + +/* Theme Specific Classes: Cube Logo Graphic */ + +.cube_container { + position: relative; + left: 0; + top: 0; +} + +.cube_image { + position: absolute; + top: -76px; + left: -49px; + width: 96px; + height: 108px; + display: block; +} + + +/* Theme Specific Classes: Advanced Content Management Graphic */ + +.advanced_image { + width: 145px; + height: 90px; + display: block; + margin-left: 14px; +} + + +/* Theme Specific Classes: Paperclipped Notes Menu */ + +.paperclip_container { + text-align: center; + width: 160px; + margin-left: auto; + margin-right: auto; +} + +.paperclip_inner_container { + border-collapse: collapse; + border-spacing: 0px; + width: 130px; + height: 175px; +} + +.paperclip_caption { + padding: 6px 0px; + text-align: right; +} + +.paperclip { + font-weight: bold; + font-size: 12px; + padding: 34px 20px 0px 20px; + text-align: left; + background-image: url(images/paperclip.png); + background-repeat: no-repeat; + background-position: top center; + margin-bottom: 5px; + vertical-align: top; +} + + +/* Theme Specific Classes: Post It Note Menu */ + +.post_it_container { + text-align: center; + margin-bottom: 9px; + margin-top: 7px; + width: 160px; + margin-left: auto; + margin-right: auto; + font-weight: bold; + font-size: 12px; +} + +.post_it_top { + background-image: url(images/post_it_top.png); + background-repeat: no-repeat; + background-position: top center; +} + +.post_it_back { + text-align: left; + background-image: url(images/post_it_middle.png); + background-repeat: repeat-y; + background-position: center; + width: 120px; + margin-left: auto; + margin-right: auto; +} + +.post_it_bottom { + background-image: url(images/post_it_bottom.png); + background-repeat: no-repeat; + background-position: bottom center; + padding: 12px 7px; +} + +.post_it_caption { + padding-bottom: 5px; +} + + +/* Brainjar Nav Menu Classes {SITELINS_ALT} */ +/* +If you do not use {SITELINS_ALT} and switch to the standard {SITELINKS} instead, +all of the below can be deleted. +*/ +/*----------------------------------------------------------------------------*/ + +div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem { + font: bold 12px arial, verdana, arial, tahoma, sans-serif; + color: #126CA3; + text-align: left; +} + +div.menuBar { + background-color: #fff; + border-top: 1px solid #fff; + padding: 4px 0px; + text-align: right; +} + +div.emenuBar { + background-color: #F7F9FA; + border-top: 1px solid #fff; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid; + border-color: transparent !important; + border-color: #fff #fff #fff #fff; + left: 0px; + margin: 0px; + padding: 2px 6px 2px 6px; + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: #126CA3; + border-color: #fff #fff #fff #fff !important; + color: #fff; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover { + background-color: #126CA3; + border-color: #fff #fff #fff #fff !important; + left: 1px; + top: 1px; + color: #fff; +} + +div.menu { + background-color: #FCFDFF; + border: 1px solid; + border-color: #fff #a5a5a5 #a5a5a5 #fff; + left: 0px; + padding: 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #F2F4FF; +} + +div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #fff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/reline/theme.php b/e107_themes/reline/theme.php new file mode 100644 index 000000000..d216cd48c --- /dev/null +++ b/e107_themes/reline/theme.php @@ -0,0 +1,364 @@ + by massimo bassi [maXb] ( http://www.robamia.com ) +| +| funky_box 1 +| -> by Andrzej Pobiedzinski [Sarej] ( http://www.imagecreators.olsztyn.pl ) +| +| Lime Light | Orange Splash +| -> by Martin R.W [matchstick] ( http://www.match-stick.co.uk ) +| +| Hands 4: holding a poster | Paper clipped | Post-It | Bubbles 3 +| -> by Davide Guglielmo [brokenarts] ( http://www.broken-arts.com ) +| ++----------------------------------------------------------------------------+ +*/ + + +// Protect the file from direct access +if (!defined('e107_INIT')) { exit; } + + +// Get language definition files for this theme +@include_once(e_THEME."reline/languages/".e_LANGUAGE.".php"); +@include_once(e_THEME."reline/languages/English.php"); + + +// Set theme info +$themename = "Reline"; +$themeversion = "1.0"; +$themeauthor = "SweetAs"; +$themedate = "24/04/06"; +$themeinfo = ""; +$xhtmlcompliant = TRUE; // If set to TRUE will display an XHTML compliant logo in theme manager +$csscompliant = TRUE; // If set to TRUE will display a CSS compliant logo in theme manager + + +// Define which icon set to use. +// There are two possible values here 'dark' and 'lite'. +// If your theme has a light background then use 'lite' and vice versa for dark themes. +// Because IE does not yet support Alpha transparency with PNG24 images, all of e107's +// icons have been saved with both a light and dark matte background (to prevent jagged +// edges that you see when no matte is present). +// The IMODE is specifying which of the icon sets to use. +// IE7 will support Alpha transparent PNG's at which point we will create a third set +// of icons (using alpha transparency instead of a matte) and IMODE will gradually be +// filtered out as this new set will work with all background colours. +// Uncomment the line below to define IMODE (remove the // ). Default is 'lite'. + +// define("IMODE", "lite"); + + +// Theme disclaimer is displayed in your site disclaimer appended to the site disclaimer text. +// Uncomment the line below to set a theme disclaimer (remove the // ). + +// define("THEME_DISCLAIMER", "Example theme disclaimer text."); + + +// Dont render core style sheet link. +// the contents of e107_files/e107.css have been copied to this themes style.css. +// By setting $no_core_css to TRUE below we can prevent the tag +// that would normally be generated in the of the page from being outputted. +// This saves us a call by the browser to a stylesheet that we no longer need. + +$no_core_css = TRUE; + + +// Output into section. +// Anything echoed from within the theme_head() function gets outputted into the of your page. +// Please note that you have other choices for based javascript. You can create a theme.js file +// in your themes folder and a link will automatically be generated to it in the of your page. +// If you have javascript that is independant of the theme rather than use theme.js or the theme_head() +// function below, its advisable to instead create a new file e107_files/user.js, placing your script +// into this, and as with theme.js, a link will automatically be generated to this file. +// Uncomment the following three lines to use. + +//function theme_head() { +// echo ""; +//} + + +// Header and footer templates for the body of your site. +// These are the header and footer that wraps the content of a page. +// Note that these are the templates for *inbetween* the and tags. +// The rest of the output (eg. the section of the page) are covered by +// the header and footer template files in e107_themes/templates. +// These are called header_default.php and footer_default.php. +// If you wish to use your own versions of these files uncomment the line below (remove the // ) +// and edit it so that the text string represents the postfix of the new set of files. +// eg. using the example text e107 will include these files: +// e107_themes/templates/header_your_version.php and e107_themes/templates/footer_your_version.php +// instead of the default: +// e107_themes/templates/header_default.php and e107_themes/templates/footer_default.php +// Please note however that using non default core header and footer templates is not recommended +// and that the flexibility of these files enables you to add and edit content to them without editing +// the files directly. Documentation for this can be found on e107.org. + +// $layout = '_your_version'; // uncomment this line (remove the // ) to use alternative template files. + + +// Main header +$HEADER = " + + + + + + + + + + + +
        + + +{LOGO} +
        + + + +
        +{SETSTYLE=top_left_menu} +{MENU=1} +
        +{SETSTYLE=bottom_left_menu} +{MENU=2} +
        + +
        + + + + + + + + + +
        +{SEARCH} +
        + +{SETSTYLE=default} + + + + + + + +
        +{WMESSAGE} +"; + + +// Main footer +$FOOTER = " +{SETSTYLE=paperclip} +{MENU=3} +{SETSTYLE=right_menu} +{MENU=4} +{SETSTYLE=post_it} +{MENU=5} +
        + +
        + +
        +{SITEDISCLAIMER} +
        "; + +// Custom footer for pages with no right menu area. Uncomment the $CUSTOMPAGES line below the +// footer to activate and use. + +$CUSTOMFOOTER['No_Right_Menu_Area'] = " + + + + + + + +
        +{SITEDISCLAIMER} +
        "; + + + // Uncomment the below line (remove the // ) and enter in the filenames (or part of) for + // those pages you wish to use the custom page layout defined above (separate with spaces). + + // $CUSTOMPAGES['No_Right_Menu_Area'] = "forum.php forum_post.php forum_viewtopic.php"; + + +// Define attributes associated with site links. + +define('PRELINK', ''); // Prefixed to all links as a group +define('POSTLINK', ''); // Postfixed to all links as a group +define('LINKSTART', ''); // Prefixed to each indivdual link +define('LINKEND', ''); // Postfixed to each indivdual link +define('LINKDISPLAY', 1); +define('LINKALIGN', 'left'); + + +// News style + +$NEWSSTYLE = "
        {STICKY_ICON}{NEWSTITLE}
        {NEWSIMAGE}{NEWSBODY}{EXTENDED}
        + +
        +  +{NEWSCOMMENTS}{TRACKBACK} +
        + + + + + + + + + +
        +{NEWSICON} + +".LAN_THEME_5." {NEWSAUTHOR} ".LAN_THEME_6." {NEWSDATE} + +{EMAILICON}{PRINTICON}{PDFICON}{ADMINOPTIONS} +
        "; + + +// Define attributes associated with news style. + +define('ICONMAIL', 'email_16.png'); +define('ICONPRINT', 'print_16.png'); +define('ICONSTYLE', 'border: 0px'); +define('COMMENTOFFSTRING', LAN_THEME_1); +define('COMMENTLINK', LAN_THEME_2); +define('PRE_EXTENDEDSTRING', '

        [ '); +define('EXTENDEDSTRING', LAN_THEME_3); +define('POST_EXTENDEDSTRING', ' ]
        '); +define('TRACKBACKSTRING', LAN_THEME_4); +define('TRACKBACKBEFORESTRING', '  |  '); + + +// Table style + +function tablestyle($caption, $text, $mode){ + global $style; + + if ($style == 'top_left_menu') + { + echo "
        "; + if (USER && $mode == 'login') + { + echo "
        "; + } + echo "
        ".$caption."
        ".$text."
        "; + } + else if ($style == 'paperclip') + { + echo "
        +
        "; + if ($caption) + { + echo "
        ".$caption."
        "; + } + echo $text."
        "; + } + else if ($style == 'post_it') + { + echo "
        +
        ".$caption."
        ".$text."
        "; + } + else if ($style == 'bottom_left_menu' || $style == 'right_menu') + { + echo ""; + } + else + { + echo "
        ".$caption."
        ".$text."
        "; + } + +} + + +// Comment post style +$sc_style['REPLY']['pre'] = ""; +$sc_style['REPLY']['post'] = ""; + +$sc_style['SUBJECT']['pre'] = ""; +$sc_style['SUBJECT']['post'] = ""; + +$sc_style['COMMENTEDIT']['pre'] = ""; +$sc_style['COMMENTEDIT']['post'] = ""; + +$sc_style['JOINED']['post'] = "
        "; + +$sc_style['LOCATION']['post'] = "
        "; + +$sc_style['RATING']['post'] = "

        "; + +$sc_style['RATING']['post'] = "
        "; + +$COMMENTSTYLE = "
        + + + +{REPLY}{SUBJECT} + + + + +{COMMENTEDIT} +
        ".LAN_THEME_5." {USERNAME} ".LAN_THEME_6." {TIMEDATE} +
        +
        +{AVATAR} +
        +{LEVEL}{JOINED}{COMMENTS}{LOCATION}{IPADDRESS} +
        +{COMMENT} +{RATING} +{SIGNATURE} +
        +
        "; + + +// Search shortcode style +$SEARCH_SHORTCODE = " +"; + + +// Chatbox post style +$CHATBOXSTYLE = "
        +{USERNAME}
        {TIMEDATE}
        {MESSAGE}
        "; + + +?> \ No newline at end of file diff --git a/e107_themes/sebes/images/arrow.png b/e107_themes/sebes/images/arrow.png new file mode 100644 index 000000000..c424321a6 Binary files /dev/null and b/e107_themes/sebes/images/arrow.png differ diff --git a/e107_themes/sebes/images/button.png b/e107_themes/sebes/images/button.png new file mode 100644 index 000000000..1e3d494be Binary files /dev/null and b/e107_themes/sebes/images/button.png differ diff --git a/e107_themes/sebes/images/fcaption.png b/e107_themes/sebes/images/fcaption.png new file mode 100644 index 000000000..fe711a44b Binary files /dev/null and b/e107_themes/sebes/images/fcaption.png differ diff --git a/e107_themes/sebes/images/forumheader.png b/e107_themes/sebes/images/forumheader.png new file mode 100644 index 000000000..dc27bb398 Binary files /dev/null and b/e107_themes/sebes/images/forumheader.png differ diff --git a/e107_themes/sebes/images/header.png b/e107_themes/sebes/images/header.png new file mode 100644 index 000000000..28bb06b97 Binary files /dev/null and b/e107_themes/sebes/images/header.png differ diff --git a/e107_themes/sebes/images/logo1.png b/e107_themes/sebes/images/logo1.png new file mode 100644 index 000000000..c8fc23bbe Binary files /dev/null and b/e107_themes/sebes/images/logo1.png differ diff --git a/e107_themes/sebes/images/logo1_template.png b/e107_themes/sebes/images/logo1_template.png new file mode 100644 index 000000000..fa633c255 Binary files /dev/null and b/e107_themes/sebes/images/logo1_template.png differ diff --git a/e107_themes/sebes/images/logo2.png b/e107_themes/sebes/images/logo2.png new file mode 100644 index 000000000..6d4a90478 Binary files /dev/null and b/e107_themes/sebes/images/logo2.png differ diff --git a/e107_themes/sebes/images/logo2_template.png b/e107_themes/sebes/images/logo2_template.png new file mode 100644 index 000000000..fdd74d181 Binary files /dev/null and b/e107_themes/sebes/images/logo2_template.png differ diff --git a/e107_themes/sebes/images/marrow.png b/e107_themes/sebes/images/marrow.png new file mode 100644 index 000000000..b28a05ed6 Binary files /dev/null and b/e107_themes/sebes/images/marrow.png differ diff --git a/e107_themes/sebes/images/oarrow.png b/e107_themes/sebes/images/oarrow.png new file mode 100644 index 000000000..b9621181e Binary files /dev/null and b/e107_themes/sebes/images/oarrow.png differ diff --git a/e107_themes/sebes/images/search.png b/e107_themes/sebes/images/search.png new file mode 100644 index 000000000..e05b0ca13 Binary files /dev/null and b/e107_themes/sebes/images/search.png differ diff --git a/e107_themes/sebes/images/selarrow.png b/e107_themes/sebes/images/selarrow.png new file mode 100644 index 000000000..3ea11781b Binary files /dev/null and b/e107_themes/sebes/images/selarrow.png differ diff --git a/e107_themes/sebes/index.html b/e107_themes/sebes/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/sebes/languages/English.php b/e107_themes/sebes/languages/English.php new file mode 100644 index 000000000..892c4c9fb --- /dev/null +++ b/e107_themes/sebes/languages/English.php @@ -0,0 +1,26 @@ +jalist"); +define("LAN_THEME_2", "Read/Post Comment: "); +define("LAN_THEME_3", "Comments are turned off for this item"); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); + +?> diff --git a/e107_themes/sebes/preview.jpg b/e107_themes/sebes/preview.jpg new file mode 100644 index 000000000..4c75201c9 Binary files /dev/null and b/e107_themes/sebes/preview.jpg differ diff --git a/e107_themes/sebes/style.css b/e107_themes/sebes/style.css new file mode 100644 index 000000000..c08490ea9 --- /dev/null +++ b/e107_themes/sebes/style.css @@ -0,0 +1,275 @@ +body { + color: #000; + font: 11px verdana, tahoma, arial, sans-serif; + background-color: #D1CFCF; +} +a { + color: #035479; + text-decoration: none; +} +a:hover { + color: #DC6504; + text-decoration: none; +} + +.mainbox { + border: 1px solid #879397; + background-color: #fff; + color: #000; +} + +#banner { + position: absolute; + right:20px; + top:40px; +} + +#logo1 { + background-image: url(images/logo1.png); + width: 215px; + height: 104px; +} + +#logo2 { + background-image: url(images/logo2.png); + width: 215px; + height: 24px; +} + +#heading { + background-image: url(images/header.png); + width: 100%; + height: 104px; + background-repeat: repeat-x; + +} + +.smalltext { + color: #000; + font: 10px verdana, tahoma, arial, sans-serif; +} + +.headertext { + color: #DC6504; + font: 16px verdana, tahoma, arial, sans-serif; + font-weight: bold; +} + +.indent { + border: 1px solid #D1CFCF; + background-color: #efefef; + color: #727272; + font: 7pt verdana, tahoma, arial, sans-serif; + padding: 10px; +} + +.docinnerbox { + padding: 10px; + text-align: left; +} + +#doclinkcolumn { + width: 214px; + background-color: #f0f0f0; + vertical-align: top; +} + +#docmaincolumn { + background-color: #fff; + border-left: 1px solid #000; + vertical-align: top; +} + +#searchbox { + text-align: right; + padding-right: 6px; +} + +form { + margin: 2px 0px 0px 0px; +} + +p { + margin: 0px; +} + +#info { + background-image: url(images/info.png); + background-repeat: repeat-x; + height: 20px; + width: 100%; +} + +ol, ul{ + margin-top: 0; + margin-bottom: 0; +} + +.captiontext, h1 { + color: #DC6504; + font: 14px verdana, tahoma, arial, sans-serif; + margin: 0; +} + +.caption { + color: #DC6504; + font: 12px verdana, tahoma, arial, sans-serif; + margin: 0; +} + +hr { + border-top: #666 1px solid; + height: 1px; + width: 100%; + text-align:center; +} + +.helpbox { + color:#000; + font: 9px tahoma, verdana, arial, helvetica, sans-serif; + border: 0px none red; + background-color: transparent; +} + +#commentform { + text-align: left; +} + +#commentformbutton { + text-align: left; +} + +.button { + border: 1px solid #000; + color: #000; + font: 7pt verdana, tahoma, arial, helvetica, sans-serif; + text-align:center; + background-image : url(images/button.png); +} + +.tbox { + background-color: #ddd; + border: 1px solid #bbb; + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; color: #777; +} + +.code_highlight { + width: 100%; + background-color: #efefef; + border: 1px solid #e0e0e0; +} + +.comment { + background-color: #f3f1f1; + width: 100%; + border: 1px solid #e0e0e0; +} + +.lowlight { + width: 100%; + background-color: #e5e5e5; + font-weight: bold; +} + +.compad { + padding: 4px; +} + +.spacer { + padding: 2px 0 2px 0; +} + +.center { + text-align: center; + margin-left: auto; + margin-right: auto; +} + +.tbox.chatbox { + width: 88%; + margin-left: auto; + margin-right: auto; +} + + + +.fborder { + border: #486386 1px solid; +} +.forumheader, .nforumcaption{ + background-color: #f3f3f7; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + background-image : url(images/forumheader.png); + border-top: 1px solid #becde0; + border-bottom: 1px solid #e2e9f1; + border-left: 0; + border-right: 0; + height: 20px; +} + +.finfobar{ + background-color: #CCC8C8; + color:#000; + padding: 4px; + border: 1px solid #C3BDBD; + text-align: left; + background-image : url(images/forumheader.png); + font: 11px verdana, tahoma, arial, helvetica, sans-serif; +} + +.forumheader2{ + background-color: #f4f6fb; + font: 12px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #f4f6fb 1px solid; +} + +.forumheader3{ + background-color: #f1f4fd; + font: 11px verdana, tahoma, arial, helvetica, sans-serif; + color:#000; + padding: 4px; + border: #f1f4fd 1px solid; +} + +.forumheader3_alt{ + background-color: #f0f0f0; +} + +.forumborder{ + border: #000080 1px solid; +} + +.fcaption { + border-bottom: 1px solid #becde0; + border-top: 1px solid #e2e9f1; + border-left: 0; + border-right: 0; + background-image : url(images/fcaption.png); + padding: 2px 0 2px 4px; + background-color: #f9fafb; + font: 9pt verdana, tahoma, arial, helvetica, sans-serif; + color:#616060; + height: 25px; +} + +.smallblacktext, .defaulttext { + font: 8pt tahoma, verdana, arial, helvetica, sans-serif; + color:#32475f; +} + +td { + text-align: left; +} + +img { + vertical-align: middle; +} + +.linkspage_button{ + vertical-align: middle; + border:0px; +} \ No newline at end of file diff --git a/e107_themes/sebes/theme.php b/e107_themes/sebes/theme.php new file mode 100644 index 000000000..51d847980 --- /dev/null +++ b/e107_themes/sebes/theme.php @@ -0,0 +1,151 @@ +".LAN_THEME_1.""); + +// [layout] + +$layout = "_default"; +$register_sc[]='USER_CONTRIBUTIONS'; +$HEADER = " +
        + + + + + + + + + + +
         
        + + + + + +
        +
        +{SETSTYLE=menu} +

        +{SITELINKS} +{MENU=1} +
        +
        +
        +{SETSTYLE=main} +"; + + +$FOOTER = " +
        +
        +
        + +
        {SITEDISCLAIMER}
        {THEMEDISCLAIMER}
        + +"; + + +define('PRELINK', ""); +define('POSTLINK', ""); +define('LINKSTART', " "); +define("LINKSTART_HILITE", " "); +define('LINKEND', "
        "); +define('LINKDISPLAY', 2); +define('LINKALIGN', "left"); + + +define("BULLET", "arrow.png"); + +/* [newsstyle] */ + +$NEWSSTYLE = " +
        {NEWSTITLE}
        +
        {NEWSAUTHOR} on {NEWSDATE} | {NEWSCOMMENTS}{TRACKBACK} +
        +{NEWSBODY} +{EXTENDED} +

        "; + +define("ICONSTYLE", ""); +define("COMMENTLINK", LAN_THEME_2); +define("COMMENTOFFSTRING", LAN_THEME_3); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " | "); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode) +{ + global $style; + if($style == "menu") + { + echo "
        {$caption}
        {$text}

        \n"; + } + else + { + if($caption) + { + echo "
        {$caption}

        {$text}\n"; + } + else + { + echo $text."\n"; + } + } +} + +$COMMENTSTYLE = " +
        +
        {USERNAME} {TIMEDATE}
        +
        {COMMENT} {COMMENTEDIT}
        +
        +"; + + +$CHATBOXSTYLE = " +

        {USERNAME} | {TIMEDATE}
        +
        +{MESSAGE} +
        "; + + +?> \ No newline at end of file diff --git a/e107_themes/templates/admin_template.php b/e107_themes/templates/admin_template.php new file mode 100644 index 000000000..7f3e3519e --- /dev/null +++ b/e107_themes/templates/admin_template.php @@ -0,0 +1,57 @@ + +{ADMIN_LOGO} +
        +{ADMIN_LOGGED} +{ADMIN_SEL_LAN} +{ADMIN_USERLAN} +
        + + + + + + +
        +{ADMIN_NAV} +{ADMIN_LANG} +{ADMIN_PWORD} +{ADMIN_STATUS=request} +{ADMIN_LATEST=request} +{ADMIN_LOG=request} +{ADMIN_HELP} +{ADMIN_MSG} +{ADMIN_PLUGINS} + +"; + +$ADMIN_FOOTER = " +{ADMIN_MENU} +{ADMIN_PRESET} +{ADMIN_SITEINFO} +{ADMIN_DOCS} +
        +{ADMIN_CREDITS} +"; + +?> \ No newline at end of file diff --git a/e107_themes/templates/banner_template.php b/e107_themes/templates/banner_template.php new file mode 100644 index 000000000..b0bcc148e --- /dev/null +++ b/e107_themes/templates/banner_template.php @@ -0,0 +1,92 @@ +\n +
        \n + + + + + + + + + + + + + +
        ".BANNERLAN_16."{BANNER_LOGIN_TABLE_LOGIN}\n
        ".BANNERLAN_17."{BANNER_LOGIN_TABLE_PASSW}\n
        {BANNER_LOGIN_TABLE_SUBMIT}
        +
        +
        "; + +} +// ##### ------------------------------------------------------------------------------------------ + +// ##### BANNER TABLE ----------------------------------------------------------------------------- +if(!$BANNER_TABLE_START){ + $BANNER_TABLE_START = " + + + + + + + + + + + "; +} +if(!$BANNER_TABLE){ + $BANNER_TABLE = " + + + + + + + + + + + + + "; + + if($BANNER_TABLE_IP){ + $BANNER_TABLE .= " + + + + "; + } + + $BANNER_TABLE .= " + + "; +} +if(!$BANNER_TABLE_END){ + $BANNER_TABLE_END = " +
        ".BANNERLAN_21."
        ".BANNERLAN_22."".BANNERLAN_23."".BANNERLAN_24."".BANNERLAN_25."".BANNERLAN_26."".BANNERLAN_27."".BANNERLAN_28."
        {BANNER_TABLE_CLIENTNAME}{BANNER_TABLE_BANNER_ID}{BANNER_TABLE_BANNER_CLICKS}{BANNER_TABLE_CLICKPERCENTAGE}{BANNER_TABLE_BANNER_IMPRESSIONS}{BANNER_TABLE_IMPRESSIONS_PURCHASED}{BANNER_TABLE_IMPRESSIONS_LEFT}
         {BANNER_TABLE_ACTIVE}{BANNER_TABLE_STARTDATE} {BANNER_TABLE_ENDDATE}
        ".BANNERLAN_35.": {BANNER_TABLE_IP_LAN}{BANNER_TABLE_IP}
         
        "; +} +// ##### ------------------------------------------------------------------------------------------ + +// ##### BANNER MENU ----------------------------------------------------------------------------- +if(!isset($BANNER_MENU_START)){ + $BANNER_MENU_START = "
        "; +} +if(!isset($BANNER_MENU)){ + $BANNER_MENU = "{BANNER}

        "; +} +if(!isset($BANNER_MENU_END)){ + $BANNER_MENU_END = "
        "; +} +// ##### ------------------------------------------------------------------------------------------ + +?> \ No newline at end of file diff --git a/e107_themes/templates/bbcode_template.php b/e107_themes/templates/bbcode_template.php new file mode 100644 index 000000000..10caea3db --- /dev/null +++ b/e107_themes/templates/bbcode_template.php @@ -0,0 +1,68 @@ +"; +// $sc_style['BB_HELP']['post'] = ""; + + + +// -------- Admin Templates ---------------------- + +$BBCODE_TEMPLATE_ADMIN = " + {BB_HELP=admin}
        + {BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left} + {BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes} + {BB_PREIMAGEDIR=".e_IMAGE."} + {BB=preimage}{BB=prefile}{BB=flash} +"; + +// $BBCODE_TEMPLATE_ADMIN .= "{BB=blank}"; + +$BBCODE_TEMPLATE_NEWSPOST = " + {BB_HELP=$mode}
        + {BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left} + {BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes} + {BB_PREIMAGEDIR=".e_IMAGE."newspost_images/} + {BB=preimage}{BB=prefile}{BB=flash} +"; + +$BBCODE_TEMPLATE_CPAGE = " + {BB_HELP}
        + {BB=newpage} + {BB=links}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right} + {BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes} + {BB_PREIMAGEDIR=".e_IMAGE."custom/} + {BB=preimage}{BB=prefile}{BB=flash} +"; + + + +?> \ No newline at end of file diff --git a/e107_themes/templates/comment_template.php b/e107_themes/templates/comment_template.php new file mode 100644 index 000000000..d910f5564 --- /dev/null +++ b/e107_themes/templates/comment_template.php @@ -0,0 +1,90 @@ +"; +$sc_style['SUBJECT']['post'] = ""; + +$sc_style['USERNAME']['pre'] = ""; +$sc_style['USERNAME']['post'] = ""; + +$sc_style['TIMEDATE']['pre'] = ""; +$sc_style['TIMEDATE']['post'] = ""; + +$sc_style['REPLY']['pre'] = ""; +$sc_style['REPLY']['post'] = ""; + +$sc_style['AVATAR']['pre'] = "
        "; +$sc_style['AVATAR']['post'] = "
        "; + +$sc_style['COMMENTS']['pre'] = ""; +$sc_style['COMMENTS']['post'] = "
        "; + +$sc_style['JOINED']['pre'] = ""; +$sc_style['JOINED']['post'] = "
        "; + +$sc_style['COMMENT']['pre'] = ""; +$sc_style['COMMENT']['post'] = "
        "; + +$sc_style['RATING']['pre'] = ""; +$sc_style['RATING']['post'] = "
        "; + +$sc_style['IPADDRESS']['pre'] = ""; +$sc_style['IPADDRESS']['post'] = "
        "; + +$sc_style['LEVEL']['pre'] = ""; +$sc_style['LEVEL']['post'] = "
        "; + +$sc_style['LOCATION']['pre'] = ""; +$sc_style['LOCATION']['post'] = "
        "; + +$sc_style['SIGNATURE']['pre'] = ""; +$sc_style['SIGNATURE']['post'] = "
        "; + + +$COMMENTSTYLE = " + + + + + + + + +
        + {SUBJECT} {USERNAME} {TIMEDATE} {REPLY} {COMMENTEDIT} +
        + {AVATAR}{COMMENTS}{JOINED} + + {COMMENT} + {RATING} + {IPADDRESS} + {LEVEL} + {LOCATION} + {SIGNATURE} +
        +
        "; + + +?> \ No newline at end of file diff --git a/e107_themes/templates/contact_template.php b/e107_themes/templates/contact_template.php new file mode 100644 index 000000000..44da185a2 --- /dev/null +++ b/e107_themes/templates/contact_template.php @@ -0,0 +1,64 @@ + + + {SITECONTACTINFO} +
        + + + "; +} + +$sc_style['CONTACT_EMAIL_COPY']['pre'] = ""; +$sc_style['CONTACT_EMAIL_COPY']['post'] = LANCONTACT_07.""; + +$sc_style['CONTACT_PERSON']['pre'] = "".LANCONTACT_14."
        "; +$sc_style['CONTACT_PERSON']['post'] = ""; + +$sc_style['CONTACT_IMAGECODE']['pre'] = "".LANCONTACT_14.""; +$sc_style['CONTACT_IMAGECODE']['post'] = ""; + +$sc_style['CONTACT_IMAGECODE']['pre'] = "".LANCONTACT_16."
        "; +$sc_style['CONTACT_IMAGECODE']['post'] = ""; + +$sc_style['CONTACT_IMAGECODE_INPUT']['pre'] = ""; +$sc_style['CONTACT_IMAGECODE_INPUT']['post'] = ""; + + +if(!$CONTACT_FORM){ + $CONTACT_FORM = " +
        + + {CONTACT_PERSON} + + + + {CONTACT_EMAIL_COPY} + + {CONTACT_IMAGECODE} + {CONTACT_IMAGECODE_INPUT} + +
        ".LANCONTACT_03."
        + +
        ".LANCONTACT_04."
        + +
        + ".LANCONTACT_05."
        + +
        + ".LANCONTACT_06."
        + +
        + +
        +
        "; +} + + +?> diff --git a/e107_themes/templates/download_template.php b/e107_themes/templates/download_template.php new file mode 100644 index 000000000..dd5ae7d7d --- /dev/null +++ b/e107_themes/templates/download_template.php @@ -0,0 +1,350 @@ + + \n + + + + + + + "; +} +if(!$DOWNLOAD_CAT_PARENT_TABLE){ + + $DOWNLOAD_CAT_PARENT_TABLE .= " + + + "; +} + +if(!$DOWNLOAD_CAT_CHILD_TABLE){ + + $DOWNLOAD_CAT_CHILD_TABLE .= " + + + + + + + + {DOWNLOAD_CAT_SUBSUB} + "; + +} + +if(!$DOWNLOAD_CAT_SUBSUB_TABLE) +{ + + $DOWNLOAD_CAT_SUBSUB_TABLE .= " + + + + + + + + "; +} + +if(!$DOWNLOAD_CAT_TABLE_END){ + $DOWNLOAD_CAT_TABLE_END = " + + +
         ".LAN_dl_19."".LAN_dl_20."".LAN_dl_21."".LAN_dl_18."
        + {DOWNLOAD_CAT_MAIN_ICON} {DOWNLOAD_CAT_MAIN_NAME} +
        + {DOWNLOAD_CAT_SUB_ICON} + + {DOWNLOAD_CAT_SUB_NEW_ICON} {DOWNLOAD_CAT_SUB_NAME}
        + + {DOWNLOAD_CAT_SUB_DESCRIPTION} + +
        + {DOWNLOAD_CAT_SUB_COUNT} + + {DOWNLOAD_CAT_SUB_SIZE} + + {DOWNLOAD_CAT_SUB_DOWNLOADED} +
        +   + + + + + + + +
        ". + LAN_dl_42." + + {DOWNLOAD_CAT_SUBSUB_ICON} + + {DOWNLOAD_CAT_SUBSUB_NEW_ICON} {DOWNLOAD_CAT_SUBSUB_NAME}
        + + {DOWNLOAD_CAT_SUBSUB_DESCRIPTION} + +
        +
        + {DOWNLOAD_CAT_SUBSUB_COUNT} + + {DOWNLOAD_CAT_SUBSUB_SIZE} + + {DOWNLOAD_CAT_SUBSUB_DOWNLOADED} +
        {DOWNLOAD_CAT_NEWDOWNLOAD_TEXT}
        {DOWNLOAD_CAT_SEARCH}
        + \n"; +} +// ##### ------------------------------------------------------------------------------------------ + + + +// ##### LIST TABLE ------------------------------------------------------------------------------- +if(!$DOWNLOAD_LIST_TABLE_START){ + + $DOWNLOAD_LIST_TABLE_START = " +
        +
        + \n + + + + + + + + + + + + "; + +} + +if(!$DOWNLOAD_LIST_TABLE){ + $DOWNLOAD_LIST_TABLE .= " + + + + + + + + + "; +} + +if(!$DOWNLOAD_LIST_TABLE_END){ + $DOWNLOAD_LIST_TABLE_END = " + +
        + ".LAN_dl_37." + +   + ".LAN_dl_38." + +   + ".LAN_dl_39." + +   + +
        ".LAN_dl_28."".LAN_dl_22."".LAN_dl_24."".LAN_dl_21."".LAN_dl_29."".LAN_dl_12."".LAN_dl_8."
        + {DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME} + + {DOWNLOAD_LIST_DATESTAMP} + + {DOWNLOAD_LIST_AUTHOR} + + {DOWNLOAD_LIST_FILESIZE} + + {DOWNLOAD_LIST_REQUESTED} + + {DOWNLOAD_LIST_RATING} + + {DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON} +
        {DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}
        +
        +
        \n"; +} +// ##### ------------------------------------------------------------------------------------------ + + +// ##### VIEW TABLE ------------------------------------------------------------------------------- + +$DL_VIEW_PAGETITLE = PAGE_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}"; +$DL_VIEW_CAPTION = "{DOWNLOAD_VIEW_CAPTION}"; + + $DL_VIEW_NEXTPREV = " +
        + + + + + + +
        {DOWNLOAD_VIEW_PREV}{DOWNLOAD_BACK_TO_LIST}{DOWNLOAD_VIEW_NEXT}
        +
        \n"; + +// Only renders the following rows when data is present. +$sc_style['DOWNLOAD_VIEW_AUTHOR_LAN']['pre'] = ""; +$sc_style['DOWNLOAD_VIEW_AUTHOR_LAN']['post'] = ""; + +$sc_style['DOWNLOAD_VIEW_AUTHOR']['pre'] = ""; +$sc_style['DOWNLOAD_VIEW_AUTHOR']['post'] = ""; + +$sc_style['DOWNLOAD_VIEW_AUTHOREMAIL_LAN']['pre'] = ""; +$sc_style['DOWNLOAD_VIEW_AUTHOREMAIL_LAN']['post'] = ""; + +$sc_style['DOWNLOAD_VIEW_AUTHOREMAIL']['pre'] = ""; +$sc_style['DOWNLOAD_VIEW_AUTHOREMAIL']['post'] = ""; + +$sc_style['DOWNLOAD_VIEW_AUTHORWEBSITE_LAN']['pre'] = ""; +$sc_style['DOWNLOAD_VIEW_AUTHORWEBSITE_LAN']['post'] = ""; + +$sc_style['DOWNLOAD_VIEW_AUTHORWEBSITE']['pre'] = ""; +$sc_style['DOWNLOAD_VIEW_AUTHORWEBSITE']['post'] = ""; + +if(!$DOWNLOAD_VIEW_TABLE){ + $DOWNLOAD_VIEW_TABLE .= " +
        + \n + + + + + {DOWNLOAD_VIEW_AUTHOR_LAN} + {DOWNLOAD_VIEW_AUTHOR} + + {DOWNLOAD_VIEW_AUTHOREMAIL_LAN} + {DOWNLOAD_VIEW_AUTHOREMAIL} + + {DOWNLOAD_VIEW_AUTHORWEBSITE_LAN} + {DOWNLOAD_VIEW_AUTHORWEBSITE} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {DOWNLOAD_VIEW_NAME} +
        {DOWNLOAD_VIEW_DESCRIPTION_LAN}{DOWNLOAD_VIEW_DESCRIPTION}
        {DOWNLOAD_VIEW_IMAGE_LAN}{DOWNLOAD_VIEW_IMAGE}
        {DOWNLOAD_VIEW_FILESIZE_LAN}{DOWNLOAD_VIEW_FILESIZE}
        {DOWNLOAD_VIEW_DATE_LAN}{DOWNLOAD_VIEW_DATE=long}
        {DOWNLOAD_VIEW_REQUESTED_LAN}{DOWNLOAD_VIEW_REQUESTED}
        {DOWNLOAD_VIEW_LINK_LAN}{DOWNLOAD_VIEW_LINK}
        {DOWNLOAD_VIEW_RATING_LAN}{DOWNLOAD_VIEW_RATING}
        {DOWNLOAD_REPORT_LINK}
        +
        {DOWNLOAD_ADMIN_EDIT}
        +
        \n"; +} + +// ##### ------------------------------------------------------------------------------------------ + +// ##### MIRROR LIST ------------------------------------------------------------------------------- + +if(!$DOWNLOAD_MIRROR_START) +{ + $DOWNLOAD_MIRROR_START = " +
        + + + + + + + + + + + "; +} + +if(!$DOWNLOAD_MIRROR) +{ + $DOWNLOAD_MIRROR = " + + + + + + + "; +} + +if(!$DOWNLOAD_MIRROR_END) +{ + $DOWNLOAD_MIRROR_END = " +
        {DOWNLOAD_MIRROR_REQUEST}
        {DOWNLOAD_MIRROR_HOST_LAN}{DOWNLOAD_MIRROR_DESCRIPTION_LAN}{DOWNLOAD_MIRROR_LOCATION_LAN}{DOWNLOAD_MIRROR_GET_LAN}
        {DOWNLOAD_MIRROR_IMAGE}

        {DOWNLOAD_MIRROR_REQUESTS}
        {DOWNLOAD_TOTAL_MIRROR_REQUESTS}
        {DOWNLOAD_MIRROR_DESCRIPTION}
        {DOWNLOAD_MIRROR_LOCATION}
        {DOWNLOAD_MIRROR_LINK} {DOWNLOAD_MIRROR_FILESIZE}
        +
        + "; +} + +// ##### ------------------------------------------------------------------------------------------ +?> \ No newline at end of file diff --git a/e107_themes/templates/email_template.php b/e107_themes/templates/email_template.php new file mode 100644 index 000000000..2863aab60 --- /dev/null +++ b/e107_themes/templates/email_template.php @@ -0,0 +1,79 @@ + + + +{STYLESHEET} + + +
        +"; + + +$EMAIL_FOOTER = " +

        +{SITENAME=link} +
        + +"; + + + +$SIGNUPEMAIL_TEMPLATE = " +
        +
        +".LAN_EMAIL_01." {USERNAME},
        +
        ". +LAN_403." {SITENAME}
        +".LAN_SIGNUP_21." ...
        +
        +{ACTIVATION_LINK}
        +
        +".LAN_SIGNUP_18."...
        +
        +".LAN_LOGINNAME.": {LOGINNAME}
        +".LAN_PASSWORD.": {PASSWORD}
        +
        +".LAN_EMAIL_04."
        +".LAN_EMAIL_05."
        +
        +".LAN_EMAIL_06."
        +
        +{SITENAME}
        +{SITEURL} +

        +{IMAGE1} +
        +
        +"; +?> \ No newline at end of file diff --git a/e107_themes/templates/footer_default.php b/e107_themes/templates/footer_default.php new file mode 100644 index 000000000..6c1d1a71f --- /dev/null +++ b/e107_themes/templates/footer_default.php @@ -0,0 +1,255 @@ + db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb); +} +if (!is_object($eTraffic)) { + $eTraffic = new e107_traffic; + $eTraffic->Bump('Lost Traffic Counters'); +} + +unset($fh); + + +if(varset($e107_popup)!=1){ + // + // B Send footer template + // + parseheader(($ph ? $cust_footer : $FOOTER)); + + // + // C Dump all debug and traffic information + // + $eTimingStop = microtime(); + global $eTimingStart; + $rendertime = number_format($eTraffic->TimeDelta( $eTimingStart, $eTimingStop ), 4); + $db_time = number_format($db_time,4); + $rinfo = ''; + + if($pref['displayrendertime']){ $rinfo .= "Render time: {$rendertime} second(s); {$db_time} of that for queries. "; } + if($pref['displaysql']){ $rinfo .= "DB queries: ".$sql -> db_QueryCount().". "; } + if(isset($pref['display_memory_usage']) && $pref['display_memory_usage']){ $rinfo .= "Memory Usage: ".$e107->get_memory_usage(); } + if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; } + echo ($rinfo ? "\n
        {$rinfo}
        \n" : ""); + + + if ((ADMIN || $pref['developer']) && E107_DEBUG_LEVEL) { + global $db_debug,$ns; + echo "\n\n"; + if (!isset($ns)) { + echo "Why did ns go away?
        "; + $ns = new e107table; + } + + $tmp = $eTraffic->Display(); + if (strlen($tmp)) { + $ns->tablerender('Traffic Counters', $tmp); + } + $tmp = $db_debug->Show_Performance(); + if (strlen($tmp)) { + $ns->tablerender('Time Analysis', $tmp); + } + $tmp = $db_debug->Show_SQL_Details(); + if (strlen($tmp)) { + $ns->tablerender('SQL Analysis', $tmp); + } + $tmp = $db_debug->Show_SC_BB(); + if (strlen($tmp)) { + $ns->tablerender('Shortcodes / BBCode',$tmp); + } + $tmp = $db_debug->Show_PATH(); + if (strlen($tmp)) { + $ns->tablerender('Paths', $tmp); + } + $tmp = $db_debug->Show_DEPRECATED(); + if (strlen($tmp)) { + $ns->tablerender('Deprecated Function Usage', $tmp); + } + } + + /* + changes by jalist 24/01/2005: + show sql queries + usage: add ?showsql to query string, must be admin + */ + + if(ADMIN && isset($queryinfo) && is_array($queryinfo)) + { + $c=1; + $mySQLInfo = $sql->mySQLinfo; + echo " + + \n\n"; + foreach ($queryinfo as $infovalue) + { + echo "\n\n\n"; + $c++; + } + echo "
        IDSQL Queries
        {$c}{$infovalue}
        "; + } + +// +// D Close DB connection. We're done talking to underlying MySQL +// + $sql -> db_Close(); // Only one is needed; the db is only connected once even with several $sql objects + + // + // Just before we quit: dump quick timer if there is any + // Works any time we get this far. Not calibrated, but it is quick and simple to use. + // To use: eQTimeOn(); eQTimeOff(); + // + $tmp = eQTimeElapsed(); + if (strlen($tmp)) { + global $ns; + $ns->tablerender('Quick Admin Timer',"Results: {$tmp} microseconds"); + } + +} // End of regular-page footer (the above NOT done for popups) + +if ($pref['developer']) { + global $oblev_at_start,$oblev_before_start; + if (ob_get_level() != $oblev_at_start) { + $oblev = ob_get_level(); + $obdbg = "
        Software defect detected; ob_*() level {$oblev} at end instead of ($oblev_at_start). POPPING EXTRA BUFFERS!
        "; + while (ob_get_level() > $oblev_at_start) { + ob_end_flush(); + } + echo $obdbg; + } + // 061109 PHP 5 has a bug such that the starting level might be zero or one. + // Until they work that out, we'll disable this message. + // Devs can re-enable for testing as needed. + // + if (0 && $oblev_before_start != 0) { + $obdbg = "
        Software warning; ob_*() level {$oblev_before_start} at start; this page not properly integrated into its wrapper.
        "; + echo $obdbg; + } +} + +if((ADMIN == true || $pref['developer']) && $error_handler->debug == true) { + echo " +

        +
        +

        PHP Errors:


        + ".$error_handler->return_errors()." +
        + "; +} + +// +// E Last themed footer code, usually JS +// +if (function_exists('theme_foot')) { + echo theme_foot(); +} + +// +// F any included JS footer scripts +// +global $footer_js; +if(isset($footer_js) && is_array($footer_js)) +{ + $footer_js = array_unique($footer_js); + foreach($footer_js as $fname) + { + echo "\n"; + $js_included[] = $fname; + } +} + +// +// G final JS script keeps user and server time in sync. +// It must be the last thing created before sending the page to the user. +// +// see e107.js and class2.php +// This must be done as late as possible in page processing. +$_serverTime=time(); +$lastSet = isset($_COOKIE['e107_tdSetTime']) ? $_COOKIE['e107_tdSetTime'] : 0; +if (abs($_serverTime - $lastSet) > 120) { + /* update time delay every couple of minutes. + * Benefit: account for user time corrections and changes in internet delays + * Drawback: each update may cause all server times to display a bit different + */ + echo "\n"; +} + +// +// H Final HTML +// +echo ""; + +// +// I Send the buffered page data, along with appropriate headers +// +$page = ob_get_clean(); + +$etag = md5($page); +header("Cache-Control: must-revalidate"); +header("ETag: {$etag}"); + +$pref['compression_level'] == 6; +if(strstr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") || strstr($_SERVER['HTTP_USER_AGENT'], "Mozilla")) { + $browser_support = true; +} +if(ini_get("zlib.output_compression") == false && function_exists("gzencode")) { + $server_support = true; +} +if($pref['compress_output'] == true && $server_support == true && $browser_support == true) { + $level = intval($pref['compression_level']); + $page = gzencode($page, $level); + header("Content-Encoding: gzip", true); + header("Content-Length: ".strlen($page), true); + echo $page; +} else { + header("Content-Length: ".strlen($page), true); + echo $page; +} + +?> \ No newline at end of file diff --git a/e107_themes/templates/fpw_template.php b/e107_themes/templates/fpw_template.php new file mode 100644 index 000000000..3725491bb --- /dev/null +++ b/e107_themes/templates/fpw_template.php @@ -0,0 +1,70 @@ + +
        + + + + + + + + + + + + + + + "; + + if($FPW_TABLE_SECIMG_SECIMG){ + $FPW_TABLE .= " + + + + "; + } + + $FPW_TABLE .=" + + + +
        ".LAN_05."
        ".LAN_FPW1.": + +
        ".LAN_112.": + +
        {FPW_TABLE_SECIMG_LAN}{FPW_TABLE_SECIMG_HIDDEN} {FPW_TABLE_SECIMG_SECIMG}
        + {FPW_TABLE_SECIMG_TEXTBOC}
        +
        + +
        +
        + "; +} +// ##### ------------------------------------------------------------------------------------------ + +// ##### FPW HEADER TABLE ------------------------------------------------------------------------- +if(!$FPW_TABLE_HEADER){ + $FPW_TABLE_HEADER = " +
        +

        + ".(file_exists(THEME."images/login_logo.png") ? "\n" : "\n")." +
        "; +} +// ##### ------------------------------------------------------------------------------------------ + +// ##### FPW FOOTER TABLE ------------------------------------------------------------------------- +if(!$FPW_TABLE_FOOTER){ + $FPW_TABLE_FOOTER = "
        "; +} +// ##### ------------------------------------------------------------------------------------------ + +?> \ No newline at end of file diff --git a/e107_themes/templates/header_default.php b/e107_themes/templates/header_default.php new file mode 100644 index 000000000..16df7eb46 --- /dev/null +++ b/e107_themes/templates/header_default.php @@ -0,0 +1,404 @@ +db_Mark_Time('(Header Top)'); + +// +// *** Code sequence for headers *** +// IMPORTANT: These items are in a carefully constructed order. DO NOT REARRANGE +// without checking with experienced devs! Various subtle things WILL break. +// +// We realize this is a bit (!) of a mess and hope to make further cleanups in a future release. +// +// A: Define themable header parsing +// B: Send HTTP headers that come before any html +// C: Send start of HTML +// D: Send JS +// E: Send CSS +// F: Send Meta Tags and Icon links +// G: Send final theme headers (theme_head() function) +// H: Generate JS for image preloading (setup for onload) +// I: Calculate onload() JS functions to be called +// J: Send end of html and start of +// K: (The rest is ignored for popups, which have no menus) +// L: (optional) Body JS to disable right clicks +// M: Send top of body for custom pages and for news +// N: Send other top-of-body HTML +// +// Load order notes for devs +// * Browsers wait until ALL HTML has loaded before executing ANY JS +// * The last CSS tag downloaded supercedes earlier CSS tags +// * Browsers don't care when Meta tags are loaded. We load last due to +// a quirk of e107's log subsystem. +// * Multiple external file references slow down page load. Each one requires +// browser-server interaction even when cached. +// + +// +// A: Define themeable header parsing +// + +if (!function_exists("parseheader")) { + function parseheader($LAYOUT){ + global $tp; + $tmp = explode("\n", $LAYOUT); + for ($c=0; $c < count($tmp); $c++) { + if (preg_match("/{.+?}/", $tmp[$c])) { + echo $tp -> parseTemplate($tmp[$c]); + } else { + echo $tmp[$c]; + } + } + } +} + +// +// B: Send HTTP headers (these come before ANY html) +// + +// send the charset to the browser - overrides spurious server settings with the lan pack settings. +header("Content-type: text/html; charset=".CHARSET, true); + + +echo (defined("STANDARDS_MODE") ? "" : "")."\n"; + +// +// C: Send start of HTML +// + +echo " + +".SITENAME.(defined("e_PAGETITLE") ? ": ".e_PAGETITLE : (defined("PAGE_NAME") ? ": ".PAGE_NAME : ""))."\n"; + +// +// D: Send JS +// +echo "\n"; + +// Wysiwyg JS support on or off. +if (isset($WYSIWYG) && $WYSIWYG == TRUE && check_class($pref['post_html']) && isset($e_wysiwyg) && $e_wysiwyg != "") { + require_once(e_HANDLER."tiny_mce/wysiwyg.php"); + define("e_WYSIWYG",TRUE); + echo wysiwyg($e_wysiwyg); +}else{ + define("e_WYSIWYG",FALSE); +} + +if (isset($theme_js_php) && $theme_js_php) { + echo "\n"; + if (file_exists(THEME.'theme.js')) { echo "\n"; } + if (filesize(e_FILE.'user.js')) { echo "\n"; } +} + +if (isset($eplug_js) && $eplug_js) { + echo "\n\n"; + echo "\n"; +} + +if((isset($pref['enable_png_image_fix']) && $pref['enable_png_image_fix'] == true) || (isset($sleight) && $sleight == true)) { + echo "\n"; +} + +if (function_exists('headerjs')){echo headerjs(); } + +// +// E: Send CSS +// +echo "\n"; + +if (isset($eplug_css) && $eplug_css) { + echo "\n\n"; + echo "\n"; +} + +echo "\n"; +if(defined("PREVIEWTHEME")) { + echo "\n"; +} else { + $css_default = "all"; + if (isset($theme_css_php) && $theme_css_php) { + echo "\n"; + } else { + if(isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss'])) + { + // Support for print and handheld media. + if(file_exists(THEME."style_mobile.css")){ + echo "\n"; + $css_default = "screen"; + } + if(file_exists(THEME."style_print.css")){ + echo "\n"; + $css_default = "screen"; + } + echo "\n"; + + + } + else + { + // Support for print and handheld media. + if(file_exists(THEME."style_mobile.css")){ + echo "\n"; + $css_default = "screen"; + } + if(file_exists(THEME."style_print.css")){ + echo "\n"; + $css_default = "screen"; + } + echo "\n"; + } + if (!isset($no_core_css) || !$no_core_css) { + echo "\n"; + } + } +} + +// +// DEPRECATED!!! This is used in log/stats.php to generate some css. We'll clean this up in a future release. +// + +if(function_exists('core_head')){ echo core_head(); } + +// +// F: Send Meta Tags and Icon links +// +echo "\n"; + +// Multi-Language meta-tags with merge and override option. + +echo " +\n"; + +echo (defined("CORE_LC")) ? "\n" : ""; + +// --- Load plugin Meta files and eplug_ before others -------- +foreach($pref['e_meta_list'] as $val) +{ + if(is_readable(e_PLUGIN.$val."/e_meta.php")) + { + echo "\n"; + require_once(e_PLUGIN.$val."/e_meta.php"); + } +} + + +$diz_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_description'][e_LANGUAGE]) ? $pref['meta_description'][e_LANGUAGE]." " : ""; +$key_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_keywords'][e_LANGUAGE]) ? $pref['meta_keywords'][e_LANGUAGE]."," : ""; + +function render_meta($type) +{ + global $pref,$tp; + + if (!isset($pref['meta_'.$type][e_LANGUAGE])){ return;} + if (!$pref['meta_'.$type][e_LANGUAGE]){ return; } + + if($type == "tag") + { + return str_replace("<", "<", $tp -> toHTML($pref['meta_tag'][e_LANGUAGE], FALSE, "nobreak, no_hook, no_make_clickable"))."\n"; + } + else + { + return ''."\n"; + } +} + +echo "\n\n"; +echo (defined("META_DESCRIPTION")) ? "\n" : render_meta('description'); +echo (defined("META_KEYWORDS")) ? "\n" : render_meta('keywords'); +echo render_meta('copyright'); +echo render_meta('author'); +echo render_meta('tag'); + +unset($key_merge,$diz_merge); + +// ---------- Favicon --------- +if (file_exists(THEME."favicon.ico")) { + echo "\n\n"; +}elseif (file_exists(e_BASE."favicon.ico")) { + echo "\n\n"; +} + +// +// G: Send Theme Headers +// + + +if(function_exists('theme_head')){ + echo "\n\n"; + echo theme_head(); +} + + +// +// H: Generate JS for image preloads +// +echo "\n\n"; +if ($pref['image_preload']) { + $ejs_listpics = ''; + $handle=opendir(THEME.'images'); + while ($file = readdir($handle)) { + if(preg_match("#(jpg|jpeg|gif|bmp|png)$#i", $file)) { + $ejs_listpics .= $file.","; + } + } + + $ejs_listpics = substr($ejs_listpics, 0, -1); + closedir($handle); + + if (!isset($script_text)) $script_text = ''; + $script_text .= "ejs_preload('".THEME_ABS."images/','".$ejs_listpics."');\n"; +} + +if (isset($script_text) && $script_text) { + echo "\n"; +} + + +// +// I: Calculate JS onload() functions for the BODY tag +// + +$fader_onload=''; +if(in_array('fader_menu', $eMenuActive)) +{ + $fader_onload = 'changecontent(); '; +} + +$links_onload = 'externalLinks();'; +$theme_onload = (defined('THEME_ONLOAD') ? THEME_ONLOAD : ''); +$body_onload = ($fader_onload != '' || $links_onload != '' || $theme_onload != '' ? " onload='".$fader_onload.$links_onload.$theme_onload."'" : ""); + +// +// J: Send end of and start of +// +echo " +\n"; +$sql->db_Mark_Time("Main Page Body"); + +// +// K: (The rest is ignored for popups, which have no menus) +// +//echo "XX - ".$e107_popup; +// require $e107_popup =1; to use it as header for popup without menus +if(!isset($e107_popup)) +{ + $e107_popup = 0; +} +if ($e107_popup != 1) { + +// +// L: (optional) Body JS to disable right clicks +// + if (isset($pref['no_rightclick']) && $pref['no_rightclick']) { + echo "\n"; + } + +// +// M: Send top of body for custom pages and for news +// + if(isset($CUSTOMPAGES)) + { + if (is_array($CUSTOMPAGES)) + { + foreach ($CUSTOMPAGES as $cust_key => $cust_value) + { + $custompage[$cust_key] = explode(' ', $cust_value); + } + } + else + { + $custompage['no_array'] = explode(' ', $CUSTOMPAGES); + } + } + else + { + $custompage['no_array'] = array(); + } + + $ph = FALSE; + if (e_PAGE == 'news.php' && isset($NEWSHEADER)) { + parseheader($NEWSHEADER); + } else { + foreach ($custompage as $key_extract => $cust_extract) { + foreach ($cust_extract as $key => $kpage) { + if ($kpage && strstr(e_SELF, $kpage) || strstr(e_SELF."?".e_QUERY,$kpage)) { + $ph = TRUE; + if ($key_extract=='no_array') { + $cust_header = $CUSTOMHEADER ? $CUSTOMHEADER : $HEADER; + $cust_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER : $FOOTER; + } else { + $cust_header = $CUSTOMHEADER[$key_extract] ? $CUSTOMHEADER[$key_extract] : $HEADER; + $cust_footer = $CUSTOMFOOTER[$key_extract] ? $CUSTOMFOOTER[$key_extract] : $FOOTER; + } + break; + } + } + } + parseheader(($ph ? $cust_header : $HEADER)); + } + + +// +// N: Send other top-of-body HTML +// + + if(ADMIN){ + if(file_exists(e_BASE.'install.php')){ echo "

        *** ".CORE_LAN4." ***
        ".CORE_LAN5."


        "; } + } + +// Display Welcome Message when old method activated. + + echo $tp->parseTemplate("{WMESSAGE=header}"); + + + + if(defined("PREVIEWTHEME")) { + themeHandler :: showPreview(); + } + + + unset($text); +} +?> diff --git a/e107_themes/templates/index.html b/e107_themes/templates/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/templates/login_template.php b/e107_themes/templates/login_template.php new file mode 100644 index 000000000..db869b048 --- /dev/null +++ b/e107_themes/templates/login_template.php @@ -0,0 +1,46 @@ +
        +
        + ".(file_exists(THEME."images/login_logo.png") ? "\n" : "\n" ); +} + +// ##### LOGIN TABLE ----------------------------------------------------------------------------- +if(!$LOGIN_TABLE){ + $LOGIN_TABLE = ""; + if($LOGIN_TABLE_LOGINMESSAGE != ""){ + $LOGIN_TABLE .= "
        {LOGIN_TABLE_LOGINMESSAGE}
        "; + } + $LOGIN_TABLE .= " +
        + ".$rs -> form_open("post", e_SELF)."\n\n\n\n\n\n\n\n\n\n\n\n\n"; + if($LOGIN_TABLE_SECIMG_SECIMG){ + $LOGIN_TABLE .= "\n\n\n"; + } + + $LOGIN_TABLE .= "\n\n\n
        ".LAN_LOGIN_4."
        ".LAN_LOGIN_1."{LOGIN_TABLE_USERNAME}".(file_exists(THEME."images/password.png") ? "\n" : "\n" )."
        ".LAN_LOGIN_2."{LOGIN_TABLE_PASSWORD}
        {LOGIN_TABLE_SECIMG_LAN}{LOGIN_TABLE_SECIMG_HIDDEN} {LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}
        {LOGIN_TABLE_AUTOLOGIN}{LOGIN_TABLE_AUTOLOGIN_LAN}
        {LOGIN_TABLE_SUBMIT}
        ". + $rs -> form_close()."\n
        "; +} +// ##### ------------------------------------------------------------------------------------------ + +// ##### LOGIN TABLE FOOTER ----------------------------------------------------------------------- +if(!$LOGIN_TABLE_FOOTER){ + $LOGIN_TABLE_FOOTER = " +
        +

        + {LOGIN_TABLE_FOOTER_USERREG} +    ".LAN_LOGIN_12." +
        +
        +
        + "; +} +// ##### ------------------------------------------------------------------------------------------ + + +?> \ No newline at end of file diff --git a/e107_themes/templates/membersonly_template.php b/e107_themes/templates/membersonly_template.php new file mode 100755 index 000000000..111dcc623 --- /dev/null +++ b/e107_themes/templates/membersonly_template.php @@ -0,0 +1,43 @@ +

        "; + +$MEMBERSONLY_CAPTION = "
        ".LAN_MEMBERS_0."
        "; + +$MEMBERSONLY_TABLE = " +
        + + + + +

        ".LAN_MEMBERS_1." ".LAN_MEMBERS_2; + if ($pref['user_reg']) + { + $MEMBERSONLY_TABLE .= " ".LAN_MEMBERS_3." "; + } + $MEMBERSONLY_TABLE .= "

        ".LAN_MEMBERS_4." +
        +
        +"; + +$MEMBERSONLY_END = "
        "; +?> \ No newline at end of file diff --git a/e107_themes/templates/online_template.php b/e107_themes/templates/online_template.php new file mode 100644 index 000000000..876c4f797 --- /dev/null +++ b/e107_themes/templates/online_template.php @@ -0,0 +1,39 @@ + + + + + + + "; +} +if(!$ONLINE_TABLE){ + $ONLINE_TABLE = " + + + + + "; +} +if(!$ONLINE_TABLE_END){ + $ONLINE_TABLE_END = " +
         ".ONLINE_EL10."".ONLINE_EL11."
        {ONLINE_TABLE_ICON}{ONLINE_TABLE_USERNAME}{ONLINE_TABLE_LOCATION}
        +
        +
        + ".ONLINE_EL1.GUESTS_ONLINE.", + ".ONLINE_EL2.MEMBERS_ONLINE." ...
        +
        {ONLINE_TABLE_MOST_EVER_ONLINE} +
        ({ONLINE_TABLE_MOST_MEMBERS_ONLINE}, {ONLINE_TABLE_MOST_GUESTS_ONLINE}) ".ONLINE_EL9." {ONLINE_TABLE_DATESTAMP}
        + {ONLINE_TABLE_MEMBERS_TOTAL}{ONLINE_TABLE_MEMBERS_NEWEST}"; +} +// ##### ------------------------------------------------------------------------------------------ + + +?> \ No newline at end of file diff --git a/e107_themes/templates/search_template.php b/e107_themes/templates/search_template.php new file mode 100644 index 000000000..a3e212b4f --- /dev/null +++ b/e107_themes/templates/search_template.php @@ -0,0 +1,111 @@ + + "; + + /* // Image Version Example + $SEARCH_SHORTCODE = " + "; + */ +} + + + + +if (!isset($SEARCH_TOP_TABLE)) { + $SEARCH_TOP_TABLE = "
        +
        + + + + "; +} + +if (!isset($SEARCH_ENHANCED)) { + $SEARCH_ENHANCED = " + + + "; +} + +if (!isset($SEARCH_CATS)) { + $SEARCH_CATS = " + + + "; +} + +if (!isset($SEARCH_TYPE)) { + $SEARCH_TYPE = " + + + "; +} + +if (!isset($SEARCH_ADV)) { + $SEARCH_ADV = " + + + "; +} + +if (!isset($SEARCH_ADV_COMBO)) { + $SEARCH_ADV_COMBO = " + + "; +} + +if (!isset($SEARCH_TABLE_MSG)) { + $SEARCH_TABLE_MSG = " + + "; +} + +if (!isset($SEARCH_BOT_TABLE)) { + $SEARCH_BOT_TABLE = " + +
        ".LAN_199." + {SEARCH_MAIN_SEARCHFIELD} {SEARCH_MAIN_SUBMIT} {ENHANCED_ICON} +
        {ENHANCED_TEXT} + {ENHANCED_FIELD} +
        ".LAN_SEARCH_19."
        + {SEARCH_MAIN_CHECKALL} {SEARCH_MAIN_UNCHECKALL} +
        + {SEARCH_MAIN_CHECKBOXES}{SEARCH_DROPDOWN} {SEARCH_ADVANCED} +
        +
        ".LAN_SEARCH_75.": + {SEARCH_TYPE_SEL} +
        +
        + {SEARCH_ADV_A} + + {SEARCH_ADV_B} +
        + {SEARCH_ADV_TEXT} +
        + {SEARCH_MESSAGE} +
        +
        +
        "; +} + +if (!isset($PRE_CHECKBOXES)) { + $PRE_CHECKBOXES = ""; /* string thats printed before each category checkbox */ +} + +if (!isset($POST_CHECKBOXES)) { + $POST_CHECKBOXES = ""; /* string thats printed after each category checkbox */ +} + +?> \ No newline at end of file diff --git a/e107_themes/templates/signup_template.php b/e107_themes/templates/signup_template.php new file mode 100755 index 000000000..f9a38f25a --- /dev/null +++ b/e107_themes/templates/signup_template.php @@ -0,0 +1,313 @@ + *
        "); + +$sc_style['SIGNUP_DISPLAYNAME']['pre'] = " + +".LAN_7." *
        ".LAN_8." + +"; +$sc_style['SIGNUP_DISPLAYNAME']['post'] = " + + +"; + +$sc_style['SIGNUP_REALNAME']['pre'] = " + +".LAN_308."".req($pref['signup_option_realname'])." + +"; +$sc_style['SIGNUP_REALNAME']['post'] = " + + +"; + + +if(!defined($USERCLASS_SUBSCRIBE_START)) +{ +$USERCLASS_SUBSCRIBE_START = " + +".LAN_USET_5." ".req($pref['signup_option_class'])." +
        ".LAN_USET_6." + + +"; +} + +if(!defined($USERCLASS_SUBSCRIBE_ROW)) +{ +$USERCLASS_SUBSCRIBE_ROW = " + + + + +"; +} + +if(!defined($USERCLASS_SUBSCRIBE_END)) +{ +$USERCLASS_SUBSCRIBE_END = " +
        + + {USERCLASS_NAME}
        + {USERCLASS_DESCRIPTION} +
        + + +"; +} + + + +if(!defined($SIGNUP_PASSWORD_LEN)) +{ +$SIGNUP_PASSWORD_LEN = " (".LAN_SIGNUP_1." {$pref['signup_pass_len']} ".LAN_SIGNUP_2.")"; +} + + +if(!defined($SIGNUP_EXTENDED_USER_FIELDS)) +{ + $SIGNUP_EXTENDED_USER_FIELDS = " + + + {EXTENDED_USER_FIELD_TEXT} + {EXTENDED_USER_FIELD_REQUIRED} + + + {EXTENDED_USER_FIELD_EDIT} + + +"; +} + +if(!defined($EXTENDED_USER_FIELD_REQUIRED)) +{ + $EXTENDED_USER_FIELD_REQUIRED = " *"; +} + +$SIGNUP_SIGNATURE_START = " + + ".LAN_120." ".req($pref['signup_option_signature'])." + +
        +
        {REN_HELP}
        + +"; + + +$sc_style['SIGNUP_IMAGES']['pre'] = " + +".LAN_121.req($pref['signup_option_image'])."
        (".LAN_SIGNUP_33.") + +"; +$sc_style['SIGNUP_IMAGES']['post'] = " + + +"; + +$sc_style['SIGNUP_TIMEZONE']['pre'] = " + +".LAN_122.req($pref['signup_option_timezone'])." + +"; +$sc_style['SIGNUP_TIMEZONE']['post'] = " + + +"; + + +$sc_style['SIGNUP_IMAGECODE']['pre'] = " + + ".LAN_410.req(2)." + +"; +$sc_style['SIGNUP_IMAGECODE']['post'] = " + + +"; + + +if(!defined($COPPA_TEMPLATE)) +{ +$COPPA_TEMPLATE = LAN_109." ".LAN_SIGNUP_14.". ".LAN_SIGNUP_15." ".LAN_SIGNUP_14." ".LAN_SIGNUP_16." +
        +
        +
        ".LAN_SIGNUP_17." +{SIGNUP_COPPA_FORM} +
        +"; +} + +if(!defined($COPPA_FAIL)) +{ +$COPPA_FAIL = "
        ".LAN_SIGNUP_9."
        "; +} + +if(!defined($SIGNUP_TEXT)) +{ +$SIGNUP_TEXT = +LAN_309." ".LAN_SIGNUP_29."

        ".LAN_SIGNUP_30."
        +"; +} + +if(!defined($SIGNUP_XUP_FORM)) +{ +$SIGNUP_XUP_FORM = " +
        + +
        + + +"; +} + +if(!defined($SIGNUP_BEGIN)) +{ +$SIGNUP_BEGIN = " +{SIGNUP_FORM_OPEN} +
        +{SIGNUP_SIGNUP_TEXT} +
        +".LAN_400."

        "; +} + +if(!defined($SIGNUP_BODY)) +{ +$SIGNUP_BODY = " +{SIGNUP_XUP} +
        + +{SIGNUP_DISPLAYNAME} + + + + +{SIGNUP_REALNAME} + + + + + + + + + + + + + + + + + + + + + + + +{SIGNUP_USERCLASS_SUBSCRIBE} +{SIGNUP_EXTENDED_USER_FIELDS} +{SIGNUP_SIGNATURE} +{SIGNUP_IMAGES} +{SIGNUP_TIMEZONE} +{SIGNUP_IMAGECODE} + + + +
        ".LAN_9." *
        ".LAN_10."
        +{SIGNUP_LOGINNAME} +
        ".LAN_17." * +{SIGNUP_PASSWORD1} +{SIGNUP_PASSWORD_LEN} +
        ".LAN_111." * +{SIGNUP_PASSWORD2} +
        ".LAN_112." * +{SIGNUP_EMAIL} +
        ".LAN_SIGNUP_39." * +{SIGNUP_EMAIL_CONFIRM} +
        ".LAN_113." +{SIGNUP_HIDE_EMAIL} +
        + +
        +
        +
        +{SIGNUP_FORM_CLOSE} +"; +} + +if(!defined($SIGNUP_END)) +{ +$SIGNUP_END = " +"; +} +?> \ No newline at end of file diff --git a/e107_themes/templates/sitedown_template.php b/e107_themes/templates/sitedown_template.php new file mode 100644 index 000000000..59f1b8459 --- /dev/null +++ b/e107_themes/templates/sitedown_template.php @@ -0,0 +1,43 @@ +")." + "; + $SITEDOWN_TABLE .= " + + + {SITEDOWN_TABLE_PAGENAME} + + +
        +
        {LOGO}
        +
        +
        + {SITEDOWN_TABLE_MAINTAINANCETEXT} +
        + + "; +} +// ##### ------------------------------------------------------------------------------------------ + +?> \ No newline at end of file diff --git a/e107_themes/templates/trackback_template.php b/e107_themes/templates/trackback_template.php new file mode 100644 index 000000000..51ba050d7 --- /dev/null +++ b/e107_themes/templates/trackback_template.php @@ -0,0 +1,12 @@ +{TITLE} +{EXCERPT}
        From: {BLOGNAME}

        +"; + +$TRACKBACK_RENDER_METHOD = TRUE; /* TRUE=tablerender, FALSE=echo */ + +?> \ No newline at end of file diff --git a/e107_themes/templates/user_template.php b/e107_themes/templates/user_template.php new file mode 100644 index 000000000..413a6ca71 --- /dev/null +++ b/e107_themes/templates/user_template.php @@ -0,0 +1,203 @@ +{EXTENDED_NAME}"; + +$EXTENDED_CATEGORY_TABLE = " + + + {EXTENDED_ICON}  + {EXTENDED_NAME} + + {EXTENDED_VALUE} + + "; + +$EXTENDED_END = ""; +// $datestamp = $gen->convert_date($user_join, "forum"); + +$USER_SHORT_TEMPLATE_START = " +
        ".LAN_138." {TOTAL_USERS} +
        +
        + {USER_FORM_START} +

        ".LAN_419.": {USER_FORM_RECORDS} ".LAN_139." {USER_FORM_ORDER} + {USER_FORM_SUBMIT} + {USER_FORM_END} +

        +
        +
        +
        + + + + + + + +"; +$USER_SHORT_TEMPLATE_END = " +
         ".LAN_142."".LAN_112."".LAN_145."
        +"; + +$USER_SHORT_TEMPLATE = " + + {USER_ICON_LINK} + {USER_ID}: {USER_NAME_LINK} + {USER_EMAIL} + {USER_JOIN} + +"; + +$sc_style['USER_SIGNATURE']['pre'] = ""; +$sc_style['USER_SIGNATURE']['post'] = ""; + +$sc_style['USER_COMMENTS_LINK']['pre'] = ""; +$sc_style['USER_COMMENTS_LINK']['post'] = ""; + +$sc_style['USER_FORUM_LINK']['pre'] = ""; +$sc_style['USER_FORUM_LINK']['post'] = ""; + +$sc_style['USER_UPDATE_LINK']['pre'] = ""; +$sc_style['USER_UPDATE_LINK']['post'] = ""; + +$sc_style['USER_RATING']['pre'] = "".LAN_406."
        "; +$sc_style['USER_RATING']['post'] = ""; + +$sc_style['USER_LOGINNAME']['pre'] = " : "; + +if(isset($pref['photo_upload']) && $pref['photo_upload']) +{ + $user_picture = "{USER_PICTURE}"; + $colspan = " colspan='2'"; + $main_colspan = ""; +} +else +{ + $user_picture = ""; + $colspan = ""; + $main_colspan = " colspan = '2' "; +} + +$sc_style['USER_SENDPM']['pre'] = ""; +$sc_style['USER_SENDPM']['post'] = "".LAN_425.""; + +if($tp->parseTemplate("{USER_SENDPM}", FALSE, $user_shortcodes)) +{ + $sendpm = "{USER_SENDPM}"; +} +else +{ + $sendpm = ""; +} + +$span = " rowspan='".($sendpm ? "5" : "4")."' "; +$sc_style['USER_PICTURE']['pre']=""; +$sc_style['USER_PICTURE']['post']=""; + +$USER_FULL_TEMPLATE = " +
        + + + + + + $user_picture + + + + + + + + + + + + + + +{$sendpm} +{USER_RATING} +{USER_SIGNATURE} +{USER_EXTENDED_ALL} + + + + + + + + + + + + + + + + + + +{USER_COMMENTS_LINK} + + + + + +{USER_FORUM_LINK} + + + + +{USER_UPDATE_LINK} + + + +
        ".LAN_142." {USER_ID} : {USER_NAME}{USER_LOGINNAME}
        + {USER_REALNAME_ICON} ".LAN_308." + {USER_REALNAME} +
        + {USER_EMAIL_ICON} ".LAN_112." + {USER_EMAIL_LINK} +
        + ".LAN_406.": + {USER_LEVEL} +
        + ".LAN_404.":   + {USER_LASTVISIT}
        {USER_LASTVISIT_LAPSE}
        +
        ".LAN_403."
        ".LAN_145."{USER_JOIN}
        {USER_DAYSREGGED}
        ".LAN_147."{USER_CHATPOSTS} ( {USER_CHATPER}% )
        ".LAN_148."{USER_COMMENTPOSTS} ( {USER_COMMENTPER}% )
        ".LAN_149."{USER_FORUMPOSTS} ( {USER_FORUMPER}% )
        ".LAN_146."{USER_VISITS}
        + + + + + +
        {USER_JUMP_LINK=prev}{USER_JUMP_LINK=next}
        +
        +{PROFILE_COMMENTS} +{PROFILE_COMMENT_FORM} +"; +?> \ No newline at end of file diff --git a/e107_themes/templates/userposts_template.php b/e107_themes/templates/userposts_template.php new file mode 100644 index 000000000..92c5bb10b --- /dev/null +++ b/e107_themes/templates/userposts_template.php @@ -0,0 +1,91 @@ +{USERPOSTS_NEXTPREV}"; +} + +// ##### USERPOSTS_COMMENTS TABLE ----------------------------------------------------------------- +if(!$USERPOSTS_COMMENTS_TABLE_START){ + $USERPOSTS_COMMENTS_TABLE_START = " +
        + \n"; +} +if(!$USERPOSTS_COMMENTS_TABLE){ + $USERPOSTS_COMMENTS_TABLE = " + + + + + + + "; +} +if(!$USERPOSTS_COMMENTS_TABLE_END){ + $USERPOSTS_COMMENTS_TABLE_END = " +
        + {USERPOSTS_COMMENTS_HREF_PRE}{USERPOSTS_COMMENTS_HEADING} + {USERPOSTS_COMMENTS_DATESTAMP} ({USERPOSTS_COMMENTS_TYPE}) +
        + {USERPOSTS_COMMENTS_COMMENT}  +
        +
        "; +} +// ##### ------------------------------------------------------------------------------------------ + +// ##### USERPOSTS FORUM TABLE -------------------------------------------------------------------- +if(!$USERPOSTS_FORUM_TABLE_START){ + $USERPOSTS_FORUM_TABLE_START = " +
        +
        + "; +} +if(!$USERPOSTS_FORUM_TABLE){ + $USERPOSTS_FORUM_TABLE .= " + + + + + + + "; +} +if(!$USERPOSTS_FORUM_TABLE_END){ + $USERPOSTS_FORUM_TABLE_END = " + + + +
        + {USERPOSTS_FORUM_TOPIC_HREF_PRE}{USERPOSTS_FORUM_TOPIC_PRE} {USERPOSTS_FORUM_TOPIC} + ({USERPOSTS_FORUM_NAME_HREF_PRE}{USERPOSTS_FORUM_NAME}) + {USERPOSTS_FORUM_DATESTAMP} +
        + {USERPOSTS_FORUM_THREAD} +
        + {USERPOSTS_FORUM_SEARCH} +
        +
        +
        "; +} +// ##### ------------------------------------------------------------------------------------------ + + +?> \ No newline at end of file diff --git a/e107_themes/templates/usersettings_template.php b/e107_themes/templates/usersettings_template.php new file mode 100755 index 000000000..0ea32ea3e --- /dev/null +++ b/e107_themes/templates/usersettings_template.php @@ -0,0 +1,206 @@ + +".LAN_CUSTOMTITLE.": + +"; +$sc_style['CUSTOMTITLE']['post'] = ""; + +$sc_style['PASSWORD1']['pre'] = " + + ".LAN_152."
        ".LAN_401." + +"; + +$sc_style['PASSWORD2']['pre'] = " + + + + + ".LAN_153."
        ".LAN_401." + +"; +$sc_style['PASSWORD2']['post'] = " + + +"; + +$sc_style['PASSWORD_LEN']['pre'] = "
        (".LAN_SIGNUP_1." "; +$sc_style['PASSWORD_LEN']['post'] = " ".LAN_SIGNUP_2.")"; + +$sc_style['USERCLASSES']['pre'] = " +".LAN_USET_5.":".req($pref['signup_option_class'])." +
        ".LAN_USET_6." + +"; +$sc_style['USERCLASSES']['post'] = ""; + +$sc_style['AVATAR_UPLOAD']['pre'] = " +".LAN_415."
        + +"; +$sc_style['AVATAR_UPLOAD']['post'] = ""; + +$sc_style['PHOTO_UPLOAD']['pre'] = " + +".LAN_425." + + + +".LAN_414."
        ".LAN_426." + +"; +$sc_style['PHOTO_UPLOAD']['post'] = ""; + + +$sc_style['XUP']['pre'] = " + +".LAN_435." + + +".LAN_433."
        ".LAN_434." + +"; +$sc_style['XUP']['post'] = ""; + +$USER_EXTENDED_CAT = "{CATNAME}"; +$USEREXTENDED_FIELD = " + + +{FIELDNAME} + + +{FIELDVAL} {HIDEFIELD} + + +"; +$REQUIRED_FIELD = "{FIELDNAME} *"; + +$USERSETTINGS_EDIT = " +
        + + + + + + + + + + + + + + + + + + + + + + {CUSTOMTITLE} + + {PASSWORD1} + {PASSWORD_LEN} + {PASSWORD2} + + + + + + + + + + + + {USERCLASSES} + {USEREXTENDED_ALL} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {AVATAR_UPLOAD} + {PHOTO_UPLOAD} + {XUP} + + + + +
        ".LAN_418."
        ".LAN_7."
        ".LAN_8."
        + {USERNAME} +
        ".LAN_9."
        ".LAN_10."
        + {LOGINNAME} +
        ".LAN_308.req($pref['signup_option_realname'])." + {REALNAME} +
        ".LAN_112." + {EMAIL} +
        ".LAN_113."
        ".LAN_114."
        + {HIDEEMAIL=radio} + +
        ".LAN_USET_8."
        ".LAN_120.req($pref['signup_option_signature'])." + {SIGNATURE=cols=58&rows=4} +
        + {SIGNATURE_HELP} +
        ".LAN_122.req($pref['signup_option_timezone'])." + {TIMEZONE} +
        ".LAN_420."
        ".LAN_404.($pref['im_width'] || $pref['im_height'] ? "
        ".($pref['im_width'] ? MAX_AVWIDTH.$pref['im_width']." pixels. " : "").($pref['im_height'] ? MAX_AVHEIGHT.$pref['im_height']." pixels." : "") : "")."
        ".LAN_422.req($pref['signup_option_image'])."
        ".LAN_423."
        + {AVATAR_REMOTE} +
        ".LAN_421."
        ".LAN_424."
        + {AVATAR_CHOOSE} +
        +
        + "; + + +?> \ No newline at end of file diff --git a/e107_themes/vekna_blue/images/bg.gif b/e107_themes/vekna_blue/images/bg.gif new file mode 100644 index 000000000..afedbefc7 Binary files /dev/null and b/e107_themes/vekna_blue/images/bg.gif differ diff --git a/e107_themes/vekna_blue/images/blank.gif b/e107_themes/vekna_blue/images/blank.gif new file mode 100644 index 000000000..63a7621dd Binary files /dev/null and b/e107_themes/vekna_blue/images/blank.gif differ diff --git a/e107_themes/vekna_blue/images/bullet2.gif b/e107_themes/vekna_blue/images/bullet2.gif new file mode 100644 index 000000000..f9c23c04c Binary files /dev/null and b/e107_themes/vekna_blue/images/bullet2.gif differ diff --git a/e107_themes/vekna_blue/images/button.png b/e107_themes/vekna_blue/images/button.png new file mode 100644 index 000000000..67d2fe62e Binary files /dev/null and b/e107_themes/vekna_blue/images/button.png differ diff --git a/e107_themes/vekna_blue/images/cap.gif b/e107_themes/vekna_blue/images/cap.gif new file mode 100644 index 000000000..8ad252a71 Binary files /dev/null and b/e107_themes/vekna_blue/images/cap.gif differ diff --git a/e107_themes/vekna_blue/images/capleft.gif b/e107_themes/vekna_blue/images/capleft.gif new file mode 100644 index 000000000..3a8745be4 Binary files /dev/null and b/e107_themes/vekna_blue/images/capleft.gif differ diff --git a/e107_themes/vekna_blue/images/caption.png b/e107_themes/vekna_blue/images/caption.png new file mode 100644 index 000000000..f18418d0a Binary files /dev/null and b/e107_themes/vekna_blue/images/caption.png differ diff --git a/e107_themes/vekna_blue/images/fcap.png b/e107_themes/vekna_blue/images/fcap.png new file mode 100644 index 000000000..3c1d397d6 Binary files /dev/null and b/e107_themes/vekna_blue/images/fcap.png differ diff --git a/e107_themes/vekna_blue/images/line_bg.gif b/e107_themes/vekna_blue/images/line_bg.gif new file mode 100644 index 000000000..1fdfa1eb9 Binary files /dev/null and b/e107_themes/vekna_blue/images/line_bg.gif differ diff --git a/e107_themes/vekna_blue/images/logo4.jpg b/e107_themes/vekna_blue/images/logo4.jpg new file mode 100644 index 000000000..cd28eeb5d Binary files /dev/null and b/e107_themes/vekna_blue/images/logo4.jpg differ diff --git a/e107_themes/vekna_blue/images/menu.png b/e107_themes/vekna_blue/images/menu.png new file mode 100644 index 000000000..b44fcfd71 Binary files /dev/null and b/e107_themes/vekna_blue/images/menu.png differ diff --git a/e107_themes/vekna_blue/images/menu1.gif b/e107_themes/vekna_blue/images/menu1.gif new file mode 100644 index 000000000..3d1a443ff Binary files /dev/null and b/e107_themes/vekna_blue/images/menu1.gif differ diff --git a/e107_themes/vekna_blue/images/menubottom.png b/e107_themes/vekna_blue/images/menubottom.png new file mode 100644 index 000000000..b0f566f20 Binary files /dev/null and b/e107_themes/vekna_blue/images/menubottom.png differ diff --git a/e107_themes/vekna_blue/index.html b/e107_themes/vekna_blue/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/e107_themes/vekna_blue/languages/English.php b/e107_themes/vekna_blue/languages/English.php new file mode 100644 index 000000000..ddce5530b --- /dev/null +++ b/e107_themes/vekna_blue/languages/English.php @@ -0,0 +1,26 @@ +jalist, based on, and with permission from Arach's site, http://e107.vekna.com"); +define("LAN_THEME_2", "Read/Post Comment: "); +define("LAN_THEME_3", "Comments are turned off for this item"); +define("LAN_THEME_4", "Read the rest ..."); +define("LAN_THEME_5", "Trackbacks: "); + +?> diff --git a/e107_themes/vekna_blue/nav_menu.css b/e107_themes/vekna_blue/nav_menu.css new file mode 100644 index 000000000..45a5def1f --- /dev/null +++ b/e107_themes/vekna_blue/nav_menu.css @@ -0,0 +1,110 @@ +div.menuBar, +div.menuBar a.menuButton, div.menuButton, div.menuButton_over, +div.menu, +div.menu a.menuItem { + font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-style: normal; + font-weight: normal; + color: #000000; +} + +div.menuBar { + background: url(images/menu1.gif) #fff; + padding: 4px 0px 4px 0px; + text-align: left; + border: 1px solid #a2a2a2; +} + +div.emenuBar { + background-color: #d8d8d8; + border-top: 1px solid #ffffff; + border-bottom: 0px solid #000; + text-align: left; +} + +div.menuBar a.menuButton, div.menuButton, div.menuButton_over { + background-color: transparent; + border: 1px solid #eeedee; + color: #000000; + cursor: default; + left: 0px; + margin: 0px; + padding: 2px 4px 2px 4px; + /* + if using a link icon replace line above with this one + padding: 2px 4px 2px 22px; + */ + position: relative; + text-decoration: none; + top: 0px; + z-index: 100; +} + +div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over { + background-color: transparent; + border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff; + color: #000000; +} + +div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, +div.menuBar a.menuButtonActive:hover { + background-color: #d5d5d5; + border-color: #a5a5a5 #ffffff #ffffff #a5a5a5; + color: #000; + left: 1px; + top: 1px; +} + +div.menu { + background-color: #eee; + border: 1px solid; + border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff; + left: 0px; + padding: 1px 1px 1px 1px; + position: absolute; + top: 0px; + visibility: hidden; + z-index: 101; +} + +div.menu a.menuItem { + color: #000000; + cursor: default; + display: block; + padding: 2px 11px 2px 0px; + text-decoration: none; + white-space: nowrap; +} + +div.menu a.menuItem:hover, div.menu a.menuItemHighlight { + background-color: #d5d5d5; + color: #000000; +} + +div.menu a.menuItem span.menuItemBuffer { + padding: 0px 2px 0px 2px; + color: #ffffff; +} + +div.menu a.menuItem:hover span.menuItemBuffer { + padding: 0px 2px 0px 2px; + color: #000000; +} + +div.menu a.menuItem span.menuItemText { + padding: 0px 0px 0px 3px; +} + +div.menu a.menuItem span.menuItemArrow { + margin-right: -.75em; +} + +div.menu div.menuItemSep { + border-top: 1px solid #a5a5a5; + border-bottom: 1px solid #ffffff; + margin: 4px 2px; +} + +a.menuItem.header { + border-bottom: 1px solid #b3b3b3; +} \ No newline at end of file diff --git a/e107_themes/vekna_blue/preview.jpg b/e107_themes/vekna_blue/preview.jpg new file mode 100644 index 000000000..4f18e92f9 Binary files /dev/null and b/e107_themes/vekna_blue/preview.jpg differ diff --git a/e107_themes/vekna_blue/style.css b/e107_themes/vekna_blue/style.css new file mode 100644 index 000000000..53c585201 --- /dev/null +++ b/e107_themes/vekna_blue/style.css @@ -0,0 +1,292 @@ +body { + background: url(images/bg.gif) #e5e5e5 fixed no-repeat left bottom; margin: 10px; text-align: left +} +body { + font: 10px verdana, arial, sans-serif +} + +#logo { + background-image: url(images/logo4.jpg); + border: 1px solid #999; + padding: 1px; + margin: 0px; + width: 800px; + height: 80px; +} + +.caption { + background-image: url(images/caption.png); + width: 200px; + height: 34px; +} + +.menubody { + background-image: url(images/menu.png); + width: 200px; + background-repeat: repeat-y; +} + +.menubottom { + background-image: url(images/menubottom.png); + width: 200px; + height: 7px; + background-repeat: no-repeat; +} + +.captionpadder { + padding-top: 2px; + padding-left: 4px; +} + +.menupadder { + padding: 8px; + width: 178px; +} + + +td { + font: 10px verdana, arial, sans-serif +} +a { + color: #5173b7; text-decoration: underline +} +a:hover { + color: black; text-decoration: underline +} +.indent { + border-right: #ffffff 1px solid; padding-right: 3px; border-top: #000 1px solid; padding-left: 3px; padding-bottom: 3px; margin: 5px; border-left: #000 1px solid; color: #000060; padding-top: 3px; border-bottom: #ffffff 1px solid; background-color: #ebebeb +} +.smalltext { + font-size: 9px; color: #444; letter-spacing: -1px +} +.smallblacktext { + font-weight: normal; font-size: 9px; color: #000; line-height: normal; font-style: normal; font-variant: normal +} +.defaulttext { + color: #000 +} +.mediumtext { + font-size: 11px; color: #000 +} +.captiontext { + font: bold 14px/120% verdana, arial, helvetica, sans-serif; color: #000 +} +.tbox { + border-right: #559 1px solid; border-top: #559 1px solid; font-size: 10px; min-height: 15px; border-left: #559 1px solid; color: #005; border-bottom: #559 1px solid; font-family: verdana, arial, helvetica, sans-serif; background-color: #e4e9f6 +} +.tbox.chatbox { + width: 80%; + margin-left: auto; + margin-right: auto; +} +.button { + border-right: #5e5d63 1px solid; border-top: #5e5d63 1px solid; font-size: 10px; background-image: url(images/button.png); border-left: #5e5d63 1px solid; color: #000; border-bottom: #5e5d63 1px solid; text-align: center +} +.button:hover { + background-image: url(images/button_hover2.png); color: #fff +} +.nextprev { + border-right: #77a 1px solid; padding-right: 1px; border-top: #77a 1px solid; padding-left: 1px; font-size: 9px; background-image: url(images/button.png); padding-bottom: 1px; border-left: #77a 1px solid; color: #000; padding-top: 1px; border-bottom: #77a 1px solid; background-color: #fcfcfc; text-align: center +} +.nextprev:hover { + background-image: url(images/button_hover.png) +} +form { + margin: 2px 0px 0px +} +.spacer { + padding: 0 0 3px 0; +} +hr { + border-top: #006699 1px solid; vertical-align: bottom; width: 100%; border-bottom: #c6d6d6 1px solid; height: 2px; text-align: center +} +.border { + border-right: #91a7d4 2px solid; border-top: #91a7d4 2px solid; border-left: #91a7d4 2px solid; border-bottom: #91a7d4 2px solid; background-color: transparent +} + +.infobar { + border-right: #ccc 1px solid; padding-right: 4px; border-top: #fff 1px solid; padding-left: 4px; font-size: 10px; background-image: url(images/cap1.gif); padding-bottom: 4px; border-left: #fff 1px solid; color: #000; padding-top: 2px; border-bottom: #ccc 1px solid; background-color: #e2e2e2 +} +p { + margin-top: 0px +} +.fborder { + padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px +} +.fbdefault { + border-right: #bbb 1px solid; border-top: #bbb 1px solid; margin: 0px; border-left: #bbb 1px solid; border-bottom: #bbb 1px solid; background-color: #fff; text-align: left +} +.forumheader { + border-right: #ccc 1px solid; padding-right: 4px; border-top: #888 1px solid; padding-left: 4px; font-weight: bolder; font-size: 12px; padding-bottom: 4px; border-left: #888 1px solid; color: #009; padding-top: 4px; border-bottom: #ccc 1px solid; background-color: #91a7d4; text-align: left +} +.forumheader2 { + border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 12px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #efefef; text-align: left +} +.f2default { + border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 12px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #efefef; text-align: left +} +.forumheader3 { + border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 11px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #fafafa; text-align: left +} +.f3default { + border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 11px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #fafafa; text-align: left +} +.fcaption { + border-right: #557 1px solid; padding-right: 3px; border-top: #557 1px solid; padding-left: 3px; font-weight: bold; font-size: 11px; background-image: url(images/fcap.png); padding-bottom: 3px; border-left: #557 1px solid; color: #333; padding-top: 3px; border-bottom: #557 1px solid; background-color: #dfdfdf; text-align: left +} +.fcdefault { + border-right: #557 1px solid; padding-right: 3px; border-top: #557 1px solid; padding-left: 3px; font-weight: bold; font-size: 11px; background-image: url(images/fcap.png); padding-bottom: 3px; border-left: #557 1px solid; color: #333; padding-top: 3px; border-bottom: #557 1px solid; background-color: #dfdfdf; text-align: left +} +.fcaption2 { + border-right: #559 1px solid; padding-right: 0px; border-top: #559 1px solid; padding-left: 8px; font-weight: bold; background-image: url(images/fcap.png); padding-bottom: 2px; border-left: #559 1px solid; color: #559; padding-top: 2px; border-bottom: #559 1px solid; background-color: #e6e6e6 +} +.fcdefault { + background: #cccccc; color: #fff +} +.finfobar { + border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; background-image: url(forum/finfobar.png); padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #ccc8c8 +} +a.forumlink { + color: #333; text-decoration: none +} +a.forumlink:hover { + color: #000 +} +.helpbox { + border-right: red 0px; border-top: red 0px; font: 9px tahoma, verdana, arial, helvetica, sans-serif; border-left: red 0px; color: #000; border-bottom: red 0px; background-color: transparent +} +#wrapptable { + border-right: #ccc 4px solid; border-top: #ccc 4px solid; background: #fff; font: 12px verdana, arial, sans-serif; border-left: #ccc 4px solid; border-bottom: #ccc 4px solid +} +.borderx { + border-right: #ccc 1px solid; padding-right: 1px; border-top: #ccc 1px solid; padding-left: 1px; margin-bottom: 0.3em; padding-bottom: 1px; border-left: #ccc 1px solid; padding-top: 1px; border-bottom: #ccc 1px solid +} +.bordery { + border-right: #ccc 1px solid; padding-right: 1px; border-top: #ccc 1px solid; padding-left: 1px; padding-bottom: 1px; border-left: #ccc 1px solid; padding-top: 1px; border-bottom: #ccc 1px solid +} +#line { + background: url(images/line_bg.gif) repeat-x left top +} +.borderx#line { + background: url(images/line_bg.gif) repeat-x left top +} +.line2 { + border-right: #ccc 1px solid; padding-right: 3px; border-top: #ccc 1px solid; padding-left: 3px; font-weight: bolder; background: url(images/line_bg.gif) repeat-x; padding-bottom: 3px; border-left: #ccc 1px solid; color: #559; padding-top: 3px; border-bottom: #ccc 1px solid +} +.incontent { + padding-right: 1em; padding-left: 1em; padding-bottom: 0.5em; padding-top: 0.5em +} +a.clean { + font-weight: bold; color: #777; text-decoration: none +} +a.clean:hover { + color: #000; text-decoration: none +} +.fl_left { + float: left; margin: 2em 0.3em 0.3em; width: 285px +} +h6 { + border-right: #999999 3px double; padding-right: 1em; border-top: #999999 3px double; padding-left: 1em; font-weight: bolder; font-size: 11px; background: #96aad6; padding-bottom: 0.3em; margin: 0px 50px 0px 0px; border-left: #999999 3px double; color: #fff; padding-top: 0.3em; border-bottom: medium none; text-align: left +} +h5 { + border-right: #999999 1px solid; padding-right: 1em; border-top: #999999 1px solid; padding-left: 1em; background: #dadade; padding-bottom: 0.3em; margin: 0px 1px; border-left: #999999 1px solid; color: black; padding-top: 0.3em; border-bottom: #999999 1px solid +} +h4 { + clear: both; font-weight: bolder; font-size: 10px; margin: 0.3em 0px 0.5em; color: #559; +} +h4 img { + padding-right: 0px; padding-left: 0px; float: right; padding-bottom: 0px; padding-top: 0px; position: relative; top: -20px +} +lefticons { + padding-right: 0px; padding-left: 0px; float: right; padding-bottom: 0px; margin: 0px; padding-top: 0px; position: relative; top: 2px +} +.box_red { + border-right: #aaa 1px solid; padding-right: 0.3em; border-top: #aaa 1px solid; padding-left: 0.3em; background: url(images/box_bgshade_lbl.gif) repeat-x 50% bottom; padding-bottom: 0.3em; margin: 0px; border-left: #aaa 1px solid; color: #559; padding-top: 0.3em; border-bottom: #aaa 1px solid +} +.box_red ul { + padding-right: 0px; padding-left: 0px; list-style-position: inside; list-style-image: url(images/bullet2.gif); padding-bottom: 0px; margin: 0px 0.5em 0.8em; padding-top: 0px +} +.box_red ul li { + line-height: 17px +} +.box_red ul li a { + color: black; text-decoration: none +} +.box_red ul li a:hover { + color: #869ecf +} +#menu { + clear: both; border-right: #777 1px solid; border-top: #777 1px solid; font-size: 9px; background: url(images/menu1.gif) #fff; border-left: medium none; border-bottom: #777 1px solid; height: 20px +} +#menu ul { + padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; list-style-type: none +} +ul.nobullets { + padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; list-style-type: none +} +.jsmenu ul { + padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; list-style-type: none +} +#menu li { + padding-right: 0px; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; width: 9%; padding-top: 0px; height: 20px +} +#menu a { + display: block; background: url(images/menu1.gif) #eee; border-left: #7e7e7e 1px solid; width: 100%; color: #000; line-height: 20px; height: 20px; text-align: center; text-decoration: none +} +#menu a span { + display: block; border-left: #fff 1px solid; width: 100%; height: 20px +} +#menu a:hover { + background-position: 100% -36px; cursor: pointer; background-color: #ddd +} +#menu a.selected { + background-position: 100% -36px; cursor: pointer; background-color: #ddd +} +.hide { + display: none +} +#sub span { + display: none +} +li#home { + width: 11% +} +li#news { + width: 11% +} +li#forum { + width: 11% +} +li#admin span { + border-right: #7e7e7e 1px solid +} +li#empty { + border-left: #7e7e7e 1px solid +} +li#admin { + background-color: red +} +.jsmenu { + border-right: #555 1px solid; padding-right: 1px; border-top: #555 1px solid; display: none; padding-left: 1px; padding-bottom: 1px; border-left: #555 1px solid; padding-top: 1px; border-bottom: #555 1px solid; position: absolute; top: 30px; background-color: #fff +} +.jsmenu li { + font-size: 10px; margin: 0px; border-bottom: #fff 1px solid; font-family: verdana,sans-serif +} +.jsmenu li.separator { + padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; line-height: 1px; padding-top: 0px; height: 1px; background-color: #fff +} +.jsmenu li a { + border-right: #aaa 1px solid; padding-right: 2px; border-top: #aaa 1px solid; display: block; padding-left: 6px; padding-bottom: 2px; border-left: #aaa 1px solid; color: #000; padding-top: 1px; border-bottom: #aaa 1px solid; text-decoration: none +} +.jsmenu a:hover { + background: #afafaf +} + +ul, ol { + margin-top: 0; + margin-bottom: 0; +} + +.linkspage_button{ + border:0px; +} \ No newline at end of file diff --git a/e107_themes/vekna_blue/theme.php b/e107_themes/vekna_blue/theme.php new file mode 100644 index 000000000..95877a9e3 --- /dev/null +++ b/e107_themes/vekna_blue/theme.php @@ -0,0 +1,188 @@ +".LAN_THEME_1.""); + +function theme_head() { + return "\n"; +} + +// [layout] + +$layout = "_default"; + +/* +to use an icon image next to links, add the following line ... +{SITELINKS_ALT=".e_IMAGE."blah.png} +instead of +{SITELINKS_ALT=no_icons} +then make change to nav_menu.css (documented in that file) +*/ + +$HEADER = " + + + + + + + + + + + + + + +
        +
        {SITELINKS_ALT=no_icons}
        +
        + +
        +{SETSTYLE=main} +"; + +$FOOTER = " + +{SETSTYLE=menu} +{MENU=1} +
        {SITEDISCLAIMER}
        {THEMEDISCLAIMER}
        +"; + +$CUSTOMHEADER = " + + + + + + + + + + + + + +
        +
        {SITELINKS_ALT=no_icons}
        +
        + +
        +{SETSTYLE=main} +"; + +$CUSTOMFOOTER = " +
        {SITEDISCLAIMER}
        {THEMEDISCLAIMER}
        +"; + +$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php user.php submitnews.php download.php links.php comment.php stats.php usersettings.php documentation"; + +$NEWSSTYLE = " +
        +
        {NEWSTITLE}
        +
        {NEWSBODY}{EXTENDED}
        +
        {NEWSAUTHOR} on {NEWSDATE} | {NEWSCOMMENTS}{TRACKBACK}
        +
        +
        +"; + +define("ICONSTYLE", ""); +define("COMMENTLINK", LAN_THEME_2); +define("COMMENTOFFSTRING", LAN_THEME_3); +define("PRE_EXTENDEDSTRING", "

        [ "); +define("EXTENDEDSTRING", LAN_THEME_4); +define("POST_EXTENDEDSTRING", " ]
        "); +define("TRACKBACKSTRING", LAN_THEME_5); +define("TRACKBACKBEFORESTRING", " | "); + + +// [linkstyle] + + + + +define('PRELINK', "
          "); +define('POSTLINK', "
        "); +define('LINKSTART', "
      • "); +define("LINKSTART_HILITE", ""); +define('LINKEND', "
      • "); +define('LINKDISPLAY', 1); +define('LINKALIGN', "left"); + + +// [tablestyle] + +function tablestyle($caption, $text, $mode) +{ + global $style; + if($style == "menu") + { + echo "

        {$caption}

        "; + } + else + { + if($caption) + { + echo "
        \n
        {$caption}
        \n
        {$text}
        \n
        \n"; + } + else + { + echo "
        \n
        \n
        {$text}
        \n
        \n"; + } + } +} + +$COMMENTSTYLE = " + + + + + +
        {USERNAME}
        {TIMEDATE}
        {AVATAR}{REPLY}
        +{COMMENT} {COMMENTEDIT} +
        +"; + +$CHATBOXSTYLE = " + +{USERNAME} +
        +{MESSAGE} +
        +
        "; + +?> \ No newline at end of file diff --git a/email.php b/email.php new file mode 100644 index 000000000..73f00144f --- /dev/null +++ b/email.php @@ -0,0 +1,230 @@ +post_toHTML($_POST['comment'], TRUE, 'retain_nl emotes_off no_make_clickable'); +$author = $tp->post_toHTML($_POST['author_name'],FALSE,"emotes_off, no_make_clickable"); +$email_send = check_email($_POST['email_send']); + + +if (isset($_POST['emailsubmit'])) +{ + if (!$email_send) + { + $error .= LAN_EMAIL_106; + } + + if($use_imagecode) + { + if(!isset($_POST['code_verify']) || !isset($_POST['rand_num'])) + { + header("location:".e_BASE."index.php"); + exit; + } + if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) + { + header("location:".e_BASE."index.php"); + exit; + } + } + + if ($comments == "") + { + $message = LAN_EMAIL_188." ".SITENAME." (".SITEURL.")"; + if (USER == TRUE) + { + $message .= "\n\n".LAN_EMAIL_1." ".USERNAME; + } + else + { + $message .= "\n\n".LAN_EMAIL_1." ".$author; + } + } + else + { + $message .= $comments; + } + $ip = $e107->getip(); + $message .= "\n\n".LAN_EMAIL_2." ".$ip."\n\n"; + + if(strpos($source,'plugin:') !== FALSE) + { + $plugin = substr($source,7); + $text = ""; + if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php")) + { + include_once(e_PLUGIN.$plugin."/e_emailprint.php"); + $text = email_item($parms); + $emailurl = SITEURL; + } + if($text == "") + { + header("location:".e_BASE."index.php"); + exit; + } + $message .= $text; + } + elseif($source == "referer") + { + if(!isset($_POST['referer']) || $_POST['referer'] == '') + { + header("location:".e_BASE."index.php"); + exit; + } + $message .= $_POST['referer']; + $emailurl = $_POST['referer']; + } + else + { + + $emailurl = $_POST['referer']; + $message = ""; + if($sql->db_Select("news", "*", "news_id='".intval($parms)."'")) + { + list($news_id, $news_title, $news_body, $news_extended, $news_datestamp, $news_author, $news_source, $news_url, $news_category, $news_allow_comments) = $sql->db_Fetch(); + $message = "
        ".$news_body."
        ".$news_extended."

        {e_BASE}news.php?extend.".$parms."
        "; + $message = $tp->toEmail($message); + + } + + if($message == "") + { + header("location:".e_BASE."index.php"); + exit; + } + } + + if ($error == "") + { + + // Load Mail Handler and Email Template. + require_once(e_HANDLER."mail.php"); + $email_body = $EMAIL_HEADER; + $email_body .= (trim($comments) != "") ? $tp->toEmail($comments)."
        " : ""; + $email_body .= $tp->toEmail($message).$EMAIL_FOOTER; + + if (sendemail($email_send, LAN_EMAIL_3.SITENAME,$email_body)) + { + $text = "
        ".LAN_EMAIL_10." ".$email_send."
        "; + } + else + { + $text = "
        ".LAN_EMAIL_9."
        "; + } + $ns->tablerender(LAN_EMAIL_11, $text); + } + else + { + $ns->tablerender(LAN_EMAIL_12, "
        ".$error."
        "); + } +} + + +// --------------------- Form ------------------------------------------------- + + + +$text = "
        \n + "; + +if (USER != TRUE) +{ + $text .= " + + + "; +} + +$text .= " + + + + + + + + + + "; + + if($use_imagecode) + { + $text .= ""; + } + +$text .= " + + + + +
        ".LAN_EMAIL_15." + +
        ".LAN_EMAIL_8." + +
        ".LAN_EMAIL_187." + +
        ".LAN_EMAIL_190.""; + $text .= $sec_img->r_image(); + $text .= " +
        + + +
        +
        "; + +$ns->tablerender(LAN_EMAIL_5, $text); + +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/error.php b/error.php new file mode 100644 index 000000000..897c957f6 --- /dev/null +++ b/error.php @@ -0,0 +1,72 @@ +document.location.href='index.php'\n"; + header("location: ".e_HTTP."index.php"); + exit; +} + +require_once(HEADERF); + +$errFrom = $_SERVER['HTTP_REFERER']; +$errTo = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; + +switch(e_QUERY) { + case 401: + header("HTTP/1.1 401 Unauthorized"); + $text = "
        Error Icon ".LAN_ERROR_1."

        ".LAN_ERROR_2."

        ".LAN_ERROR_3."
        +
        ".LAN_ERROR_2."".LAN_ERROR_20."
        "; + break; + case 403: + header("HTTP/1.1 403 Forbidden"); + $text = "
        Error Icon ".LAN_ERROR_4."

        ".LAN_ERROR_5."

        ".LAN_ERROR_6."
        +
        ".LAN_ERROR_2."".LAN_ERROR_20."
        "; + break; + default: + + + case 404: + header("HTTP/1.1 404 Not Found"); + $text = "

        Error Icon ".LAN_ERROR_7."


        ".LAN_ERROR_21."

        ".LAN_ERROR_23."{$errTo}".LAN_ERROR_24."

        "; + + if (strlen($errFrom)) $text .= LAN_ERROR_9." ( {$errFrom} ) -- ".LAN_ERROR_19."
        "; + + $base_path = e_HTTP; + + $text .= "
        ".LAN_ERROR_20."
        "; + $text .= "".LAN_ERROR_22."

        "; + + break; + + + case 500: + header("HTTP/1.1 500 Internal Server Error"); + $text = "
        Error Icon ".LAN_ERROR_10."

        ".LAN_ERROR_11."

        ".LAN_ERROR_12."
        +
        ".LAN_ERROR_2."".LAN_ERROR_20."
        "; + break; + $text = "
        ".LAN_ERROR_13." (".$_SERVER['QUERY_STRING'].")

        ".LAN_ERROR_14."

        ".LAN_ERROR_15."
        +
        ".LAN_ERROR_2."".LAN_ERROR_20."
        "; +} + +$ns->tablerender(PAGE_NAME, $text); +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 000000000..97a1f4e7d Binary files /dev/null and b/favicon.ico differ diff --git a/forum.php b/forum.php new file mode 100644 index 000000000..0fd0c21fb --- /dev/null +++ b/forum.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/forum_viewforum.php b/forum_viewforum.php new file mode 100644 index 000000000..94939b445 --- /dev/null +++ b/forum_viewforum.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/forum_viewtopic.php b/forum_viewtopic.php new file mode 100644 index 000000000..4cbdb5f44 --- /dev/null +++ b/forum_viewtopic.php @@ -0,0 +1,12 @@ + diff --git a/fpw.php b/fpw.php new file mode 100644 index 000000000..f377d5402 --- /dev/null +++ b/fpw.php @@ -0,0 +1,173 @@ +tablerender(LAN_03, "
        ".$txt."
        "); + require_once(FOOTERF); + exit; +} + +//the seperator character used +$fpw_sep = "#"; + +if (e_QUERY) { + define("FPW_ACTIVE","TRUE"); + $tmp = explode($fpw_sep, e_QUERY); + $tmpinfo = preg_replace("#[\W_]#", "", $tp -> toDB($tmp[0], true)); + if ($sql->db_Select("tmp", "*", "tmp_info LIKE '%{$fpw_sep}{$tmpinfo}' ")) { + $row = $sql->db_Fetch(); + extract($row); + $sql->db_Delete("tmp", "tmp_info LIKE '%{$fpw_sep}{$tmpinfo}' "); + $newpw = ""; + $pwlen = rand(8, 12); + for($a = 0; $a <= $pwlen; $a++) { + $newpw .= chr(rand(97, 122)); + } + $mdnewpw = md5($newpw); + + list($username, $md5) = explode($fpw_sep, $tmp_info); + $sql->db_Update("user", "user_password='$mdnewpw', user_viewed='' WHERE user_name='".$tp -> toDB($username, true)."' "); + cookie($pref['cookie_name'], "", (time()-2592000)); + $_SESSION[$pref['cookie_name']] = ""; + + $txt = LAN_FPW8." {$username} ".LAN_FPW9." {$newpw}

        ".LAN_FPW10." ".LAN_FPW11." ".LAN_FPW12; + fpw_error($txt); + + } else { + fpw_error(LAN_FPW7); + } +} + +if (isset($_POST['pwsubmit'])) { + require_once(e_HANDLER."mail.php"); + $email = $_POST['email']; + + if ($pref['fpwcode'] && extension_loaded("gd")) { + if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) { + fpw_error(LAN_FPW3); + } + } + + $clean_email = check_email($tp -> toDB($_POST['email'])); + $clean_username = $tp -> toDB($_POST['username']); + $query = "user_email='{$clean_email}' "; + // Allow admins to remove 'username' from fpw_template.php if they wish. + $query .= (isset($_POST['username'])) ? " AND user_loginname='{$clean_username}'" : ""; + + if ($sql->db_Select("user", "*", $query)) { + $row = $sql->db_Fetch(); + extract($row); + + if ($user_admin == 1 && $user_perms == "0") { + sendemail($pref['siteadminemail'], LAN_06, LAN_07."".$e107->getip()." ".LAN_08); + echo "\n"; + die(); + } + + if ($sql->db_Select("tmp", "*", "tmp_ip = 'pwreset' AND tmp_info LIKE '{$user_name}{$fpw_sep}%'")) { + fpw_error(LAN_FPW4); + exit; + } + + mt_srand ((double)microtime() * 1000000); + $maxran = 1000000; + $rand_num = mt_rand(0, $maxran); + $datekey = date("r"); + $rcode = md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref). $rand_num . $datekey); + + $link = SITEURL."fpw.php?{$rcode}"; + $message = LAN_FPW5." ".SITENAME." ".LAN_FPW14." : ".$e107->getip().".\n\n".LAN_FPW15."\n\n".LAN_FPW16."\n\n".LAN_FPW17."\n\n{$link}"; + // $message = LAN_FPW5."\n\n{$link}"; + + $deltime = time()+86400 * 2; + //Set timestamp two days ahead so it doesn't get auto-deleted + $sql->db_Insert("tmp", "'pwreset',{$deltime},'{$user_name}{$fpw_sep}{$rcode}'"); + + if (sendemail($_POST['email'], "".LAN_09."".SITENAME, $message)) { + $text = "
        ".LAN_FPW6."
        "; + } else { + $text = "
        ".LAN_02."
        "; + } + + $ns->tablerender(LAN_03, $text); + require_once(FOOTERF); + exit; + } else { + $text = LAN_213; + $ns->tablerender(LAN_214, "
        ".$text."
        "); + } +} + + +if (USE_IMAGECODE) { + + $FPW_TABLE_SECIMG_LAN = LAN_FPW2; + $FPW_TABLE_SECIMG_HIDDEN = ""; + $FPW_TABLE_SECIMG_SECIMG = $sec_img->r_image(); + $FPW_TABLE_SECIMG_TEXTBOC = ""; +} + +if (!$FPW_TABLE) { + if (file_exists(THEME."fpw_template.php")) { + require_once(THEME."fpw_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/fpw_template.php"); + } +} +$text = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE); + +$ns->tablerender(LAN_03, $text); +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/gsitemap.php b/gsitemap.php new file mode 100644 index 000000000..cb506adbd --- /dev/null +++ b/gsitemap.php @@ -0,0 +1,79 @@ + db_Select("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order "); + $nfArray = $sql -> db_getList(); + $text = "
          "; + + foreach($nfArray as $nfa) + { + $url = (substr($nfa['gsitemap_url'],0,4)== "http")? $nfa['gsitemap_url'] : SITEURL.$tp->replaceConstants($nfa['gsitemap_url'],TRUE); + $text .= "
        • ".$tp->toHTML($nfa['gsitemap_cat'],"","defs").": ".$tp->toHTML($nfa['gsitemap_name'],"","defs")."
          \n"; + } + $text .= "
        "; + + $ns -> tablerender(SITENAME." : ".GSLAN_Name."", $text); + + require_once(FOOTERF); + exit; +} + + +$xml = " +"; + +$sql -> db_Select("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order "); +$smArray = $sql -> db_getList(); +foreach($smArray as $sm) +{ + $loc = (substr($sm['gsitemap_url'],0,4)== "http")? $sm['gsitemap_url'] : SITEURL.$tp->replaceConstants($sm['gsitemap_url'],TRUE); + $xml .= " + + ".$loc." + ".get_iso_8601_date($sm['gsitemap_lastmod'])." + ".$sm['gsitemap_freq']." + ".$sm['gsitemap_priority']." + "; +} + +$xml .= " +"; + +echo $xml; + +/* ungu at terong dot com */ +function get_iso_8601_date($int_date) +{ + $date_mod = date('Y-m-d\TH:i:s', $int_date); + $pre_timezone = date('O', $int_date); + $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); + $date_mod .= $time_zone; + return $date_mod; +} + + +?> diff --git a/index.php b/index.php new file mode 100644 index 000000000..f8d8ac756 --- /dev/null +++ b/index.php @@ -0,0 +1,100 @@ + diff --git a/install_.php b/install_.php new file mode 100644 index 000000000..9db3c7599 --- /dev/null +++ b/install_.php @@ -0,0 +1,1935 @@ +important security checks and There is NO workaround. Please contact your host for more information."); +} + +if(!function_exists("print_a")) { + function print_a($var) { + return '
        '.htmlentities(print_r($var, true), null, "UTF-8").'
        '; + } +} + +header("Content-type: text/html; charset=utf-8"); + +$installer_folder_name = 'e107_install'; + +include_once("./{$HANDLERS_DIRECTORY}e107_class.php"); + +$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY'); +$e107 = new e107($e107_paths, realpath(dirname(__FILE__))); +unset($e107_paths); + +$e107->e107_dirs['INSTALLER'] = "{$installer_folder_name}/"; + +$e_install = new e_install(); +$e_forms = new e_forms(); + +$e_install->template->SetTag("installer_css_http", $_SERVER['PHP_SELF']."?object=stylesheet"); +$e_install->template->SetTag("installer_folder_http", e_HTTP.$installer_folder_name."/"); +$e_install->template->SetTag("files_dir_http", e_FILE_ABS); + +if(!isset($_POST['stage'])) { + $_POST['stage'] = 1; +} +$_POST['stage'] = intval($_POST['stage']); + +switch ($_POST['stage']) { + case 1: + $e_install->stage_1(); + break; + case 2: + $e_install->stage_2(); + break; + case 3: + $e_install->stage_3(); + break; + case 4: + $e_install->stage_4(); + break; + case 5: + $e_install->stage_5(); + break; + case 6: + $e_install->stage_6(); + break; + case 7: + $e_install->stage_7(); + break; + default: + $e_install->raise_error("Install stage information from client makes no sense to me."); +} + +if($_SERVER['QUERY_STRING'] == "debug"){ + $e_install->template->SetTag("debug_info", print_a($e_install)); +} else { + $e_install->template->SetTag("debug_info", (count($e_install->debug_info) ? print_a($e_install->debug_info)."Backtrace:
        ".print_a($e_install) : "")); +} + +echo $e_install->template->ParseTemplate(template_data(), TEMPLATE_TYPE_DATA); + + + +class e_install { + + var $required_php = "4.3"; + + var $paths; + var $template; + var $debug_info; + var $e107; + var $previous_steps; + var $stage; + var $post_data; + + function e_install() { + $this->template = new SimpleTemplate(); + while (@ob_end_clean()); + global $e107; + $this->e107 = $e107; + if(isset($_POST['previous_steps'])) { + $this->previous_steps = unserialize(base64_decode($_POST['previous_steps'])); + unset($_POST['previous_steps']); + } else { + $this->previous_steps = array(); + } + $this->post_data = $_POST; + } + + function raise_error($details){ + $this->debug_info[] = array ( + 'info' => array ( + 'details' => $details, + 'backtrace' => debug_backtrace() + ) + ); + } + + function stage_1(){ + global $e_forms; + $this->stage = 1; + $this->get_lan_file(); + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_003); + $this->template->SetTag("stage_title", LANINS_004); + $e_forms->start_form("language_select", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $e_forms->add_select_item("language", $this->get_languages(), "English"); + $this->finish_form(); + $e_forms->add_button("submit", LANINS_006); + $this->template->SetTag("stage_content", "
        \n


        \n".$e_forms->return_form()."
        "); + } + + function stage_2(){ + global $e_forms; + $this->stage = 2; + $this->previous_steps['language'] = $_POST['language']; + $this->get_lan_file(); + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_021); + $this->template->SetTag("stage_title", LANINS_022); + $page_info = nl2br(LANINS_023); + $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $output = " +

        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".LANINS_030."
        ".LANINS_031."
        ".LANINS_032."
        + ".LANINS_033."
        ".LANINS_034."
        +
        +

        \n"; + $e_forms->add_plain_html($output); + $this->finish_form(); + $e_forms->add_button("submit", LANINS_035); + $this->template->SetTag("stage_content", $page_info.$e_forms->return_form()); + } + + function stage_3(){ + global $e_forms; + $this->stage = 3; + $this->get_lan_file(); + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_036); + $this->previous_steps['mysql']['server'] = $_POST['server']; + $this->previous_steps['mysql']['user'] = $_POST['name']; + $this->previous_steps['mysql']['password'] = $_POST['password']; + $this->previous_steps['mysql']['db'] = $_POST['db']; + $this->previous_steps['mysql']['createdb'] = (isset($_POST['createdb']) && $_POST['createdb'] == true ? true : false); + $this->previous_steps['mysql']['prefix'] = $_POST['prefix']; + if($this->previous_steps['mysql']['server'] == "" || $this->previous_steps['mysql']['user'] == "" | $this->previous_steps['mysql']['db'] == "") { + $this->stage = 3; + $this->template->SetTag("stage_num", LANINS_021); + $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $head = LANINS_039."

        \n"; + $output = " +

        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".LANINS_030."
        ".LANINS_031."
        ".LANINS_032."
        + ".LANINS_033."
        ".LANINS_034."
        +
        +

        \n"; + $e_forms->add_plain_html($output); + $e_forms->add_button("submit", LANINS_035); + $this->template->SetTag("stage_title", LANINS_040); + } else { + $success = true; + $this->template->SetTag("stage_title", LANINS_037.($this->previous_steps['mysql']['createdb'] == 1 ? LANINS_038 : "")); + if (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) { + $success = false; + $page_content = LANINS_041.nl2br("\n\n".LANINS_083."\n".mysql_error().""); + } else { + $page_content = LANINS_042; + if($this->previous_steps['mysql']['createdb'] == 1) { + if (!mysql_query("CREATE DATABASE ".$this->previous_steps['mysql']['db'])) { + $success = false; + $page_content .= "

        ".LANINS_043.nl2br("\n\n".LANINS_083."\n".mysql_error().""); + } else { + $page_content .= "

        ".LANINS_044; + } + } + } + if($success){ + $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $page_content .= "

        ".LANINS_045."

        "; + $e_forms->add_button("submit", LANINS_035); + } + $head = $page_content; + } + $this->finish_form(); + $this->template->SetTag("stage_content", $head.$e_forms->return_form()); + } + + function stage_4(){ + global $e_forms; + $this->stage = 4; + $this->get_lan_file(); + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_007); + $this->template->SetTag("stage_title", LANINS_008); + $not_writable = $this->check_writable_perms(); + $version_fail = false; + $perms_errors = ""; + if(count($not_writable)) { + $perms_pass = false; + foreach ($not_writable as $file) { + $perms_errors .= (substr($file, -1) == "/" ? LANINS_010a : LANINS_010)."...
        {$file}
        \n"; + } + $perms_notes = LANINS_018; + } else { + $perms_pass = true; + $perms_errors = " "; + $perms_notes = LANINS_017; + } + if(!function_exists("mysql_connect")) { + $version_fail = true; + $mysql_note = LANINS_011; + $mysql_help = LANINS_012; + } elseif (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) { + $mysql_note = LANINS_011; + $mysql_help = LANINS_013; + } else { + $mysql_note = mysql_get_server_info(); + $mysql_help = LANINS_017; + } + if(!function_exists("utf8_encode")) { + $xml_installed = false; + } else { + $xml_installed = true; + } + + $php_version = phpversion(); + if(version_compare($php_version, $this->required_php, ">=")) { + $php_help = LANINS_017; + } else { + $php_help = LANINS_019; + } + $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + if(!$perms_pass) { + $e_forms->add_button("retest_perms", LANINS_009); + $this->stage = 3; // make the installer jump back a step + } elseif ($perms_pass && !$version_fail && $xml_installed) { + $e_forms->add_button("continue_install", LANINS_020); + } + $output = " + + + + + + + + + + + + + + + + + + + + + +
        ".LANINS_014."{$perms_errors}{$perms_notes}
        ".LANINS_015."{$php_version}{$php_help}
        ".LANINS_016."{$mysql_note}{$mysql_help}
        ".LANINS_050."".($xml_installed ? LANINS_051 : LANINS_052)."".($xml_installed ? LANINS_017 : LANINS_053."php.net".LANINS_054)."
        \n

        \n\n"; + $this->finish_form(); + $this->template->SetTag("stage_content", $output.$e_forms->return_form()); + } + + + + function stage_5(){ + global $e_forms; + $this->stage = 5; + $this->get_lan_file(); + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_046); + $this->template->SetTag("stage_title", LANINS_047); + $e_forms->start_form("admin_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $output = " +
        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        previous_steps['admin']['user'] : "")."' maxlength='60' />".LANINS_073."
        previous_steps['admin']['display'] : "")."' maxlength='60' />".LANINS_075."
        ".LANINS_077."
        ".LANINS_079."
        previous_steps['admin']['email'] : LANINS_082)."' maxlength='100' />".LANINS_081."
        +
        +

        \n"; + $e_forms->add_plain_html($output); + $this->finish_form(); + $e_forms->add_button("submit", LANINS_035); + $this->template->SetTag("stage_content", $e_forms->return_form()); + } + + function stage_6(){ + global $e_forms; + $this->get_lan_file(); + $this->stage = 6; + + $_POST['u_name'] = str_replace(array("'", '"'), "", $_POST['u_name']); + $_POST['d_name'] = str_replace(array("'", '"'), "", $_POST['d_name']); + + $this->previous_steps['admin']['user'] = $_POST['u_name']; + if ($_POST['d_name'] == "") { + $this->previous_steps['admin']['display'] = $_POST['u_name']; + } else { + $this->previous_steps['admin']['display'] = $_POST['d_name']; + } + $this->previous_steps['admin']['email'] = $_POST['email']; + $this->previous_steps['admin']['password'] = $_POST['pass1']; + + if(trim($_POST['u_name']) == "" || trim($_POST['email']) == "" || trim($_POST['pass1']) == "") { + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_num", LANINS_046); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_title", LANINS_047); + $e_forms->start_form("admin_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $page = LANINS_086."
        ".($_SERVER['QUERY_STRING'] == "debug" ? print_a($_POST, true) : "")."
        "; + + $this->finish_form(5); + $e_forms->add_button("submit", LANINS_048); + } elseif($_POST['pass1'] != $_POST['pass2']) { + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_num", LANINS_046); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_title", LANINS_047); + $e_forms->start_form("admin_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $page = LANINS_049."
        ".($_SERVER['QUERY_STRING'] == "debug" ? print_a($_POST, true) : "")."
        "; + + $this->finish_form(5); + $e_forms->add_button("submit", LANINS_048); + } else { + + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_056); + $this->template->SetTag("stage_title", LANINS_055); + + $e_forms->start_form("confirmation", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); + $page = nl2br(LANINS_057); + $this->finish_form(); + $e_forms->add_button("submit", LANINS_035); + } + + $this->template->SetTag("stage_content", $page.$e_forms->return_form()); + } + + function stage_7(){ + global $e_forms; + $this->get_lan_file(); + + $this->stage = 7; + + $this->template->SetTag("installation_heading", LANINS_001); + $this->template->SetTag("stage_pre", LANINS_002); + $this->template->SetTag("stage_num", LANINS_058); + $this->template->SetTag("stage_title", LANINS_071); + + $config_file = "previous_steps['mysql']['server']}'; +\$mySQLuser = '{$this->previous_steps['mysql']['user']}'; +\$mySQLpassword = '{$this->previous_steps['mysql']['password']}'; +\$mySQLdefaultdb = '{$this->previous_steps['mysql']['db']}'; +\$mySQLprefix = '{$this->previous_steps['mysql']['prefix']}'; + +\$ADMIN_DIRECTORY = \"{$this->e107->e107_dirs['ADMIN_DIRECTORY']}\"; +\$FILES_DIRECTORY = \"{$this->e107->e107_dirs['FILES_DIRECTORY']}\"; +\$IMAGES_DIRECTORY = \"{$this->e107->e107_dirs['IMAGES_DIRECTORY']}\"; +\$THEMES_DIRECTORY = \"{$this->e107->e107_dirs['THEMES_DIRECTORY']}\"; +\$PLUGINS_DIRECTORY = \"{$this->e107->e107_dirs['PLUGINS_DIRECTORY']}\"; +\$HANDLERS_DIRECTORY = \"{$this->e107->e107_dirs['HANDLERS_DIRECTORY']}\"; +\$LANGUAGES_DIRECTORY = \"{$this->e107->e107_dirs['LANGUAGES_DIRECTORY']}\"; +\$HELP_DIRECTORY = \"{$this->e107->e107_dirs['HELP_DIRECTORY']}\"; +\$DOWNLOADS_DIRECTORY = \"{$this->e107->e107_dirs['DOWNLOADS_DIRECTORY']}\"; + +?>"; + + $config_result = $this->write_config($config_file); + $e_forms->start_form("confirmation", "index.php"); + if ($config_result) { + $page = $config_result."
        "; + } else { + $errors = $this->create_tables(); + if ($errors == true) { + $page = $errors."
        "; + } else { + $page = nl2br(LANINS_069)."
        "; + $e_forms->add_button("submit", LANINS_035); + } + } + $this->finish_form(); + $this->template->SetTag("stage_content", $page.$e_forms->return_form()); + } + + function get_lan_file(){ + if(!isset($this->previous_steps['language'])) { + $this->previous_steps['language'] = "English"; + } + $this->lan_file = "{$this->e107->e107_dirs['LANGUAGES_DIRECTORY']}{$this->previous_steps['language']}/lan_installer.php"; + if(is_readable($this->lan_file)){ + include($this->lan_file); + } elseif(is_readable("{$this->e107->e107_dirs['LANGUAGES_DIRECTORY']}English/lan_installer.php")) { + include("{$this->e107->e107_dirs['LANGUAGES_DIRECTORY']}English/lan_installer.php"); + } else { + $this->raise_error("Fatal: Could not get valid language file for installation."); + } + } + + function get_languages() { + $handle = opendir("{$this->e107->e107_dirs['LANGUAGES_DIRECTORY']}"); + while ($file = readdir($handle)) { + if ($file != "." && $file != ".." && $file != "/" && $file != "CVS") { + if(file_exists("./{$this->e107->e107_dirs['LANGUAGES_DIRECTORY']}{$file}/lan_installer.php")){ + $lanlist[] = $file; + } + } + } + closedir($handle); + return $lanlist; + } + + function finish_form($force_stage = false) { + global $e_forms; + if($this->previous_steps) { + $e_forms->add_hidden_data("previous_steps", base64_encode(serialize($this->previous_steps))); + } + $e_forms->add_hidden_data("stage", ($force_stage ? $force_stage : ($this->stage + 1))); + } + + function check_writable_perms(){ + $bad_files = array(); + $data = 'e107_config.php|{$FILES_DIRECTORY}cache/|{$FILES_DIRECTORY}public/|{$FILES_DIRECTORY}public/avatars/|{$PLUGINS_DIRECTORY}|{$THEMES_DIRECTORY}'; + foreach ($this->e107->e107_dirs as $dir_name => $value) { + $find[] = "{\${$dir_name}}"; + $replace[] = "./$value"; + } + $data = str_replace($find, $replace, $data); + $files = explode("|", trim($data)); + foreach ($files as $file) { + if(!is_writable($file)) { + $bad_files[] = str_replace("./", "", $file); + } + } + return $bad_files; + } + + function create_tables() { + + $link = mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password']); + if(!$link) { + return nl2br(LANINS_084."\n\n".LANINS_083."\n".mysql_error($link).""); + } + + $db_selected = mysql_select_db($this->previous_steps['mysql']['db'], $link); + if(!$db_selected) { + return nl2br(LANINS_085." '{$this->previous_steps['mysql']['db']}'\n\n".LANINS_083."\n".mysql_error($link).""); + } + + $filename = "{$this->e107->e107_dirs['ADMIN_DIRECTORY']}sql/core_sql.php"; + $fd = fopen ($filename, "r"); + $sql_data = fread($fd, filesize($filename)); + fclose ($fd); + + if (!$sql_data) { + return nl2br(LANINS_060)."

        "; + } + + preg_match_all("/create(.*?)myisam;/si", $sql_data, $result ); + + foreach ($result[0] as $sql_table) { + preg_match("/CREATE TABLE\s(.*?)\s\(/si", $sql_table, $match); + $tablename = $match[1]; + preg_match_all("/create(.*?)myisam;/si", $sql_data, $result ); + $sql_table = preg_replace("/create table\s/si", "CREATE TABLE {$this->previous_steps['mysql']['prefix']}", $sql_table); + if (!mysql_query($sql_table, $link)) { + return nl2br(LANINS_061."\n\n".LANINS_083."\n".mysql_error($link).""); + } + } + + $datestamp = time(); + + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}news VALUES (0, '".LANINS_063."', '".LANINS_062."', '', '{$datestamp}', '0', '1', 1, 0, 0, 0, 0, '0', '', 'welcome.png', 0) "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}news_category VALUES (0, 'Misc', 'icon26.png') "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}links VALUES (0, 'Home', 'index.php', '', '', 1, 1, 0, 0, 0) "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}links VALUES (0, 'Downloads', 'download.php', '', '', 1, 2, 0, 0, 0) "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}links VALUES (0, 'Members', 'user.php', '', '', 1, 3, 0, 0, 0) "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}links VALUES (0, 'Submit News', 'submitnews.php', '', '', 1, 4, 0, 0, 0) "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}links VALUES (0, 'Contact Us', 'contact.php', '', '', 1, 5, 0, 0, 0) "); + + $udirs = "admin/|plugins/|temp"; + $e_SELF = $_SERVER['PHP_SELF']; + $e_HTTP = preg_replace("#".$udirs."#i", "", substr($e_SELF, 0, strrpos($e_SELF, "/"))."/"); + + $pref_language = isset($this->previous_steps['language']) ? $this->previous_steps['language'] : "English"; + + if (file_exists($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$pref_language."/lan_prefs.php")) { + include_once($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$pref_language."/lan_prefs.php"); + } else { + include_once($this->e107->e107_dirs['LANGUAGES_DIRECTORY']."English/lan_prefs.php"); + } + + $site_admin_user = $this->previous_steps['admin']['display']; + $site_admin_email = $this->previous_steps['admin']['email']; + + require_once("{$this->e107->e107_dirs['FILES_DIRECTORY']}def_e107_prefs.php"); + + include_once("{$this->e107->e107_dirs['HANDLERS_DIRECTORY']}arraystorage_class.php"); + + $tmp = ArrayData::WriteArray($pref); + + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('SitePrefs', '{$tmp}')"); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('SitePrefs_Backup', '{$tmp}')"); + + $emote = 'a:60:{i:0;a:1:{s:2:"&|";s:7:"cry.png";}i:1;a:1:{s:3:"&-|";s:7:"cry.png";}i:2;a:1:{s:3:"&o|";s:7:"cry.png";}i:3;a:1:{s:3:":((";s:7:"cry.png";}i:4;a:1:{s:3:"~:(";s:7:"mad.png";}i:5;a:1:{s:4:"~:o(";s:7:"mad.png";}i:6;a:1:{s:4:"~:-(";s:7:"mad.png";}i:7;a:1:{s:2:":)";s:9:"smile.png";}i:8;a:1:{s:3:":o)";s:9:"smile.png";}i:9;a:1:{s:3:":-)";s:9:"smile.png";}i:10;a:1:{s:2:":(";s:9:"frown.png";}i:11;a:1:{s:3:":o(";s:9:"frown.png";}i:12;a:1:{s:3:":-(";s:9:"frown.png";}i:13;a:1:{s:2:":D";s:8:"grin.png";}i:14;a:1:{s:3:":oD";s:8:"grin.png";}i:15;a:1:{s:3:":-D";s:8:"grin.png";}i:16;a:1:{s:2:":?";s:12:"confused.png";}i:17;a:1:{s:3:":o?";s:12:"confused.png";}i:18;a:1:{s:3:":-?";s:12:"confused.png";}i:19;a:1:{s:3:"%-6";s:11:"special.png";}i:20;a:1:{s:2:"x)";s:8:"dead.png";}i:21;a:1:{s:3:"xo)";s:8:"dead.png";}i:22;a:1:{s:3:"x-)";s:8:"dead.png";}i:23;a:1:{s:2:"x(";s:8:"dead.png";}i:24;a:1:{s:3:"xo(";s:8:"dead.png";}i:25;a:1:{s:3:"x-(";s:8:"dead.png";}i:26;a:1:{s:2:":@";s:7:"gah.png";}i:27;a:1:{s:3:":o@";s:7:"gah.png";}i:28;a:1:{s:3:":-@";s:7:"gah.png";}i:29;a:1:{s:2:":!";s:8:"idea.png";}i:30;a:1:{s:3:":o!";s:8:"idea.png";}i:31;a:1:{s:3:":-!";s:8:"idea.png";}i:32;a:1:{s:2:":|";s:11:"neutral.png";}i:33;a:1:{s:3:":o|";s:11:"neutral.png";}i:34;a:1:{s:3:":-|";s:11:"neutral.png";}i:35;a:1:{s:2:"?!";s:12:"question.png";}i:36;a:1:{s:2:"B)";s:12:"rolleyes.png";}i:37;a:1:{s:3:"Bo)";s:12:"rolleyes.png";}i:38;a:1:{s:3:"B-)";s:12:"rolleyes.png";}i:39;a:1:{s:2:"8)";s:10:"shades.png";}i:40;a:1:{s:3:"8o)";s:10:"shades.png";}i:41;a:1:{s:3:"8-)";s:10:"shades.png";}i:42;a:1:{s:2:":O";s:12:"suprised.png";}i:43;a:1:{s:3:":oO";s:12:"suprised.png";}i:44;a:1:{s:3:":-O";s:12:"suprised.png";}i:45;a:1:{s:2:":p";s:10:"tongue.png";}i:46;a:1:{s:3:":op";s:10:"tongue.png";}i:47;a:1:{s:3:":-p";s:10:"tongue.png";}i:48;a:1:{s:2:":P";s:10:"tongue.png";}i:49;a:1:{s:3:":oP";s:10:"tongue.png";}i:50;a:1:{s:3:":-P";s:10:"tongue.png";}i:51;a:1:{s:2:";)";s:8:"wink.png";}i:52;a:1:{s:3:";o)";s:8:"wink.png";}i:53;a:1:{s:3:";-)";s:8:"wink.png";}i:54;a:1:{s:4:"!ill";s:7:"ill.png";}i:55;a:1:{s:7:"!amazed";s:10:"amazed.png";}i:56;a:1:{s:4:"!cry";s:7:"cry.png";}i:57;a:1:{s:6:"!dodge";s:9:"dodge.png";}i:58;a:1:{s:6:"!alien";s:9:"alien.png";}i:59;a:1:{s:6:"!heart";s:9:"heart.png";}}'; + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('emote', '{$emote}') "); + + $menu_conf = 'a:23:{s:15:"comment_caption";s:15:"Latest Comments";s:15:"comment_display";s:2:"10";s:18:"comment_characters";s:2:"50";s:15:"comment_postfix";s:12:"[ more ... ]";s:13:"comment_title";i:0;s:15:"article_caption";s:8:"Articles";s:16:"articles_display";s:2:"10";s:17:"articles_mainlink";s:23:"Articles Front Page ...";s:21:"newforumposts_caption";s:18:"Latest Forum Posts";s:21:"newforumposts_display";s:2:"10";s:19:"forum_no_characters";s:2:"20";s:13:"forum_postfix";s:10:"[more ...]";s:11:"update_menu";s:20:"Update menu Settings";s:17:"forum_show_topics";s:1:"1";s:24:"newforumposts_characters";s:2:"50";s:21:"newforumposts_postfix";s:10:"[more ...]";s:19:"newforumposts_title";i:0;s:13:"clock_caption";s:11:"Date / Time";s:15:"reviews_caption";s:7:"Reviews";s:15:"reviews_display";s:2:"10";s:15:"reviews_parents";s:1:"1";s:16:"reviews_mainlink";s:21:"Review Front Page ...";s:16:"articles_parents";s:1:"1";}'; + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('menu_pref', '{$menu_conf}') "); + + preg_match("/^(.*?)($|-)/", mysql_get_server_info(), $mysql_version); + if (version_compare($mysql_version[1], '4.0.1', '<')) { + $search_prefs = 'a:12:{s:11:\"user_select\";s:1:\"1\";s:9:\"time_secs\";s:2:\"60\";s:13:\"time_restrict\";s:1:\"0\";s:8:\"selector\";s:1:\"2\";s:9:\"relevance\";s:1:\"0\";s:13:\"plug_handlers\";N;s:10:\"mysql_sort\";b:0;s:11:\"multisearch\";s:1:\"1\";s:6:\"google\";s:1:\"0\";s:13:\"core_handlers\";a:5:{s:4:\"news\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"0\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"1\";}s:8:\"comments\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"2\";}s:5:\"users\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"3\";}s:9:\"downloads\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"4\";}s:5:\"pages\";a:6:{s:5:\"class\";s:1:\"0\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:9:\"pre_title\";s:1:\"0\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"order\";s:1:\"5\";}}s:17:\"comments_handlers\";a:2:{s:4:\"news\";a:3:{s:2:\"id\";i:0;s:3:\"dir\";s:4:\"core\";s:5:\"class\";s:1:\"0\";}s:8:\"download\";a:3:{s:2:\"id\";i:2;s:3:\"dir\";s:4:\"core\";s:5:\"class\";s:1:\"0\";}}s:9:\"php_limit\";s:0:\"\";}'; + } else { + $search_prefs = 'a:12:{s:11:\"user_select\";s:1:\"1\";s:9:\"time_secs\";s:2:\"60\";s:13:\"time_restrict\";s:1:\"0\";s:8:\"selector\";s:1:\"2\";s:9:\"relevance\";s:1:\"0\";s:13:\"plug_handlers\";N;s:10:\"mysql_sort\";b:1;s:11:\"multisearch\";s:1:\"1\";s:6:\"google\";s:1:\"0\";s:13:\"core_handlers\";a:5:{s:4:\"news\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"0\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"1\";}s:8:\"comments\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"2\";}s:5:\"users\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"3\";}s:9:\"downloads\";a:6:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:5:\"order\";s:1:\"4\";}s:5:\"pages\";a:6:{s:5:\"class\";s:1:\"0\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";s:9:\"pre_title\";s:1:\"0\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"order\";s:1:\"5\";}}s:17:\"comments_handlers\";a:2:{s:4:\"news\";a:3:{s:2:\"id\";i:0;s:3:\"dir\";s:4:\"core\";s:5:\"class\";s:1:\"0\";}s:8:\"download\";a:3:{s:2:\"id\";i:2;s:3:\"dir\";s:4:\"core\";s:5:\"class\";s:1:\"0\";}}s:9:\"php_limit\";s:0:\"\";}'; + } + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('search_prefs', '{$search_prefs}') "); + + $notify_prefs = mysql_escape_string("array ('event' => array ('usersup' => array ('type' => 'off', 'class' => '254', 'email' => '',),'userveri' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'login' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'logout' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'flood' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'subnews' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newspost' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newsupd' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newsdel' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), ), )"); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('notify_prefs', '{$notify_prefs}') "); + + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}banner VALUES (0, 'e107', 'e107login', 'e107password', 'banner1.png', 'http://e107.org', 0, 0, 0, 0, 0, 0, '', 'campaign_one') "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}banner VALUES (0, 'e107', 'e107login', 'e107password', 'banner2.png', 'http://e107.org', 0, 0, 0, 0, 0, 0, '', 'campaign_one') "); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}banner VALUES (0, 'e107', 'e107login', 'e107password', 'banner3.png', 'http://e107.org', 0, 0, 0, 0, 0, 0, '', 'campaign_one') "); + + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (1, 'login_menu', 1, 1, '0', '', 'login_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (3, 'online_menu', 0, 0, '0', '', 'online_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (4, 'blogcalendar_menu', 0, 0, '0', '', 'blogcalendar_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (5, 'tree_menu', 0, 0, '0', '', 'tree_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (6, 'search_menu', 0, 0, '0', '', 'search_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (7, 'compliance_menu', 0, 0, '0', '', 'compliance_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (8, 'userlanguage_menu', 0, 0, '0', '', 'userlanguage_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (9, 'powered_by_menu', 2, 2, '0', '', 'powered_by_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (10, 'counter_menu', 0, 0, '0', '', 'counter_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (11, 'usertheme_menu', 0, 0, '0', '', 'usertheme_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (12, 'banner_menu', 0, 0, '0', '', 'banner_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (13, 'online_extended_menu', 2, 1, '0', '', 'online_extended_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (14, 'clock_menu', 0, 0, '0', '', 'clock_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (15, 'sitebutton_menu', 0, 0, '0', '', 'sitebutton_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (16, 'comment_menu', 0, 0, '0', '', 'comment_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (17, 'lastseen_menu', 0, 0, '0', '', 'lastseen/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (18, 'other_news_menu', 0, 0, '0', '', 'other_news_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (19, 'other_news2_menu', 0, 0, '0', '', 'other_news_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (20, 'admin_menu', 0, 0, '0', '', 'admin_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (21, 'rss_menu', 5, 1, '0', '', 'rss_menu/')"); + mysql_query("INSERT INTO `{$this->previous_steps['mysql']['prefix']}menus` VALUES (22, 'PCMag', 3, 1, '0', '', '1')"); + + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}userclass_classes VALUES (1, 'PRIVATEMENU', 'Grants access to private menu items')"); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}userclass_classes VALUES (2, 'PRIVATEFORUM1', 'Example private forum class')"); + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}plugin VALUES (0, 'Integrity Check', '0.03', 'integrity_check', 1) "); + + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}generic VALUES (0, 'wmessage', 1145848343, 1, '', 0, '[center]''[/center]')"); + + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}page VALUES (1, '', '[img]{e_IMAGE}pcmag.png[/img] ', 0, 1145843485, 0, 0, '', '', '', 'PCMag')"); + + // Create the admin user + $ip = $_SERVER['REMOTE_ADDR']; + $userp = "1, '{$this->previous_steps['admin']['display']}', '{$this->previous_steps['admin']['user']}', '', '".md5($this->previous_steps['admin']['password'])."', '', '{$this->previous_steps['admin']['email']}', '', '', '', 0, ".time().", 0, 0, 0, 0, 0, 0, '{$ip}', 0, '', '', '', 0, 1, '', '', '0', '', ".time().", ''"; + mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})" ); + mysql_close(); + + return false; + } + + function write_config($data) { + $fp = @fopen("e107_config.php", "w"); + if (!@fwrite($fp, $data)) { + @fclose ($fp); + return nl2br(LANINS_070); + } + @fclose ($fp); + return false; + } +} + +class e_forms { + + var $form; + var $opened; + + function start_form($id, $action, $method = "post" ) { + $this->form = "\n
        \n"; + $this->opened = true; + } + + function add_select_item($id, $labels, $selected) { + $this->form .= " + \n"; + } + + function add_button($id, $title, $align = "right", $type = "submit") { + $this->form .= "
        \n"; + } + + function add_hidden_data($id, $data) { + $this->form .= "\n"; + } + + function add_plain_html($html_data) { + $this->form .= $html_data; + } + + function return_form() { + if($this->opened == true) { + $this->form .= "
        \n"; + } + $this->opened = false; + return $this->form; + } +} + +class SimpleTemplate { + + var $Tags = array(); + var $open_tag = "{"; + var $close_tag = "}"; + + function SimpleTemplate() { + define("TEMPLATE_TYPE_FILE", 0); + define("TEMPLATE_TYPE_DATA", 1); + } + + function SetTag($TagName, $Data) { + $this->Tags[$TagName] = array( 'Tag' => $TagName, + 'Data' => $Data + ); + } + + function RemoveTag($TagName) { + unset($this->Tags[$TagName]); + } + + function ClearTags() { + $this->Tags = array(); + } + + function ParseTemplate($Template, $template_type = TEMPLATE_TYPE_FILE) { + if($template_type == TEMPLATE_TYPE_DATA) { + $TemplateData = $Template; + } else { + $TemplateData = file_get_contents($Template); + } + foreach ($this->Tags as $Tag) { + $TemplateData = str_replace($this->open_tag.$Tag['Tag'].$this->close_tag, $Tag['Data'], $TemplateData); + } + return $TemplateData; + } +} + +function template_data() { + $data = " + + +{installation_heading} + + + + + + +
        +

        {installation_heading}

        +
        +
        +
        +
        +
        +

        {stage_pre}{stage_num} - {stage_title}

        +
        +

        {stage_content}

        + {debug_info} +
        +
        +
        +
         
        +
        +
         
        + + +"; + return $data; +} + +function get_object($name) { + switch ($name) { + case "stylesheet"; + header("Content-type: text/css"); + echo "#container{ + float:left; + margin-right : -230px; + width : 670px; +} +#content{ +margin: 15px 0px 0px -15px; +} +#footer{ + background : url({$_SERVER['PHP_SELF']}?object=01_footer.jpg) top no-repeat; + margin : auto; + padding : 20px 0 0 0; + width : 700px; +} +#header h1{ + font-size : 20px; + left : 18px; + line-height : 20px; + margin : 0; + position : absolute; + top : 17px; +} +#header{ + background : url({$_SERVER['PHP_SELF']}?object=01_header01.jpg) no-repeat; + height : 151px; + margin : auto; + position : relative; + width : 700px; +} +#wrapper{ + background : white url({$_SERVER['PHP_SELF']}?object=01_bodybg.jpg) repeat-y; + margin : auto; + text-align:left; + width : 700px; +} +.clearing{ + clear : both; + height : 0; +} +.contentbody{ + margin : 0px; + padding : 0 5px 20px 43px; +} +a:hover, a:active{ + color : black; +} +a:link, a:visited{ + color : #23598C; + text-decoration : none; +} +h1 { + color : #23598C; +} +body{ + background : #123454 url(images/01_bg.gif) top repeat-x; + color : #4C4C4C; + font-family : Trebuchet MS, \"Lucida Sans Unicode\", Arial, Lucida Sans, Tahoma, Sans-Serif; + font-size : 13px; + padding : 20px 0 20px 0; + text-align : center; +} +h3{ + color : #3E565F; + font-size : 16px; + margin : 0 0 8px 0; +} +img{ + border : none; +} + +.logoimage { + padding-left: 600px; + padding-top: 65px; +} + +td { + vertical-align: top; +} + +.row-border { + border-bottom: 1px solid #999; + padding: 6px 3px 6px 3px; +}"; + break; + + /* The following data is base64 encoded to preserve binary state in ASCII file */ + + case "01_footer.jpg": + header("Content-type: image/jpeg"); + echo trim(base64_decode(" +/9j/4AAQSkZJRgABAgEASABIAAD/4QPgRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUA +AAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAUAAAAcgEyAAIAAAAUAAAAhodp +AAQAAAABAAAAnAAAAMgAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIDcuMAAyMDA1OjAy +OjI2IDA0OjE2OjUyAAAAAAOgAQADAAAAAf//AACgAgAEAAAAAQAAArygAwAEAAAAAQAAAA0AAAAA +AAAABgEDAAMAAAABAAYAAAEaAAUAAAABAAABFgEbAAUAAAABAAABHgEoAAMAAAABAAIAAAIBAAQA +AAABAAABJgICAAQAAAABAAACsgAAAAAAAABIAAAAAQAAAEgAAAAB/9j/4AAQSkZJRgABAgEASABI +AAD/7QAMQWRvYmVfQ00AAv/uAA5BZG9iZQBkgAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwP +FRgTExUTExgRDAwMDAwMEQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBDQsLDQ4NEA4OEBQO +Dg4UFA4ODg4UEQwMDAwMEREMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDP/AABEI +AAIAgAMBIgACEQEDEQH/3QAEAAj/xAE/AAABBQEBAQEBAQAAAAAAAAADAAECBAUGBwgJCgsBAAEF +AQEBAQEBAAAAAAAAAAEAAgMEBQYHCAkKCxAAAQQBAwIEAgUHBggFAwwzAQACEQMEIRIxBUFRYRMi +cYEyBhSRobFCIyQVUsFiMzRygtFDByWSU/Dh8WNzNRaisoMmRJNUZEXCo3Q2F9JV4mXys4TD03Xj +80YnlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3EQACAgECBAQDBAUGBwcG +BTUBAAIRAyExEgRBUWFxIhMFMoGRFKGxQiPBUtHwMyRi4XKCkkNTFWNzNPElBhaisoMHJjXC0kST +VKMXZEVVNnRl4vKzhMPTdePzRpSkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2JzdHV2d3h5ent8f/ +2gAMAwEAAhEDEQA/ANro3/I+D/y9/R6v5v6H0W/zf/B/6P8A4NXP/rhXgiSkO5WDZ97/APrhS/8A +rhXgiSSn3v8A+uFL/wCuFeCJJKfe/wD64Uv/AK4V4Ikkp97/APrhS/8ArhXgiSSn3v8A+uFL/wCu +FeCJJKfe/wD64Uv/AK4V4Ikkp97/APrhQM7+g5P/AIoP5qzn+q5eFpJBRf/Z/+0ImFBob3Rvc2hv +cCAzLjAAOEJJTQQlAAAAAAAQAAAAAAAAAAAAAAAAAAAAADhCSU0D7QAAAAAAEABIAAAAAQABAEgA +AAABAAE4QklNBCYAAAAAAA4AAAAAAAAAAAAAP4AAADhCSU0EDQAAAAAABAAAAHg4QklNBBkAAAAA +AAQAAAAeOEJJTQPzAAAAAAAJAAAAAAAAAAABADhCSU0ECgAAAAAAAQAAOEJJTScQAAAAAAAKAAEA +AAAAAAAAAThCSU0D9QAAAAAASAAvZmYAAQBsZmYABgAAAAAAAQAvZmYAAQChmZoABgAAAAAAAQAy +AAAAAQBaAAAABgAAAAAAAQA1AAAAAQAtAAAABgAAAAAAAThCSU0D+AAAAAAAcAAA//////////// +/////////////////wPoAAAAAP////////////////////////////8D6AAAAAD///////////// +////////////////A+gAAAAA/////////////////////////////wPoAAA4QklNBAAAAAAAAAIA +ADhCSU0EAgAAAAAAAgAAOEJJTQQIAAAAAAAQAAAAAQAAAkAAAAJAAAAAADhCSU0EHgAAAAAABAAA +AAA4QklNBBoAAAAAA0kAAAAGAAAAAAAAAAAAAAANAAACvAAAAAoAVQBuAHQAaQB0AGwAZQBkAC0A +NAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACvAAAAA0AAAAAAAAAAAAAAAAAAAAA +AQAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAG51bGwAAAACAAAABmJvdW5kc09iamMAAAAB +AAAAAAAAUmN0MQAAAAQAAAAAVG9wIGxvbmcAAAAAAAAAAExlZnRsb25nAAAAAAAAAABCdG9tbG9u +ZwAAAA0AAAAAUmdodGxvbmcAAAK8AAAABnNsaWNlc1ZsTHMAAAABT2JqYwAAAAEAAAAAAAVzbGlj +ZQAAABIAAAAHc2xpY2VJRGxvbmcAAAAAAAAAB2dyb3VwSURsb25nAAAAAAAAAAZvcmlnaW5lbnVt +AAAADEVTbGljZU9yaWdpbgAAAA1hdXRvR2VuZXJhdGVkAAAAAFR5cGVlbnVtAAAACkVTbGljZVR5 +cGUAAAAASW1nIAAAAAZib3VuZHNPYmpjAAAAAQAAAAAAAFJjdDEAAAAEAAAAAFRvcCBsb25nAAAA +AAAAAABMZWZ0bG9uZwAAAAAAAAAAQnRvbWxvbmcAAAANAAAAAFJnaHRsb25nAAACvAAAAAN1cmxU +RVhUAAAAAQAAAAAAAG51bGxURVhUAAAAAQAAAAAAAE1zZ2VURVhUAAAAAQAAAAAABmFsdFRhZ1RF +WFQAAAABAAAAAAAOY2VsbFRleHRJc0hUTUxib29sAQAAAAhjZWxsVGV4dFRFWFQAAAABAAAAAAAJ +aG9yekFsaWduZW51bQAAAA9FU2xpY2VIb3J6QWxpZ24AAAAHZGVmYXVsdAAAAAl2ZXJ0QWxpZ25l +bnVtAAAAD0VTbGljZVZlcnRBbGlnbgAAAAdkZWZhdWx0AAAAC2JnQ29sb3JUeXBlZW51bQAAABFF +U2xpY2VCR0NvbG9yVHlwZQAAAABOb25lAAAACXRvcE91dHNldGxvbmcAAAAAAAAACmxlZnRPdXRz +ZXRsb25nAAAAAAAAAAxib3R0b21PdXRzZXRsb25nAAAAAAAAAAtyaWdodE91dHNldGxvbmcAAAAA +ADhCSU0EEQAAAAAAAQEAOEJJTQQUAAAAAAAEAAAAAzhCSU0EDAAAAAACzgAAAAEAAACAAAAAAgAA +AYAAAAMAAAACsgAYAAH/2P/gABBKRklGAAECAQBIAEgAAP/tAAxBZG9iZV9DTQAC/+4ADkFkb2Jl +AGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwM +DAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEM +DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAAgCAAwEiAAIRAQMRAf/dAAQACP/EAT8A +AAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoL +EAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT +8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2 +xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFC +I8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE +1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMRAD8A2ujf8j4P/L39Hq/m +/ofRb/N/8H/o/wDg1c/+uFeCJKQ7lYNn3v8A+uFL/wCuFeCJJKfe/wD64Uv/AK4V4Ikkp97/APrh +S/8ArhXgiSSn3v8A+uFL/wCuFeCJJKfe/wD64Uv/AK4V4Ikkp97/APrhS/8ArhXgiSSn3v8A+uFA +zv6Dk/8Aig/mrOf6rl4WkkFF/9k4QklNBCEAAAAAAFUAAAABAQAAAA8AQQBkAG8AYgBlACAAUABo +AG8AdABvAHMAaABvAHAAAAATAEEAZABvAGIAZQAgAFAAaABvAHQAbwBzAGgAbwBwACAANwAuADAA +AAABADhCSU0EBgAAAAAABwAIAAAAAQEA/+ESSGh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8A +PD94cGFja2V0IGJlZ2luPSfvu78nIGlkPSdXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQnPz4KPD9h +ZG9iZS14YXAtZmlsdGVycyBlc2M9IkNSIj8+Cjx4OnhhcG1ldGEgeG1sbnM6eD0nYWRvYmU6bnM6 +bWV0YS8nIHg6eGFwdGs9J1hNUCB0b29sa2l0IDIuOC4yLTMzLCBmcmFtZXdvcmsgMS41Jz4KPHJk +ZjpSREYgeG1sbnM6cmRmPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgt +bnMjJyB4bWxuczppWD0naHR0cDovL25zLmFkb2JlLmNvbS9pWC8xLjAvJz4KCiA8cmRmOkRlc2Ny +aXB0aW9uIGFib3V0PSd1dWlkOjM4ZWY1NGQ0LTg3ZjAtMTFkOS1hMDM2LWFlYWQ3YjZlYzZhMycK +ICB4bWxuczp4YXBNTT0naHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyc+CiAgPHhhcE1N +OkRvY3VtZW50SUQ+YWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjM4ZWY1NGQyLTg3ZjAtMTFkOS1hMDM2 +LWFlYWQ3YjZlYzZhMzwveGFwTU06RG9jdW1lbnRJRD4KIDwvcmRmOkRlc2NyaXB0aW9uPgoKPC9y +ZGY6UkRGPgo8L3g6eGFwbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9J3cnPz7/7gAOQWRvYmUAZEAAAAAB/9sAhAABAQEB +AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAgICAgICAgICAgIDAwMDAwMD +AwMDAQEBAQEBAQEBAQECAgECAgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD +AwMDAwMDAwMDAwP/wAARCAANArwDAREAAhEBAxEB/90ABABY/8QBogAAAAYCAwEAAAAAAAAAAAAA +BwgGBQQJAwoCAQALAQAABgMBAQEAAAAAAAAAAAAGBQQDBwIIAQkACgsQAAIBAwQBAwMCAwMDAgYJ +dQECAwQRBRIGIQcTIgAIMRRBMiMVCVFCFmEkMxdScYEYYpElQ6Gx8CY0cgoZwdE1J+FTNoLxkqJE +VHNFRjdHYyhVVlcassLS4vJkg3SThGWjs8PT4yk4ZvN1Kjk6SElKWFlaZ2hpanZ3eHl6hYaHiImK +lJWWl5iZmqSlpqeoqaq0tba3uLm6xMXGx8jJytTV1tfY2drk5ebn6Onq9PX29/j5+hEAAgEDAgQE +AwUEBAQGBgVtAQIDEQQhEgUxBgAiE0FRBzJhFHEIQoEjkRVSoWIWMwmxJMHRQ3LwF+GCNCWSUxhj +RPGisiY1GVQ2RWQnCnODk0Z0wtLi8lVldVY3hIWjs8PT4/MpGpSktMTU5PSVpbXF1eX1KEdXZjh2 +hpamtsbW5vZnd4eXp7fH1+f3SFhoeIiYqLjI2Oj4OUlZaXmJmam5ydnp+So6SlpqeoqaqrrK2ur6 +/9oADAMBAAIRAxEAPwA6v/CWPvHYuU+M/wAjvitDkUpO3tsd9v8AIjGYOqqKKOfeGyN59dbH6+rP +7s0b1SV1fVbQyPW0kuS0RsIo8lRBQTKdMie4tjOl/a34WsDR6K+jKzHP2hsetD1HvIV5C9jdWOr/ +ABhZNdPUFQuPsK5+0dbXeM3aKRWpqrVBNCzRSwzK0csUkZKyRuj2ZGVxYggEEe45qPz6HoJHTx/f +Sm/46J/tz73+fVtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR +69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+ +fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/t +z79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/4 +6J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/f +Sm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR +69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+ +fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/t +z79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/4 +6J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/f +Sm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR +69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+ +fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/t +z79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/4 +6J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/f +Sm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR +69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+ +fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/t +z79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/4 +6J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/f +Sm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR +69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR69/fSm/46J/tz79+fXtR64Sb1pgjfup9P6/X +/b+/fn1rUekJmt34TC0uQ3/vHN4/aewNjU1Vundu8s9UQ4/b2DxOAiGSrKnIZKrlgpoI0RF1eouq +vqCkC3u0cck0iRRIWdjQAZJPoOqO6Rq0srBY1FSTwAHz6+XX/s1Gxv8Ah03/AGef+Dbg/wBGn/Dh +v+za/wB3/DS/3r/uJ/syP+mL+D+D7j7L+8H93/2NHl8X3PGrTz7yE/dc39Wf3ZUeP9L4dfLV4emv +2V6gv94xf1h/edD4H1XiU86eJqp9tOv/0Ncz4+/7ML/pi2d/sqf+mD/T197L/cX/AEEDdh7N+7+3 +k+8/gX9ySNweL7Lyfc+P9r7bX5f2tXvJvdP3d9LJ+8vD+l89dNP56sfZ8+HWOW3/AF31MX7v8T6q +uNFdX5Uz9vy49bYdAP8AhYh/D6D7Nsr9r9lS/bfxFf5X/wDEPB4I/D9//GX/AIv9747eX7r/ACnX +fyevV7jB/wDW51Ghbj5C4p/h6kZP9cHSMClP+Xf/AC5/b1Jt/wALGv8AVVP/ACR/Kt/6+e6U9uvV +/wBlx/n6t/zED0H/AGb/AObr1v8AhY1/qqn/AJI/lW/9fPfqe3Xq/wCy4/z9e/5iB6D/ALN/83Xr +f8LGv9VU/wDJH8q3/r579T269X/Zcf5+vf8AMQPQf9m/+br1v+FjX+qqf+SP5Vv/AF89+p7der/s +uP8AP17/AJiB6D/s3/zdet/wsa/1VT/yR/Kt/wCvnv1Pbr1f9lx/n69/zED0H/Zv/m69b/hY1/qq +n/kj+Vb/ANfPfqe3Xq/7Lj/P17/mIHoP+zf/ADdet/wsa/1VT/yR/Kt/6+e/U9uvV/2XH+fr3/MQ +PQf9m/8Am69b/hY1/qqn/kj+Vb/189+p7der/suP8/Xv+Ygeg/7N/wDN163/AAsa/wBVU/8AJH8q +3/r579T269X/AGXH+fr3/MQPQf8AZv8A5uvW/wCFjX+qqf8Akj+Vb/189+p7der/ALLj/P17/mIH +oP8As3/zdet/wsa/1VT/AMkfyrf+vnv1Pbr1f9lx/n69/wAxA9B/2b/5uvW/4WNf6qp/5I/lW/8A +Xz36nt16v+y4/wA/Xv8AmIHoP+zf/N163/Cxr/VVP/JH8q3/AK+e/U9uvV/2XH+fr3/MQPQf9m/+ +br1v+FjX+qqf+SP5Vv8A189+p7der/suP8/Xv+Ygeg/7N/8AN163/Cxr/VVP/JH8q3/r579T269X +/Zcf5+vf8xA9B/2b/wCbr1v+FjX+qqf+SP5Vv/Xz36nt16v+y4/z9e/5iB6D/s3/AM3Xrf8ACxr/ +AFVT/wAkfyrf+vnv1Pbr1f8AZcf5+vf8xA9B/wBm/wDm69b/AIWNf6qp/wCSP5Vv/Xz36nt16v8A +suP8/Xv+Ygeg/wCzf/N163/Cxr/VVP8AyR/Kt/6+e/U9uvV/2XH+fr3/ADED0H/Zv/m69b/hY1/q +qn/kj+Vb/wBfPfqe3Xq/7Lj/AD9e/wCYgeg/7N/83Xrf8LGv9VU/8kfyrf8Ar579T269X/Zcf5+v +f8xA9B/2b/5uvW/4WNf6qp/5I/lW/wDXz36nt16v+y4/z9e/5iB6D/s3/wA3Xrf8LGv9VU/8kfyr +f+vnv1Pbr1f9lx/n69/zED0H/Zv/AJuvW/4WNf6qp/5I/lW/9fPfqe3Xq/7Lj/P17/mIHoP+zf8A +zdet/wALGv8AVVP/ACR/Kt/6+e/U9uvV/wBlx/n69/zED0H/AGb/AObr1v8AhY1/qqn/AJI/lW/9 +fPfqe3Xq/wCy4/z9e/5iB6D/ALN/83Xrf8LGv9VU/wDJH8q3/r579T269X/Zcf5+vf8AMQPQf9m/ ++br1v+FjX+qqf+SP5Vv/AF89+p7der/suP8AP17/AJiB6D/s3/zdet/wsa/1VT/yR/Kt/wCvnv1P +br1f9lx/n69/zED0H/Zv/m69b/hY1/qqn/kj+Vb/ANfPfqe3Xq/7Lj/P17/mIHoP+zf/ADdet/ws +a/1VT/yR/Kt/6+e/U9uvV/2XH+fr3/MQPQf9m/8Am69b/hY1/qqn/kj+Vb/189+p7der/suP8/Xv ++Ygeg/7N/wDN163/AAsa/wBVU/8AJH8q3/r579T269X/AGXH+fr3/MQPQf8AZv8A5uvW/wCFjX+q +qf8Akj+Vb/189+p7der/ALLj/P17/mIHoP8As3/zdet/wsa/1VT/AMkfyrf+vnv1Pbr1f9lx/n69 +/wAxA9B/2b/5uvW/4WNf6qp/5I/lW/8AXz36nt16v+y4/wA/Xv8AmIHoP+zf/N163/Cxr/VVP/JH +8q3/AK+e/U9uvV/2XH+fr3/MQPQf9m/+br1v+FjX+qqf+SP5Vv8A189+p7der/suP8/Xv+Ygeg/7 +N/8AN163/Cxr/VVP/JH8q3/r579T269X/Zcf5+vf8xA9B/2b/wCbr1v+FjX+qqf+SP5Vv/Xz36nt +16v+y4/z9e/5iB6D/s3/AM3Xrf8ACxr/AFVT/wAkfyrf+vnv1Pbr1f8AZcf5+vf8xA9B/wBm/wDm +69b/AIWNf6qp/wCSP5Vv/Xz36nt16v8AsuP8/Xv+Ygeg/wCzf/N163/Cxr/VVP8AyR/Kt/6+e/U9 +uvV/2XH+fr3/ADED0H/Zv/m69b/hY1/qqn/kj+Vb/wBfPfqe3Xq/7Lj/AD9e/wCYgeg/7N/83Xrf +8LGv9VU/8kfyrf8Ar579T269X/Zcf5+vf8xA9B/2b/5uvW/4WNf6qp/5I/lW/wDXz36nt16v+y4/ +z9e/5iB6D/s3/wA3Xrf8LGv9VU/8kfyrf+vnv1Pbr1f9lx/n69/zED0H/Zv/AJuvW/4WNf6qp/5I +/lW/9fPfqe3Xq/7Lj/P17/mIHoP+zf8Azdet/wALGv8AVVP/ACR/Kt/6+e/U9uvV/wBlx/n69/zE +D0H/AGb/AObr1v8AhY1/qqn/AJI/lW/9fPfqe3Xq/wCy4/z9e/5iB6D/ALN/83Xrf8LGv9VU/wDJ +H8q3/r579T269X/Zcf5+vf8AMQPQf9m/+br1v+FjX+qqf+SP5Vv/AF89+p7der/suP8AP17/AJiB +6D/s3/zdet/wsa/1VT/yR/Kt/wCvnv1Pbr1f9lx/n69/zED0H/Zv/m69b/hY1/qqn/kj+Vb/ANfP +fqe3Xq/7Lj/P17/mIHoP+zf/ADdet/wsa/1VT/yR/Kt/6+e/U9uvV/2XH+fr3/MQPQf9m/8Am69b +/hY1/qqn/kj+Vb/189+p7der/suP8/Xv+Ygeg/7N/wDN163/AAsa/wBVU/8AJH8q3/r579T269X/ +AGXH+fr3/MQPQf8AZv8A5uvW/wCFjX+qqf8Akj+Vb/189+p7der/ALLj/P17/mIHoP8As3/zdet/ +wsa/1VT/AMkfyrf+vnv1Pbr1f9lx/n69/wAxA9B/2b/5uvW/4WNf6qp/5I/lW/8AXz36nt16v+y4 +/wA/Xv8AmIHoP+zf/N163/Cxr/VVP/JH8q3/AK+e/U9uvV/2XH+fr3/MQPQf9m/+br1v+FjX+qqf ++SP5Vv8A189+p7der/suP8/Xv+Ygeg/7N/8AN163/Cxr/VVP/JH8q3/r579T269X/Zcf5+vf8xA9 +B/2b/wCbr1v+FjX+qqf+SP5Vv/Xz36nt16v+y4/z9e/5iB6D/s3/AM3Xrf8ACxr/AFVT/wAkfyrf ++vnv1Pbr1f8AZcf5+vf8xA9B/wBm/wDm69b/AIWNf6qp/wCSP5Vv/Xz36nt16v8AsuP8/Xv+Ygeg +/wCzf/N163/Cxr/VVP8AyR/Kt/6+e/U9uvV/2XH+fr3/ADED0H/Zv/m69b/hY1/qqn/kj+Vb/wBf +Pfqe3Xq/7Lj/AD9e/wCYgeg/7N/83Xrf8LGv9VU/8kfyrf8Ar579T269X/Zcf5+vf8xA9B/2b/5u +vW/4WNf6qp/5I/lW/wDXz36nt16v+y4/z9e/5iB6D/s3/wA3Xrf8LGv9VU/8kfyrf+vnv1Pbr1f9 +lx/n69/zED0H/Zv/AJuvW/4WNf6qp/5I/lW/9fPfqe3Xq/7Lj/P17/mIHoP+zf8Azdet/wALGv8A +VVP/ACR/Kt/6+e/U9uvV/wBlx/n69/zED0H/AGb/AObr1v8AhY1/qqn/AJI/lW/9fPfqe3Xq/wCy +4/z9e/5iB6D/ALN/83Xrf8LGv9VU/wDJH8q3/r579T269X/Zcf5+vf8AMQPQf9m/+br1v+FjX+qq +f+SP5Vv/AF89+p7der/suP8AP17/AJiB6D/s3/zdet/wsa/1VT/yR/Kt/wCvnv1Pbr1f9lx/n69/ +zED0H/Zv/m69b/hY1/qqn/kj+Vb/ANfPfqe3Xq/7Lj/P17/mIHoP+zf/ADdet/wsa/1VT/yR/Kt/ +6+e/U9uvV/2XH+fr3/MQPQf9m/8Am69b/hY1/qqn/kj+Vb/189+p7der/suP8/Xv+Ygeg/7N/wDN +163/AAsa/wBVU/8AJH8q3/r579T269X/AGXH+fr3/MQPQf8AZv8A5uvW/wCFjX+qqf8Akj+Vb/18 +9+p7der/ALLj/P17/mIHoP8As3/zdet/wsa/1VT/AMkfyrf+vnv1Pbr1f9lx/n69/wAxA9B/2b/5 +uvW/4WM/6qp/5I/lW/8AR/v3/MOvV/2XH+fr3/MQfQf9m/VYX8z7/oIK/wBF+L/4cdPeP+hH9z7/ +APuevSo6i1/fUP2n+lT/AGU9jsj7j+JeH+G/3r9flv8AZ86/Yj5e/qZ9T/upKfVeWrVq/wBr4meH +HT+fQf37+t/04/e2v6Xz06dP+28PH2avy6oK/b8f+0e5A7dPy6BWdXz6/9k= +")); + break; + case "01_bodybg.jpg": + header("Content-type: image/jpeg"); + echo trim(base64_decode(" +/9j/4AAQSkZJRgABAgEASABIAAD/4QOnRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUA +AAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAUAAAAcgEyAAIAAAAUAAAAhodp +AAQAAAABAAAAnAAAAMgAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIDcuMAAyMDA1OjAy +OjI2IDA0OjE2OjIwAAAAAAOgAQADAAAAAf//AACgAgAEAAAAAQAAArygAwAEAAAAAQAAAAEAAAAA +AAAABgEDAAMAAAABAAYAAAEaAAUAAAABAAABFgEbAAUAAAABAAABHgEoAAMAAAABAAIAAAIBAAQA +AAABAAABJgICAAQAAAABAAACeQAAAAAAAABIAAAAAQAAAEgAAAAB/9j/4AAQSkZJRgABAgEASABI +AAD/7QAMQWRvYmVfQ00AAv/uAA5BZG9iZQBkgAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwP +FRgTExUTExgRDAwMDAwMEQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBDQsLDQ4NEA4OEBQO +Dg4UFA4ODg4UEQwMDAwMEREMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDP/AABEI +AAEAgAMBIgACEQEDEQH/3QAEAAj/xAE/AAABBQEBAQEBAQAAAAAAAAADAAECBAUGBwgJCgsBAAEF +AQEBAQEBAAAAAAAAAAEAAgMEBQYHCAkKCxAAAQQBAwIEAgUHBggFAwwzAQACEQMEIRIxBUFRYRMi +cYEyBhSRobFCIyQVUsFiMzRygtFDByWSU/Dh8WNzNRaisoMmRJNUZEXCo3Q2F9JV4mXys4TD03Xj +80YnlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3EQACAgECBAQDBAUGBwcG +BTUBAAIRAyExEgRBUWFxIhMFMoGRFKGxQiPBUtHwMyRi4XKCkkNTFWNzNPElBhaisoMHJjXC0kST +VKMXZEVVNnRl4vKzhMPTdePzRpSkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2JzdHV2d3h5ent8f/ +2gAMAwEAAhEDEQA/APRug/8AIfTv/CtP/ntivr5VSRO5QNg/VSS+VUkEv1UkvlVJJT9VJL5VSSU/ +VSS+VUklP1UkvlVJJT9VJL5VSSU/VSp9Y/5Izv8Awvb/ANQ5fMKSQ3Udn//Z/+0IYFBob3Rvc2hv +cCAzLjAAOEJJTQQlAAAAAAAQAAAAAAAAAAAAAAAAAAAAADhCSU0D7QAAAAAAEABIAAAAAQABAEgA +AAABAAE4QklNBCYAAAAAAA4AAAAAAAAAAAAAP4AAADhCSU0EDQAAAAAABAAAAHg4QklNBBkAAAAA +AAQAAAAeOEJJTQPzAAAAAAAJAAAAAAAAAAABADhCSU0ECgAAAAAAAQAAOEJJTScQAAAAAAAKAAEA +AAAAAAAAAThCSU0D9QAAAAAASAAvZmYAAQBsZmYABgAAAAAAAQAvZmYAAQChmZoABgAAAAAAAQAy +AAAAAQBaAAAABgAAAAAAAQA1AAAAAQAtAAAABgAAAAAAAThCSU0D+AAAAAAAcAAA//////////// +/////////////////wPoAAAAAP////////////////////////////8D6AAAAAD///////////// +////////////////A+gAAAAA/////////////////////////////wPoAAA4QklNBAAAAAAAAAIA +ADhCSU0EAgAAAAAAAgAAOEJJTQQIAAAAAAAQAAAAAQAAAkAAAAJAAAAAADhCSU0EHgAAAAAABAAA +AAA4QklNBBoAAAAAA0kAAAAGAAAAAAAAAAAAAAABAAACvAAAAAoAVQBuAHQAaQB0AGwAZQBkAC0A +MwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACvAAAAAEAAAAAAAAAAAAAAAAAAAAA +AQAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAG51bGwAAAACAAAABmJvdW5kc09iamMAAAAB +AAAAAAAAUmN0MQAAAAQAAAAAVG9wIGxvbmcAAAAAAAAAAExlZnRsb25nAAAAAAAAAABCdG9tbG9u +ZwAAAAEAAAAAUmdodGxvbmcAAAK8AAAABnNsaWNlc1ZsTHMAAAABT2JqYwAAAAEAAAAAAAVzbGlj +ZQAAABIAAAAHc2xpY2VJRGxvbmcAAAAAAAAAB2dyb3VwSURsb25nAAAAAAAAAAZvcmlnaW5lbnVt +AAAADEVTbGljZU9yaWdpbgAAAA1hdXRvR2VuZXJhdGVkAAAAAFR5cGVlbnVtAAAACkVTbGljZVR5 +cGUAAAAASW1nIAAAAAZib3VuZHNPYmpjAAAAAQAAAAAAAFJjdDEAAAAEAAAAAFRvcCBsb25nAAAA +AAAAAABMZWZ0bG9uZwAAAAAAAAAAQnRvbWxvbmcAAAABAAAAAFJnaHRsb25nAAACvAAAAAN1cmxU +RVhUAAAAAQAAAAAAAG51bGxURVhUAAAAAQAAAAAAAE1zZ2VURVhUAAAAAQAAAAAABmFsdFRhZ1RF +WFQAAAABAAAAAAAOY2VsbFRleHRJc0hUTUxib29sAQAAAAhjZWxsVGV4dFRFWFQAAAABAAAAAAAJ +aG9yekFsaWduZW51bQAAAA9FU2xpY2VIb3J6QWxpZ24AAAAHZGVmYXVsdAAAAAl2ZXJ0QWxpZ25l +bnVtAAAAD0VTbGljZVZlcnRBbGlnbgAAAAdkZWZhdWx0AAAAC2JnQ29sb3JUeXBlZW51bQAAABFF +U2xpY2VCR0NvbG9yVHlwZQAAAABOb25lAAAACXRvcE91dHNldGxvbmcAAAAAAAAACmxlZnRPdXRz +ZXRsb25nAAAAAAAAAAxib3R0b21PdXRzZXRsb25nAAAAAAAAAAtyaWdodE91dHNldGxvbmcAAAAA +ADhCSU0EEQAAAAAAAQEAOEJJTQQUAAAAAAAEAAAAAzhCSU0EDAAAAAAClQAAAAEAAACAAAAAAQAA +AYAAAAGAAAACeQAYAAH/2P/gABBKRklGAAECAQBIAEgAAP/tAAxBZG9iZV9DTQAC/+4ADkFkb2Jl +AGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwM +DAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEM +DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAAQCAAwEiAAIRAQMRAf/dAAQACP/EAT8A +AAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoL +EAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT +8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2 +xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFC +I8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE +1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMRAD8A9G6D/wAh9O/8K0/+ +e2K+vlVJE7lA2D9VJL5VSQS/VSS+VUklP1UkvlVJJT9VJL5VSSU/VSS+VUklP1UkvlVJJT9VKn1j +/kjO/wDC9v8A1Dl8wpJDdR2f/9kAOEJJTQQhAAAAAABVAAAAAQEAAAAPAEEAZABvAGIAZQAgAFAA +aABvAHQAbwBzAGgAbwBwAAAAEwBBAGQAbwBiAGUAIABQAGgAbwB0AG8AcwBoAG8AcAAgADcALgAw +AAAAAQA4QklNBAYAAAAAAAcACAAAAAEBAP/hEkhodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAv +ADw/eHBhY2tldCBiZWdpbj0n77u/JyBpZD0nVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkJz8+Cjw/ +YWRvYmUteGFwLWZpbHRlcnMgZXNjPSJDUiI/Pgo8eDp4YXBtZXRhIHhtbG5zOng9J2Fkb2JlOm5z +Om1ldGEvJyB4OnhhcHRrPSdYTVAgdG9vbGtpdCAyLjguMi0zMywgZnJhbWV3b3JrIDEuNSc+Cjxy +ZGY6UkRGIHhtbG5zOnJkZj0naHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4 +LW5zIycgeG1sbnM6aVg9J2h0dHA6Ly9ucy5hZG9iZS5jb20vaVgvMS4wLyc+CgogPHJkZjpEZXNj +cmlwdGlvbiBhYm91dD0ndXVpZDozOGVmNTRkMC04N2YwLTExZDktYTAzNi1hZWFkN2I2ZWM2YTMn +CiAgeG1sbnM6eGFwTU09J2h0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8nPgogIDx4YXBN +TTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDo2ZTEwMWQwMy04N2VlLTExZDktYTAz +Ni1hZWFkN2I2ZWM2YTM8L3hhcE1NOkRvY3VtZW50SUQ+CiA8L3JkZjpEZXNjcmlwdGlvbj4KCjwv +cmRmOlJERj4KPC94OnhhcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSd3Jz8+/+4ADkFkb2JlAGRAAAAAAf/bAIQAAQEB +AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMD +AwMDAwEBAQEBAQEBAQEBAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD +AwMDAwMDAwMDAwMD/8AAEQgAAQK8AwERAAIRAQMRAf/dAAQAWP/EAaIAAAAGAgMBAAAAAAAAAAAA +AAcIBgUECQMKAgEACwEAAAYDAQEBAAAAAAAAAAAABgUEAwcCCAEJAAoLEAACAQMEAQMDAgMDAwIG +CXUBAgMEEQUSBiEHEyIACDEUQTIjFQlRQhZhJDMXUnGBGGKRJUOhsfAmNHIKGcHRNSfhUzaC8ZKi +RFRzRUY3R2MoVVZXGrLC0uLyZIN0k4Rlo7PD0+MpOGbzdSo5OkhJSlhZWmdoaWp2d3h5eoWGh4iJ +ipSVlpeYmZqkpaanqKmqtLW2t7i5usTFxsfIycrU1dbX2Nna5OXm5+jp6vT19vf4+foRAAIBAwIE +BAMFBAQEBgYFbQECAxEEIRIFMQYAIhNBUQcyYRRxCEKBI5EVUqFiFjMJsSTB0UNy8BfhgjQlklMY +Y0TxorImNRlUNkVkJwpzg5NGdMLS4vJVZXVWN4SFo7PD0+PzKRqUpLTE1OT0laW1xdXl9ShHV2Y4 +doaWprbG1ub2Z3eHl6e3x9fn90hYaHiImKi4yNjo+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq ++v/aAAwDAQACEQMRAD8As/8A+EtP/btzt3/xfbf/AP8AA+fHz2OPcD/kuRf80F/4/J0CeRv+SNN/ +z0H/AI5H1tO4X/gPF/wX2B/Xoarw6fPfut9e9+691737r3Xvfuvde9+691737r3Xvfuvde9+6917 +37r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfu +vde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691 +737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvf +uvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+69 +1737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xv +fuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691wk/Q3+t7917oNMz/AMXvDf8Aa4xf/uZD +715fn1T8Q+3r5of/AHcT/wDmbn/5+73OP/Okf9QH/WHqGv8Ancf+o/8A6zdf/9k=")); + break; + + case "01_header01.jpg": + header("Content-type: image/jpeg"); + echo trim(base64_decode(" +/9j/4AAQSkZJRgABAgEASABIAAD/4QhMRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUA +AAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAcAAAAcgEyAAIAAAAUAAAAjodp +AAQAAAABAAAApAAAANAACvyAAAAnEAAK/IAAACcQQWRvYmUgUGhvdG9zaG9wIENTMiBXaW5kb3dz +ADIwMDU6MDY6MTYgMTc6Mzc6MzkAAAAAA6ABAAMAAAAB//8AAKACAAQAAAABAAACvKADAAQAAAAB +AAAAlwAAAAAAAAAGAQMAAwAAAAEABgAAARoABQAAAAEAAAEeARsABQAAAAEAAAEmASgAAwAAAAEA +AgAAAgEABAAAAAEAAAEuAgIABAAAAAEAAAcWAAAAAAAAAEgAAAABAAAASAAAAAH/2P/gABBKRklG +AAECAABIAEgAAP/tAAxBZG9iZV9DTQAC/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBEL +CgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsN +Dg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM +DAwM/8AAEQgAIwCgAwEiAAIRAQMRAf/dAAQACv/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYH +CAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQh +EjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXi +ZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm9jdHV2d3h5ent8fX5/cRAAICAQIE +BAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFCI8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKy +gwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dX +Z3eHl6e3x//aAAwDAQACEQMRAD8A7boHQOhO6F05zunYrnOxaXOc6mskk1sc5znOYXOc5x3Oc5X/ +APm90H/ytxP+2K//ACCxOmdevxumYdDK63Nrx6WgkukxXXzAVn/nLlf6Gr/Od/5FQnm8QkQZHQkb +SQKdL/m90H/ytxP+2K//ACCX/N7oP/lbif8AbFf/AJBZv/ObL/0NX+c7/wAioH605c6UVf5zv/Ip +DmsR2kfskokB1f8Am90H/wArcT/tiv8A8gl/ze6D/wCVuJ/2xX/5BZQ+tGaeKKv853/kU/8AznzB +zRV/nO/8il96xfvH7Cix/IOp/wA3ug/+VuJ/2xX/AOQS/wCb3Qf/ACtxP+2K/wDyCyv+dOZ2oqP9 +p3/kUv8AnRmd6Kh/ad/5FH7zj/eP2FHFH+QdX/m90H/ytxP+2K//ACCX/N7oP/lbif8AbFf/AJBZ +X/OnL/0NX+c7/wAil/zpy/8AQVf5zv8AyKP3iHc/YVccf5B1f+b3Qf8AytxP+2K//IJf83ug/wDl +bif9sV/+QWV/zpy/9BV/nO/8il/zpzP9BV/nO/8AIoHmcY/SP2FPFH+QdX/m90H/AMrcT/tiv/yC +X/N7oP8A5W4n/bFf/kFlf86Mv/QVf5zv/Ipf86Mz/QVf5zv/ACKX3nH3P2FXFF1f+b3Qf/K3E/7Y +r/8AIJf83ug/+VuJ/wBsV/8AkFlf86cz/QVf5zv/ACKX/OjM70Vf5zv/ACKB5rGP0j9klcUXV/5v +dB/8rcT/ALYr/wDIJf8AN7oP/lbif9sV/wDkFlf86Mz/AEFX+c7/AMipj6zZZ/wNX+c7/wAigebx +DeR+ySRRdL/m90H/AMrcT/tiv/yCodf6B0JvQuoub07Fa5uLcWltNYIIre5rmuazc1zXDc1zVD/n +Ll9qav8AOd/5FV+p9dyMjpmZQ+qsNsx7mktJkTVZxISjzuEyAEjZIG0lGn//0L9FsY9DR2pq/wDP +daJ6p7qgLXBlbewrqH/gdaXqErKyRPHPUfNL81tt19+nKgLZKpusM8pvU80YgALSdW+cgAQCo+uD +3kqn6rRymOQe2gThEDog2W76x+SXrKj6x8UvWTqRTe9YJesFQ9bzT+sjSqb3rJesFRFpPCffHP3B +NpVN31uw1S9Ydz8gqXqnjgeCXqeaVKpu+v4aJesqPqFSFpHJTZBNN31CSq+dnHDpZYdDZY2rcQXB +m4Pe659dZbZb6ba/5qt7N/8ApFAZBQ8gsyKwxxLdrg5rhBhwBb9E/Sbte5qUfmjxj0WOKv3Uir3W +yfrF0nGrY7GuvuvMgtsdv+0H+TjM2sw9v5lmP6NNbP6RXetK28WYtpHD6LDHxqeVztHTGU5dmQGs +ZY8Bvq/Sgf8AAsd+f/Lu+h/wq0m2AVuYNGiqxoHkKrAFPmjhOTGcQF2OLhFR/R4Ukh//0Yu3e2N0 +bK+Nv+jr8VE7/wCX8ti8uSWXP+clt8x3R0fTjvn87/oqLt/8v/orzNJSQ+jG+l+/+V/0Uvf/ACv+ +ivNEk77FPpfv/lf9FL3/AMr/AKK80SR+xT6X7/5X/RUhv/lf9FeZJIFIfT/ft/P+WxQ9/wDL/wCi +vM0kB9FPpnv/AJf/AEUhv8/ntXmaSR+iC+ne/wDlf9FL3/yv+ivMUk37FPp3v/lf9FL3/wAr/orz +FJI7dFPpvv8A5X/RTt3SZ3Rss52x/N2eC8xSTsfzR23Cer//2f/tDnhQaG90b3Nob3AgMy4wADhC +SU0EBAAAAAAABxwCAAACAAIAOEJJTQQlAAAAAAAQRgzyiSa4VtqwnAGhsKeQdzhCSU0D7QAAAAAA +EABIAAAAAQACAEgAAAABAAI4QklNBCYAAAAAAA4AAAAAAAAAAAAAP4AAADhCSU0EDQAAAAAABAAA +AHg4QklNBBkAAAAAAAQAAAAeOEJJTQPzAAAAAAAJAAAAAAAAAAABADhCSU0ECgAAAAAAAQAAOEJJ +TScQAAAAAAAKAAEAAAAAAAAAAThCSU0D9QAAAAAASAAvZmYAAQBsZmYABgAAAAAAAQAvZmYAAQCh +mZoABgAAAAAAAQAyAAAAAQBaAAAABgAAAAAAAQA1AAAAAQAtAAAABgAAAAAAAThCSU0D+AAAAAAA +cAAA/////////////////////////////wPoAAAAAP////////////////////////////8D6AAA +AAD/////////////////////////////A+gAAAAA/////////////////////////////wPoAAA4 +QklNBAAAAAAAAAIAAThCSU0EAgAAAAAABAAAAAA4QklNBDAAAAAAAAIBAThCSU0ELQAAAAAABgAB +AAAABDhCSU0ECAAAAAAAEAAAAAEAAAJAAAACQAAAAAA4QklNBB4AAAAAAAQAAAAAOEJJTQQaAAAA +AANLAAAABgAAAAAAAAAAAAAAlwAAArwAAAALADAAMQBfAGgAZQBhAGQAZQByADAAMQAAAAEAAAAA +AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACvAAAAJcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAA +AAAAAAAAAAAAAAAQAAAAAQAAAAAAAG51bGwAAAACAAAABmJvdW5kc09iamMAAAABAAAAAAAAUmN0 +MQAAAAQAAAAAVG9wIGxvbmcAAAAAAAAAAExlZnRsb25nAAAAAAAAAABCdG9tbG9uZwAAAJcAAAAA +UmdodGxvbmcAAAK8AAAABnNsaWNlc1ZsTHMAAAABT2JqYwAAAAEAAAAAAAVzbGljZQAAABIAAAAH +c2xpY2VJRGxvbmcAAAAAAAAAB2dyb3VwSURsb25nAAAAAAAAAAZvcmlnaW5lbnVtAAAADEVTbGlj +ZU9yaWdpbgAAAA1hdXRvR2VuZXJhdGVkAAAAAFR5cGVlbnVtAAAACkVTbGljZVR5cGUAAAAASW1n +IAAAAAZib3VuZHNPYmpjAAAAAQAAAAAAAFJjdDEAAAAEAAAAAFRvcCBsb25nAAAAAAAAAABMZWZ0 +bG9uZwAAAAAAAAAAQnRvbWxvbmcAAACXAAAAAFJnaHRsb25nAAACvAAAAAN1cmxURVhUAAAAAQAA +AAAAAG51bGxURVhUAAAAAQAAAAAAAE1zZ2VURVhUAAAAAQAAAAAABmFsdFRhZ1RFWFQAAAABAAAA +AAAOY2VsbFRleHRJc0hUTUxib29sAQAAAAhjZWxsVGV4dFRFWFQAAAABAAAAAAAJaG9yekFsaWdu +ZW51bQAAAA9FU2xpY2VIb3J6QWxpZ24AAAAHZGVmYXVsdAAAAAl2ZXJ0QWxpZ25lbnVtAAAAD0VT +bGljZVZlcnRBbGlnbgAAAAdkZWZhdWx0AAAAC2JnQ29sb3JUeXBlZW51bQAAABFFU2xpY2VCR0Nv +bG9yVHlwZQAAAABOb25lAAAACXRvcE91dHNldGxvbmcAAAAAAAAACmxlZnRPdXRzZXRsb25nAAAA +AAAAAAxib3R0b21PdXRzZXRsb25nAAAAAAAAAAtyaWdodE91dHNldGxvbmcAAAAAADhCSU0EKAAA +AAAADAAAAAE/8AAAAAAAADhCSU0EEQAAAAAAAQEAOEJJTQQUAAAAAAAEAAAABDhCSU0EDAAAAAAH +MgAAAAEAAACgAAAAIwAAAeAAAEGgAAAHFgAYAAH/2P/gABBKRklGAAECAABIAEgAAP/tAAxBZG9i +ZV9DTQAC/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEM +DAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQR +DAwMDAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAIwCgAwEiAAIR +AQMRAf/dAAQACv/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAA +AAAAAQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIj +JBVSwWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU +5PSltcXV5fVWZnaGlqa2xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITES +BEFRYXEiEwUygZEUobFCI8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi +8rOEw9N14/NGlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMR +AD8A7boHQOhO6F05zunYrnOxaXOc6mskk1sc5znOYXOc5x3Oc5X/APm90H/ytxP+2K//ACCxOmde +vxumYdDK63Nrx6WgkukxXXzAVn/nLlf6Gr/Od/5FQnm8QkQZHQkbSQKdL/m90H/ytxP+2K//ACCX +/N7oP/lbif8AbFf/AJBZv/ObL/0NX+c7/wAioH605c6UVf5zv/IpDmsR2kfskokB1f8Am90H/wAr +cT/tiv8A8gl/ze6D/wCVuJ/2xX/5BZQ+tGaeKKv853/kU/8AznzBzRV/nO/8il96xfvH7Cix/IOp +/wA3ug/+VuJ/2xX/AOQS/wCb3Qf/ACtxP+2K/wDyCyv+dOZ2oqP9p3/kUv8AnRmd6Kh/ad/5FH7z +j/eP2FHFH+QdX/m90H/ytxP+2K//ACCX/N7oP/lbif8AbFf/AJBZX/OnL/0NX+c7/wAil/zpy/8A +QVf5zv8AyKP3iHc/YVccf5B1f+b3Qf8AytxP+2K//IJf83ug/wDlbif9sV/+QWV/zpy/9BV/nO/8 +il/zpzP9BV/nO/8AIoHmcY/SP2FPFH+QdX/m90H/AMrcT/tiv/yCX/N7oP8A5W4n/bFf/kFlf86M +v/QVf5zv/Ipf86Mz/QVf5zv/ACKX3nH3P2FXFF1f+b3Qf/K3E/7Yr/8AIJf83ug/+VuJ/wBsV/8A +kFlf86cz/QVf5zv/ACKX/OjM70Vf5zv/ACKB5rGP0j9klcUXV/5vdB/8rcT/ALYr/wDIJf8AN7oP +/lbif9sV/wDkFlf86Mz/AEFX+c7/AMipj6zZZ/wNX+c7/wAigebxDeR+ySRRdL/m90H/AMrcT/ti +v/yCodf6B0JvQuoub07Fa5uLcWltNYIIre5rmuazc1zXDc1zVD/nLl9qav8AOd/5FV+p9dyMjpmZ +Q+qsNsx7mktJkTVZxISjzuEyAEjZIG0lGn//0L9FsY9DR2pq/wDPdaJ6p7qgLXBlbewrqH/gdaXq +ErKyRPHPUfNL81tt19+nKgLZKpusM8pvU80YgALSdW+cgAQCo+uD3kqn6rRymOQe2gThEDog2W76 +x+SXrKj6x8UvWTqRTe9YJesFQ9bzT+sjSqb3rJesFRFpPCffHP3BNpVN31uw1S9Ydz8gqXqnjgeC +XqeaVKpu+v4aJesqPqFSFpHJTZBNN31CSq+dnHDpZYdDZY2rcQXBm4Pe659dZbZb6ba/5qt7N/8A +pFAZBQ8gsyKwxxLdrg5rhBhwBb9E/Sbte5qUfmjxj0WOKv3Uir3WyfrF0nGrY7GuvuvMgtsdv+0H ++TjM2sw9v5lmP6NNbP6RXetK28WYtpHD6LDHxqeVztHTGU5dmQGsZY8Bvq/Sgf8AAsd+f/Lu+h/w +q0m2AVuYNGiqxoHkKrAFPmjhOTGcQF2OLhFR/R4Ukh//0Yu3e2N0bK+Nv+jr8VE7/wCX8ti8uSWX +P+clt8x3R0fTjvn87/oqLt/8v/orzNJSQ+jG+l+/+V/0Uvf/ACv+ivNEk77FPpfv/lf9FL3/AMr/ +AKK80SR+xT6X7/5X/RUhv/lf9FeZJIFIfT/ft/P+WxQ9/wDL/wCivM0kB9FPpnv/AJf/AEUhv8/n +tXmaSR+iC+ne/wDlf9FL3/yv+ivMUk37FPp3v/lf9FL3/wAr/orzFJI7dFPpvv8A5X/RTt3SZ3Rs +s52x/N2eC8xSTsfzR23Cer//2ThCSU0EIQAAAAAAVQAAAAEBAAAADwBBAGQAbwBiAGUAIABQAGgA +bwB0AG8AcwBoAG8AcAAAABMAQQBkAG8AYgBlACAAUABoAG8AdABvAHMAaABvAHAAIABDAFMAMgAA +AAEAOEJJTQ+gAAAAAAD4bWFuaUlSRlIAAADsOEJJTUFuRHMAAADMAAAAEAAAAAEAAAAAAABudWxs +AAAAAwAAAABBRlN0bG9uZwAAAAAAAAAARnJJblZsTHMAAAABT2JqYwAAAAEAAAAAAABudWxsAAAA +AQAAAABGcklEbG9uZ14Sb90AAAAARlN0c1ZsTHMAAAABT2JqYwAAAAEAAAAAAABudWxsAAAABAAA +AABGc0lEbG9uZwAAAAAAAAAAQUZybWxvbmcAAAAAAAAAAEZzRnJWbExzAAAAAWxvbmdeEm/dAAAA +AExDbnRsb25nAAAAAAAAOEJJTVJvbGwAAAAIAAAAAAAAAAA4QklND6EAAAAAABxtZnJpAAAAAgAA +ABAAAAABAAAAAAAAAAEAAAAAOEJJTQQGAAAAAAAHAAIAAAABAQD/4TpqaHR0cDovL25zLmFkb2Jl +LmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pO +VGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSIz +LjEuMS0xMTEiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkv +MDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0i +IgogICAgICAgICAgICB4bWxuczp4YXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21t +LyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9z +VHlwZS9SZXNvdXJjZVJlZiMiPgogICAgICAgICA8eGFwTU06RG9jdW1lbnRJRD51dWlkOkM2M0I1 +Q0Q1ODRERUQ5MTFCRDI1RUZFMTZCQzU3QkMzPC94YXBNTTpEb2N1bWVudElEPgogICAgICAgICA8 +eGFwTU06SW5zdGFuY2VJRD51dWlkOkM3M0I1Q0Q1ODRERUQ5MTFCRDI1RUZFMTZCQzU3QkMzPC94 +YXBNTTpJbnN0YW5jZUlEPgogICAgICAgICA8eGFwTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlw +ZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD51dWlkOkM0M0I1Q0Q1 +ODRERUQ5MTFCRDI1RUZFMTZCQzU3QkMzPC9zdFJlZjppbnN0YW5jZUlEPgogICAgICAgICAgICA8 +c3RSZWY6ZG9jdW1lbnRJRD51dWlkOkMzM0I1Q0Q1ODRERUQ5MTFCRDI1RUZFMTZCQzU3QkMzPC9z +dFJlZjpkb2N1bWVudElEPgogICAgICAgICA8L3hhcE1NOkRlcml2ZWRGcm9tPgogICAgICA8L3Jk +ZjpEZXNjcmlwdGlvbj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAg +ICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAg +ICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpY +UmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZm +OllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRp +ZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPHRpZmY6 +TmF0aXZlRGlnZXN0PjI1NiwyNTcsMjU4LDI1OSwyNjIsMjc0LDI3NywyODQsNTMwLDUzMSwyODIs +MjgzLDI5NiwzMDEsMzE4LDMxOSw1MjksNTMyLDMwNiwyNzAsMjcxLDI3MiwzMDUsMzE1LDMzNDMy +Ozk4M0M1QkM5MkRENEI4NzZEMjQyOTczQzUyQTEzOUJGPC90aWZmOk5hdGl2ZURpZ2VzdD4KICAg +ICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIi +CiAgICAgICAgICAgIHhtbG5zOnhhcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAg +ICAgICAgIDx4YXA6TW9kaWZ5RGF0ZT4yMDA1LTA2LTE2VDE3OjM3OjM5KzAxOjAwPC94YXA6TW9k +aWZ5RGF0ZT4KICAgICAgICAgPHhhcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ1MyIFdp +bmRvd3M8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDUtMDYt +MTZUMTc6Mzc6MzkrMDE6MDA8L3hhcDpDcmVhdGVEYXRlPgogICAgICAgICA8eGFwOk1ldGFkYXRh +RGF0ZT4yMDA1LTA2LTE2VDE3OjM3OjM5KzAxOjAwPC94YXA6TWV0YWRhdGFEYXRlPgogICAgICA8 +L3JkZjpEZXNjcmlwdGlvbj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAg +ICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAg +ICAgICA8ZXhpZjpDb2xvclNwYWNlPi0xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlm +OlBpeGVsWERpbWVuc2lvbj43MDA8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhp +ZjpQaXhlbFlEaW1lbnNpb24+MTUxPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgICAgPGV4 +aWY6TmF0aXZlRGlnZXN0PjM2ODY0LDQwOTYwLDQwOTYxLDM3MTIxLDM3MTIyLDQwOTYyLDQwOTYz +LDM3NTEwLDQwOTY0LDM2ODY3LDM2ODY4LDMzNDM0LDMzNDM3LDM0ODUwLDM0ODUyLDM0ODU1LDM0 +ODU2LDM3Mzc3LDM3Mzc4LDM3Mzc5LDM3MzgwLDM3MzgxLDM3MzgyLDM3MzgzLDM3Mzg0LDM3Mzg1 +LDM3Mzg2LDM3Mzk2LDQxNDgzLDQxNDg0LDQxNDg2LDQxNDg3LDQxNDg4LDQxNDkyLDQxNDkzLDQx +NDk1LDQxNzI4LDQxNzI5LDQxNzMwLDQxOTg1LDQxOTg2LDQxOTg3LDQxOTg4LDQxOTg5LDQxOTkw +LDQxOTkxLDQxOTkyLDQxOTkzLDQxOTk0LDQxOTk1LDQxOTk2LDQyMDE2LDAsMiw0LDUsNiw3LDgs +OSwxMCwxMSwxMiwxMywxNCwxNSwxNiwxNywxOCwyMCwyMiwyMywyNCwyNSwyNiwyNywyOCwzMDs1 +N0U1QjRCMDVFNjY5RjYzNjY4NTJCNjgxNzMyRTY3NzwvZXhpZjpOYXRpdmVEaWdlc3Q+CiAgICAg +IDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgog +ICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgog +ICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL2pwZWc8L2RjOmZvcm1hdD4KICAgICAgPC9yZGY6RGVz +Y3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAg +IHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyI+CiAg +ICAgICAgIDxwaG90b3Nob3A6Q29sb3JNb2RlPjM8L3Bob3Rvc2hvcDpDb2xvck1vZGU+CiAgICAg +ICAgIDxwaG90b3Nob3A6SGlzdG9yeS8+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3Jk +ZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3 +Ij8+/+4ADkFkb2JlAGSAAAAAAf/bAIQACAYGBgYGCAYGCAwIBwgMDgoICAoOEA0NDg0NEBEMDAwM +DAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEJCAgJCgkLCQkLDgsNCw4RDg4ODhERDAwM +DAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAlwK8AwEiAAIRAQMR +Af/dAAQALP/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA +AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB +UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE +1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ +qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy +obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp +0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo ++DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8AhnkbyNe+dr2aKKYWljaB +WvLxl58edeCIlV5u/Fv2s6sv5G+TSADe6oxHVhJbgE+IBt835GqP8G3pGxbVJAx7kC3tyAc6rHGK +ZbkyS4iAapqxwjwgkXbyz/lRfkz/AJbNV/5G23/ZPm/5UX5M/wCWzVf+Rtt/2T51f0x4ZvTHhkPE +n3lnwR7g8o/5UX5M/wCWzVf+Rtt/2T5v+VF+TP8Als1X/kbbf9k+dX9MeGb0x4Y+JPvK8Ee4PKP+ +VF+TP+WzVf8Akbbf9k+b/lRfkz/ls1X/AJG23/ZPnV/THhm9MeGPiT7yvBHuDyj/AJUX5M/5bNV/ +5G23/ZPm/wCVF+TP+WzVf+Rtt/2T51f0x4ZvTHhj4k+8rwR7g8o/5UX5M/5bNV/5G23/AGT5v+VF ++TP+WzVf+Rtt/wBk+dX9MeGb0x4Y+JPvK8Ee4PKP+VF+TP8Als1X/kbbf9k+b/lRfkz/AJbNV/5G +23/ZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ls1X/AJG23/ZPm/5UX5M/5bNV/wCRtt/2T51f0x4Z +vTHhj4k+8rwR7g8o/wCVF+TP+WzVf+Rtt/2T5v8AlRfkz/ls1X/kbbf9k+dX9MeGb0x4Y+JPvK8E +e4PKP+VF+TP+WzVf+Rtt/wBk+b/lRfkz/ls1X/kbbf8AZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ +AJbNV/5G23/ZPm/5UX5M/wCWzVf+Rtt/2T51f0x4ZvTHhj4k+8rwR7g8o/5UX5M/5bNV/wCRtt/2 +T5v+VF+TP+WzVf8Akbbf9k+dX9MeGb0x4Y+JPvK8Ee4PKP8AlRfkz/ls1X/kbbf9k+b/AJUX5M/5 +bNV/5G23/ZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ls1X/kbbf8AZPm/5UX5M/5bNV/5G23/AGT5 +1f0x4ZvTHhj4k+8rwR7g8o/5UX5M/wCWzVf+Rtt/2T5v+VF+TP8Als1X/kbbf9k+dX9MeGb0x4Y+ +JPvK8Ee4PKP+VF+TP+WzVf8Akbbf9k+b/lRfkz/ls1X/AJG23/ZPnV/THhm9MeGPiT7yvBHuDyj/ +AJUX5M/5bNV/5G23/ZPm/wCVF+TP+WzVf+Rtt/2T51f0x4ZvTHhj4k+8rwR7g8o/5UX5M/5bNV/5 +G23/AGT5v+VF+TP+WzVf+Rtt/wBk+dX9MeGb0x4Y+JPvK8Ee4PKP+VF+TP8Als1X/kbbf9k+b/lR +fkz/AJbNV/5G23/ZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ls1X/AJG23/ZPm/5UX5M/5bNV/wCR +tt/2T51f0x4ZvTHhj4k+8rwR7g8o/wCVF+TP+WzVf+Rtt/2T5v8AlRfkz/ls1X/kbbf9k+dX9MeG +b0x4Y+JPvK8Ee4PKP+VF+TP+WzVf+Rtt/wBk+b/lRfkz/ls1X/kbbf8AZPnV/THhm9MeGPiT7yvB +HuDyj/lRfkz/AJbNV/5G23/ZPm/5UX5M/wCWzVf+Rtt/2T51f0x4ZvTHhj4k+8rwR7g8o/5UX5M/ +5bNV/wCRtt/2T5v+VF+TP+WzVf8Akbbf9k+dX9MeGb0x4Y+JPvK8Ee4PKP8AlRfkz/ls1X/kbbf9 +k+b/AJUX5M/5bNV/5G23/ZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ls1X/kbbf8AZPm/5UX5M/5b +NV/5G23/AGT51f0x4ZvTHhj4k+8rwR7g8o/5UX5M/wCWzVf+Rtt/2T5v+VF+TP8Als1X/kbbf9k+ +dX9MeGb0x4Y+JPvK8Ee4PKP+VF+TP+WzVf8Akbbf9k+b/lRfkz/ls1X/AJG23/ZPnV/THhm9MeGP +iT7yvBHuDyj/AJUX5M/5bNV/5G23/ZPm/wCVF+TP+WzVf+Rtt/2T51f0x4ZvTHhj4k+8rwR7g8o/ +5UX5M/5bNV/5G23/AGT5v+VF+TP+WzVf+Rtt/wBk+dX9MeGb0x4Y+JPvK8Ee4PKP+VF+TP8Als1X +/kbbf9k+b/lRfkz/AJbNV/5G23/ZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ls1X/AJG23/ZPm/5U +X5M/5bNV/wCRtt/2T51f0x4ZvTHhj4k+8rwR7g8o/wCVF+TP+WzVf+Rtt/2T5v8AlRfkz/ls1X/k +bbf9k+dX9MeGb0x4Y+JPvK8Ee4PKP+VF+TP+WzVf+Rtt/wBk+b/lRfkz/ls1X/kbbf8AZPnV/THh +m9MeGPiT7yvBHuDyj/lRfkz/AJbNV/5G23/ZPm/5UX5M/wCWzVf+Rtt/2T51f0x4ZvTHhj4k+8rw +R7g8o/5UX5M/5bNV/wCRtt/2T5v+VF+TP+WzVf8Akbbf9k+dX9MeGb0x4Y+JPvK8Ee4PKP8AlRfk +z/ls1X/kbbf9k+b/AJUX5M/5bNV/5G23/ZPnV/THhm9MeGPiT7yvBHuDyj/lRfkz/ls1X/kbbf8A +ZPm/5UX5M/5bNV/5G23/AGT51f0x4ZvTHhj4k+8rwR7g8o/5UX5M/wCWzVf+Rtt/2T5v+VF+TP8A +ls1X/kbbf9k+dX9MeGb0x4Y+JPvK8Ee4PKP+VF+TP+WzVf8Akbbf9k+b/lRfkz/ls1X/AJG23/ZP +nV/THhm9MeGPiT7yvBHuDyj/AJUX5M/5bNV/5G23/ZPm/wCVF+TP+WzVf+Rtt/2T51f0x4ZvTHhj +4k+8rwR7g8o/5UX5M/5bNV/5G23/AGT5v+VF+TP+WzVf+Rtt/wBk+dX9MeGb0x4Y+JPvK8Ee4PKP ++VF+TP8Als1X/kbbf9k+V/yozyZ/y2ar/wAjbf8A7J86x6Y8MoximPiT7yvBHuDxHzB+R1mtk8/l +a+uJLyJS31O99NvVpvxjliWERt/rK/L/ACM4rRq8aHlWnGm9fCme0GTjKhG3xD8TnmLgn/K3fT4j +h/iXjwptT6/SlMmMkuGW/Kt2BhHijtzvZ//Qkv5Gf8oZef8AbVl/6h7fOrx9BnKPyM/5Qy8/7asv +/UPb51ePoMnk+uXvY4/oHuX5s2bIMnZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2b +FXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs +2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFX +Zs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZs2bFXZj0zZj0xVCyf3qf6w/XnmL/wArB/4M3/Y/ +np2T+9T/AFh+vPMX/lYP/Bm/7H8nH6Ze4fewl9Ufefuf/9GS/kb/AMobef8AbVl/6h7fOrx9BnKP +yN/5Q28/7asv/UPb51ePoMlk+uXvYw+ke5fmzZsiydmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZs +VdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmz +ZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVd +mzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmzZsVdmPTNmPTFULJ/ep/rD9eeYv +/Kv/APgzf9j+enZP71P9YfrzzH/5V/8A8Gb/ALH8nH6Z+4fewl9Ufefuf//SMPyuu7qy/L28mtJP +SlOsuvKitsbeCuzBhksXXdfoKXtP+ecX/NGQz8uSB+XV0O7a0wH0WsLfqGSVWAUVzU9q5csdSRCc +4ihsCQGED6I+5H/p7zD/AMtx/wCRcP8A1Tzfp7zD/wAt3/JOH/mjABkGN9TwzBGfU/6rP/TFNpj+ +nfMP/Ld/yTh/6p5X6f8AMA/4/wD/AJJRf80YXczm5ZIZ8/8Aqs/9MVtMD5g8wf8ALcf+RcX/ADRl +f4g8w/8ALb/yTi/5owByzcsP5jN/qk/9MVtH/wCIPMP/AC2/8k4v+aM3+IPMP/Lb/wAk4v8AmjAH +LNyw/mM3+qT/ANMVso//ABB5h/5bf+ScX/NGb/EHmH/lt/5Jxf8ANGF/PL5Y/mM/+qS/0xW0f/iD +zD/y2/8AJOL/AJozHzB5h/5bf+ScX/NGF5bGlqe+EZ83+qz/ANMUElHt5j8xA7Xu3/GOL/mjGnzJ +5j/5bv8AknF/zRhazb7Zq5cM2T+fL/TFrMpd6Y/4k8x/8t3/ACTi/wCaMv8AxJ5j/wCW7/knD/zR +hbyzcsPj5f58vmUcUu8pl/iTzH/y3f8AJKL/AKp5v8SeY/8Alu/5Jxf9U8LeW2X16YPHy/z5fMrc +u8pj/iPzH/y3f8k4v+qeX/iPzHSv17/knF/1Twuocep+nIHU5BynL5lkOLvKNHmTzGf+P3/klF/z +Rm/xH5j/AOW7/klF/wBU8BUFa5hsdhj+Zy/z5fMpqXeUd/iLzJ2vv+SUX/VPMfMXmMf8f3/JKL/m +jAJIrTNyWuI1OX+fL5ld+8/NG/4j8x/8t3/JKL/qnm/xH5j/AOW7/klF/wBU8AFhTYdMZzrkxny/ +zpfMsSZd5TL/ABH5j/5bv+SUX/VPN/iPzH/y3f8AJKL/AJowt5ZXMfPD4+X+fL5ljxS7ymf+JPMf +/Ld/ySi/5ozf4k8xf8t3/JOL/mjC34z7Y4IO+5x8fJ/Pl80ccu8o/wDxL5j7XxP/ADyi/wCaMseY +vMp631P+eUX/AFTwCKDpmx8fL/Pl8yjjl3lMP8ReY/8Alv8A+SUP/VPN/iHzJ/y3/wDJKH/qnhfy +AyvUHYY+Nm/ny+ZXin3lMf8AEPmP/lv/AOSUP/VPN/iHzF3v/wDklD/1TwtMhOVywjJl/wBUl8yn +il3n5pkfMfmL/lu/5JQ/9U8r/EfmP/lu/wCSUX/NGF1c1aZMZMn8+XzK8cu8/NMf8R+Y/wDlu/5J +xf8AVPN/iTzH/wAt3/JOL/qnhbyzcsPiZP50vmV45d5TL/EnmP8A5bv+ScX/AFTzf4k8x/8ALd/y +Ti/6p4W8s3LB4uT+fL5rxS7ymX+I/Mf/AC3f8kov+aMx8yeYh/x/f8kov+aMLeWWCo7VPicHi5f5 +8vmV45d5TJfMXmU7/XqD/jFD/wBU8v8AxF5jHW//AOSUP/VPCwuTlVweLk/ny+ZXil3lMv8AEfmL +/luP/IqH/qnm/wAR+Y/+W7/klF/zRhdyyuWROeY/jl8ykSl3lMv8SeY/+W7/AJJRf80ZX+JPMf8A +y3f8k4v+qeF1cuuR/MZek5fMpuXeUxHmPzH/AMt3/JOL/qnl/wCI/Mfe+/5Jxf8ANGFtc1cRnzH+ +OXzK8Uu8pl/iPzH/AMt3/JOL/mjN/iPzF/y3f8kov+aMLeWblkvGy/z5fMo4pd5TL/EfmP8A5bv+ +ScX/ADRm/wAR+Y/+W7/knF/zRhbyzcsPi5f58vmV4pd5TL/EfmP/AJbv+ScX/NGb/EfmP/lu/wCS +cX/NGFvLNyx8bL/Pl8yvFLvKY/4k8x9r7/knF/zRmHmTzH/y3f8AJOL/AKp4Xcs1cHi5f58vmU8R +7ymP+JPMf/Ld/wAk4v8AmjMfMnmL/lu/5JRf80YXVrmr7YDly/6pL5leM95TH/EnmP8A5bf+ScX/ +ADRm/wASeY/+W7/knF/1TwtLAZviboKD3yEs+Uf5SX+mKeM95TL/ABJ5j/5bv+ScX/NGV/iXzH2v +Sf8AnlF/zRgARgbnc5ZKjIfmM/Scv9MV4z3lHjzF5lPW+p/zyi/6p44+YvMY63//ACSh/wCqeFvq +HttlVxGbPe+Sf+mK3LvKY/4k8x/8t3/JKH/qnm/xJ5i/5bj/AMiov+qeFtcvc5Z4+X/VJf6Yrcu8 +pj/iTzH/AMt3/JOL/qnm/wAR+Y/+W7/klF/1TwBscsHscTqcvScvmUji7yjx5i8yf8tv/JOL/mjF +P8QeYu99t/xji/5owvDDLBGUy1OfpkkP84tg96Yfp/zDX/e7b/jHF/zRl/p/zB/y2/8AJOL/AJow +vrmrlX5rUf6rP/TFkmH6f8wf8tv/ACTi/wCaM36f8wf8tv8AyTi/5owvrmrj+Zz/AOqz/wBMVTD9 +P+YP+W3/AJJxf80Zv8QeYP8Alt/5Jxf80YX1yuVdhucH5rP/AKrP/TFUefMHmEf8fv8AyTi/5oyx +r/mJv+P3b/jHF/zRgEL3brjq4fzec8sk/wDTFCO/T3mH/lu/5JRf80Zv075h/wCW4/8AIuH/AKp4 +Brmrj+a1H+qz/wBMUJlY6zrUuqWUNxdepFJKquvCMVBPiqA5xf8A8q//AODN/wBj+db04/7mNP8A ++M6frzkn/lX/APwZf+x/Nhhy5T2fqJmcjIGNGzY9UerGR3j7z9z/AP/TW/Lw0/Lyb/ttyf8AUFHh ++G2GR/8AL/b8u5v+23J/1Bx4eK2wzVdq/wCM/wCaP0tcPpj7lXkM3LE+Qzcs19MlTlm5YnyzcsaV +U5ZuWJ8s3LGlVOWblifLNywqqcs3LE+WUWxpVzPTGNICNsTLeOVXLYxDUSv5ZqjE65dclbFfyy69 +sT5ZYJ+eAlICquPAodsYG9svllRkS2CIVKjNyGJ8hjTIMFFkrcsrn9+IGUeNMazknYfwyQh3sTIK +xl7d8Yzj5YnRjuWAy6J33ywRrkGsytv1PDfHDke1MbyUdBm9Q5IRLEkrwg774+qjbbEC5OblhEEU +r818coyDsMR5ZVclwhaVvUPyyi2JcsuuGlX1GaoxlcrliqpUZuWMqc1ThCaX1zcsZmrhtFL+WVyx +lc1cbVU5ZuWJ1zcsiSmlTlmrifLNyyNrSpyGblifLNywFVSozVGJ1zVyFMlXkM3IYlXNywgIVSwz +chiXLNyyQCFXkM3IYlyzcsKqvLNyGJVy+WKqnLNyxLlm5Yqq8s3LES/0nLAY9TQYCQFXlx/YMscm +9hlAKvTLLgdN8iSTyQqKoG/68xcDpiBcnNyrkOHfdkArGQnKrvviZbbbbxyg+Gk0q1HhmDDEueVy +xpVYv3yuY7dcS5Zq4eELasJNsrmOmJVzVxoLat6lPc44S0wPXNXBKAKRIoj1QSfwxwl364F5ZXOh +yo4wy4yjfUqNs3LxwKjE+2E2p+Zkt7tdI0aA6trUnwpZwbhD/NO/2Y1X9r/jXIRw5Jy4MceIlmJ2 +yRQW67DFBRRtkXu08+eVUj1DzDDFqenTAPcGxWj2hP7JWi+pGv8Avz4v+MmHGn6pZapbi5sZlmjP +h1Hsy9VOHPos+EjxAKPUbxZE0j+WbliXKuauViDC1WuauJVzVyQACLRemn/czp//ABnT9ecn/wDK +v/8Agy/9j+dV0w/7mtO/4zp+vOV/+Ve/8GX/ALH82OH/AIztT/Wj/uoIP8PvP3P/1H+Qdvy6n/7b +cn/UHHhwrbDCbyJt+XE//bcf/qDjw0DbDNZ2p/jJ9w/S1w+iPuVuWbliXLNyzAZKvLNyxHnljkeg +yJICq3LK5Yzie5pm+Ae+DiHRNL+den4ZdT3xPn4bZXLHiWlWuMJI743njGfJRsnkiVALiT3yq4ly +yuRy4RPUtRVuWavviXI98wO+HhQr9KY8HEg22+XypkCCWYpV5ZuWIlvDGl9vbEQSZK7PjC2JFvfG +8snGADAyKtXNyOJcs3LJ0xVa++bliPLNywgIVuWbliPPNzwqrcs3LEeeVz98VV+Wbl74hyJ7ZfxH +rQY2FVuWVzxPYd65sFrSpyxwrscSBy+YG2RJPRkB3qtTm54iXp0yuZwgFSVbllcsS5ZuWSpiq8s3 +LEeWblgKq3LNyxLlm5YKSq8s3LEuWVyxVW5Zq4lyzcsgVVa5uWJcsrliAqtyzcsR5ZfLJUqryzcs +S5ZuWFCryzcsR5ZueKVblm5YhzJ6b5YBP2j9GAkIVedem+WATux+jGggdMxkAyO5VVFB0GYuBgcy +E5uWERWlYuTlcsS5ZuWGkqtc1cS5ZuWRKVXl75q4lyzcsCqtc1cS5Zq4qq1zcsS5ZuWSCFWubliQ +bKrh2VV5ZuXviY5N0298cFA365EkKuBLe2JXd5Z6dbvd3sywwRiryOaAf1P+TivLOd69Ol35xe21 +RGutPsoo3itOVI+bBSXZOjn4v2slp8Jz5eC6HM+5MY8RpPILrXvO0noaMH0rRSaSalIKTzL3+rp+ +yp/n/wCG/YzonlnQdE8q23o6ZAFkenrXDfFLIR3kkO7f8Q/ycjmn+YdOe2H1ZljRAAU6Up2ply+Z +O0P/AATf0ze4tPDFHhxiu89S3gAbB6A+oJIpWShU9Qc5/rXleziuW1Ty3cLYXpJMkKH9zJ3oyDZf +9j/wOBJNZll+3KT7V2+7E/0n/lZYcYIIkLB5g8kq1jrxMostViNpeDbf7D+6N74dBwe+c813zTYS +j6jDGt7c148wfhiNdzzHVv8AIXJF5bu5prORJW5ei/BSetKVzS67QwxDxMRoXRj3X3FhIVuyHllh +sQD5fLNbVMUdpRrrenf8Z0/XnL//ACr3/gy/9j+dM0hq67pv/GdP15zP/wAq9/4Mv/Y/mfh/4z9T +/Wj/ALqKn+H3n7n/1b8jmn5bz/8Abcf/AKg48MFLECgwB5G/8lndnw1s0/6RoRhgrbDNT2tKQ1JA +HQMMf0R9y4Kx6mmWEXvvjDIBjTKTmu4Znmz2V6quUZPDA/PK5ZIYiiwr8z45XLEeXvlVyYxravyy +uWI1y+WSEEWqF8Yz9uvvjC2M5ZZGIYSKpXNXEuWblllMFXllhsR5ZfPbEqiA1O+Vz7jpiHP3yufv +ka702rF65XLEuROb4j2w7MVXlm5YnRvGmXTxONhV3LNz98oKPnjqAdseMK1yr75Y5HtT55uXhmLE +4OMq2Q3jlhfE4wuBjTJj6j1VVCjL5KMQLk5XLDw960rmQ9srnU74jyzcsNJVuWbniPLNyxpVbnlc +sS5ZuWEBCryzcsS5ZuWSVV5ZuWJcs3LAtKvLNyxLlm5ZFVXlm5YlyzcsU0q8s3I4lyzcsBWlXlm5 +YlyzcsFWqryzcsRqc1cNLStyzcsSrlchiqtzyueJAk9B9OOCjvvgJQu5FugrjgpP2jlA5RemDcqq +9M3MDEC5yuWERVWMhOVXEuWblkqSq8s3LEuWblihV5ZuWJcs3LAUqvLNyxOublkUqoIrvl96Ylzr +juXvkTaQAv28cvvtifOvTtjuYyJkQyEQvG25yq++UKn2GOAAyHifFPC4KxPgMeFCjxOVyyq48RKK +Cpt0yiKjfrjK5fLGyig7fIBqUXqeb9QNP90Rf8RTJ/XIfNEJPNl+fGCOn3Jmd2Yb1P8AmH7wyhGi +lEkcsD+pESjDuO/zxyao/wBmX4W8exw0ubXrthNdWvXbN6bHJmqzavFbxmWaQIg6k/w8cjt3r1/q +zG3tuVvanYkH43H+Uf2V/wAlcBX9pLPqJjYkxoF4g9BUZINJ0jdfhyu5SNcla0nSQOJ49N8nPlo8 +YbkH/fv/ABqM2n6WEiZ2AAVSSTsBtjPL5pHc/wDGX/jUZi9oRAwAf0gwyfT8WQcwOhx4auBOWPVx +mkmNmuPNM9GNde0z/jOn685z/wCVe/8ABl/7H86FojV1/TP+YhP15z3/AMq9/wCDL/2P5lYT/rfq +f60f91FnIbx95+5//9avJZp+Ws5/7Xj/APUHHgkOaDfAnk7b8s7j/tuP/wBQceKhthmv7SAOpPuD +VD6Y+5V5ZuWJcjm5HMOmSryzcsS5ZuRxpCryzcsS55uRxVV5ZuWJ/Ee2XxbxwWFbLHEy2WVA6muV +sOmTiWEi7lXL+LwzVpm5e+EyQ2Ae5pl08TjeWblkTJV9FHbLqPDE65uWCyVVOWblidcwJw0hUrjg +ab98TBA3JzGUD3wbnkyEVUttjS9O+INITjeWSEO9BVzJ4Y0uTiXLNyydBVTlmrifLNywqqVzVxPl +m5YqqVzVxPlm5YqqVzVxPlm5Yqqcs3LEq5q4VVeWbliVc1cKFXlmriVcvlgKVSuauJ8s3LAqpXNX +E+WbljSqlc1cT5ZuWAgpVK5q4nyOUWwiKFXllcsTFT02x4AHXc4EWuBJ6fjjgAOu5xtcrmBgolVW +ub1AMQLk5VcRAdU0qmQnK5Yz5ZvbJbJpfXNXGjNjstLq5q43NXBaaXVzVxhJ65VThRSpyzcsT5Zu +RyJVU5ZuWJcvfLBPbIqqcswemMC+JxwoOmRMlXgufYY8NQUHXxxLlm5ZAi+i2Vb1DjvUrgctm5Y8 +IXiKJ55fLA3OnzyxIfHHgTxIjlm5YH5nN6h8ceAp4giA2FWr6NHqDLdQsYb2Mfu5V2rTscGiQ+Ob +1DvvjDjxzE4HhI6p4wx9LqaNvq2ppwlGwmp8Le5xlzbVFRuD0OHtxDFdR+nMvIePcH2wnltLixqU +Pq2/h3GbrTa+OQCGWoy7/wCE/qZCYKRppvq3rPx60yTW8Ntp8QluSFFKhe5wvN9DbAeipe4k+woF +T9AxaDS57thPqjVB3FuDUf7M/tZkZtRjwjc2TyA5pMgObct7f60fRsx6NoDvJ+z9Ff7xvf7OG1la +RWUIhiqd6szGpJPUnHIFjUIgCqNgBl8s0+fUZMx9WwHIDk1SkSq1y1eh9sR5ZfLMcjZiE20B6+Yd +M/5iE/XkD/8AKvf+DL/2P5NfL7U8xaWT0+sxj7zT+OQv/wAq7/4Mv/Y/mXhj/gOoHnH/AHUWRP0+ +8/c//9dvk7/yV95/22z/ANQ0OPFCBXGeT/8AyV95/wBtz/sWhywdhmu7S/xg+5qj9MfcuI8Mogj3 +yq5q5hXXVk4Bj7ZfHxOauavvgMvNVwCjLrjKjMWAyNrSpXKDYnz2xpcYRZQaXscbyxOuauTAYFUr +mridc1caQqVzVxOuUWHjkhFVWubliJkxvInJiC0rlwM3qHtiFc1clwhKqXJyuRxOuauNKqVzVxOu +auGlVK5VTjK5q4qqVzVxOuVXFVSpy64nXNXFV9cuuJVy64qqVzVxOuVXFVTlm5YnXNXJIVOWblid +c1cVVOWblidc1cFKqcs3LGZsdglUrmrjR08c21cBkvCurlVOZQT7Y8Ko3yPGmltGPtjwoG/U5eVy +AwcRKOFcMxNMTMmNDg4pEQqlq9MbWvtjOQzcgcU0F+XXEw2bkMO60FSuauJFxlc8aW1blm5Ylyyu +XhjS2rcs3LEOVM3LDSLVuWauIgsdsdTxODZbX8vDLoT7Y2oGblkTaLXgAe+XXGcq5VcFd6FSubkM +TrmrjwhVSuauJ1zVwcKqlc3LE65q4KVUrm5YnXNXJBVTlm5YnXNXCqpXNXE65q5EhVTlmridc3LI +0lattbxyGVIlWQ9WAFcVLYnXNXJLS+uauMrmrhpC+uXXGVyi3bHhVMtBYf4h0sf8vUP/ACcXIf8A ++Vc/8GX/ALH8lfl818xaV/zFQ/8AJxcin/lW/wDwZP8AsfzMxD/A8484/wC6ik/w+8/c/wD/0E/K +Rp+V14aV/wBzfQf8w0OJiY0/u2+45wfNms7Ur8ybvkGGP6I+57x6x/323/AnL9Y/77b/AIE5wbNm +B6fNm949Y/77b/gTm9dv99t/wJzg+bEcPmr3czt2jb/gTjfXfvG//AnOFZsmOGmBe5md6/3bf8Cc +r1m/kb/gTnDc2WDh82D3P1m/kb/gTm9Zv5G/4E5wzNh9KHufrN/I3/AnKM7f77f/AIE5w3Nk48C7 +PcDM/wDI3/AnK9Zv5G/4E5xDNk9le3es38jf8Cc3rN/I3/AnOI5sOyXt3rN/I3/AnN6zfyN/wJzi +ObHZXt3rN/I3/AnN6zfyN/wJziObHZXt3rN/I3/AnN6zfyN/wJziObHZD271m/kb/gTm9Zv99t9x +ziObBsuz271W7o33HN6x/kb7jnEc2Oyvb/Wb+Rv+BOV6zfyN/wACc4jmw7K9u9Zv5G/4E5vWb+Rv ++BOcRzY7Je3es38jf8Cc3rN/I33HOI5sdkPbvVb+RvuOX6zfyN9xziGbDsr271m/kb7jm9Y/yN9x +ziObHZXt3rN/I33HL9Y/yN9xziGbHZXuHrH+RvuOX6zf77b/AIE5w7NkTTJ7iJmI+wwHyOOE1P2G +P+xOcMzZA8KHuvrt/vtv+BOYzsB/duf9ic4Vmwenqr3P6xJ/vt6f6p/pjDO/++2/4E5w/NkvSnd7 +f6zV2Rv+BOb1mr9hv+BOcQzYfSh7f6zfyN/wJzes38jf8Cc4hmw7K9v9Zv5G/wCBOb1m/kb/AIE5 +xDNjsr271m/kb7jl+s38jf8AAnOIZsdkPbvWb+RvuOb1m/3233HOI5sTXRXt4kPdW+444TeCN9xz +h2bImuqvc/WP8jf8Ccr1m/kb/gTnDc2D0q9z9Zv99t/wJzesf5G/4E5wzNkTwrs9z9Y/yN/wJzes +38jf8Cc4ZmxFea7PcvWP8jf8Cc3rN/I3/AnOG5slsuz3P1j/ACN/wJyvWb+Rv+BOcNzY+ldnuXrH ++Rv+BOb1j/I3/AnOG5sfSh7l6zfyN/wJzes38jf8Cc4bmx9KvcvWP8jf8Cc3rH+Rv+BOcNzY+lXu +XrH+Rv8AgTm9Zv8Afbf8Cc4bmwGk7PcvWb+Rv+BOV6x/kb7jnDs2Q9Pml7l6zfyN9xzesf5G/wCB +OcNzZIcKC9y9Y/yN/wACc3rN/I33HOG5sl6V2e5Gdu0bf8Ccb6p7o33HOH5sJrokU+gvLjlvMelD +iR/pUPUH/fi5F/8AyrX/AIMn/Y/nJc2ZOL/FM/vj/uoplVx95+5//9k=")); + break; + case "01_hdot.gif": + header("Content-type: image/gif"); + echo trim(base64_decode(" +R0lGODlhAwABAJEAAAAAAP///1xcXP///yH5BAEAAAMALAAAAAADAAEAAAIC1FYAOw==")); + break; + } +} diff --git a/links.php b/links.php new file mode 100644 index 000000000..d5a941e93 --- /dev/null +++ b/links.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 000000000..d7e713ac0 --- /dev/null +++ b/login.php @@ -0,0 +1,83 @@ +"; + $LOGIN_TABLE_PASSWORD = ""; + if ($use_imagecode) + { + $LOGIN_TABLE_SECIMG_LAN = LAN_LOGIN_13; + $LOGIN_TABLE_SECIMG_HIDDEN = ""; + $LOGIN_TABLE_SECIMG_SECIMG = $sec_img->r_image(); + $LOGIN_TABLE_SECIMG_TEXTBOC = ""; + } + $LOGIN_TABLE_AUTOLOGIN = ""; + $LOGIN_TABLE_AUTOLOGIN_LAN = LAN_LOGIN_8; + $LOGIN_TABLE_SUBMIT = ""; + + if (!$LOGIN_TABLE) + { + if (file_exists(THEME."login_template.php")) + { + require_once(THEME."login_template.php"); + } + else + { + require_once(e_BASE.$THEMES_DIRECTORY."templates/login_template.php"); + } + } + $text = preg_replace("/\{(.*?)\}/e", '$\1', $LOGIN_TABLE); + + echo preg_replace("/\{(.*?)\}/e", '$\1', $LOGIN_TABLE_HEADER); + + $login_message = LAN_LOGIN_3." | ".SITENAME; + $ns->tablerender($login_message, $text, 'login_page'); + + if ($pref['user_reg']) + { + $LOGIN_TABLE_FOOTER_USERREG = "".LAN_LOGIN_11.""; + } + echo preg_replace("/\{(.*?)\}/e", '$\1', $LOGIN_TABLE_FOOTER); + +} +else +{ + echo "\n"; + exit; +} + +echo ""; + +$sql->db_Close(); + +?> \ No newline at end of file diff --git a/membersonly.php b/membersonly.php new file mode 100644 index 000000000..2fc65384e --- /dev/null +++ b/membersonly.php @@ -0,0 +1,41 @@ +tablerender($MEMBERSONLY_CAPTION, $MEMBERSONLY_TABLE); +echo $MEMBERSONLY_END; + +?> diff --git a/news.php b/news.php new file mode 100644 index 000000000..295ff8ad7 --- /dev/null +++ b/news.php @@ -0,0 +1,576 @@ + Cache + if($tmp = checkCache($cacheString)){ + require_once(HEADERF); + renderCache($tmp, TRUE); + } + // <-- Cache + + $qs = explode(".", e_QUERY); + + $category = intval($qs[1]); + if ($action == 'cat' && $category != 0) { + $gen = new convert; + $sql->db_Select("news_category", "*", "category_id='$category'"); + $row = $sql->db_Fetch(); + extract($row); // still required for the table-render. :( + } + if ($action == 'all'){ + if(!defined("NEWSALL_LIMIT")){ define("NEWSALL_LIMIT",10); } + // show archive of all news items using list-style template. + $news_total = $sql->db_Count("news", "(*)", "WHERE news_class REGEXP '".e_CLASS_REGEXP."'"); + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." + AND (n.news_end=0 || n.news_end>".time().") ORDER BY n.news_sticky DESC,n.news_datestamp DESC LIMIT ".intval($from).",".NEWSALL_LIMIT; + $category_name = "All"; + } + elseif ($action == 'cat'){ + // show archive of all news items in a particular category using list-style template. + $news_total = $sql->db_Count("news", "(*)", "WHERE news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (news_class REGEXP ".$nobody_regexp.") AND news_start < ".time()." AND (news_end=0 || news_end>".time().") AND news_category=".intval($sub_action)); + if(!defined("NEWSLIST_LIMIT")){ define("NEWSLIST_LIMIT",10); } + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_category=".intval($sub_action)." ORDER BY n.news_datestamp DESC LIMIT ".intval($from).",".NEWSLIST_LIMIT; + } + + if($category_name){ + define("e_PAGETITLE", $category_name); + } + + require_once(HEADERF); + + if(!$NEWSLISTSTYLE){ + $NEWSLISTSTYLE = " +
        + + +
        + {NEWSCATICON} + + {NEWSTITLELINK} +
        + {NEWSSUMMARY} + + {NEWSDATE} + {NEWSCOMMENTS} + +
        + {NEWSTHUMBNAIL} +
        +
        \n"; + + } + $param['itemlink'] = (defined("NEWSLIST_ITEMLINK")) ? NEWSLIST_ITEMLINK : ""; + $param['thumbnail'] =(defined("NEWSLIST_THUMB")) ? NEWSLIST_THUMB : "border:0px"; + $param['catlink'] = (defined("NEWSLIST_CATLINK")) ? NEWSLIST_CATLINK : ""; + $param['caticon'] = (defined("NEWSLIST_CATICON")) ? NEWSLIST_CATICON : ICONSTYLE; + $sql->db_Select_gen($query); + $newsList = $sql->db_getList(); + foreach($newsList as $row) + { + $text .= $ix->render_newsitem($row, 'return', '', $NEWSLISTSTYLE, $param); + } + + $amount = ($action == "all") ? NEWSALL_LIMIT : NEWSLIST_LIMIT; + + $icon = ($row['category_icon']) ? "" : ""; + $parms = $news_total.",".$amount.",".$from.",".e_SELF.'?'.$action.".".$sub_action.".[FROM]"; + $text .= "
        ".$tp->parseTemplate("{NEXTPREV={$parms}}")."
        "; + + if(!$NEWSLISTTITLE){ + $NEWSLISTTITLE = LAN_NEWS_82." '{$category_name}'"; + } + + ob_start(); + $ns->tablerender($NEWSLISTTITLE, $text); + $cache_data = ob_get_flush(); + setNewsCache($cacheString, $cache_data); + require_once(FOOTERF); + exit; +} + +if ($action == "extend") { + + // --> Cache + if($tmp = checkCache($cacheString)){ + require_once(HEADERF); + renderCache($tmp, TRUE); + } + // <-- Cache + + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_id=".intval($sub_action); + $sql->db_Select_gen($query); + $news = $sql->db_Fetch(); + + if($news['news_title']){ + if($pref['meta_news_summary'] && $news['news_title']){ + define("META_DESCRIPTION",SITENAME.": ".$news['news_title']." - ".$news['news_summary']); + } + define("e_PAGETITLE",$news['news_title']); + } + + require_once(HEADERF); + ob_start(); + $ix->render_newsitem($news, "extend"); + $cache_data = ob_get_contents(); + ob_end_flush(); + setNewsCache($cacheString, $cache_data); + require_once(FOOTERF); + exit; +} + +if (empty($order)){ + $order = "news_datestamp"; +} +$order = $tp -> toDB($order, true); + +$interval = 10; +if ($action == "list"){ + $sub_action = intval($sub_action); + $news_total = $sql->db_Count("news", "(*)", "WHERE news_category=$sub_action AND news_class REGEXP '".e_CLASS_REGEXP."' AND news_render_type<2"); + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." + AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type<2 + AND n.news_category={$sub_action} ORDER BY n.news_sticky DESC,".$order." DESC LIMIT ".intval($from).",".ITEMVIEW; +} +elseif($action == "item") +{ + $sub_action = intval($sub_action); + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_id={$sub_action}"; +} +elseif(strstr(e_QUERY, "month")) +{ + $tmp = explode(".", e_QUERY); + $item = $tp -> toDB($tmp[1]); + $year = substr($item, 0, 4); + $month = substr($item, 4); + $startdate = mktime(0, 0, 0, $month, 1, $year); + $lastday = date("t", $startdate); + $enddate = mktime(23, 59, 59, $month, $lastday, $year); + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type<2 AND n.news_datestamp > $startdate AND n.news_datestamp < $enddate ORDER BY ".$order." DESC LIMIT ".intval($from).",".ITEMVIEW; +} +elseif(strstr(e_QUERY, "day")) +{ + $tmp = explode(".", e_QUERY); + $item = $tp -> toDB($tmp[1]); + $year = substr($item, 0, 4); + $month = substr($item, 4, 2); + $day = substr($item, 6, 2); + $startdate = mktime(0, 0, 0, $month, $day, $year); + $lastday = date("t", $startdate); + $enddate = mktime(23, 59, 59, $month, $day, $year); + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type<2 AND n.news_datestamp > $startdate AND n.news_datestamp < $enddate ORDER BY ".$order." DESC LIMIT ".intval($from).",".ITEMVIEW; +} +else +{ + $news_total = $sql->db_Count("news", "(*)", "WHERE news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (news_class REGEXP ".$nobody_regexp.") AND news_start < ".time()." AND (news_end=0 || news_end>".time().") AND news_render_type<2" ); + + if(!isset($pref['newsposts_archive'])) + { + $pref['newsposts_archive'] = 0; + } + $interval = $pref['newsposts']-$pref['newsposts_archive']; + + // Get number of news item to show + if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) { + $query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon, COUNT(*) AS tbcount FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + LEFT JOIN #trackback AS tb ON tb.trackback_pid = n.news_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' + AND NOT (n.news_class REGEXP ".$nobody_regexp.") + AND n.news_start < ".time()." + AND (n.news_end=0 || n.news_end>".time().") + AND n.news_render_type<2 + GROUP by n.news_id + ORDER BY news_sticky DESC, ".$order." DESC LIMIT ".intval($from).",".$pref['newsposts']; + } + else + { + $query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n + LEFT JOIN #user AS u ON n.news_author = u.user_id + LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id + WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' + AND NOT (n.news_class REGEXP ".$nobody_regexp.") + AND n.news_start < ".time()." + AND (n.news_end=0 || n.news_end>".time().") + AND n.news_render_type<2 + ORDER BY n.news_sticky DESC, ".$order." DESC LIMIT ".intval($from).",".$pref['newsposts']; + } + // #### END --------------------------------------------------------------------------------------------------- +} + +if($tmp_cache = checkCache($cacheString)) // normal news front-page - with cache. +{ + require_once(HEADERF); + + if(!$action) + { + if (isset($pref['fb_active'])) + { + require_once(e_PLUGIN."featurebox/featurebox.php"); + } + if (isset($pref['nfp_display']) && $pref['nfp_display'] == 1) + { + require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php"); + } + + } + + //news archive + if ($action != "item" && $action != 'list' && $pref['newsposts_archive']) { + if ($sql->db_Select_gen($query)) { + $newsAr = $sql -> db_getList(); + if($newsarchive = checkCache('newsarchive')){ + $tmp_cache = $tmp_cache.$newsarchive; + }else{ + newsarchive($newsAr); + } + } + } + renderCache($tmp_cache, TRUE); +} + + +if (!$sql->db_Select_gen($query)) { + require_once(HEADERF); + echo "

        ".(strstr(e_QUERY, "month") ? LAN_NEWS_462 : LAN_NEWS_83)."


        "; + require_once(FOOTERF); + exit; +} else { + $newsAr = $sql -> db_getList(); +} + + +$p_title = ($action == "item") ? $newsAr[1]['news_title'] : $newsAr[1]['category_name']; + +if($action != "" && !is_numeric($action)) +{ + if($action == "item" && $pref['meta_news_summary'] && $newsAr[1]['news_title']){ + define("META_DESCRIPTION",SITENAME.": ".$newsAr[1]['news_title']." - ".$newsAr[1]['news_summary']); + } + define("e_PAGETITLE", $p_title); +} + +require_once(HEADERF); +if(!$action) +{ + if (isset($pref['fb_active'])){ // --->feature box + require_once(e_PLUGIN."featurebox/featurebox.php"); + } + + if (isset($pref['nfp_display']) && $pref['nfp_display'] == 1){ + require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php"); + } +} + + +/* +changes by jalist 03/02/2005: +news page templating + +*/ +if(isset($pref['news_unstemplate']) && $pref['news_unstemplate'] && file_exists(THEME."news_template.php")) { + // theme specific template required ... + require_once(THEME."news_template.php"); + + if($ALTERNATECLASS1){ + return TRUE; + } + + $newscolumns = (isset($NEWSCOLUMNS) ? $NEWSCOLUMNS : 1); + $newspercolumn = (isset($NEWSITEMSPERCOLUMN) ? $NEWSITEMSPERCOLUMN : 10); + $newsdata = array(); + $loop = 1; + foreach($newsAr as $news) { + + if(is_array($ALTERNATECLASSES)) { + $newsdata[$loop] .= "
        ".$ix->render_newsitem($news, "return")."
        "; + $ALTERNATECLASSES = array_reverse($ALTERNATECLASSES); + } else { + $newsdata[$loop] .= $ix->render_newsitem($news, "return"); + } + $loop ++; + if($loop > $newscolumns) { + $loop = 1; + } + } + $loop = 1; + foreach($newsdata as $data) { + $var = "ITEMS{$loop}"; + $$var = $data; + $loop ++; + } + $text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSCLAYOUT); + + require_once(HEADERF); + echo $text; + setNewsCache($cacheString, $text); + +} else { + /* + changes by jalist 22/01/2005: + added ability to add a new date header to news posts, turn on and off from news->prefs + */ + + ob_start(); + + $newpostday = 0; + $thispostday = 0; + $pref['newsHeaderDate'] = 1; + $gen = new convert(); + + if (!defined("DATEHEADERCLASS")) { + define("DATEHEADERCLASS", "nextprev"); + // if not defined in the theme, default class nextprev will be used for new date header + } + + // #### normal newsitems, rendered via render_newsitem(), the $query is changed above (no other changes made) --------- + + $i= 1; + while(isset($newsAr[$i]) && $i <= $interval) { + $news = $newsAr[$i]; + // render new date header if pref selected ... + $thispostday = strftime("%j", $news['news_datestamp']); + if ($newpostday != $thispostday && (isset($pref['news_newdateheader']) && $pref['news_newdateheader'])) { + echo "
        ".strftime("%A %d %B %Y", $news['news_datestamp'])."
        "; + } + $newpostday = $thispostday; + $news['category_id'] = $news['news_category']; + if ($action == "item") { + unset($news['news_render_type']); + } + + $ix->render_newsitem($news); + $i++; + } + $parms = $news_total.",".ITEMVIEW.",".$from.",".e_SELF.'?'."[FROM].".$action.(isset($sub_action) ? ".".$sub_action : ""); + $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}"); + echo ($nextprev ? "
        ".$nextprev."
        " : ""); + + $cache_data = ob_get_clean(); + require_once(HEADERF); + echo $cache_data; + setNewsCache($cacheString, $cache_data); +} + +// ##### -------------------------------------------------------------------------------------------------------------- + +function newsarchive($newsAr){ + global $ns, $gen, $interval, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2; + + // do not show the news archive on the news.php?item.X page (but only on the news mainpage) + require_once(e_FILE.'shortcode/batch/news_archives.php'); + + ob_start(); + + $i = $interval + 1; + while(isset($newsAr[$i])) + { + $news2 = $newsAr[$i]; + // Code from Lisa + // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X + // instead of the actual hyperlink that may have been added to a newstitle on creation + $search = array(); + $replace = array(); + $search[0] = "/\(.*?)<\/a>/si"; + $replace[0] = '\\2'; + $search[1] = "/\(.*?)<\/a>/si"; + $replace[1] = '\\2'; + $search[2] = "/\(.*?)<\/a>/si"; + $replace[2] = '\\2'; + $search[3] = "/\(.*?)<\/a>/si"; + $replace[3] = '\\2'; + $search[4] = "/\(.*?)<\/a>/si"; + $replace[4] = '\\2'; + $news2['news_title'] = preg_replace($search, $replace, $news2['news_title']); + // End of code from Lisa + + $gen = new convert; + $news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short"); + + + if(!$NEWSARCHIVE){ + $NEWSARCHIVE ="
        + + + + +
        +
        {ARCHIVE_BULLET} {ARCHIVE_LINK} {ARCHIVE_AUTHOR} @ ({ARCHIVE_DATESTAMP}) ({ARCHIVE_CATEGORY})
        +
        +
        "; + + } + $textnewsarchive .= $tp->parseTemplate($NEWSARCHIVE, FALSE, $news_archive_shortcodes); + $i++; + } + $ns->tablerender($pref['newsposts_archive_title'], $textnewsarchive, 'news_archive'); + $newsarchive = ob_get_contents(); + ob_end_flush(); // dump collected data + setNewsCache('newsarchive', $newsarchive); +} + +// #### new: news archive --------------------------------------------------------------------------------------------- +if ($action != "item" && $action != 'list' && $pref['newsposts_archive']) { + newsarchive($newsAr); +} +// #### END ----------------------------------------------------------------------------------------------------------- + +if ($action != "item") { + if (is_numeric($action)){ + $action = ""; + } + // $parms = $news_total.",".ITEMVIEW.",".$from.",".e_SELF.'?'."[FROM].".$action.(isset($sub_action) ? ".".$sub_action : ""); + // $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}"); + // echo ($nextprev ? "
        ".$nextprev."
        " : ""); +} + +if(is_dir("remotefile")) { + require_once(e_HANDLER."file_class.php"); + $file = new e_file; + $reject = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*', 'Readme.txt'); + $crem = $file -> get_files(e_BASE."remotefile", "", $reject); + if(count($crem)) { + foreach($crem as $loadrem) { + if(strstr($loadrem['fname'], "load_")) { + require_once(e_BASE."remotefile/".$loadrem['fname']); + } + } + } +} + +if (isset($pref['nfp_display']) && $pref['nfp_display'] == 2) { + require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php"); +} + +render_newscats(); + +require_once(FOOTERF); + + +// ========================================================================= +function setNewsCache($cache_tag, $cache_data) { + global $e107cache; + $e107cache->set($cache_tag, $cache_data); + $e107cache->set($cache_tag."_title", defined("e_PAGETITLE") ? e_PAGETITLE : ''); + $e107cache->set($cache_tag."_diz", defined("META_DESCRIPTION") ? META_DESCRIPTION : ''); +} + +function checkCache($cacheString){ + global $pref,$e107cache; + $cache_data = $e107cache->retrieve($cacheString); + $cache_title = $e107cache->retrieve($cacheString."_title"); + $cache_diz = $e107cache->retrieve($cacheString."_diz"); + $etitle = ($cache_title != "e_PAGETITLE") ? $cache_title : ""; + $ediz = ($cache_diz != "META_DESCRIPTION") ? $cache_diz : ""; + if($etitle){ + define(e_PAGETITLE,$etitle); + } + if($ediz){ + define("META_DESCRIPTION",$ediz); + } + if ($cache_data) { + return $cache_data; + } else { + return false; + } +} + +function renderCache($cache, $nfp = FALSE){ + global $pref,$tp,$sql,$CUSTOMFOOTER, $FOOTER,$cust_footer,$ph; + global $db_debug,$ns,$eTraffic,$eTimingStart, $error_handler, $db_time, $sql2, $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb,$e107; + echo $cache; + if ($nfp && $pref['nfp_display'] == 2) { + require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php"); + } + render_newscats(); + require_once(FOOTERF); + exit; +} + +function render_newscats(){ // -- CNN Style Categories. ---- + global $pref,$ns,$tp; + if (isset($pref['news_cats']) && $pref['news_cats'] == '1') { + $text3 = $tp->toHTML("{NEWS_CATEGORIES}", TRUE, 'parse_sc,nobreak,emotes_off,no_make_clickable'); + $ns->tablerender(LAN_NEWS_23, $text3, 'news_cat'); + } +} + +?> \ No newline at end of file diff --git a/online.php b/online.php new file mode 100644 index 000000000..264421e66 --- /dev/null +++ b/online.php @@ -0,0 +1,282 @@ + $pinfo) { + $class_check = TRUE; + list($oid, $oname) = explode(".", $uinfo, 2); + $sql2 = new db; + $sql2->db_Select("user", "user_id", "user_admin > '0' "); + $row_2 = $sql2->db_Fetch(); + $online_location = $pinfo; + $online_location_page = substr(strrchr($online_location, "/"), 1); + if (!strstr($online_location, "forum_") || !strstr($online_location, "content.php") || !strstr($online_location, "comment.php")) { + $online_location_page = str_replace(".php", "", substr(strrchr($online_location, "/"), 1)); + } + if ($online_location_page == "log" || $online_location_page == "error") { + $online_location = "news.php"; + $online_location_page = NEWS; + } + if ($online_location_page == "request") { + $online_location = "download.php"; + } + if ($online_location_page == "article") { + $online_location_page = ARTICLEPAGE; + } + if ($online_location_page == "chat") { + $online_location_page = CHAT; + } + //if($online_location_page == "comment"){$online_location_page = COMMENT;} + if ($online_location_page == "content") { + $online_location_page = CONTENT; + } + if ($online_location_page == "download") { + $online_location_page = DOWNLOAD; + } + if ($online_location_page == "email") { + $online_location_page = EMAIL; + } + if ($online_location_page == "forum") { + $online_location_page = FORUM; + } + if ($online_location_page == "links") { + $online_location_page = LINKS; + } + if ($online_location_page == "news") { + $online_location_page = NEWS; + } + if ($online_location_page == "oldpolls") { + $online_location_page = OLDPOLLS; + } + if ($online_location_page == "print") { + $online_location_page = PRINTPAGE; + } + if ($online_location_page == "login") { + $online_location_page = LOGIN; + } + if ($online_location_page == "search") { + $online_location_page = SEARCH; + } + if ($online_location_page == "stats") { + $online_location_page = STATS; + } + if ($online_location_page == "submitnews") { + $online_location_page = SUBMITNEWS; + } + if ($online_location_page == "upload") { + $online_location_page = UPLOAD; + } + if ($online_location_page == "user") { + $online_location_page = USERPAGE; + } + if ($online_location_page == "usersettings") { + $online_location_page = USERSETTINGS; + } + if ($online_location_page == "new") { + $online_location_page = LISTNEW; + } + if ($online_location_page == "online") { + $online_location_page = ONLINE; + } + if ($online_location_page == "userposts") { + $online_location_page = USERPOSTS; + } + if ($online_location_page == "subcontent") { + $online_location_page = SUBCONTENT; + } + if ($online_location_page == "top") { + $online_location_page = TOP; + } + //commonly used plugin pages + if ($online_location_page == "bugtracker") { + $online_location_page = BUGTRACKER; + } + if ($online_location_page == "event") { + $online_location_page = EVENT; + } + if ($online_location_page == "calendar") { + $online_location_page = CALENDAR; + } + if ($online_location_page == "faq") { + $online_location_page = FAQ; + } + if ($online_location_page == "pm") { + $online_location_page = PM; + } + if ($online_location_page == "survey") { + $online_location_page = SURVEY; + } + if (strstr($online_location, "content.php")) { + $tmp = explode(".", substr(strrchr($online_location, "php."), 2)); + if ($tmp[0] == "article") { + $sql->db_Select("content", "content_heading, content_class", "content_id='".intval($tmp[1])."'"); + list($content['content_heading'], $content['content_class']) = $sql->db_Fetch(); + $online_location_page = ARTICLE.": ".$content['content_heading']; + $online_location = str_replace("php.", "php?", $online_location); + if (!check_class($content['content_class'])) { + $class_check = FALSE; + $online_location_page = ARTICLE.": \"".CLASSRESTRICTED."\""; + } + } elseif($tmp[0] == "review") { + $sql->db_Select("content", "content_heading, content_class", "content_id='".intval($tmp[1])."'"); + list($content['content_heading'], $content['content_class']) = $sql->db_Fetch(); + $online_location_page = REVIEW.": ".$content['content_heading']; + $online_location = str_replace("php.", "php?", $online_location); + if (!check_class($content['content_class'])) { + $class_check = FALSE; + $online_location_page = REVIEW.": \"".CLASSRESTRICTED."\""; + } + } elseif($tmp[0] == "content") { + $sql->db_Select("content", "content_heading, content_class", "content_id='".intval($tmp[1])."'"); + list($content['content_heading'], $content['content_class']) = $sql->db_Fetch(); + $online_location_page = CONTENT.": ".$content['content_heading']; + $online_location = str_replace("php.", "php?", $online_location); + if (!check_class($content['content_class'])) { + $class_check = FALSE; + $online_location_page = CONTENT.": \"".CLASSRESTRICTED."\""; + } + } + } + if (strstr($online_location, "comment.php")) { + $tmp = explode(".php.", $online_location); + $tmp = explode(".", $tmp[1]); + if ($tmp[1] == "news") { + $id = ($tmp[0] == "reply" ? $tmp[3] : $tmp[2]); + $sql->db_Select("news", "news_title, news_class", "news_id='".intval($id)."'"); + list($news['news_title'], $news['news_class']) = $sql->db_Fetch(); + $online_location_page = ($tmp[0] == "reply" ? COMMENT.": ".ONLINE_EL12." > ".$news['news_title'] : COMMENT.": ".$news['news_title']); + $online_location = "comment.php?comment.news.$id"; + if (!check_class($news['news_class'])) { + $class_check = FALSE; + $online_location_page = COMMENT.": \"".CLASSRESTRICTED."\""; + } + } elseif($tmp[1] == "poll") { + $id = ($tmp[0] == "reply" ? $tmp[3] : $tmp[2]); + $sql->db_Select("poll", "poll_title", "poll_id='".intval($id)."'"); + list($poll['poll_title']) = $sql->db_Fetch(); + $online_location_page = POLLCOMMENT.": ".$poll['poll_title']; + $online_location = "comment.php?comment.poll.$id"; + } else { + $online_location_page = COMMENT; + $class_check = FALSE; + } + } + if (strstr($online_location, "forum")) { + $tmp = explode(".", substr(strrchr($online_location, "php."), 2)); + if (strstr($online_location, "_viewtopic")) { + if ($tmp[2]) { + $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10); + $t_page = $tmp[2]/$pref['forum_postspage'] +1; + } else { + $t_page = 1; + } + $qry = " + SELECT t.thread_name, f.forum_name, f.forum_class from #forum_t AS t + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + WHERE t.thread_id = '".intval($tmp[0])."' + "; + $sql->db_Select_gen($qry); + $forum = $sql->db_Fetch(); + $online_location_page = ONLINE_EL13." .:. ".$forum['forum_name']."->".ONLINE_EL14." .:. ".$forum['thread_name']."->".ONLINE_EL15.": ".$t_page; + $online_location = str_replace("php.", "php?", $online_location); + if (!check_class($forum['forum_class'])) { + $class_check = FALSE; + $online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\""; + } + } elseif(strstr($online_location, "_viewforum")) { + $sql->db_Select("forum", "forum_name, forum_class", "forum_id='".intval($tmp[0])."' "); + list($forum['forum_name'], $forum['forum_class']) = $sql->db_Fetch(); + $online_location_page = ONLINE_EL13." .:. ".$forum['forum_name']; + $online_location = str_replace("php.", "php?", $online_location); + if (!check_class($forum['forum_class'])) { + $class_check = FALSE; + $online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\""; + } + } elseif(strstr($online_location, "_post")) { + $sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_forum_id='".intval($tmp[0])."' AND thread_parent='0'"); + list($forum_t['thread_name'], $forum_t['thread_forum_id']) = $sql->db_Fetch(); + $sql->db_Select("forum", "forum_name", "forum_id='".$forum_t['thread_forum_id']."'"); + list($forum['forum_name']) = $sql->db_Fetch(); + $online_location_page = ONLINE_EL12.": ".ONLINE_EL13." .:. ".$forum['forum_name']."->".ONLINE_EL14." .:. ".$forum_t['thread_name']; + $online_location = e_PLUGIN."forum/forum_viewtopic.php?$tmp[0].$tmp[1]"; + } + } + if (strstr($online_location, "admin")) { + $class_check = FALSE; + $online_location_page = ADMINAREA; + } + $pm_installed = ($pref['pm_title'] ? TRUE : FALSE); + $ONLINE_TABLE_ICON = ($pm_installed && $oid != USERID ? $tp->parseTemplate("{pm_menu.sendpm={$oid}}") : ""); + + $ONLINE_TABLE_USERNAME = "
        $oname"; + $ONLINE_TABLE_LOCATION = ($class_check ? "$online_location_page" : $online_location_page); + + if (!$ONLINE_TABLE) { + if (file_exists(THEME."online_template.php")) { + require_once(THEME."online_template.php"); + } else { + require_once(e_BASE.$THEMES_DIRECTORY."templates/online_template.php"); + } + } + $textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $ONLINE_TABLE); +} + +$ONLINE_TABLE_MEMBERS_ONLINE = ONLINE_EL1.GUESTS_ONLINE; +$ONLINE_TABLE_GUESTS_ONLINE = ONLINE_EL2.MEMBERS_ONLINE; +if ((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])) { + global $sysprefs; + $menu_pref['most_members_online'] = MEMBERS_ONLINE; + $menu_pref['most_guests_online'] = GUESTS_ONLINE; + $menu_pref['most_online_datestamp'] = time(); + $sysprefs->setArray('menu_pref'); +} + +if (!isset($gen) || !is_object($gen)) { + $gen = new convert; +} + +$datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short"); + +$ONLINE_TABLE_MOST_EVER_ONLINE = ONLINE_EL8.($menu_pref['most_members_online'] + $menu_pref['most_guests_online']); +$ONLINE_TABLE_MOST_MEMBERS_ONLINE = strtolower(ONLINE_EL2).$menu_pref['most_members_online']; +$ONLINE_TABLE_MOST_GUESTS_ONLINE = strtolower(ONLINE_EL1).$menu_pref['most_guests_online']; +$ONLINE_TABLE_DATESTAMP = $datestamp; + +$total_members = $sql->db_Count("user"); + +if ($total_members > 1) { + $newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); + $row = $sql->db_Fetch(); + extract($row); + + $ONLINE_TABLE_MEMBERS_TOTAL = "
        ".ONLINE_EL5.": ".$total_members; + $ONLINE_TABLE_MEMBERS_NEWEST = "
        ".ONLINE_EL6.": ".(USER ? "".$user_name."" : $user_name); +} + +$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $ONLINE_TABLE_START); +$textend = preg_replace("/\{(.*?)\}/e", '$\1', $ONLINE_TABLE_END); +$text = $textstart.$textstring.$textend; + +$ns->tablerender(ONLINE_EL4, $text); + +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/page.php b/page.php new file mode 100644 index 000000000..9978bdaa0 --- /dev/null +++ b/page.php @@ -0,0 +1,423 @@ + setPageCookie(); +} + +if(!e_QUERY) +{ + require_once(HEADERF); + $tmp = $page -> listPages(); + if(is_array($tmp)) + { + $ns -> tablerender($tmp['title'], $tmp['text']); + require_once(FOOTERF); + exit; + } +} +else +{ + + $cacheString = 'page_'.$page->pageID; + $cachePageTitle = 'page-t_'.$page->pageID; + + if($cacheData = $e107cache->retrieve($cacheString)) + { + + list($pagetitle,$comment_flag) = explode("^",$e107cache->retrieve($cachePageTitle)); + define("e_PAGETITLE", $pagetitle); + require_once(HEADERF); + echo $cacheData; + + } + else + { + + $tmp = $page -> showPage(); + define("e_PAGETITLE", $tmp['title']); + require_once(HEADERF); + if ($tmp['err']) // Need to display error block after header defined + { + $ns -> tablerender($tmp['title'], $tmp['text']); + require_once(FOOTERF); + exit; + } + ob_start(); + $ns -> tablerender($tmp['title'], $tmp['text']); + $cache_data = ob_get_flush(); + $e107cache->set($cacheString, $cache_data); + $e107cache->set($cachePageTitle, $tmp['title']."^".$tmp['comment_flag']); + $comment_flag = $tmp['comment_flag']; + } + + if($com = $page -> pageComment($comment_flag)) + { + echo $com['comment'].$com['comment_form']; + } +} + +require_once(FOOTERF); + +/* EOF */ + +class pageClass +{ + + var $bullet; /* bullet image */ + var $pageText; /* main text of selected page, not parsed */ + var $multipageFlag; /* flag - true if multiple page page, false if not */ + var $pageTitles; /* array containing page titles */ + var $pageID; /* id number of page to be displayed */ + var $pageSelected; /* selected page of multiple page page */ + var $pageToRender; /* parsed page to be sent to screen */ + var $debug; /* temp debug flag */ + var $title; /* title of page, it if has one (as defined in [newpage=title] tag */ + + + function pageClass($debug=FALSE) + { + /* constructor */ + + $tmp = explode(".", e_QUERY); + $this -> pageID = intval($tmp[0]); + $this -> pageSelected = (isset($tmp[1]) ? intval($tmp[1]) : 0); + if(defined("BULLET")) + { + $this -> bullet = ""; + } + elseif(file_exists(THEME."images/bullet2.gif")) + { + $this -> bullet = "bullet"; + + } + else + { + $this -> bullet = ""; + } + + $this -> debug = $debug; + + if($this -> debug) + { + $this -> debug = "PageID ".$this -> pageID."
        "; + $this -> debug .= "pageSelected ".$this -> pageSelected."
        "; + } + } + + function listPages() + { + global $pref, $sql, $ns; + + if(!$pref['listPages']) + { + message_handler("MESSAGE", LAN_PAGE_1); + } + else + { + if(!$sql -> db_Select("page", "*", "page_theme='' AND page_class IN (".USERCLASS_LIST.") ")) + { + $text = LAN_PAGE_2; + } + else + { + $pageArray = $sql -> db_getList(); + foreach($pageArray as $page) + { + extract($page); + $text .= $this -> bullet." ".$page_title."
        "; + } + $ns -> tablerender(LAN_PAGE_11, $text,"cpage_list"); + } + } + } + + + function showPage() + { + global $sql, $ns; + $query = "SELECT p.*, u.user_id, u.user_name FROM #page AS p + LEFT JOIN #user AS u ON p.page_author = u.user_id + WHERE p.page_id='".intval($this -> pageID)."' AND p.page_class IN (".USERCLASS_LIST.") "; + + if(!$sql -> db_Select_gen($query) && !$_GET['elan']) + { + $ret['title'] = LAN_PAGE_12; // ***** CHANGED + $ret['text'] = LAN_PAGE_3; + $ret['comment_flag'] = ''; + $ret['err'] = TRUE; + return $ret; + } + + extract($sql -> db_Fetch()); + + $this -> pageText = $page_text; + + $this -> pageCheckPerms($page_class, $page_password); + + if($this -> debug) + { + echo "pageText ".$this -> pageText."
        "; + } + + $this -> parsePage(); + + $gen = new convert; + + if($page_author) + { + $text = "
        ".$user_name.", ".$gen->convert_date($page_datestamp, "long")."

        "; + } + + if($this -> title) + { + $text .= "".$this -> title."

        "; + } + + $text .= $this -> pageToRender; + $text .= $this -> pageIndex(); + $text .= $this -> pageRating($page_rating_flag); + + $ret['title'] = $page_title; + $ret['text'] = $text; + $ret['comment_flag'] = $page_comment_flag; + $ret['err'] = FALSE; + + return $ret; + } + + function parsePage() + { + global $tp; + if(preg_match_all("/\[newpage.*?\]/si", $this -> pageText, $pt)) + { + $pages = preg_split("/\[newpage.*?\]/si", $this -> pageText, -1, PREG_SPLIT_NO_EMPTY); + $this -> multipageFlag = TRUE; + } + else + { + $this -> pageToRender = $tp -> toHTML($this -> pageText, TRUE, 'parse_sc, constants'); + return; + } + + foreach($pt[0] as $title) + { + $this -> pageTitles[] = $title; + } + + + if(!trim($pages[0])) + { + $count = 0; + foreach($pages as $page) + { + $pages[$count] = $pages[($count+1)]; + $count++; + } + unset($pages[(count($pages)-1)]); + } + + $pageCount = count($pages); + $titleCount = count($this -> pageTitles); + /* if the vars above don't match, page 1 has no [newpage] tag, so we need to create one ... */ + + if($pageCount != $titleCount) + { + array_unshift($this -> pageTitles, "[newpage]"); + } + + /* ok, titles now match pages, rename the titles if needed ... */ + + $count =0; + foreach($this -> pageTitles as $title) + { + $titlep = preg_replace("/\[newpage=(.*?)\]/", "\\1", $title); + $this -> pageTitles[$count] = ($titlep == "[newpage]" ? LAN_PAGE_13." ".($count+1)." " : $tp -> toHTML($titlep, TRUE, 'parse_sc, constants,emotes_off,no_make_clickable')); + $count++; + } + + $this -> pageToRender = $tp -> toHTML($pages[$this -> pageSelected], TRUE, 'parse_sc, constants'); + $this -> title = (substr($this -> pageTitles[$this -> pageSelected], -1) == ";" ? "" : $this -> pageTitles[$this -> pageSelected]); + + if($this -> debug) + { + echo "multipageFlag ".$this -> multipageFlag."
        "; + if($this -> multipageFlag) + { + echo "
        "; print_r($pages); echo "
        "; + echo "pageCount ".$pageCount."
        "; + echo "titleCount ".$titleCount."
        "; + echo "
        "; print_r($this -> pageTitles); echo "
        "; + } + } + } + + function pageIndex() + { + $itext = "

        "; + $count = 0; + foreach($this -> pageTitles as $title) + { + $itext .= $this -> bullet." ".($count == $this -> pageSelected ? $title : "".$title."")."
        \n"; + $count++; + } + return $itext; + } + + function pageRating($page_rating_flag) + { + if($page_rating_flag) + { + require_once(e_HANDLER."rate_class.php"); + $rater = new rater; + $rate_text = "
        "; + + if ($ratearray = $rater->getrating("page", $this -> pageID)) + { + if ($ratearray[2] == "") + { + $ratearray[2] = 0; + } + $rate_text .= "\n"; + $rate_text .= " ".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]." "; + $rate_text .= ($ratearray[0] == 1 ? "vote" : "votes"); + } + else + { + $rating .= LAN_PAGE_dl_13; + } + $rate_text .= ""; + + if (!$rater->checkrated("page", $this -> pageID) && USER) + { + $rate_text .= $rater->rateselect("     ".LAN_PAGE_4."", "page", $this -> pageID); + } + else if(!USER) + { + $rate_text .= " "; + } + else + { + $rate_text .= LAN_PAGE_5; + } + $rate_text .= "
        "; + } + return $rate_text; + } + + function pageComment($page_comment_flag) + { + global $sql, $ns, $e107cache, $tp, $comment_shortcodes,$cacheString; + + if($page_comment_flag) + { + require_once(e_HANDLER."comment_class.php"); + $cobj = new comment; + + if (isset($_POST['commentsubmit'])) + { + $cobj->enter_comment($_POST['author_name'], $_POST['comment'], "page", $this -> pageID, $pid, $_POST['subject']); + $e107cache->clear("comment.page.".$this -> pageID); + $e107cache->clear($cacheString); + } + + return $cobj->compose_comment("page", "comment", $this -> pageID, $width="", $subject="", $showrate=FALSE, $return=TRUE); + } + } + + function pageCheckPerms($page_class, $page_password) + { + global $ns, $tp, $HEADER, $FOOTER, $sql; // $tp added + + if (!check_class($page_class)) + { + message_handler("MESSAGE", LAN_PAGE_6); + require_once(FOOTERF); exit; + } + + if (!$page_password) + { + return TRUE; + } + + if($_POST['submit_page_pw']) + { + if($_POST['page_pw'] == $page_password) + { + $this -> setPageCookie(); + } + } + else + { + $cookiename = "e107page_".$this -> pageID; + + if($_COOKIE[$cookiename] == md5($page_password.USERID)) + { + return TRUE; + } + } + + if ($_POST['submit_page_pw']) + { + message_handler("MESSAGE", LAN_PAGE_7); + } + + $pw_entry_text = " +
        +
        + + + + + + + + + + + + +
        ".LAN_PAGE_8."
        ".LAN_PAGE_9.":
        +
        +
        + "; + // Mustn't return to higher level code here + + // HEADERF requires that $tp is defined - hence declared as global above. + require_once(HEADERF); + $ns->tablerender(" ", $pw_entry_text); // HEADERF also clears $text - hence different variable + require_once(FOOTERF); + exit; + } + + function setPageCookie() + { + global $pref; + $pref['pageCookieExpire'] = max($pref['pageCookieExpire'], 120); + $hash = md5($_POST['page_pw'].USERID); + cookie("e107page_".e_QUERY, $hash, (time() + $pref['pageCookieExpire'])); + header("location:".e_SELF."?".e_QUERY); + exit; + } +} + +?> \ No newline at end of file diff --git a/print.php b/print.php new file mode 100644 index 000000000..9d171043d --- /dev/null +++ b/print.php @@ -0,0 +1,102 @@ +db_Select("news", "*", "news_id='{$parms}'"); + $row = $sql->db_Fetch(); + extract($row); + $news_body = $tp->toHTML($news_body, TRUE); + $news_extended = $tp->toHTML($news_extended, TRUE); + if ($news_author == 0) + { + $a_name = "e107"; + $category_name = "e107 welcome message"; + } + else + { + $sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'"); + list($category_id, $category_name) = $sql->db_Fetch(); + $sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'"); + list($a_id, $a_name) = $sql->db_Fetch(); + } + $news_datestamp = $con->convert_date($news_datestamp, "long"); + $text = " + ".LAN_PRINT_135.": ".$news_title." +
        + (".LAN_PRINT_86." ".$category_name.") +
        + ".LAN_PRINT_94." ".$a_name."
        + ".$news_datestamp." +

        ". + $news_body; + + if ($news_extended != ""){ $text .= "

        ".$news_extended; } + if ($news_source != ""){ $text .= "

        ".$news_source; } + if ($news_url != ""){ $text .= "
        ".$news_url; } + + $text .= "


        ". + LAN_PRINT_303.SITENAME." +
        + ( http://".$_SERVER[HTTP_HOST].e_HTTP."comment.php?comment.news.".$news_id." ) + "; +} + +if(defined("TEXTDIRECTION") && TEXTDIRECTION == "rtl"){ + $align = 'right'; +}else{ + $align = 'left'; +} + +echo " +
        ".$tp->parseTemplate("{LOGO}", TRUE)."


        +
        ".$text."


        +
        "; + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/rate.php b/rate.php new file mode 100644 index 000000000..2653b1f72 --- /dev/null +++ b/rate.php @@ -0,0 +1,60 @@ + 10 || $qs[3] < 1 || strpos($qs[2], '://') !== false) +{ + header("location:".e_BASE."index.php"); + exit; +} + +$table = $tp -> toDB($qs[0]); +$itemid = intval($qs[1]); +$returnurl = $tp -> toDB($qs[2]); +$rate = intval($qs[3]); + +if ($sql -> db_Select("rate", "*", "rate_table='{$table}' AND rate_itemid='{$itemid}'")) +{ + $row = $sql -> db_Fetch(); + if(strpos($row['rate_voters'], ".".USERID.".") === FALSE) + { + $rate_voters = $row['rate_voters'].".".USERID."."; + $new_rating = $row['rate_rating']+$rate; + $sql -> db_Update("rate", "rate_votes=rate_votes+1, rate_rating='{$new_rating}', rate_voters='{$rate_voters}' WHERE rate_itemid='{$itemid}' "); + } + else + { + header("location:".e_BASE."index.php"); + exit; + } +} +else +{ + $sql->db_Insert("rate", " 0, '{$table}', '{$itemid}', '{$rate}', '1', '.".USERID.".' "); +} + +header("location:".$returnurl); +exit; + +?> \ No newline at end of file diff --git a/request.php b/request.php new file mode 100644 index 000000000..8868f4cf6 --- /dev/null +++ b/request.php @@ -0,0 +1,405 @@ +base_path}"); + exit(); +} + +$id = FALSE; +if (!is_numeric(e_QUERY)) { + if ($sql->db_Select("download", "download_id", "download_url='".$tp -> toDB(e_QUERY)."'")) { + $row = $sql->db_Fetch(); + $type = "file"; + $id = $row['download_id']; + } else if(strstr(e_QUERY, "http://") || strstr(e_QUERY, "ftp://" || strstr(e_QUERY, "https://"))) { + header("location: ".e_QUERY); + exit(); + } else if(file_exists($DOWNLOADS_DIRECTORY.e_QUERY)) { + send_file($DOWNLOADS_DIRECTORY.e_QUERY); + exit(); + } +} + +if(strstr(e_QUERY, "mirror")) { + list($action, $download_id, $mirror_id) = explode(".", e_QUERY); + $download_id = intval($download_id); + $mirror_id = intval($mirror_id); + $qry = "SELECT d.*, dc.download_category_class FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_id WHERE d.download_id = {$download_id}"; + if ($sql->db_Select_gen($qry)) { + $row = $sql->db_Fetch(); + extract($row); + if (check_class($download_category_class) && check_class($download_class)) { + if($pref['download_limits'] && $download_active == 1) { + check_download_limits(); + } + $mirrorList = explode(chr(1), $download_mirror); + $mstr = ""; + foreach($mirrorList as $mirror) { + if($mirror) { + $tmp = explode(",", $mirror); + $mid = intval($tmp[0]); + $address = $tmp[1]; + $requests = $tmp[2]; + if($tmp[0] == $mirror_id) { + $gaddress = $address; + $requests ++; + } + $mstr .= $mid.",".$address.",".$requests.chr(1); + } + } + $sql->db_Update("download", "download_requested = download_requested + 1, download_mirror = '{$mstr}' WHERE download_id = '".intval($download_id)."'"); + $sql->db_Update("download_mirror", "mirror_count = mirror_count + 1 WHERE mirror_id = '".intval($mirror_id)."'"); + header("Location: {$gaddress}"); + exit(); + } + } +} + +$tmp = explode(".", e_QUERY); +if (!$tmp[1] || strstr(e_QUERY, "pub_")) { + $id = intval($tmp[0]); + $type = "file"; +} else { + $table = preg_replace("#\W#", "", $tp -> toDB($tmp[0], true)); + $id = intval($tmp[1]); + $type = "image"; +} + +if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY)) { + if(strstr(e_QUERY, "pub_")) + { + $bid = str_replace("pub_", "", e_QUERY); + if (file_exists(e_FILE."public/".$bid)) + { + send_file(e_FILE."public/".$bid); + exit(); + } + } + if (file_exists($DOWNLOADS_DIRECTORY.e_QUERY)) { + send_file($DOWNLOADS_DIRECTORY.e_QUERY); + exit(); + } + require_once(HEADERF); + $ns->tablerender(LAN_dl_61, "
        ".LAN_dl_65."\n

        \n".LAN_dl_64."
        "); + require_once(FOOTERF); + exit(); +} + +if ($type == "file") +{ + $qry = "SELECT d.*, dc.download_category_class FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_category WHERE d.download_id = {$id}"; + if ($sql->db_Select_gen($qry)) { + $row = $sql->db_Fetch(); + if (check_class($row['download_category_class']) && check_class($row['download_class'])) { + if($pref['download_limits'] && $row['download_active'] == 1) { + check_download_limits(); + } + extract($row); + if($download_mirror) { + $array = explode(chr(1), $download_mirror); + $c = (count($array)-1); + for ($i=1; $i < $c; $i++) { + $d = mt_rand(0, $i); + $tmp = $array[$i]; + $array[$i] = $array[$d]; + $array[$d] = $tmp; + } + $tmp = explode(",", $array[0]); + $mirror_id = $tmp[0]; + $mstr = ""; + foreach($array as $mirror) { + if($mirror) { + $tmp = explode(",", $mirror); + $mid = $tmp[0]; + $address = $tmp[1]; + $requests = $tmp[2]; + if($tmp[0] == $mirror_id) { + $gaddress = $address; + $requests ++; + } + $mstr .= "{$mid}, {$address}, {$requests}".chr(1); + } + } + $sql -> db_Update("download", "download_requested = download_requested + 1, download_mirror = '{$mstr}' WHERE download_id = '".intval($download_id)."'"); + $sql -> db_Update("download_mirror", "mirror_count = mirror_count + 1 WHERE mirror_id = '".intval($mirror_id)."'"); + + header("Location: ".$gaddress); + exit(); + } + + // increment download count + $sql->db_Update("download", "download_requested = download_requested + 1 WHERE download_id = '{$id}'"); + $user_id = USER ? USERID : 0; + $ip = $e107->getip(); + $request_data = "'0', '{$user_id}', '{$ip}', '{$id}', '".time()."'"; + //add request info to db + $sql->db_Insert("download_requests", $request_data, FALSE); + if (preg_match("/Binary\s(.*?)\/.*/", $download_url, $result)) { + $bid = $result[1]; + $result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'"); + $binary_data = @mysql_result($result, 0, "binary_data"); + $binary_filetype = @mysql_result($result, 0, "binary_filetype"); + $binary_name = @mysql_result($result, 0, "binary_name"); + header("Content-type: {$binary_filetype}"); + header("Content-length: {$download_filesize}"); + header("Content-Disposition: attachment; filename={$binary_name}"); + header("Content-Description: PHP Generated Data"); + echo $binary_data; + exit(); + } + if (strstr($download_url, "http://") || strstr($download_url, "ftp://") || strstr($download_url, "https://")) { + header("Location: {$download_url}"); + exit(); + } else { + if (file_exists($DOWNLOADS_DIRECTORY.$download_url)) { + send_file($DOWNLOADS_DIRECTORY.$download_url); + exit(); + } else if(file_exists(e_FILE."public/{$download_url}")) { + send_file(e_FILE."public/{$download_url}"); + exit(); + } + } + } else { + // Download Access Denied. + if((!strpos($pref['download_denied'],".php") && + !strpos($pref['download_denied'],".htm") && + !strpos($pref['download_denied'],".html") && + !strpos($pref['download_denied'],".shtml") || + (strpos($pref['download_denied'],"signup.php") && USER == TRUE) + )){ + require_once(HEADERF); + $denied_message = ($pref['download_denied'] && !strpos($pref['download_denied'],"signup.php")) ? $tp->toHTML($pref['download_denied'],"","defs") : LAN_dl_63; + $ns -> tablerender(LAN_dl_61, $denied_message); + require_once(FOOTERF); + exit(); + }else{ + header("Location: ".trim($pref['download_denied'])); + } + } + } + else if(strstr(e_QUERY, "pub_")) + { + /* check to see if public upload and not in download table ... */ + $bid = str_replace("pub_", "", e_QUERY); + if($result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '$bid' ")) + { + $binary_data = @mysql_result($result, 0, "binary_data"); + $binary_filetype = @mysql_result($result, 0, "binary_filetype"); + $binary_name = @mysql_result($result, 0, "binary_name"); + header("Content-type: {$binary_filetype}"); + header("Content-length: {$download_filesize}"); + header("Content-Disposition: attachment; filename={$binary_name}"); + header("Content-Description: PHP Generated Data"); + echo $binary_data; + exit(); + } + } + + require_once(HEADERF); + $ns -> tablerender(LAN_dl_61, "
        ".LAN_dl_65."

        ".LAN_dl_64."
        "); + require_once(FOOTERF); + exit(); +} + +$sql->db_Select($table, "*", "{$table}_id = '{$id}'"); +$row = $sql->db_Fetch(); +extract($row); +$image = ($table == "upload" ? $upload_ss : $download_image); +if (preg_match("/Binary\s(.*?)\/.*/", $image, $result)) { + $bid = $result[1]; + $result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'"); + $binary_data = @mysql_result($result, 0, "binary_data"); + $binary_filetype = @mysql_result($result, 0, "binary_filetype"); + $binary_name = @mysql_result($result, 0, "binary_name"); + header("Content-type: {$binary_filetype}"); + header("Content-Disposition: inline; filename={$binary_name}"); + echo $binary_data; + exit(); +} + +$image = ($table == "upload" ? $upload_ss : $download_image); + +if (strpos($image, "http") !== FALSE) { + header("Location: {$image}"); + exit(); +} else { + if ($table == "download") { + require_once(HEADERF); + if (file_exists(e_FILE."download/{$image}")) { + $disp = "
        "; + } + else if(file_exists(e_FILE."downloadimages/{$image}")) { + $disp = "
        "; + } else { + $disp = "
        "; + } + $disp .= "
        "; + $ns->tablerender($image, $disp); + + require_once(FOOTERF); + } else { + if (is_file(e_FILE."public/{$image}")) { + echo ""; + } elseif(is_file(e_FILE."downloadimages/{$image}")) { + echo ""; + } else { + require_once(HEADERF); + $ns -> tablerender(LAN_dl_61, "
        ".LAN_dl_65."

        ".LAN_dl_64."
        "); + require_once(FOOTERF); + exit; + } + exit(); + } +} + +// File retrieval function. by Cam. +function send_file($file) { + global $pref, $DOWNLOADS_DIRECTORY,$FILES_DIRECTORY, $e107; + if (!$pref['download_php']) + { + header("Location: ".SITEURL.$file); + exit(); + } + @set_time_limit(10 * 60); + @e107_ini_set("max_execution_time", 10 * 60); + while (@ob_end_clean()); // kill all output buffering else it eats server resources + $filename = $file; + $file = basename($file); + $path = realpath($filename); + $path_downloads = realpath($DOWNLOADS_DIRECTORY); + $path_public = realpath($FILES_DIRECTORY."public/"); + if(!strstr($path, $path_downloads) && !strstr($path,$path_public)) { + if(E107_DEBUG_LEVEL > 0 && ADMIN){ + echo "Failed to Download ".$file."
        "; + echo "The file-path ".$path." didn't match with either $path_downloads or $path_public
        "; + exit(); + }else{ + header("location: {$e107->base_path}"); + exit(); + } + } else { + if (is_file($filename) && is_readable($filename) && connection_status() == 0) { + if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) + { + $file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1); + } + if (isset($_SERVER['HTTP_RANGE'])) + { + $seek = intval(substr($_SERVER['HTTP_RANGE'] , strlen('bytes='))); + } + $bufsize = 2048; + ignore_user_abort(true); + $data_len = filesize($filename); + if ($seek > ($data_len - 1)) { $seek = 0; } + if ($filename == null) { $filename = basename($this->data); } + $res =& fopen($filename, 'rb'); + if ($seek) + { + fseek($res , $seek); + } + $data_len -= $seek; + header("Expires: 0"); + header("Cache-Control: max-age=30" ); + header("Content-Type: application/force-download"); + header("Content-Disposition: attachment; filename=\"{$file}\""); + header("Content-Length: {$data_len}"); + header("Pragma: public"); + if ($seek) + { + header("Accept-Ranges: bytes"); + header("HTTP/1.0 206 Partial Content"); + header("status: 206 Partial Content"); + header("Content-Range: bytes {$seek}-".($data_len - 1)."/{$data_len}"); + } + while (!connection_aborted() && $data_len > 0) + { + echo fread($res , $bufsize); + $data_len -= $bufsize; + } + fclose($res); + } else { + + if(E107_DEBUG_LEVEL > 0 && ADMIN){ + echo "file failed =".$file."
        "; + echo "path =".$path."
        "; + exit(); + }else{ + header("location: ".e_BASE."index.php"); + exit(); + } + } + } +} +function check_download_limits() { + global $pref, $sql, $ns, $HEADER, $e107, $tp; + // Check download count limits + $qry = "SELECT gen_intdata, gen_chardata, (gen_intdata/gen_chardata) as count_perday FROM #generic WHERE gen_type = 'download_limit' AND gen_datestamp IN (".USERCLASS_LIST.") AND (gen_chardata >= 0 AND gen_intdata >= 0) ORDER BY count_perday DESC"; + if($sql->db_Select_gen($qry)) { + $limits = $sql->db_Fetch(); + $cutoff = time() - (86400 * $limits['gen_chardata']); + if(USER) { + $where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_userid = ".USERID; + } else { + $ip = $e107->getip(); + $where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_ip = '{$ip}'"; + } + $qry = "SELECT COUNT(d.download_id) as count FROM #download_requests as dr LEFT JOIN #download as d ON dr.download_request_download_id = d.download_id AND d.download_active = 1 WHERE {$where} GROUP by dr.download_request_userid"; + if($sql->db_Select_gen($qry)) { + $row=$sql->db_Fetch(); + if($row['count'] >= $limits['gen_intdata']) { + // Exceeded download count limit + + require_once(HEADERF); + $ns->tablerender(LAN_dl_61, LAN_dl_62); + require(FOOTERF); + exit(); + } + } + } + // Check download bandwidth limits + $qry = "SELECT gen_user_id, gen_ip, (gen_user_id/gen_ip) as bw_perday FROM #generic WHERE gen_type='download_limit' AND gen_datestamp IN (".USERCLASS_LIST.") AND (gen_user_id >= 0 AND gen_ip >= 0) ORDER BY bw_perday DESC"; + if($sql->db_Select_gen($qry)) { + $limit = $sql->db_Fetch(); + $cutoff = time() - (86400*$limit['gen_ip']); + if(USER) { + $where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_userid = ".USERID; + } else { + $ip = $e107->getip(); + $where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_ip = '{$ip}'"; + } + $qry = "SELECT SUM(d.download_filesize) as total_bw FROM #download_requests as dr LEFT JOIN #download as d ON dr.download_request_download_id = d.download_id AND d.download_active = 1 WHERE {$where} GROUP by dr.download_request_userid"; + if($sql->db_Select_gen($qry)) { + $row=$sql->db_Fetch(); + if($row['total_bw'] / 1024 > $limit['gen_user_id']) { + //Exceed bandwith limit + require(HEADERF); + $ns->tablerender(LAN_dl_61, LAN_dl_62); + require(FOOTERF); + exit(); + } + } + } +} + +?> \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100644 index 000000000..95d82dae9 --- /dev/null +++ b/robots.txt @@ -0,0 +1,5 @@ +User-agent: * +Disallow: /e107_admin/ +Disallow: /e107_handlers/ +Disallow: /e107_files/cache/ +Disallow: /e107_files/public/avatars/ diff --git a/search.php b/search.php new file mode 100644 index 000000000..b085f9cc6 --- /dev/null +++ b/search.php @@ -0,0 +1,548 @@ + tablerender(LAN_SEARCH_20, "
        ".LAN_SEARCH_21."
        "); + require_once(FOOTERF); + exit; +} + +if($_GET['t'] == '0'){$_GET['t'] = 'news';} +if($_GET['t'] == 1){$_GET['t'] = 'comments';} +if($_GET['t'] == 2){$_GET['t'] = 'users';} +if($_GET['t'] == 3){$_GET['t'] = 'downloads';} +if($_GET['t'] == 4){$_GET['t'] = 'pages';} + +$search_prefs = $sysprefs -> getArray('search_prefs'); + +// load search routines +$search_info = array(); +$auto_order = 1000; +function search_info($id, $type, $plug_require, $info='') { + global $tp, $search_prefs, $auto_order; + if (check_class($search_prefs[$type.'_handlers'][$id]['class'])) { + if ($plug_require) { + require_once($plug_require); + $ret = $search_info[0]; + } else { + $ret = $info; + } + $ret['chars'] = $search_prefs[$type.'_handlers'][$id]['chars']; + $ret['results'] = $search_prefs[$type.'_handlers'][$id]['results']; + $ret['pre_title'] = $search_prefs[$type.'_handlers'][$id]['pre_title']; + $ret['pre_title_alt'] = $tp -> toHtml($search_prefs[$type.'_handlers'][$id]['pre_title_alt']); + $ret['order'] = (isset($search_prefs[$type.'_handlers'][$id]['order']) && $search_prefs[$type.'_handlers'][$id]['order']) ? $search_prefs[$type.'_handlers'][$id]['order'] : $auto_order; + $auto_order++; + return $ret; + } else { + return false; + } +} + +//core search routines + +if ($search_info['news'] = search_info('news', 'core', false, array('sfile' => e_HANDLER.'search/search_news.php', 'qtype' => LAN_98, 'refpage' => 'news.php', 'advanced' => e_HANDLER.'search/advanced_news.php', 'id' => 'news'))) { + // $search_id++; +} else { + unset($search_info['news']); +} + +if ($search_info['comments'] = search_info('comments', 'core', false, array('sfile' => e_HANDLER.'search/search_comment.php', 'qtype' => LAN_99, 'refpage' => 'comment.php', 'advanced' => e_HANDLER.'search/advanced_comment.php', 'id' => 'comment'))) { + // $search_id++; +} else { + unset($search_info['comments']); +} + +if ($search_info['users'] = search_info('users', 'core', false, array('sfile' => e_HANDLER.'search/search_user.php', 'qtype' => LAN_140, 'refpage' => 'user.php', 'advanced' => e_HANDLER.'search/advanced_user.php', 'id' => 'user'))) { + // $search_id++; +} else { + unset($search_info['users']); +} + +if ($search_info['downloads'] = search_info('downloads', 'core', false, array('sfile' => e_HANDLER.'search/search_download.php', 'qtype' => LAN_197, 'refpage' => 'download.php', 'advanced' => e_HANDLER.'search/advanced_download.php', 'id' => 'download'))) { + // $search_id++; +} else { + unset($search_info['downloads']); +} + +if ($search_info['pages'] = search_info('pages', 'core', false, array('sfile' => e_HANDLER.'search/search_pages.php', 'qtype' => LAN_418, 'refpage' => 'page.php', 'advanced' => e_HANDLER.'search/advanced_pages.php', 'id' => 'pages'))) { + // $search_id++; +} else { + unset($search_info['pages']); +} + +//plugin search routines // plugin folder is used as the search key. ie. $_GET['t'] = 'chatbox'; +foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) { + if (is_readable(e_PLUGIN.$plug_dir."/e_search.php")) { + if ($search_info[$plug_dir] = search_info($plug_dir, 'plug', e_PLUGIN.$plug_dir."/e_search.php")) { + // $search_id++; + } else { + unset($search_info[$plug_dir]); + } + } +} + + +// order search routines +function array_sort($array, $column, $order = SORT_DESC) { + $i = 0; + foreach($array as $info) { + $sortarr[] = $info[$column]; + $i++; + } + array_multisort($sortarr, $order, $array, $order); + return($array); +} + + $search_info = array_sort($search_info, 'order', SORT_ASC); + +// validate search query +$perform_search = true; + +function magic_search($data) { + foreach ($data as $key => $value) { + if (is_array($value)) { + $data[$key] = magic_search($value); + } else { + $data[$key] = stripslashes($value); + } + } + return $data; +} + +if (!e_QUERY) { + $enhanced = true; +} + +if (isset($_GET['q']) || isset($_GET['in']) || isset($_GET['ex']) || isset($_GET['ep']) || isset($_GET['beg'])) { + if (MAGIC_QUOTES_GPC == true) { + $_GET = magic_search($_GET); + } + $full_query = $_GET['q']; + if ($_GET['in']) { + $en_in = explode(' ', $_GET['in']); + foreach ($en_in as $en_in_key) { + $full_query .= " +".$en_in_key; + } + $enhanced = true; + } + if ($_GET['ex']) { + $en_ex = explode(' ', $_GET['ex']); + foreach ($en_ex as $en_ex_key) { + $full_query .= " -".$en_ex_key; + } + $enhanced = true; + } + if ($_GET['ep']) { + $full_query .= " \"".$_GET['ep']."\""; + $enhanced = true; + } + if ($_GET['be']) { + $en_be = explode(' ', $_GET['be']); + foreach ($en_be as $en_be_key) { + $full_query .= " ".$en_be_key."*"; + } + $enhanced = true; + } + + if (isset($_GET['r']) && !is_numeric($_GET['r'])) { + $perform_search = false; + $SEARCH_MESSAGE = LAN_201; + $result_flag = 0; + } else if (strlen($full_query) == 0) { + $perform_search = false; + $SEARCH_MESSAGE = LAN_201; + } else if (strlen($full_query) < 3) { + $perform_search = false; + $SEARCH_MESSAGE = LAN_417; + } else if ($search_prefs['time_restrict']) { + $time = time() - $search_prefs['time_secs']; + $query_check = $tp -> toDB($full_query); + $ip = getip(); + if ($sql -> db_Select("tmp", "tmp_ip, tmp_time, tmp_info", "tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'")) { + $row = $sql -> db_Fetch(); + if (($row['tmp_time'] > $time) && ($row['tmp_info'] != 'type_search '.$query_check)) { + $perform_search = false; + $SEARCH_MESSAGE = LAN_SEARCH_17.$search_prefs['time_secs'].LAN_SEARCH_18; + } else { + $sql -> db_Update("tmp", "tmp_time='".time()."', tmp_info='type_search ".$query_check."' WHERE tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'"); + } + } else { + $sql -> db_Insert("tmp", "'".$ip."', '".time()."', 'type_search ".$query_check."'"); + } + } + if ($perform_search) { + $result_flag = $_GET['r']; + } + $query = trim($full_query); +} + +// forward user if searching in google +$search_count = count($search_info); +$google_id = $search_count + 1; +if ($search_prefs['selector'] == 1) { + if ($perform_search && isset($_GET['t'][$google_id]) && $_GET['t'][$google_id]) { + header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query))); + exit; + } +} else { + if ($perform_search && isset($_GET['t']) && $_GET['t'] == $google_id) { + header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query))); + exit; + } +} + +// determine areas being searched +if (!$search_prefs['user_select'] && $_GET['r'] < 1) { + foreach($search_info as $key => $value) { + $searchtype[$key] = true; + } +} else { + if (isset($_GET['t'])) { + if (is_array($_GET['t'])) { + $searchtype = $_GET['t']; + } else { + $searchtype[$_GET['t']] = true; + } + } else { + if (isset($_GET['ref'])) { + foreach($search_info as $key => $value) { + if ($value['id'] == $_GET['ref']) { + $searchtype[$key] = true; + $_GET['t'] = $key; + } + } + } else if (e_QUERY) { + if (isset($_SERVER['HTTP_REFERER'])) { + if (!$refpage = substr($_SERVER['HTTP_REFERER'], (strrpos($_SERVER['HTTP_REFERER'], "/")+1))) { + $refpage = "index.php"; + } + } else { + $refpage = ""; + } + + foreach($search_info as $key => $value) { + if ($value['refpage']) { + if (strpos($refpage, $value['refpage']) !== FALSE) { + $searchtype[$key] = true; + $_GET['t'] = $key; + } + } + } + } + + if (!isset($searchtype) && isset($query)) { + if ($search_prefs['multisearch']) { + $searchtype['all'] = true; + } else { + $searchtype[0] = true; + } + } + } +} + +// standard search config +if ($search_prefs['selector'] == 2) { + $SEARCH_DROPDOWN = "".$value['qtype'].$POST_CHECKBOXES; + } else { + $SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."".$value['qtype'].$POST_CHECKBOXES; + } +} + +if (check_class($search_prefs['google'])) { + if ($search_prefs['selector'] == 2) { + $SEARCH_DROPDOWN .= ""; + } else if ($search_prefs['selector'] == 1) { + $SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."Google".$POST_CHECKBOXES; + } else { + $SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."Google".$POST_CHECKBOXES; + } +} + +if ($search_prefs['selector'] == 2) { + $SEARCH_DROPDOWN .= ""; +} + +$value = isset($_GET['q']) ? $tp -> post_toForm($_GET['q']) : ""; +$SEARCH_MAIN_SEARCHFIELD = ""; +if ($search_prefs['selector'] == 1) { + $SEARCH_MAIN_CHECKALL = ""; + $SEARCH_MAIN_UNCHECKALL = ""; +} + +$SEARCH_MAIN_SUBMIT = ""; + +$ENHANCED_ICON = ""; + +$enhanced_types['in'] = LAN_SEARCH_24.':'; +$enhanced_types['ex'] = LAN_SEARCH_25.':'; +$enhanced_types['ep'] = LAN_SEARCH_26.':'; +$enhanced_types['be'] = LAN_SEARCH_27.':'; + +$ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'"; + +// advanced search config +if (!$_GET['adv'] || $_GET['t'] == 'all') { + foreach ($_GET as $gk => $gv) { + if ($gk != 't' && $gk != 'q' && $gk != 'r' && $gk != 'in' && $gk != 'ex' && $gk != 'ep' && $gk != 'be' && $gk != 'adv') { + unset($_GET[$gk]); + } + } +} + +$SEARCH_TYPE_SEL = " ".LAN_SEARCH_29."  + ".LAN_SEARCH_30; + +foreach ($search_info as $key => $value) { + if (!isset($search_info[$key]['advanced'])) { + $js_adv .= " && abid != ".$key; + } +} + +if (isset($search_info[$_GET['t']]['advanced'])) { + $SEARCH_TYPE_DISPLAY = ""; +} else { + $SEARCH_TYPE_DISPLAY = "style='display: none'"; +} + +if (check_class($search_prefs['google'])) { + $js_adv .= " && abid != ".$google_id; +} + +if ($perform_search) { + $con = new convert; + e107_require(e_HANDLER.'search_class.php'); + $sch = new e_search; + + // omitted words message + $stop_count = count($sch -> stop_keys); + if ($stop_count) { + if ($stop_count > 1) { + $SEARCH_MESSAGE = LAN_SEARCH_32.": "; + } else { + $SEARCH_MESSAGE = LAN_SEARCH_33.": "; + } + $i = 1; + foreach ($sch -> stop_keys as $stop_key) { + $SEARCH_MESSAGE .= $stop_key; + if ($i != $stop_count) { + $SEARCH_MESSAGE .= ', '; + } + $i++; + } + } +} + +require_once(HEADERF); + +// render search config + +if (!isset($SEARCH_TOP_TABLE)) { + if (file_exists(THEME."search_template.php")) { + require(THEME."search_template.php"); + } else { + require(e_BASE.$THEMES_DIRECTORY."templates/search_template.php"); + } +} + +$text = preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TOP_TABLE); +foreach ($enhanced_types as $en_id => $ENHANCED_TEXT) { + $ENHANCED_DISPLAY_ID = "en_".$en_id; + $ENHANCED_FIELD = ""; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_ENHANCED); +} +if ($search_prefs['user_select']) { + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_CATS); +} + +$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TYPE); + +if ($_GET['adv']) { + if (isset($search_info[$_GET['t']]['advanced'])) { + @require_once($search_info[$_GET['t']]['advanced']); + foreach ($advanced as $adv_key => $adv_value) { + if ($adv_value['type'] == 'single') { + $SEARCH_ADV_TEXT = $adv_value['text']; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_ADV_COMBO); + } else { + if ($adv_value['type'] == 'dropdown') { + $SEARCH_ADV_A = $adv_value['text']; + $SEARCH_ADV_B = ""; + } else if ($adv_value['type'] == 'date') { + $SEARCH_ADV_A = $adv_value['text']; + $SEARCH_ADV_B = " "; + } else if ($adv_value['type'] == 'author') { + require_once(e_HANDLER.'user_select_class.php'); + $us = new user_select; + $SEARCH_ADV_A = $adv_value['text']; + $SEARCH_ADV_B = $us -> select_form('popup', $adv_key, $_GET[$adv_key]); + } else if ($adv_value['type'] == 'dual') { + $SEARCH_ADV_A = $adv_value['adv_a']; + $SEARCH_ADV_B = $adv_value['adv_b']; + } + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_ADV); + } + } + } else { + $_GET['adv'] = 0; + } +} + +$text .= $SEARCH_MESSAGE ? preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TABLE_MSG) : ""; +$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_BOT_TABLE); + +$ns -> tablerender(PAGE_NAME." ".SITENAME, $text); + +// parse search +if ($perform_search) { + foreach ($search_info as $key => $a) { + if (isset($searchtype[$key]) || isset($searchtype['all'])) { + unset($text); + if (file_exists($search_info[$key]['sfile'])) { + $pre_title = ($search_info[$key]['pre_title'] == 2) ? $search_info[$key]['pre_title_alt'] : $search_info[$key]['pre_title']; + $search_chars = $search_info[$key]['chars']; + $search_res = $search_info[$key]['results']; + @require_once($search_info[$key]['sfile']); + $parms = $results.",".$search_res.",".$_GET['r'].",".e_SELF."?q=".$_GET['q']."&t=".$key."&r=[FROM]"; + $core_parms = array('r' => '', 'q' => '', 't' => '', 's' => ''); + foreach ($_GET as $pparm_key => $pparm_value) { + if (!isset($core_parms[$pparm_key])) { + $parms .= "&".$pparm_key."=".$_GET[$pparm_key]; + } + } + if ($results > $search_res) { + $nextprev = ($results > $search_res) ? $tp -> parseTemplate("{NEXTPREV={$parms}}") : ""; + $text .= "
        ".$nextprev."
        "; + } + if ($results > 0) { + $res_from = $_GET['r'] + 1; + $res_to = ($_GET['r'] + $search_res) > $results ? $results : ($_GET['r'] + $search_res); + $res_display = $res_from." - ".$res_to." ".LAN_SEARCH_12." ".$results; + } else { + $res_display = ""; + } + $ns->tablerender(LAN_SEARCH_11." ".$res_display." ".LAN_SEARCH_13." ".(isset($_GET[$advanced_caption['id']]) ? $advanced_caption['title'][$_GET[$advanced_caption['id']]] : $search_info[$key]['qtype']), $text); + } + } + } +} + +// old 6xx search parser for reverse compatability +function parsesearch($text, $match) { + $text = strip_tags($text); + $temp = stristr($text, $match); + $pos = strlen($text) - strlen($temp); + $matchedText = substr($text,$pos,strlen($match)); + if ($pos < 70) { + $text = "...".substr($text, 0, 100)."..."; + } else { + $text = "...".substr($text, ($pos-50), $pos+30)."..."; + } + $text = preg_replace("/".$match."/i", "".$matchedText."", $text); + return($text); +} + +function headerjs() { + global $search_count, $google_id, $search_prefs, $js_adv, $search_info; + if ($search_prefs['selector'] == 1) { + + $types = array_keys($search_info); + $types = implode("', '", $types); + + $script = ""; + + } + + $script .= ""; + + return $script; +} + +require_once(FOOTERF); + +?> \ No newline at end of file diff --git a/signup.php b/signup.php new file mode 100644 index 000000000..da66ea3dc --- /dev/null +++ b/signup.php @@ -0,0 +1,921 @@ + +if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1)) +{ + e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE); + e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE); + require_once(HEADERF); + + if(!$clean_email = check_email($tp -> toDB($_POST['resend_email']))) + { + $clean_email = "xxx"; + } + + if(!$new_email = check_email($tp -> toDB($_POST['resend_newemail']))) + { + $new_email = FALSE; + } + + + if($_POST['submit_resend']) + { + if($_POST['resend_email'] && !$new_email && $sql->db_Select_gen("SELECT * FROM #user WHERE user_ban=0 AND user_sess='' AND (user_loginname= \"".$tp->toDB($_POST['resend_email'])."\" OR user_name = \"".$tp->toDB($_POST['resend_email'])."\" OR user_email = \"".$clean_email."\" ) ")) + { + $ns -> tablerender(LAN_SIGNUP_40,LAN_SIGNUP_41."
        "); + require_once(FOOTERF); + exit; + } + + if(trim($_POST['resend_password']) !="" && $new_email) + { + if($sql->db_Select("user", "user_id", "user_password = \"".md5($_POST['resend_password'])."\" AND user_ban=2 AND user_sess !='' LIMIT 1")) + { + $row = $sql -> db_Fetch(); + if($sql->db_Update("user", "user_email='".$new_email."' WHERE user_id = '".$row['user_id']."' LIMIT 1 ")) + { + $clean_email = $new_email; + } + } + else + { + require_once(e_HANDLER."message_handler.php"); + message_handler("ALERT",LAN_SIGNUP_52); // Incorrect Password. + } + } + + if($sql->db_Select("user", "*", "(user_loginname = \"".$tp->toDB($_POST['resend_email'])."\" OR user_name = \"".$tp->toDB($_POST['resend_email'])."\" OR user_email = \"".$clean_email."\" ) AND user_ban=2 AND user_sess !='' LIMIT 1")) + { + $row = $sql -> db_Fetch(); + + $_POST['password1'] = "xxxxxxxxx"; + $_POST['loginname'] = $row['user_loginname']; + $_POST['name'] = $row['user_name']; + $nid = $row['user_id']; + $u_key = $row['user_sess']; + + $eml = render_email(); + $mailheader_e107id = $nid; + require_once(e_HANDLER."mail.php"); + + +/* echo "Sending to: ".$row['user_email']; + require_once(FOOTERF); + exit; +*/ + + if(!sendemail($row['user_email'], $eml['subject'], $eml['message'], $row['user_name'], "", "", $eml['attachments'], $eml['cc'], $eml['bcc'], $returnpath, $returnreceipt,$eml['inline-images'])) + { + $ns -> tablerender(LAN_ERROR,LAN_SIGNUP_42); + require_once(FOOTERF); + exit; + } + else + { + $ns -> tablerender(LAN_SIGNUP_43,LAN_SIGNUP_44." ".$row['user_email']." - ".LAN_SIGNUP_45."

        "); + require_once(FOOTERF); + exit; + } + } + exit; + } + elseif(!$_POST['submit_resend']) + { + + $text .= "
        +
        + + + + + + + + + + + + + + + + + + "; + + $text .=" + + +
        ".LAN_SIGNUP_48." + +
        ".LAN_SIGNUP_49."
        ".LAN_SIGNUP_50." +
        ".LAN_SIGNUP_51." + +
        "; + $text .= ""; // resend activation email. + $text .= "
        +
        +
        "; + + $ns -> tablerender(LAN_SIGNUP_47, $text); + require_once(FOOTERF); + exit; + } + + exit; +} + +// ------------------------------------------------------------------ + +if(!$_POST) // Notice Removal. +{ + + $error = ""; + $text = " "; + $password1 = ""; + $password2 = ""; + $email = ""; + $loginname = ""; + $realname = ""; + $user_timezone = ""; + $image = ""; + $avatar_upload = ""; + $photo_upload = ""; + $_POST['ue'] = ""; + $signature = ""; +} + +if(ADMIN && (e_QUERY == "preview" || e_QUERY == "test" || e_QUERY == "preview.aftersignup")) +{ + e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE); + e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE); + if(e_QUERY == "preview.aftersignup") + { + require_once(HEADERF); + if(trim($pref['signup_text_after'])) + { + $text = $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs')."
        "; + } + else + { + if ($pref['user_reg_veri'] == 2) + { + $text = LAN_SIGNUP_37; + } + else + { + $text = LAN_405; + } + } + $ns->tablerender(LAN_406, $text); + require_once(FOOTERF); + exit; + } + + $eml = render_email(TRUE); + echo $eml['preview']; + + if(e_QUERY == "test") + { + require_once(e_HANDLER."mail.php"); + $message = $eml['message']; + $subj = $eml['subject']; + $inline = $eml['inline-images']; + $Cc = $eml['cc']; + $Bcc = $eml['bcc']; + $attachments = $eml['attachments']; + + if(!sendemail(USEREMAIL, $subj, $message, USERNAME, "", "", $attachments, $Cc, $Bcc, $returnpath, $returnreceipt,$inline)) + { + echo "



          >> ".LAN_SIGNUP_42; // there was a problem. + } + else + { + echo "

          >> ".LAN_SIGNUP_43." [ ".USEREMAIL." ] - ".LAN_SIGNUP_45; + } + } + exit; +} + +if ($pref['membersonly_enabled']) +{ + $HEADER = "

        "; + if (file_exists(THEME."images/login_logo.png")) + { + $HEADER .= "\n"; + } + else + { + $HEADER .= "\n"; + } + $HEADER .= "
        "; + $FOOTER = "
        "; +} + +if($signup_imagecode) +{ + require_once(e_HANDLER."secure_img_handler.php"); + $sec_img = new secure_image; +} + +if($pref['user_reg'] == 0) +{ + header("location: ".e_HTTP."index.php"); + exit; +} + +if(USER) +{ + header("location: ".e_HTTP."index.php"); + exit; +} + +// After clicking the activation link ------------------------- +if (e_QUERY) +{ + $qs = explode(".", e_QUERY); + if ($qs[0] == "activate" && (count($qs) == 3 || count($qs) == 4) && $qs[2]) + { + // return the message in the correct language. + if($qs[3] && strlen($qs[3]) == 2 ) + { + require_once(e_HANDLER."language_class.php"); + $lng = new language; + $the_language = $lng->convert($qs[3]); + if(is_readable(e_LANGUAGEDIR.$the_language."/lan_signup.php")) + { + include(e_LANGUAGEDIR.$the_language."/lan_signup.php"); + } + else + { + require_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_signup.php"); + } + } + else + { + include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_signup.php"); + } + + + $e107cache->clear("online_menu_totals"); + if ($sql->db_Select("user", "*", "user_sess='".$tp -> toDB($qs[2], true)."' ")) + { + if ($row = $sql->db_Fetch()) + { + $sql->db_Update("user", "user_ban='0', user_sess='' WHERE user_sess='".$tp -> toDB($qs[2], true)."' "); + $e_event->trigger("userveri", $row); + require_once(HEADERF); + $text = LAN_401." ".LAN_SIGNUP_22." ".LAN_SIGNUP_23."
        ".LAN_SIGNUP_24." ".SITENAME; + $ns->tablerender(LAN_402, $text); + require_once(FOOTERF); + exit; + } + } + else + { + header("location: ".e_BASE."index.php"); + exit; + } + } +} + + +if (isset($_POST['register'])) +{ + $e107cache->clear("online_menu_totals"); + $error_message = ""; + require_once(e_HANDLER."message_handler.php"); + if ($signup_imagecode && !isset($_POST['xupexist'])) + { + if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) + { + $error_message .= LAN_SIGNUP_3."\\n"; + $error = TRUE; + } + } + + if($_POST['xupexist']) + { + require_once(e_HANDLER."xml_class.php"); + $xml = new parseXml; + if(!$rawData = $xml -> getRemoteXmlFile($_POST['xupexist'])) + { + echo "Error: Unable to open remote XUP file"; + } + preg_match_all("#\#si", $rawData, $match); + $count = 0; + foreach($match[1] as $value) + { + $xup[$value] = $match[2][$count]; + $count++; + } + + $_POST['name'] = $xup['NICKNAME']; + $_POST['email'] = $xup['EMAIL']; + $_POST['signature'] = $xup['SIG']; + $_POST['hideemail'] = $xup['EMAILHIDE']; + $_POST['timezone'] = $xup['TZ']; + $_POST['realname'] = $xup['FN']; + $_POST['image'] = $xup['AV']; + + $_POST['ue']['user_homepage'] = $xup['URL']; + $_POST['ue']['user_icq'] = $xup['ICQ']; + $_POST['ue']['user_aim'] = $xup['AIM']; + $_POST['ue']['user_msn'] = $xup['MSN']; + $_POST['ue']['user_yahoo'] = $xup['YAHOO']; + $_POST['ue']['user_location'] = $xup['GEO']; + $_POST['ue']['user_birthday'] = $xup['BDAY']; + + unset($xup); + } + if($_POST['loginnamexup']) $_POST['loginname'] = $_POST['loginnamexup']; + if($_POST['password1xup']) $_POST['password1'] = $_POST['password1xup']; + if($_POST['password2xup']) $_POST['password2'] = $_POST['password2xup']; + + if (strstr($_POST['loginname'], "#") || strstr($_POST['loginname'], "=") || strstr($_POST['loginname'], "\\") || strstr($_POST['loginname'], "'") || strstr($_POST['loginname'], '"')) + { + $error_message .= LAN_409."\\n"; + $error = TRUE; + } + + $_POST['loginname'] = trim(preg_replace("/ |\#|\=/", "", $_POST['loginname'])); + if ($_POST['loginname'] == "Anonymous") + { + $error_message .= LAN_103."\\n"; + $error = TRUE; + } + + // Use LoginName for DisplayName if restricted **** MOVED FORWARD **** + if (!check_class($pref['displayname_class'])) + { + $_POST['name'] = $_POST['loginname']; + } + + // Check for disallowed names. + if(isset($pref['signup_disallow_text'])) + { + $tmp = explode(",", $pref['signup_disallow_text']); + foreach($tmp as $disallow) + { + if( strstr($_POST['name'], $disallow) || strstr($_POST['loginname'], $disallow) ){ + $error_message .= LAN_103."\\n"; + $error = TRUE; + } + } + } + + // Check if form maxlength has been bypassed + if ( strlen($_POST['name']) > 30 || strlen($_POST['loginname']) > 30) + { + exit; + } + + // Display Name exists. + if ($sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['name'])."'")) + { + $error_message .= LAN_411.": ".$tp -> toDB($_POST['name'])."\\n"; + $error = TRUE; + } + // Login Name exists + if ($sql->db_Select("user", "*", "user_loginname='".$tp -> toDB($_POST['loginname'])."' ")) + { + $error_message .= LAN_104.": ".$tp -> toDB($_POST['loginname'])."\\n"; + $error = TRUE; + } + + // check for multiple signups from the same IP address. + if($ipcount = $sql->db_Select("user", "*", "user_ip='".$e107->getip()."' and user_ban !='2' ")) + { + if($ipcount >= $pref['signup_maxip'] && trim($pref['signup_maxip']) != "") + { + $error_message .= LAN_202."\\n"; + $error = TRUE; + } + } + + // Check password fields are matching. + if ($_POST['password1'] != $_POST['password2']) + { + $error_message .= LAN_105."\\n"; + $error = TRUE; + $password1 = ""; + $password2 = ""; + } + + // Email address confirmation. + if ($_POST['email'] != $_POST['email_confirm']) + { + $error_message .= LAN_SIGNUP_38."\\n"; + $error = TRUE; + $email = ""; + $email_confirm = ""; + } + + // Password length check. + if (trim(strlen($_POST['password1'])) < $pref['signup_pass_len']) + { + $error_message .= LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5."\\n"; + $error = TRUE; + $password1 = ""; + $password2 = ""; + } + + // Check for emtpy fields + if (trim($_POST['name']) == "" || trim($_POST['loginname']) == "" || trim($_POST['password1']) == "" || trim($_POST['password2']) == "") + { + $error_message .= LAN_185."\\n"; + $error = TRUE; + } + + // ========== Verify Custom Signup options if selected ======================== + + $signup_option_title = array(LAN_308, LAN_120, LAN_121, LAN_122, LAN_SIGNUP_28); + $signup_option_names = array("realname", "signature", "image", "timezone", "class"); + + foreach($signup_option_names as $key => $value) + { + if ($pref['signup_option_'.$value] == 2 && !$_POST[$value]) + { + $error_message .= LAN_SIGNUP_6.$signup_option_title[$key].LAN_SIGNUP_7."\\n"; + $error = TRUE; + } + } + + // Check for Duplicate Email address. + if ($sql->db_Select("user", "user_email, user_ban, user_sess", "user_email='".$tp -> toDB($_POST['email'])."' ")) + { + $chk = $sql -> db_Fetch(); + if($chk['user_ban']== 2 && $chk['user_sess']){ + // duplicate because unactivated + $error = TRUE; + header("Location: ".e_BASE."signup.php?resend"); + exit; + }else{ + $error_message .= LAN_408."\\n"; + $error = TRUE; + } + } + + // Extended Field validation + $extList = $usere->user_extended_get_fieldList(); + + foreach($extList as $ext) + { + if(isset($_POST['ue']['user_'.$ext['user_extended_struct_name']])) + { + + $newval = trim($_POST['ue']['user_'.$ext['user_extended_struct_name']]); + if($ext['user_extended_struct_required'] == 1 && $newval == "" ) + { + $_ftext = (defined($ext['user_extended_struct_text']) ? constant($ext['user_extended_struct_text']) : $ext['user_extended_struct_text']); + $error_message .= LAN_SIGNUP_6.$_ftext.LAN_SIGNUP_7."\\n"; + $error = TRUE; + } + $parms = explode("^,^", $ext['user_extended_struct_parms']); + $regex = (isset($parms[1]) ? $tp->toText($parms[1]) : ""); + $regexfail = (isset($parms[2]) ? trim($tp->toText($parms[2])) : ""); + + if($regexfail == "") + { + $regexfail = $ext['user_extended_struct_name']." ".LAN_SIGNUP_53; + } + + if(defined($regexfail)) {$regexfail = constant($regexfail);} + + if($regex != "" && $newval != "") + { + if(!preg_match($regex, $newval)) + { + $error_message .= $regexfail."\\n"; + $error = TRUE; + } + } + } + } + + // Email syntax validation. + if (!check_email($_POST['email'])) + { + message_handler("P_ALERT", LAN_106); + $error_message .= LAN_106."\\n"; + $error = TRUE; + } + + // Check Email against banlist. + $wc = $tp -> toDB("*".trim(substr($_POST['email'], strpos($_POST['email'], "@")))); + if ($sql->db_Select("banlist", "*", "banlist_ip='".$tp -> toDB($_POST['email'])."' OR banlist_ip='{$wc}'")) + { + $brow = $sql -> db_Fetch(); + $error = TRUE; + if($brow['banlist_reason']) + { + $repl = array("\n","\r","
        "); + $error_message = str_replace($repl,"\\n",$tp->toHTML($brow['banlist_reason'],"","nobreak defs"))."\\n"; + $email = ""; + } + else + { + exit; + } + } + + // Check email address on remote server (if enabled). + if (varsettrue($pref['signup_remote_emailcheck']) && $error != TRUE) + { + require_once(e_HANDLER."mail_validation_class.php"); + list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL); + $validator = new email_validation_class; + $validator->localuser= $adminuser; + $validator->localhost= $adminhost; + $validator->timeout=3; + // $validator->debug=1; + // $validator->html_debug=1; + if($validator->ValidateEmailBox(trim($_POST['email'])) != 1) + { + $error_message .= LAN_106."\\n"; + $error = TRUE; + $email = ""; + $email_confirm = ""; + } + + } + + if($error_message) + { + message_handler("P_ALERT", $error_message); + } + + // ========== End of verification.. ==================================================== + + if (!$error) + { + $fp = new floodprotect; + if ($fp->flood("user", "user_join") == FALSE) + { + header("location:".e_BASE."index.php"); + exit; + } + + if ($sql->db_Select("user", "*", "user_email='".$tp -> toDB($_POST['email'])."' AND user_ban='1'")) { + exit; + } + + $username = $tp -> toDB(strip_tags($_POST['name'])); + $loginname = $tp -> toDB(strip_tags($_POST['loginname'])); + $time = time(); + $ip = $e107->getip(); + + $ue_fields = ""; + foreach($_POST['ue'] as $key => $val) + { + $key = $tp->toDB($key); + $val = $tp->toDB($val); + $ue_fields .= ($ue_fields) ? ", " : ""; + $ue_fields .= $key."='".$val."'"; + } + + $u_key = md5(uniqid(rand(), 1)); + $nid = $sql->db_Insert("user", "0, '{$username}', '{$loginname}', '', '".md5($_POST['password1'])."', '{$u_key}', '".$tp -> toDB($_POST['email'])."', '".$tp -> toDB($_POST['signature'])."', '".$tp -> toDB($_POST['image'])."', '".$tp -> toDB($_POST['timezone'])."', '".$tp -> toDB($_POST['hideemail'])."', '".$time."', '0', '".$time."', '0', '0', '0', '0', '".$ip."', '2', '0', '', '', '0', '0', '".$tp -> toDB($_POST['realname'])."', '', '', '', '0', '".$tp -> toDB($_POST['xupexist'])."' "); + if(!$nid) + { + require_once(HEADERF); + $ns->tablerender("", LAN_SIGNUP_36); + require_once(FOOTERF); + } + + if ($pref['user_reg_veri']) + { + // ==== Update Userclass =======> + + if ($_POST['class']) + { + unset($insert_class); + sort($_POST['class']); + $insert_class = implode(",",$_POST['class']); + $sql->db_Update("user", "user_class='".$tp -> toDB($insert_class)."' WHERE user_id='".$nid."' "); + } + + // ========= save extended fields into db table. ===== + + if($ue_fields) + { + $sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$nid}')"); + $sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '{$nid}'"); + } + + // ========== Send Email =========> + + if ($pref['user_reg_veri'] != 2) + { + $eml = render_email(); + $mailheader_e107id = $eml['userid']; + require_once(e_HANDLER."mail.php"); + + + if(!sendemail($_POST['email'], $eml['subject'], $eml['message'], "", "", "", $eml['attachments'], $eml['cc'], $eml['bcc'], "", "", $eml['inline-images'])) + { + $error_message = LAN_SIGNUP_42; // There was a problem, the registration mail was not sent, please contact the website administrator. + } + } + + $_POST['ip'] = $ip; + $e_event->trigger("usersup", $_POST); // send everything in the template, including extended fields. + + require_once(HEADERF); + if($pref['signup_text_after']) + { + $text = $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs')."
        "; + } + else + { + if ($pref['user_reg_veri'] == 2) + { + $text = LAN_SIGNUP_37; + } + else + { + $text = LAN_405; + } + } + if(isset($error_message)) + { + $text .= "
        ".$error_message."
        "; + } + $ns->tablerender(LAN_406, $text); + require_once(FOOTERF); + exit; + } + else + { + require_once(HEADERF); + + if(!$sql -> db_Select("user", "user_id", "user_name='{$username}' AND user_password='".md5($_POST['password1'])."'")) + { + $ns->tablerender("", LAN_SIGNUP_36); + require_once(FOOTERF); + exit; + } + $sql->db_Update("user", "user_ban = '0' WHERE user_id = '{$nid}'"); + + // ==== Update Userclass ======= + if ($_POST['class']) + { + unset($insert_class); + sort($_POST['class']); + $insert_class = implode(",",$_POST['class']); + $sql->db_Update("user", "user_class='".$tp -> toDB($insert_class)."' WHERE user_id='".$nid."' "); + } + // ======== save extended fields to DB table. + + if($ue_fields) + { + $sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$nid}')"); + $sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '{$nid}'"); + } + + // ========================================================== + $_POST['ip'] = $ip; + $e_event->trigger("usersup", $_POST); // send everything in the template, including extended fields. + + if($pref['signup_text_after']) + { + $text = $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs')."
        "; + } + else + { + $text = LAN_107." ".SITENAME.", ".LAN_SIGNUP_12."

        ".LAN_SIGNUP_13; + } + $ns->tablerender(LAN_SIGNUP_8,$text); + require_once(FOOTERF); + exit; + } + } + +} +require_once(HEADERF); + +$qs = ($error ? "stage" : e_QUERY); +if ($pref['use_coppa'] == 1 && strpos($qs, "stage") === FALSE) +{ + $text = $tp->parseTemplate($COPPA_TEMPLATE, TRUE, $signup_shortcodes); + $ns->tablerender(LAN_110, $text); + require_once(FOOTERF); + exit; +} + +if (!$website) +{ + $website = "http://"; +} + +if (strpos(LAN_109, "stage") === FALSE) +{ + if (isset($_POST['newver'])) + { + if (!$_POST['coppa']) + { + $text = $tp->parseTemplate($COPPA_FAIL); + $ns->tablerender(LAN_110, $text); + require_once(FOOTERF); + exit; + } + } +} + +require_once(e_HANDLER."form_handler.php"); +$rs = new form; + + +$text = $tp->parseTemplate($SIGNUP_BEGIN.$SIGNUP_BODY.$SIGNUP_END, TRUE, $signup_shortcodes); +$ns->tablerender(LAN_123, $text); +require_once(FOOTERF); +exit; + +// Default Signup Form -----> + +$ns->tablerender(LAN_123, $text); + +require_once(FOOTERF); + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + +function req($field) +{ + return ($field == 2 ? REQUIRED_FIELD_MARKER : ""); +} +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + +function headerjs() +{ + $script_txt = " + \n"; + + global $cal; + $script_txt .= $cal->load_files(); + return $script_txt; +} + + +function render_email($preview = FALSE) +{ + // 1 = Body + // 2 = Subject + + global $pref,$nid,$u_key,$_POST,$SIGNUPEMAIL_LINKSTYLE,$SIGNUPEMAIL_SUBJECT,$SIGNUPEMAIL_TEMPLATE; + + if($preview == TRUE) + { + $_POST['password1'] = "test-password"; + $_POST['loginname'] = "test-loginname"; + $_POST['name'] = "test-username"; + $_POST['website'] = "www.test-site.com"; + $nid = 0; + $u_key = "1234567890ABCDEFGHIJKLMNOP"; + } + + define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$nid.".".$u_key : SITEURL."/signup.php?activate.".$nid.".".$u_key.".".e_LAN)); + $pass_show = ($pref['user_reg_secureveri'])? "*******" : $_POST['password1']; + + if (file_exists(THEME."email_template.php")) + { + require_once(THEME."email_template.php"); + } + else + { + require_once(e_THEME."templates/email_template.php"); + } + + $inline_images = explode(",",$SIGNUPEMAIL_IMAGES); + if($SIGNUPEMAIL_BACKGROUNDIMAGE) + { + $inline_images[] = $SIGNUPEMAIL_BACKGROUNDIMAGE; + } + + $ret['userid'] = $nid; + $ret['cc'] = $SIGNUPEMAIL_CC; + $ret['bcc'] = $SIGNUPEMAIL_BCC; + $ret['attachments'] = $SIGNUPEMAIL_ATTACHMENTS; + $ret['inline-images'] = implode(",",$inline_images); + + $style = ($SIGNUPEMAIL_LINKSTYLE) ? "style='$SIGNUPEMAIL_LINKSTYLE'" : ""; + + $search[0] = "{LOGINNAME}"; + $replace[0] = $_POST['loginname']; + + $search[1] = "{PASSWORD}"; + $replace[1] = $pass_show; + + $search[2] = "{ACTIVATION_LINK}"; + $replace[2] = "".RETURNADDRESS.""; + + $search[3] = "{SITENAME}"; + $replace[3] = SITENAME; + + $search[4] = "{SITEURL}"; + $replace[4] = "".SITEURL.""; + + $search[5] = "{USERNAME}"; + $replace[5] = $_POST['name']; + + $search[6] = "{USERURL}"; + $replace[6] = ($_POST['website']) ? $_POST['website'] : ""; + + $cnt=1; + + foreach($inline_images as $img) + { + if(is_readable($inline_images[$cnt-1])) + { + $cid_search[] = "{IMAGE".$cnt."}"; + $cid_replace[] = "\"".SITENAME."\"\n"; + $path_search[] = "{IMAGE".$cnt."}"; + $path_replace[] = "\"".SITENAME."\"\n"; + } + $cnt++; + } + + $subject = str_replace($search,$replace,$SIGNUPEMAIL_SUBJECT); + $ret['subject'] = $subject; + + $HEAD = "\n"; + $HEAD .= "\n"; + $HEAD .= "\n"; + $HEAD .= ($SIGNUPEMAIL_USETHEME == 1) ? "\n" : ""; + $HEAD .= ($preview) ? "Signup Preview\n" : ""; + if($SIGNUPEMAIL_USETHEME == 2) + { + $CSS = file_get_contents(THEME."style.css"); + $HEAD .= ""; + } + + $HEAD .= "\n"; + if($SIGNUPEMAIL_BACKGROUNDIMAGE) + { + $HEAD .= "\n"; + } + else + { + $HEAD .= "\n"; + } + $FOOT = "\n\n\n"; + + $SIGNUPEMAIL_TEMPLATE = $HEAD.$SIGNUPEMAIL_TEMPLATE.$FOOT; + $message = str_replace($search,$replace,$SIGNUPEMAIL_TEMPLATE); + + $ret['message'] = str_replace($cid_search,$cid_replace,$message); + $ret['preview'] = str_replace($path_search,$path_replace,$message); + + return $ret; +} +?> diff --git a/sitedown.php b/sitedown.php new file mode 100644 index 000000000..c4a22a8cc --- /dev/null +++ b/sitedown.php @@ -0,0 +1,47 @@ +parseTemplate($SITEDOWN_TABLE, TRUE, $sitedown_shortcodes); + +?> \ No newline at end of file diff --git a/subcontent.php b/subcontent.php new file mode 100644 index 000000000..d9c7c36b9 --- /dev/null +++ b/subcontent.php @@ -0,0 +1,28 @@ + db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){ + header("location:".e_PLUGIN."content/content_submit.php"); +} else { + header("location:".e_BASE."index.php"); +} + +?> \ No newline at end of file diff --git a/submitnews.php b/submitnews.php new file mode 100644 index 000000000..f4969b977 --- /dev/null +++ b/submitnews.php @@ -0,0 +1,220 @@ +tablerender(NWSLAN_12, NWSLAN_11); + require_once(FOOTERF); + exit; +} + +$author_name = $tp->toDB($_POST['author_name']); +$author_email = $tp->toDB(check_email($_POST['author_email'])); + +if (isset($_POST['submit'])) +{ + $user = (USER ? USERNAME : $author_name); + $email = (USER ? USEREMAIL : $author_email); + + if ($user && $email) + { + $ip = $e107->getip(); + $fp = new floodprotect; + if ($fp->flood("submitnews", "submitnews_datestamp") == false) + { + header("location:" . e_BASE . "index.php"); + exit; + } + $itemtitle = $tp->toDB($_POST['itemtitle']); + $item = $tp->toDB($_POST['item']); + $item = str_replace("src="e107_images", "src="" . SITEURL . "e107_images", $item); + // Process File Upload ================================================= + if ($_FILES['file_userfile'] && $pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS) + { + require_once(e_HANDLER . "upload_handler.php"); + $uploaded = file_upload(e_IMAGE . "newspost_images/"); + $file = $uploaded[0]['name']; + $filetype = $uploaded[0]['type']; + $filesize = $uploaded[0]['size']; + $fileext = substr(strrchr($file, "."), 1); + + if (!$pref['upload_maxfilesize']) + { + $pref['upload_maxfilesize'] = ini_get('upload_max_filesize') * 1048576; + } + + if ($uploaded && $fileext != "jpg" && $fileext != "gif" && $fileext != "png") + { + $message = SUBNEWSLAN_3; + $error = true; + } + + if ($filesize > $pref['upload_maxfilesize']) + { + $message = SUBNEWSLAN_4; + $error = true; + } + + if (!$error) + { + // $numberoffiles = count($uploaded); + $today = getdate(); + $newname = USERID . "_" . $today[0] . "_" . str_replace(" ", "_", substr($itemtitle, 0, 6)) . "." . $fileext; + if ($file && $pref['subnews_resize']) + { + require_once(e_HANDLER . "resize_handler.php"); + $rezwidth = $pref['subnews_resize']; + if (!resize_image(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname, $rezwidth)) + { + rename(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname); + } + } elseif ($file) + { + rename(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname); + } + } + } + + if ($error == false) + { + if (!file_exists(e_IMAGE . "newspost_images/" . $newname)) + { + $newname = ""; + } + $sql->db_Insert("submitnews", "0, '$user', '$email', '$itemtitle', '".intval($_POST['cat_id'])."','$item', '" . time() . "', '$ip', '0', '$newname' "); + $edata_sn = array("user" => $user, "email" => $email, "itemtitle" => $itemtitle, "catid" => intval($_POST['cat_id']), "item" => $item, "ip" => $ip, "newname" => $newname); + $e_event->trigger("subnews", $edata_sn); + $ns->tablerender(LAN_133, "
        " . LAN_134 . "
        "); + require_once(FOOTERF); + exit; + } + else + { + require_once(e_HANDLER . "message_handler.php"); + message_handler("P_ALERT", $message); + } + } +} + +if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); } + +$text = "
        +
        \n + "; +if (!USER) +{ + $text .= "\n\n\n\n\n\n\n"; +} +$news_aj = new textparse(); +// Added by Barry +if (!empty($pref['news_subheader'])) +{ + $text .= " + + "; +} +// end barry +$text .= " + + + + + + "; +if ($pref['subnews_htmlarea']) +{ + require_once(e_HANDLER . "tiny_mce/wysiwyg.php"); + echo wysiwyg("item"); +} + +$insertjs = (!$pref['subnews_htmlarea'])?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "rows='25' "; +$text .= " + + + + + \n"; +if ($pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS) +{ + $text .= " + + + + \n"; +} + +$text .= " + + + +
        " . LAN_7 . "\n\n
        " . LAN_112 . "\n\n
        " . $news_aj->tpa($pref['news_subheader']) . "
        " . NWSLAN_6 . ": "; +if (!$sql->db_Select("news_category")) +{ + $text .= NWSLAN_10; +} +else +{ + $text .= " + "; +} +$text .= "
        " . LAN_62 . " + +
        " . LAN_135 . " + +
        " . SUBNEWSLAN_5 . "
        " . SUBNEWSLAN_6 . "
        + +
        + +
        +
        +
        "; +$ns->tablerender(LAN_136, $text); +require_once(FOOTERF); +function headerjs() +{ + $script = ""; + return $script; +} + +?> \ No newline at end of file diff --git a/top.php b/top.php new file mode 100644 index 000000000..31f66910e --- /dev/null +++ b/top.php @@ -0,0 +1,211 @@ +db_Select_gen($query)) { + $text = "
        \n\n"; + if (!is_object($gen)) { + $gen = new convert; + } + + $text .= " + + + + + + + \n"; + + while ($row = $sql->db_Fetch()) { + extract($row); + if (check_class($forum_class)) { + + if($user_name) + { + $POSTER = "{$user_name}"; + } else { + list($anonposter, $ipaddress) = explode(chr(1), $thread_anon); + $POSTER = $anonposter; + } + + $LINKTOTHREAD = e_PLUGIN_ABS."forum/forum_viewtopic.php?".$thread_id; + $LINKTOFORUM = e_PLUGIN_ABS."forum/forum_viewforum.php?".$thread_forum_id; + $lastpost_datestamp = $gen->convert_date($thread_lastpost, "forum"); + list($lastpost_id, $lastpost_name) = explode('.', $thread_lastuser, 2); + if (!$lastpost_id) { + $LASTPOST = $lastpost_name.'
        '.$lastpost_datestamp; + } else { + $LASTPOST = "".$lastpost_name."
        ".$lastpost_datestamp; + } + + $text .= " + + + + + + + \n"; + } + } + + $text .= "
         ".LAN_1."".LAN_2."".LAN_3."".LAN_4."".LAN_5."
        {$thread_name} ({$forum_name}){$POSTER}{$thread_views}{$thread_total_replies}{$LASTPOST}
        \n
        "; + + $ns->tablerender(LAN_7, $text, "nfp"); + require_once(e_HANDLER."np_class.php"); + $ftotal = $sql->db_Select("forum_t", "*", "thread_parent='0'"); + $ix = new nextprev("top.php", $from, $view, $ftotal, "", "active.forum.".$view.""); + } +} +if ($action == "top") { + require_once(e_HANDLER."level_handler.php"); + define("IMAGE_rank_main_admin_image", ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "" : "")); + define("IMAGE_rank_admin_image", ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "" : "")); + define("IMAGE_rank_moderator_image", ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "" : "")); + + if ($subaction == "forum" || $subaction == "all") { + $top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view.""); + $text = " +
        + + + + + + + \n"; + $counter = 1 + $from; + while ($row = $sql->db_Fetch()) { + extract($row); + $ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref); + $text .= " + + + + + "; + $counter++; + } + $text .= "
         ".TOP_LAN_1."".TOP_LAN_2."".TOP_LAN_6."
        {$counter}{$user_name}{$user_forums}".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."
        \n
        "; + $ns->tablerender(TOP_LAN_0, $text); + if ($subaction == "forum") { + require_once(e_HANDLER."np_class.php"); + $ftotal = $sql->db_Count("user", "(*)", "WHERE `user_forums` > 0"); + $ix = new nextprev("top.php", $from, $view, $ftotal, "Forum Posts", "top.forum.".$view.""); + } + } + + + if ($subaction == "comment" || $subaction == "all") { + $top_forum_posters = $sql->db_Select("user", "*", "`user_comments` > 0 ORDER BY user_comments DESC LIMIT 0, 10"); + $text = " +
        + + + + + + + \n"; + $counter = 1; + while ($row = $sql->db_Fetch()) { + extract($row); + $ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref); + $text .= " + + + + + "; + $counter++; + } + $text .= "
         ".TOP_LAN_1."".TOP_LAN_4."".TOP_LAN_6."
        {$counter}{$user_name}{$user_comments}".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."
        \n
        "; + $ns->tablerender(TOP_LAN_3, $text); + } + + if ($subaction == "chat" || $subaction == "all") { + $top_forum_posters = $sql->db_Select("user", "*", "`user_chats` > 0 ORDER BY user_chats DESC LIMIT 0, 10"); + $text = " +
        + + + + + + + \n"; + $counter = 1; + while ($row = $sql->db_Fetch()) { + extract($row); + $ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref); + $text .= " + + + + + "; + $counter++; + } + $text .= "
         ".TOP_LAN_1."".TOP_LAN_2."".TOP_LAN_6."
        {$counter}{$user_name}{$user_chats}".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."
        \n
        "; + $ns->tablerender(TOP_LAN_5, $text); + } +} +require_once(FOOTERF); +?> \ No newline at end of file diff --git a/upload.php b/upload.php new file mode 100644 index 000000000..53790b0f1 --- /dev/null +++ b/upload.php @@ -0,0 +1,176 @@ +".LAN_403."
        "; + $ns->tablerender(LAN_20, $text); + require_once(FOOTERF); + exit; +} + +if (isset($_POST['upload'])) { + if (($_POST['file_email'] || USER == TRUE) && $_POST['file_name'] && $_POST['file_description']) { + + require_once(e_HANDLER."upload_handler.php"); + $uploaded = file_upload(e_FILE."public/", "unique"); + + $file = $uploaded[0]['name']; + $filetype = $uploaded[0]['type']; + $filesize = $uploaded[0]['size']; + $image = $uploaded[1]['name']; + $imagetype = $uploaded[1]['type']; + + if (!$pref['upload_maxfilesize']) { + $pref['upload_maxfilesize'] = ini_get('upload_max_filesize') * 1048576; + } + + + if ($filesize > $pref['upload_maxfilesize']) { + $message = LAN_405; + } else { + if (is_array($uploaded)) { + $poster = (USER ? USERID.".".USERNAME : "0".$_POST['file_poster']); + $_POST['file_email'] = ($_POST['file_email'] ? $_POST['file_email'] : USEREMAIL); + $_POST['file_description'] = $tp->toDB($_POST['file_description']); + $file_time = time(); + $sql->db_Insert("upload", "0, '".$tp -> toDB($poster)."', '".$tp -> toDB(check_email($_POST['file_email']))."', '".$tp -> toDB($_POST['file_website'])."', '".$file_time."', '".$tp -> toDB($_POST['file_name'])."', '".$tp -> toDB($_POST['file_version'])."', '".$file."', '".$image."', '".$tp -> toDB($_POST['file_description'])."', '".$tp -> toDB($_POST['file_demo'])."', '".$filesize."', 0, '".$tp -> toDB($_POST['download_category'])."'"); + $edata_fu = array("upload_user" => $poster, "upload_email" => $_POST['file_email'], "upload_name" => $tp -> toDB($_POST['file_name']),"upload_file" => $file, "upload_version" => $_POST['file_version'], "upload_description" => $tp -> toDB($_POST['file_description']), "upload_size" => $filesize, "upload_category" => $tp -> toDB($_POST['download_category']), "upload_website" => $tp -> toDB($_POST['file_website']), "upload_image" => $image, "upload_demo" => $tp -> toDB($_POST['file_demo']), "upload_time" => $file_time); + $e_event->trigger("fileupload", $edata_fu); + $message .= "
        ".LAN_404; + } + } + + } else { + require_once(e_HANDLER."message_handler.php"); + message_handler("ALERT", 5); + } +} + +if (isset($message)) { + $ns->tablerender("", "
        ".$message."
        "); + require_once(FOOTERF); + exit; +} + +$text = "
        +
        + + + + + + + + + "; + +if (!USER) { + $text .= " + + + + + + + + "; +} + +$text .= " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ".DOWLAN_11.":"; + + require_once(e_FILE."shortcode/batch/download_shortcodes.php"); + $dlparm = (isset($download_category)) ? $download_category : ""; + $text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$dlparm}}",true,$download_shortcodes); + + +$text .= " +
        "; + +$text .= "".LAN_406."
        ".LAN_419.":"; + +if (is_readable(e_ADMIN.'filetypes.php')) { + $a_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php')); + $a_filetypes = explode(',', $a_filetypes); + foreach ($a_filetypes as $ftype) { + $sa_filetypes[] = '.'.trim(str_replace('.', '', $ftype)); + } + $allowed_filetypes = implode(' | ', $sa_filetypes); +} + +$text .= " ".$allowed_filetypes."
        ".LAN_407."
        + ".LAN_418.($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'] : ini_get('upload_max_filesize'))."
        "; + +$text .= "".LAN_408." ".LAN_420."
        ".LAN_61."
        ".LAN_112."
        ".LAN_409."
        ".LAN_410."
        ".LAN_411."
        ".LAN_412."
        ".LAN_413."
        ".LAN_144."
        ".LAN_414."
        ".LAN_415."
        +
        +
        "; + +$ns->tablerender(LAN_417, $text); + +require_once(FOOTERF); +?> diff --git a/user.php b/user.php new file mode 100644 index 000000000..f9649d274 --- /dev/null +++ b/user.php @@ -0,0 +1,200 @@ +db_Select("user", "user_sess", "user_id='". USERID."'"); + @unlink(e_FILE."public/avatars/".$row['user_sess']); + $sql->db_Update("user", "user_sess='' WHERE user_id=".intval($tmp[1])); + header("location:".e_SELF."?id.".$tmp[1]); + exit; + } +} + +$qs = explode(".", e_QUERY); +$self_page =($qs[0] == 'id' && intval($qs[1]) == USERID); + +if (file_exists(THEME."user_template.php")) +{ + require_once(THEME."user_template.php"); +} +else +{ + require_once(e_BASE.$THEMES_DIRECTORY."templates/user_template.php"); +} +$user_frm = new form; +require_once(HEADERF); +if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); } + +if (!check_class(varset($pref['memberlist_access'], 253)) && !$self_page) +{ + $ns->tablerender(LAN_20, "
        ".USERLAN_2."
        "); + require_once(FOOTERF); + exit; +} + +if (isset($_POST['records'])) +{ + $records = intval($_POST['records']); + $order = ($_POST['order'] == 'ASC' ? 'ASC' : 'DESC'); + $from = 0; +} +else if(!e_QUERY) +{ + $records = 20; + $from = 0; + $order = "DESC"; +} +else +{ + if ($qs[0] == "self") + { + $id = USERID; + } + else + { + if ($qs[0] == "id") + { + $id = $qs[1]; + } + else + { + $qs = explode(".", e_QUERY); + $from = intval($qs[0]); + $records = intval($qs[1]); + $order = ($qs[2] == 'ASC' ? 'ASC' : 'DESC'); + } + } +} +if ($records > 30) +{ + $records = 30; +} + +if (isset($id)) +{ + if ($id == 0) + { + $text = "
        ".LAN_137." ".SITENAME."
        "; + $ns->tablerender(LAN_20, $text); + require_once(FOOTERF); + exit; + } + + $loop_uid = $id; + + $ret = $e_event->trigger("showuser", $id); + if ($ret!='') + { + $text = "
        ".$ret."
        "; + $ns->tablerender(LAN_20, $text); + require_once(FOOTERF); + exit; + } + + if (isset($_POST['commentsubmit']) && $pref['profile_comments']) + { + require_once(e_HANDLER."comment_class.php"); + $cobj = new comment; + $cobj->enter_comment($_POST['author_name'], $_POST['comment'], 'profile', $id, $pid, $_POST['subject']); + } + + if($pref['profile_comments']) + { + include_once(e_HANDLER."comment_class.php"); + } + + if($text = renderuser($id)) + { + $ns->tablerender(LAN_402, $text); + } + else + { + $text = "
        ".LAN_400."
        "; + $ns->tablerender(LAN_20, $text); + } + unset($text); + require_once(FOOTERF); + exit; +} + +$users_total = $sql->db_Count("user","(*)", "WHERE user_ban = 0"); + +if (!$sql->db_Select("user", "*", "user_ban = 0 ORDER BY user_id $order LIMIT $from,$records")) +{ + echo "
        ".LAN_141."
        "; +} +else +{ + $userList = $sql->db_getList(); + + $text .= $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes); + foreach ($userList as $row) + { + $text .= renderuser($row, "short"); + } + $text .= $tp->parseTemplate($USER_SHORT_TEMPLATE_END, TRUE, $user_shortcodes); +} + +$ns->tablerender(LAN_140, $text); + +$parms = $users_total.",".$records.",".$from.",".e_SELF.'?[FROM].'.$records.".".$order; +echo "
         ".$tp->parseTemplate("{NEXTPREV={$parms}}")."
        "; + + +function renderuser($uid, $mode = "verbose") +{ + global $sql, $pref, $tp, $sc_style, $user_shortcodes; + global $EXTENDED_START, $EXTENDED_TABLE, $EXTENDED_END, $USER_SHORT_TEMPLATE, $USER_FULL_TEMPLATE; + global $user; + + if(is_array($uid)) + { + $user = $uid; + } + else + { + if(!$user = get_user_data($uid)) + { + return FALSE; + } + } + + if($mode == 'verbose') + { + return $tp->parseTemplate($USER_FULL_TEMPLATE, TRUE, $user_shortcodes); + } + else + { + return $tp->parseTemplate($USER_SHORT_TEMPLATE, TRUE, $user_shortcodes); + } +} + +require_once(FOOTERF); +?> diff --git a/userposts.php b/userposts.php new file mode 100644 index 000000000..23ee8dfa3 --- /dev/null +++ b/userposts.php @@ -0,0 +1,272 @@ +db_Select("user", "user_name", "user_id=".$id); + $row = $sql->db_Fetch(); + extract($row); + $user_id = $id.".".$user_name.""; + } + else + { + $user_name = UP_LAN_16.$id; + } + + if (!$USERPOSTS_COMMENTS_TABLE) + { + if (file_exists(THEME."userposts_template.php")) + { + require_once(THEME."userposts_template.php"); + } + else + { + require_once(e_BASE.$THEMES_DIRECTORY."templates/userposts_template.php"); + } + } + + + $sql2 = new db; + if(is_numeric($id)) + { + $ccaption = UP_LAN_1.$user_name; + $sql->db_Select("user", "user_comments", "user_id=".$id.""); + list($user_comments) = $sql->db_Fetch(); + $ctotal = $user_comments; + $data = $cobj->getCommentData($amount='10', $from, "comment_author = '".$user_id."'"); + } + else + { + require_once(e_HANDLER."encrypt_handler.php"); + $dip = decode_ip($id); + $ccaption = UP_LAN_1.$dip; + $data = $cobj->getCommentData($amount='10', $from, "comment_ip = '".$id."'"); + } + + if(empty($data) || !is_array($data)){ + $ctext = "".UP_LAN_7.""; + } + + global $row; + foreach($data as $row){ + $userposts_comments_table_string .= parse_userposts_comments_table($row); + } + + $userposts_comments_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE_START); + $userposts_comments_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE_END); + + $ctext .= $userposts_comments_table_start."".$userposts_comments_table_string."".$userposts_comments_table_end; + + $ns->tablerender($ccaption, $ctext); + + $parms = $ctotal.",10,".$from.",".e_SELF."?[FROM].comments.".$id; + $USERPOSTS_NEXTPREV = $tp->parseTemplate("{NEXTPREV={$parms}}"); + echo preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_NP_TABLE); +} + + + +if ($action == "forums" || isset($_POST['fsearch'])) +{ + + if(is_numeric($id)) + { + $user_id = intval($id); + $sql->db_Select("user", "user_name", "user_id=".$id.""); + $row = $sql->db_Fetch(); + $fcaption = UP_LAN_0." ".$row['user_name']; + } + else + { + $user_name = 0; + } + + if (!$USERPOSTS_FORUM_TABLE) + { + if (file_exists(THEME."userposts_template.php")) + { + require_once(THEME."userposts_template.php"); + } + else + { + require_once(e_BASE.$THEMES_DIRECTORY."templates/userposts_template.php"); + } + } + + $s_info = ""; + if (isset($_POST['f_query']) && $_POST['f_query'] != "") + { + $f_query = $tp -> toDB($_POST['f_query']); + $s_info = "AND (ft.thread_name REGEXP('".$f_query."') OR ft.thread_thread REGEXP('".$f_query."'))"; + $fcaption = UP_LAN_12." ".$row['user_name']; + } + $qry = " + SELECT f.*, ft.* FROM #forum_t AS ft + LEFT JOIN #forum AS f ON ft.thread_forum_id = f.forum_id + LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id + WHERE ft.thread_user LIKE '{$user_id}.%' + AND f.forum_class IN (".USERCLASS_LIST.") + AND fp.forum_class IN (".USERCLASS_LIST.") + {$s_info} + ORDER BY ft.thread_datestamp DESC LIMIT {$from}, 10 + "; + + $total_qry = " + SELECT COUNT(*) AS count FROM #forum_t AS ft + LEFT JOIN #forum AS f ON ft.thread_forum_id = f.forum_id + LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id + WHERE ft.thread_user LIKE '{$user_id}.%' + AND f.forum_class IN (".USERCLASS_LIST.") + AND fp.forum_class IN (".USERCLASS_LIST.") + {$s_info} + "; + + $ftotal = 0; + if($sql->db_Select_gen($total_qry)) + { + $row = $sql->db_Fetch(); + $ftotal = $row['count']; + } + + if (!$sql->db_Select_gen($qry)) + { + $ftext .= "".UP_LAN_8.""; + } + else + { + if (!is_object($gen)) + { + $gen = new convert; + } + $render = $sql -> db_getList(); + foreach ($render as $row) + { + $userposts_forum_table_string .= parse_userposts_forum_table($row); + } + $userposts_forum_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE_START); + $USERPOSTS_FORUM_SEARCH = " "; + $userposts_forum_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE_END); + $ftext .= $userposts_forum_table_start."".$userposts_forum_table_string."".$userposts_forum_table_end; + } + $ns->tablerender($fcaption, $ftext); + + $parms = $ftotal.",10,".$from.",".e_SELF."?[FROM].forums.".$id; + $USERPOSTS_NEXTPREV = $tp->parseTemplate("{NEXTPREV={$parms}}"); + echo preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_NP_TABLE); +} + +require_once(FOOTERF); + + + + +function parse_userposts_comments_table($row) +{ + global $USERPOSTS_COMMENTS_TABLE, $pref, $gen, $tp, $menu_pref, $id, $sql2, $comment_files; + + $gen = new convert; + $datestamp = $gen->convert_date($row['comment_datestamp'], "short"); + $USERPOSTS_COMMENTS_ICON = ""; + $USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp; + $USERPOSTS_COMMENTS_HEADING = $row['comment_title']; + $USERPOSTS_COMMENTS_COMMENT = $row['comment_comment']; + $USERPOSTS_COMMENTS_HREF_PRE = ""; + $USERPOSTS_COMMENTS_TYPE = $row['comment_type']; + + return(preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE)); +} + + +function parse_userposts_forum_table($row) +{ + global $USERPOSTS_FORUM_TABLE, $gen, $tp, $id; + extract($row); + + $gen = new convert; + $sql2 = new db; + + $poster = substr($thread_user, (strpos($thread_user, ".")+1)); + $datestamp = $gen->convert_date($thread_datestamp, "short"); + $DATESTAMP = $datestamp; + + if ($thread_parent) + { + if ($cachevar[$thread_parent]) + { + $thread_name = $cachevar[$thread_parent]; + } + else + { + $tmp = $thread_parent; + $sql2->db_Select("forum_t", "thread_name", "thread_id = '".intval($thread_parent)."' "); + list($thread_name) = $sql2->db_Fetch(); + $cachevar[$thread_parent] = $thread_name; + } + $USERPOSTS_FORUM_TOPIC_PRE = UP_LAN_15.": "; + } + else + { + $tmp = $thread_id; + $USERPOSTS_FORUM_TOPIC_PRE = UP_LAN_2.": "; + } + + $thread_thread = $tp->toHTML($thread_thread, TRUE, "", $id); + + $USERPOSTS_FORUM_ICON = ""; + $USERPOSTS_FORUM_TOPIC_HREF_PRE = ""; + $USERPOSTS_FORUM_TOPIC = $thread_name; + $USERPOSTS_FORUM_NAME_HREF_PRE = ""; + $USERPOSTS_FORUM_NAME = $forum_name; + $USERPOSTS_FORUM_THREAD = $thread_thread; + $USERPOSTS_FORUM_DATESTAMP = UP_LAN_11." ".$datestamp; + + return(preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE)); +} + +?> \ No newline at end of file diff --git a/usersettings.php b/usersettings.php new file mode 100644 index 000000000..91e302eaa --- /dev/null +++ b/usersettings.php @@ -0,0 +1,490 @@ + + +$error = ""; + +if (isset($_POST['updatesettings'])) +{ + if(!varsettrue($pref['auth_method']) || $pref['auth_method'] == '>e107') + { + $pref['auth_method'] = 'e107'; + } + + if($pref['auth_method'] != 'e107') + { + $_POST['password1'] = ''; + $_POST['password2'] = ''; + } + + if ($_uid && ADMIN) + { + $inp = $_uid; + $remflag = TRUE; + } + else + { + $inp = USERID; + } + $_POST['image'] = str_replace(array('\'', '"', '(', ')'), '', $_POST['image']); // these are invalid anyways, so why allow them? (XSS Fix) + + // check prefs for required fields =================================. + + if ($_POST['image'] && $size = getimagesize($_POST['image'])) { + $avwidth = $size[0]; + $avheight = $size[1]; + $avmsg = ""; + + $pref['im_width'] = ($pref['im_width']) ? $pref['im_width'] : 120; + $pref['im_height'] = ($pref['im_height']) ? $pref['im_height'] : 100; + if ($avwidth > $pref['im_width']) { + $avmsg .= LAN_USET_1." ($avwidth)
        ".LAN_USET_2.": {$pref['im_width']}

        "; + } + if ($avheight > $pref['im_height']) { + $avmsg .= LAN_USET_3." ($avheight)
        ".LAN_USET_4.": {$pref['im_height']}"; + } + if ($avmsg) { + $_POST['image'] = ""; + $error = $avmsg; + } + + } + + $signup_option_title = array(LAN_308, LAN_120, LAN_121, LAN_122, LAN_USET_6); + $signup_option_names = array("realname", "signature", "image", "timezone", "class"); + + foreach($signup_option_names as $key => $value) + { + if ($pref['signup_option_'.$value] == 2 && !$_POST[$value] && !$_uid) + { + $error .= LAN_SIGNUP_6.$signup_option_title[$key].LAN_SIGNUP_7."\\n"; + } + } + + // ==================================================================== + + $pwreset = ""; + if ($_POST['password1'] != $_POST['password2']) { + $error .= LAN_105."\\n"; + } + else + { + if(trim($_POST['password1']) != "") + { + $pwreset = "user_password = '".md5(trim($_POST['password1']))."', "; + } + } + + if(isset($pref['signup_disallow_text'])) + { + $tmp = explode(",", $pref['signup_disallow_text']); + foreach($tmp as $disallow){ + if(strstr($_POST['username'], $disallow)){ + $error .= LAN_USET_11."\\n"; + } + } + } + + if (strlen(trim($_POST['password1'])) < $pref['signup_pass_len'] && trim($_POST['password1']) != "") { + $error .= LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5."\\n"; + $password1 = ""; + $password2 = ""; + } + + if (isset($pref['disable_emailcheck']) && $pref['disable_emailcheck']==1) + { + } else { + if (!check_email($_POST['email'])) + { + $error .= LAN_106."\\n"; + } + } + + if ($sql->db_Select("user", "user_name, user_email", "user_email='".$tp -> toDB($_POST['email'])."' AND user_id !=".USERID."' ")) { + $error .= LAN_408."\\n"; + } + +// $username = strip_tags($_POST['username']); + + $user_sess = ""; + if ($file_userfile['error'] != 4) + { + require_once(e_HANDLER."upload_handler.php"); + require_once(e_HANDLER."resize_handler.php"); + + if ($uploaded = file_upload(e_FILE."public/avatars/", "avatar")) + { + if ($uploaded[0]['name'] && $pref['avatar_upload']) + { + // avatar uploaded + $_POST['image'] = "-upload-".$uploaded[0]['name']; + if (!resize_image(e_FILE."public/avatars/".$uploaded[0]['name'], e_FILE."public/avatars/".$uploaded[0]['name'], "avatar")) + { + unset($message); + $error .= RESIZE_NOT_SUPPORTED."\\n"; + @unlink(e_FILE."public/avatars/".$uploaded[0]['name']); + } + } + if ($uploaded[1]['name'] || (!$pref['avatar_upload'] && $uploaded[0]['name'])) + { + // photograph uploaded + $user_sess = ($pref['avatar_upload'] ? $uploaded[1]['name'] : $uploaded[0]['name']); + resize_image(e_FILE."public/avatars/".$user_sess, e_FILE."public/avatars/".$user_sess, 180); + } + } + } + + if ($user_sess != "") + { + $sesschange = "user_sess = '".$tp->toDB($user_sess)."', "; + } + + // Validate Extended User Fields. + if($_POST['ue']) + { + if($sql->db_Select('user_extended_struct')) { + while($row = $sql->db_Fetch()) + { + $extList["user_".$row['user_extended_struct_name']] = $row; + } + } + + $ue_fields = ""; + foreach($_POST['ue'] as $key => $val) + { + $err = false; + $parms = explode("^,^", $extList[$key]['user_extended_struct_parms']); + $regex = $tp->toText($parms[1]); + $regexfail = $tp->toText($parms[2]); + if(defined($regexfail)) {$regexfail = constant($regexfail);} + if($val == '' && $extList[$key]['user_extended_struct_required'] == 1 && !$_uid) + { + $error .= LAN_SIGNUP_6.($tp->toHtml($extList[$key]['user_extended_struct_text'],FALSE,"defs"))." ".LAN_SIGNUP_7."\\n"; + $err = TRUE; + } + if($regex != "" && $val != "") + { + if(!preg_match($regex, $val)) + { + $error .= $regexfail."\\n"; + $err = TRUE; + } + } + if(!$err) + { + $val = $tp->toDB($val); + $ue_fields .= ($ue_fields) ? ", " : ""; + $ue_fields .= $key."='".$val."'"; + } + } + } + + + + if (!$error) + { + unset($_POST['password1']); + unset($_POST['password2']); + + $ret = $e_event->trigger("preuserset", $_POST); + if(trim($_POST['user_xup']) != "") + { + if($sql->db_Select('user', 'user_xup', "user_id = '".intval($inp)."'")) + { + $row = $sql->db_Fetch(); + $update_xup = ($row['user_xup'] != $_POST['user_xup']) ? TRUE : FALSE; + } + } + + if ($ret == '') + { + $udata = get_user_data($inp); + $peer = ($inp == USERID ? false : true); + $loginname = strip_tags($_POST['loginname']); + + if (!$loginname) + { + $sql->db_Select("user", "user_loginname", "user_id='".intval($inp)."'"); + $row = $sql -> db_Fetch(); + $loginname = $row['user_loginname']; + } + else + { + if(!check_class($pref['displayname_class'], $udata['user_class'], $peer)) + { + $new_username = "user_name = '{$loginname}', "; + } + } + + if (isset($_POST['username']) && check_class($pref['displayname_class'])) + { + $username = strip_tags($_POST['username']); + $username = $tp->toDB(substr($username, 0, $pref['displayname_maxlength'])); + $new_username = "user_name = '{$username}', "; + } + + + $_POST['signature'] = $tp->toDB($_POST['signature']); + $_POST['realname'] = $tp->toDB($_POST['realname']); + + $new_customtitle = ""; + + if(isset($_POST['customtitle']) && ($pref['forum_user_customtitle'] || ADMIN)) + { + $new_customtitle = ", user_customtitle = '".$tp->toDB($_POST['customtitle'])."' "; + } + + + if($ue_fields) + { + $hidden_fields = implode("^", array_keys($_POST['hide'])); + if($hidden_fields != "") + { + $hidden_fields = "^".$hidden_fields."^"; + } + $ue_fields .= ", user_hidden_fields = '".$hidden_fields."'"; + } + + $sql->db_Update("user", "{$new_username} {$pwreset} {$sesschange} user_email='".$tp -> toDB($_POST['email'])."', user_signature='".$_POST['signature']."', user_image='".$tp -> toDB($_POST['image'])."', user_timezone='".$tp -> toDB($_POST['timezone'])."', user_hideemail='".$tp -> toDB($_POST['hideemail'])."', user_login='".$_POST['realname']."' {$new_customtitle}, user_xup='".$tp -> toDB($_POST['user_xup'])."' WHERE user_id='".intval($inp)."' "); + // If user has changed display name, update the record in the online table + if(isset($username) && ($username != USERNAME) && !$_uid) + { + $sql->db_Update("online", "online_user_id = '".USERID.".".$username."' WHERE online_user_id = '".USERID.".".USERNAME."'"); + } + + if(ADMIN && getperms("4")) + { + $sql -> db_Update("user", "user_loginname='".$tp -> toDB($loginname)."' WHERE user_id='".intval($inp)."' "); + } + + if($ue_fields) + { + $sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id, user_hidden_fields) values ('".intval($inp)."', '')"); + $sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '".intval($inp)."'"); + } + + // Update Userclass ======= + if (!$_uid && $sql->db_Select("userclass_classes", "*", "userclass_editclass IN (".USERCLASS_LIST.")")) + { + $ucList = $sql->db_getList(); + if ($sql->db_Select("user", "user_class", "user_id = '".intval($inp)."'")) + { + $row = $sql->db_Fetch(); + $cur_classes = explode(",", $row['user_class']); + $newclist = array_flip($cur_classes); + foreach($ucList as $c) + { + $cid = $c['userclass_id']; + if(!in_array($cid, $_POST['class'])) + { + unset($newclist[$cid]); + } + else + { + $newclist[$cid] = 1; + } + } + $newclist = array_keys($newclist); + $nid = implode(',', array_diff($newclist, array(''))); + $sql->db_Update("user", "user_class='".$nid."' WHERE user_id='".intval($inp)."'"); + } + } + + if($update_xup == TRUE) + { + require_once(e_HANDLER."login.php"); + userlogin::update_xup($inp, $_POST['user_xup']); + } + + $e_event->trigger("postuserset", $_POST); + + // ======================= + + if(e_QUERY == "update") { + header("Location: index.php"); + } + $message = "
        ".LAN_150."
        "; + $caption = LAN_151; + } else { + $message = "
        ".$ret."
        "; + $caption = LAN_151; + } + unset($_POST); + } +} + +if ($error) +{ + require_once(e_HANDLER."message_handler.php"); + message_handler("P_ALERT", $error); + $adref = $_POST['adminreturn']; +} +// ------------------- + +if(isset($message)) +{ + $ns->tablerender($caption, $message); +} + +// --------------------- + + +$uuid = ($_uid) ? $_uid : USERID; + +$qry = " +SELECT u.*, ue.* FROM #user AS u +LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id +WHERE u.user_id='".intval($uuid)."' +"; + +$sql->db_Select_gen($qry); +$curVal=$sql->db_Fetch(); +$tmp = ($curVal['user_class'] != "" ? explode(",", $curVal['user_class']) : ""); +$tmp[] = e_UC_MEMBER; +$tmp[] = e_UC_READONLY; +$tmp[] = e_UC_PUBLIC; +if($curVal['user_admin'] == 1) +{ + $tmp[] = e_UC_ADMIN; +} +$curVal['userclass_list'] = implode(",", $tmp); + +if($_POST) +{ // Fix for all the values being lost when an error occurred. + foreach($_POST as $key => $val) + { + $curVal["user_".$key] = $val; + } + foreach($_POST['ue'] as $key => $val) + { + $curVal[$key] = $val; + } +} + +require_once(e_HANDLER."form_handler.php"); +$rs = new form; + +$text = (e_QUERY ? $rs->form_open("post", e_SELF."?".e_QUERY, "dataform", "", " enctype='multipart/form-data'") : $rs->form_open("post", e_SELF, "dataform", "", " enctype='multipart/form-data'")); + +if(e_QUERY == "update") +{ + $text .= "

        ".str_replace("*","*",LAN_USET_9)."
        ".LAN_USET_10."

        "; +} + +$text .= $tp->parseTemplate($USERSETTINGS_EDIT, FALSE, $usersettings_shortcodes); +$text .= "
        "; + +$text .= " + +
        + + "; + +$ns->tablerender(LAN_155, $text); +require_once(FOOTERF); + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + +function req($field) { + global $pref; + if ($field == 2) + { + $ret = " *"; + } + else + { + $ret = ""; + } + return $ret; +} +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + +function headerjs() { + global $cal; + $script = "\n"; + + $script .= $cal->load_files(); + return $script; +} +?>