/** * Constructor. */ function __construct() { if (e107::isInstalled('nodejs_comment')) { // Get plugin preferences. $this->plugPrefs = e107::getPlugConfig('nodejs_comment')->getPref(); $this->renderMenu(); } }
function __construct() { $pref = e107::pref('faqs'); if (!empty($pref['display_social']) && e107::isInstalled('social') == true) { $this->share = true; } if (!empty($pref['display_datestamp'])) { $this->datestamp = true; } }
function __construct() { $mes = e107::getMessage(); $frm = e107::getForm(); $tp = e107::getParser(); // $this->simulation(); $mailoutPlugins = e107::getConfig()->get('e_mailout_list'); if (empty($_GET['id'])) { return; } $tmp = base64_decode($_GET['id']); parse_str($tmp, $data); $data['plugin'] = $tp->filter($data['plugin'], 'str'); $data['email'] = $tp->filter($data['email'], 'email'); e107::getMessage()->addDebug(print_a($data, true)); $plugin = vartrue($data['plugin'], false); if (empty($data) || !e107::isInstalled($plugin) || !in_array($plugin, $mailoutPlugins)) { $this->invalidURL(); return; } $ml = e107::getAddon($plugin, 'e_mailout'); if (!empty($data['userclass'])) { $data['userclass'] = intval($data['userclass']); $listName = e107::getUserClass()->getName($data['userclass']); } else { $listName = $ml->mailerName; } if (vartrue($_POST['remove']) && !empty($data)) { if ($ml->unsubscribe('process', $data) != false) { $text = "<p><b>" . $data['email'] . "</b> has been removed from " . $listName . ".</p>"; $mes->addSuccess($text); } else { $text = "<p>There was a problem when attempting to remove <b>" . $data['email'] . "</b> from " . $listName . ".</p>"; $mes->addError($text); } echo "<div class='container'>" . $mes->render() . "</div>"; return; } if ($ml->unsubscribe('check', $data) != false) { $text = "<p>We are very sorry for the inconvenience. <br />Please click the button below to remove <b>" . $data['email'] . "</b> from <i>" . $listName . "</i>.</p>"; $text .= $frm->open('unsub', 'post', e_REQUEST_URI); $text .= $frm->button('remove', 'Remove ', 'submit'); $text .= $frm->close(); $mes->setTitle('Unsubscribe', E_MESSAGE_INFO)->addInfo($text); echo "<div class='container'>" . $mes->render() . "</div>"; return; } else { $this->invalidURL(); return; } }
/** * {XURL_ICONS: size=2x} */ function sc_xurl_icons($parm = '') { $social = array('rss' => array('href' => e107::isInstalled('rss_menu') ? e107::url('rss_menu', 'index', array('rss_url' => 'news')) : '', 'title' => 'RSS/Atom Feed'), 'facebook' => array('href' => deftrue('XURL_FACEBOOK'), 'title' => 'Facebook'), 'twitter' => array('href' => deftrue('XURL_TWITTER'), 'title' => 'Twitter'), 'google-plus' => array('href' => deftrue('XURL_GOOGLE'), 'title' => 'Google Plus'), 'linkedin' => array('href' => deftrue('XURL_LINKEDIN'), 'title' => 'LinkedIn'), 'github' => array('href' => deftrue('XURL_GITHUB'), 'title' => 'Github'), 'pinterest' => array('href' => deftrue('XURL_PINTEREST'), 'title' => 'Pinterest'), 'flickr' => array('href' => deftrue('XURL_FLICKR'), 'title' => 'Flickr'), 'instagram' => array('href' => deftrue('XURL_INSTAGRAM'), 'title' => 'Instagram'), 'youtube' => array('href' => deftrue('XURL_YOUTUBE'), 'title' => 'YouTube'), 'vimeo' => array('href' => deftrue('XURL_VIMEO'), 'title' => 'Vimeo')); $class = vartrue($parm['size']) ? 'fa-' . $parm['size'] : ''; $text = ''; foreach ($social as $id => $data) { if ($data['href'] != '') { $text .= '<a rel="external" href="' . $data['href'] . '" class="e-tip social-icon social-' . $id . '" title="' . $data['title'] . '"> <span class="fa fa-' . $id . ' ' . $class . '"></span> </a>'; $text .= "\n"; } } if ($text != '') { return '<p class="xurl-social-icons hidden-print">' . $text . '</p>'; } }
function profile($udata) { $pref = e107::getPref(); if (!$pref['cb_user_addon']) { return array(); } if (!($chatposts = e107::getRegistry('total_chatposts'))) { $chatposts = 0; // In case plugin not installed if (e107::isInstalled("chatbox_menu")) { $chatposts = e107::getDb()->count("chatbox"); } e107::setRegistry('total_chatposts', $chatposts); } $perc = $chatposts > 0 ? round($udata['user_chats'] / $chatposts * 100, 2) : 0; $var = array(0 => array('label' => LAN_PLUGIN_CHATBOX_MENU_POSTS, 'text' => $udata['user_chats'] . " ( " . $perc . "% )")); return $var; }
* e107 Chatbox plugin * * @package e107_plugins * @subpackage chatbox */ error_reporting(E_ALL); if (isset($_POST['chatbox_ajax'])) { define('e_MINIMAL', true); if (!defined('e107_INIT')) { require_once '../../class2.php'; } } global $e107cache, $e_event, $e107; $tp = e107::getParser(); $pref = e107::getPref(); if (!e107::isInstalled('chatbox_menu')) { return ''; } e107::lan('chatbox_menu', e_LANGUAGE); // FIXME - start - LAN is not loaded /* if(($pref['cb_layer']==2) || isset($_POST['chatbox_ajax'])) { if(isset($_POST['chat_submit'])) { //Normally the menu.sc file will auto-load the language file, this is needed in case //ajax is turned on and the menu is not loaded from the menu.sc inclXXXude_lan(e_PLUGIN.'chatbox_menu/languages/'.e_LANGUAGE.'/'.e_LANGUAGE.'.php'); }
function update_706_to_800($type = '') { global $pref, $e107info; global $sysprefs, $eArrayStorage; //$mes = new messageLog; // Combined logging and message displaying handler //$mes = e107::getMessage(); $log = e107::getAdminLog(); // Used for combined logging and message displaying $sql = e107::getDb(); $sql2 = e107::getDb('sql2'); $tp = e107::getParser(); $ns = e107::getRender(); e107::getCache()->clearAll('db'); e107::getCache()->clearAll('system'); // List of unwanted $pref values which can go $obs_prefs = array('frontpage_type', 'rss_feeds', 'log_lvcount', 'zone', 'upload_allowedfiletype', 'real', 'forum_user_customtitle', 'utf-compatmode', 'frontpage_method', 'standards_mode', 'image_owner', 'im_quality', 'signup_option_timezone', 'modules', 'plug_sc', 'plug_bb', 'plug_status', 'plug_latest', 'subnews_hide_news', 'upload_storagetype'); // List of DB tables not required (includes a few from 0.6xx) $obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last', 'session', 'preset', 'tinymce'); // List of DB tables newly required (defined in core_sql.php) (The existing dblog table gets renamed) // No Longer required. - automatically checked against core_sql.php. // $new_tables = array('audit_log', 'dblog', 'news_rewrite', 'core_media', 'core_media_cat','cron', 'mail_recipients', 'mail_content'); // List of core prefs that need to be converted from serialized to e107ArrayStorage. $serialized_prefs = array("'emote'", "'menu_pref'", "'search_prefs'", "'emote_default'", "'pm_prefs'"); $create_dir = array(e_MEDIA, e_SYSTEM, e_CACHE, e_CACHE_CONTENT, e_CACHE_IMAGE, e_CACHE_DB, e_LOG, e_BACKUP, e_CACHE_URL, e_TEMP, e_IMPORT); foreach ($create_dir as $dr) { if (!is_dir($dr)) { mkdir($dr, 0755); } } // List of changed DB tables (defined in core_sql.php) // No Longer required. - automatically checked against core_sql.php. // (primarily those which have changed significantly; for the odd field write some explicit code - it'll run faster) // $changed_tables = array('user', 'dblog', 'admin_log', 'userclass_classes', 'banlist', 'menus', // 'plugin', 'news', 'news_category', 'online', 'page', 'links', 'comments'); // List of changed DB tables from core plugins (defined in pluginname_sql.php file) // key = plugin directory name. Data = comma-separated list of tables to check // (primarily those which have changed significantly; for the odd field write some explicit code - it'll run faster) // No Longer required. - automatically checked by db-verify /* $pluginChangedTables = array('linkwords' => 'linkwords', 'featurebox' => 'featurebox', 'links_page' => 'links_page', 'poll' => 'polls', 'content' => 'pcontent' ); */ /* $setCorePrefs = array( //modified prefs during upgrade. 'adminstyle' => 'infopanel', 'admintheme' => 'bootstrap', 'admincss' => 'admin_style.css', 'resize_dimensions' => array( 'news-image' => array('w' => 250, 'h' => 250), 'news-bbcode' => array('w' => 250, 'h' => 250), 'page-bbcode' => array('w' => 250, 'h' => 250) ) ); */ $do_save = TRUE; // List of changed menu locations. $changeMenuPaths = array(array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'sitebutton_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'compliance_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'powered_by_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'sitebutton_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'counter_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'latestnews_menu'), array('oldpath' => 'compliance_menu', 'newpath' => 'siteinfo', 'menu' => 'compliance_menu'), array('oldpath' => 'powered_by_menu', 'newpath' => 'siteinfo', 'menu' => 'powered_by_menu'), array('oldpath' => 'sitebutton_menu', 'newpath' => 'siteinfo', 'menu' => 'sitebutton_menu'), array('oldpath' => 'counter_menu', 'newpath' => 'siteinfo', 'menu' => 'counter_menu'), array('oldpath' => 'usertheme_menu', 'newpath' => 'user', 'menu' => 'usertheme_menu'), array('oldpath' => 'userlanguage_menu', 'newpath' => 'user', 'menu' => 'userlanguage_menu'), array('oldpath' => 'lastseen_menu', 'newpath' => 'online', 'menu' => 'lastseen_menu'), array('oldpath' => 'other_news_menu', 'newpath' => 'news', 'menu' => 'other_news_menu'), array('oldpath' => 'other_news_menu', 'newpath' => 'news', 'menu' => 'other_news2_menu'), array('oldpath' => 'user_menu', 'newpath' => 'user', 'menu' => 'usertheme_menu'), array('oldpath' => 'user_menu', 'newpath' => 'user', 'menu' => 'userlanguage_menu'), array('oldpath' => 'poll_menu', 'newpath' => 'poll', 'menu' => 'poll_menu'), array('oldpath' => 'banner_menu', 'newpath' => 'banner', 'menu' => 'banner_menu'), array('oldpath' => 'online_menu', 'newpath' => 'online', 'menu' => 'online_menu')); // List of DB tables (key) and field (value) which need changing to accommodate IPV6 addresses $ip_upgrade = array('download_requests' => 'download_request_ip', 'submitnews' => 'submitnews_ip', 'tmp' => 'tmp_ip', 'chatbox' => 'cb_ip'); $db_parser = new db_table_admin(); // Class to read table defs and process them $do_save = FALSE; // Set TRUE to update prefs when update complete $updateMessages = array(); // Used to log actions for the admin log - TODO: will go once all converted to new class $just_check = $type == 'do' ? FALSE : TRUE; // TRUE if we're just seeing whether an update is needed // if (!$just_check) // { // foreach(vartrue($setCorePrefs) as $k=>$v) // { // $pref[$k] = $v; // } // } if (!$just_check) { $log->logMessage(LAN_UPDATE_14 . $e107info['e107_version'], E_MESSAGE_NODISPLAY); } $statusTexts = array(E_MESSAGE_SUCCESS => 'Success', E_MESSAGE_ERROR => 'Fail', E_MESSAGE_INFO => 'Info'); if (isset($pref['forum_user_customtitle']) && !isset($pref['signup_option_customtitle'])) { if ($just_check) { return update_needed('pref: forum_user_customtitle needs to be renamed'); } $pref['signup_option_customtitle'] = $pref['forum_user_customtitle']; unset($pref['forum_user_customtitle']); $log->logMessage(LAN_UPDATE_20 . 'customtitle', E_MESSAGE_SUCCESS); $do_save = TRUE; } // convert all serialized core prefs to e107 ArrayStorage; $serialz_qry = "SUBSTRING( e107_value,1,5)!='array' AND e107_value !='' "; $serialz_qry .= "AND e107_name IN (" . implode(",", $serialized_prefs) . ") "; if (e107::getDb()->select("core", "*", $serialz_qry)) { if ($just_check) { return update_needed('Convert serialized core prefs'); } while ($row = e107::getDb()->fetch(MYSQL_ASSOC)) { $status = e107::getDb('sql2')->update('core', "e107_value=\"" . convert_serialized($row['e107_value']) . "\" WHERE e107_name='" . $row['e107_name'] . "'") ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $log->addDebug(LAN_UPDATE_22 . $row['e107_name'] . ": " . $status); } } if (e107::getDb()->select("core", "*", "e107_name='pm_prefs' LIMIT 1")) { if ($just_check) { return update_needed('Rename the pm prefs'); } e107::getDb()->update("core", "e107_name='plugin_pm' WHERE e107_name = 'pm_prefs'"); } //@TODO de-serialize the user_prefs also. // Banlist if (!$sql->field('banlist', 'banlist_id')) { if ($just_check) { return update_needed('Banlist table requires updating.'); } $sql->gen("ALTER TABLE #banlist DROP PRIMARY KEY"); $sql->gen("ALTER TABLE `#banlist` ADD `banlist_id` INT( 11 ) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"); } // Move the maximum online counts from menu prefs to a separate pref - 'history' e107::getCache()->clearAll('system'); $menuConfig = e107::getConfig('menu', true, true); if ($menuConfig->get('most_members_online') || $menuConfig->get('most_guests_online') || $menuConfig->get('most_online_datestamp')) { $status = E_MESSAGE_DEBUG; if ($just_check) { return update_needed('Move online counts from menupref'); } $newPrefs = e107::getConfig('history'); foreach (array('most_members_online', 'most_guests_online', 'most_online_datestamp') as $v) { if (FALSE === $newPrefs->get($v, FALSE)) { if (FALSE !== $menuConfig->get($v, FALSE)) { $newPrefs->set($v, $menuConfig->get($v)); } else { $newPrefs->set($v, 0); } } $menuConfig->remove($v); } $result = $newPrefs->save(false, true, false); if ($result === TRUE) { $resultMessage = 'Historic member counts updated'; $result = $menuConfig->save(false, true, false); // Only re-save if successul. } elseif ($result === FALSE) { $resultMessage = 'moving historic member counts'; $status = E_MESSAGE_ERROR; } else { // No change $resultMessage = 'Historic member counts already updated'; $status = E_MESSAGE_INFO; } // $result = $menuConfig->save(false, true, false); // Save updated menuprefs - without the counts - don't delete them if it fails. //$updateMessages[] = $statusTexts[$status].': '.$resultMessage; // Admin log message $log->logMessage($resultMessage, $status); // User message } // ++++++++ Modify Menu Paths +++++++. if (varset($changeMenuPaths)) { foreach ($changeMenuPaths as $val) { $qry = "SELECT menu_path FROM `#menus` WHERE menu_name = '" . $val['menu'] . "' AND (menu_path='" . $val['oldpath'] . "' || menu_path='" . $val['oldpath'] . "/' ) LIMIT 1"; if ($sql->gen($qry)) { if ($just_check) { return update_needed('Menu path changed required: ' . $val['menu'] . ' '); } $updqry = "menu_path='" . $val['newpath'] . "/' WHERE menu_name = '" . $val['menu'] . "' AND (menu_path='" . $val['oldpath'] . "' || menu_path='" . $val['oldpath'] . "/' ) "; $status = $sql->update('menus', $updqry) ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $log->logMessage(LAN_UPDATE_23 . '<b>' . $val['menu'] . '</b> : ' . $val['oldpath'] . ' => ' . $val['newpath'], $status); // LAN_UPDATE_25; // catch_error($sql); } } } // Leave this one here.. just in case.. //delete record for online_extended_menu (now only using one online menu) if ($sql->db_Select('menus', '*', "menu_path='online_extended_menu' || menu_path='online_extended_menu/'")) { if ($just_check) { return update_needed("The Menu table needs to have some paths corrected in its data."); } $row = $sql->db_Fetch(); //if online_extended is activated, we need to activate the new 'online' menu, and delete this record if ($row['menu_location'] != 0) { $status = $sql->update('menus', "menu_name='online_menu', menu_path='online/' WHERE menu_path='online_extended_menu' || menu_path='online_extended_menu/' ") ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $log->logMessage(LAN_UPDATE_23 . "<b>online_menu</b> : online/", $status); } else { //else if the menu is not active //we need to delete the online_extended menu row, and change the online_menu to online $sql->delete('menus', " menu_path='online_extended_menu' || menu_path='online_extended_menu/' "); $log->logMessage(LAN_UPDATE_31, E_MESSAGE_DEBUG); } catch_error($sql); } //change menu_path for online_menu (if it still exists) if ($sql->db_Select('menus', 'menu_path', "menu_path='online_menu' || menu_path='online_menu/'")) { if ($just_check) { return update_needed('change menu_path for online menu'); } $status = $sql->update('menus', "menu_path='online/' WHERE menu_path='online_menu' || menu_path='online_menu/' ") ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $log->logMessage(LAN_UPDATE_23 . "<b>online_menu</b> : online/", $status); catch_error($sql); } if (!$just_check) { // Alert Admin to delete deprecated menu folders. $chgPath = array(); foreach ($changeMenuPaths as $cgpArray) { if (is_dir(e_PLUGIN . $cgpArray['oldpath'])) { if (!in_array($cgpArray['oldpath'], $chgPath)) { $chgPath[] = $cgpArray['oldpath']; } } } if (count($chgPath)) { $log->addWarning(LAN_UPDATE_57 . ' '); array_unique($chgPath); asort($chgPath); foreach ($chgPath as $cgp) { $log->addWarning(e_PLUGIN_ABS . "<b>" . $cgp . "</b>"); } } } //--------------------------------------------------------- // Comments - split user field //--------------------------------------------------------- if ($sql->db_Field('comments', 'comment_author')) { if ($just_check) { return update_needed('Comment table author field update'); } if (!$sql->db_Field('comments', 'comment_author_id') && !$sql->gen("ALTER TABLE `#comments`\r\n\t\t\t\tADD COLUMN comment_author_id int(10) unsigned NOT NULL default '0' AFTER `comment_author`,\r\n\t\t\t\tADD COLUMN comment_author_name varchar(100) NOT NULL default '' AFTER `comment_author_id`")) { // Flag error // $commentMessage = LAN_UPDAXXTE_34; $log->logMessage(LAN_UPDATE_21 . "comments", E_MESSAGE_ERROR); } else { if (FALSE === $sql->update('comments', "comment_author_id=SUBSTRING_INDEX(`comment_author`,'.',1), comment_author_name=SUBSTRING(`comment_author` FROM POSITION('.' IN `comment_author`)+1)")) { // Flag error $log->logMessage(LAN_UPDATE_21 . 'comments', E_MESSAGE_ERROR); } else { // Delete superceded field - comment_author if (!$sql->gen("ALTER TABLE `#comments` DROP COLUMN `comment_author`")) { // Flag error $log->logMessage(LAN_UPDATE_24 . 'comments - comment_author', E_MESSAGE_ERROR); } } } $log->logMessage(LAN_UPDATE_21 . 'comments', E_MESSAGE_DEBUG); } // Add index to download history // Deprecated by db-verify-class // if (FALSE !== ($temp = addIndexToTable('download_requests', 'download_request_datestamp', $just_check, $updateMessages))) // { // if ($just_check) // { // return update_needed($temp); // } // } // Extra index to tmp table // Deprecated by db-verify-class // if (FALSE !== ($temp = addIndexToTable('tmp', 'tmp_time', $just_check, $updateMessages))) // { // if ($just_check) // { // return update_needed($temp); // } // } // Extra index to rss table (if used) // Deprecated by db-verify-class // if (FALSE !== ($temp = addIndexToTable('rss', 'rss_name', $just_check, $updateMessages, TRUE))) // { // if ($just_check) // { // return update_needed($temp); // } // } // Front page prefs (logic has changed) if (!isset($pref['frontpage_force'])) { if ($just_check) { return update_needed('Change front page prefs'); } $pref['frontpage_force'] = array(e_UC_PUBLIC => ''); $fpdef = vartrue($pref['frontpage']['all']) == 'index.php' ? 'index.php' : 'news.php'; $pref['frontpage'] = array(e_UC_PUBLIC => $fpdef); // $_pdateMessages[] = LAN_UPDATE_38; //FIXME $log->logMessage(LAN_UPDATE_20 . "frontpage", E_MESSAGE_DEBUG); $do_save = TRUE; } // Check need for user timezone before we delete the field if (vartrue($pref['signup_option_timezone'])) { if ($sql->db_Field('user', 'user_timezone', '', TRUE) && !$sql->db_Field('user_extended', 'user_timezone', '', TRUE)) { if ($just_check) { return update_needed('Move user timezone info'); } if (!copy_user_timezone()) { // Error doing the transfer //$updateMessages[] = LAN_UPDATE_42; $log->logMessage(LAN_UPDATE_42, E_MESSAGE_ERROR); return FALSE; } //$updateMessages[] = LAN_UPDATE_41; $log->logMessage(LAN_UPDATE_41, E_MESSAGE_DEBUG); } } // Tables defined in core_sql.php to be RENAMED. // Next bit will be needed only by the brave souls who used an early CVS - probably delete before release if ($sql->isTable('rl_history') && !$sql->isTable('dblog')) { if ($just_check) { return update_needed('Rename rl_history to dblog'); } $sql->gen('ALTER TABLE `' . MPREFIX . 'rl_history` RENAME `' . MPREFIX . 'dblog`'); //$updateMessages[] = LAN_UPDATE_44; $log->logMessage(LAN_UPDATE_44, E_MESSAGE_DEBUG); catch_error($sql); } //--------------------------------- if ($sql->isTable('dblog') && !$sql->isTable('admin_log')) { if ($just_check) { return update_needed('Rename dblog to admin_log'); } $sql->gen('ALTER TABLE `' . MPREFIX . 'dblog` RENAME `' . MPREFIX . 'admin_log`'); catch_error($sql); //$updateMessages[] = LAN_UPDATE_43; $log->logMessage(LAN_UPDATE_43, E_MESSAGE_DEBUG); } // New tables required (list at top. Definitions in core_sql.php) // ALL DEPRECATED by db_verify class.. see below. /* foreach ($new_tables as $nt) { if (!$sql->isTable($nt)) { if ($just_check) return update_needed('Add table: '.$nt); // Get the definition $defs = $db_parser->get_table_def($nt,e_ADMIN.'sql/core_sql.php'); if (count($defs)) // **** Add in table here { $status = $sql->gen('CREATE TABLE `'.MPREFIX.$defs[0][1].'` ('.$defs[0][2].') TYPE='.$defs[0][3]) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; // $updateMessages[] = LAN_UPDATE_45.$defs[0][1]; $log->logMessage(LAN_UPDATE_27.$defs[0][1], $status); // catch_error($sql); } else { // error parsing defs file $log->logMessage(LAN_UPDATE_46.$defs[0][1], E_MESSAGE_ERROR); } unset($defs); } } // Tables whose definition needs changing significantly $debugLevel = E107_DBG_SQLDETAILS; foreach ($changed_tables as $ct) { $req_defs = $db_parser->get_table_def($ct,e_ADMIN."sql/core_sql.php"); $req_fields = $db_parser->parse_field_defs($req_defs[0][2]); // Required definitions if ($debugLevel) { $log->logMessage("Required table structure: <br />".$db_parser->make_field_list($req_fields), E_MESSAGE_DEBUG); } if ((($actual_defs = $db_parser->get_current_table($ct)) === FALSE) || !is_array($actual_defs)) // Adds current default prefix { $log->logMessage("Couldn't get table structure: ".$ct, E_MESSAGE_DEBUG); } else { // echo $db_parser->make_table_list($actual_defs); $actual_fields = $db_parser->parse_field_defs($actual_defs[0][2]); if ($debugLevel) { $log->logMessage("Actual table structure: <br />".$db_parser->make_field_list($actual_fields), E_MESSAGE_DEBUG); } $diffs = $db_parser->compare_field_lists($req_fields,$actual_fields); if (count($diffs[0])) { // Changes needed if ($just_check) return update_needed("Field changes rqd; table: ".$ct); // Do the changes here if ($debugLevel) { $log->logMessage("List of changes found:<br />".$db_parser->make_changes_list($diffs), E_MESSAGE_DEBUG); } $qry = 'ALTER TABLE '.MPREFIX.$ct.' '.implode(', ',$diffs[1]); if ($debugLevel) { $log->logMessage("Update Query used: ".$qry, E_MESSAGE_DEBUG); } $status = $sql->gen($qry) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $log->logMessage(LAN_UPDATE_21.$ct, $status); catch_error($sql); } } } // Plugin tables whose definition needs changing significantly foreach ($pluginChangedTables as $plugName => $plugList) { if (e107::isInstalled($plugName)) { $ttc = explode(',',$plugList); foreach ($ttc as $ct) { $sqlDefs = e_PLUGIN.$plugName.'/'.str_replace('_menu','',$plugName).'_sql.php'; // Filename containing definitions // echo "Looking at file: {$sqlDefs}, table {$ct}<br />"; $req_defs = $db_parser->get_table_def($ct,$sqlDefs); if (!is_array($req_defs)) { echo "Couldn't get definitions from file {$sqlDefs}<br />"; continue; } $req_fields = $db_parser->parse_field_defs($req_defs[0][2]); // Required definitions if (E107_DBG_SQLDETAILS) { $message = "Required plugin table structure: <br />".$db_parser->make_field_list($req_fields); $log->logMessage($message, E_MESSAGE_DEBUG); } if ((($actual_defs = $db_parser->get_current_table($ct)) === FALSE) || !is_array($actual_defs)) // Adds current default prefix { // echo "Couldn't get table structure: {$ct}<br />"; } else { // echo $db_parser->make_table_list($actual_defs); $actual_fields = $db_parser->parse_field_defs($actual_defs[0][2]); if (E107_DBG_SQLDETAILS) { $message= "Actual table structure: <br />".$db_parser->make_field_list($actual_fields); $log->logMessage($message, E_MESSAGE_DEBUG); } $diffs = $db_parser->compare_field_lists($req_fields,$actual_fields); if (count($diffs[0])) { // Changes needed if (E107_DBG_SQLDETAILS) { $message = "List of changes found:<br />".$db_parser->make_changes_list($diffs); $log->logMessage($message, E_MESSAGE_DEBUG); } if ($just_check) return update_needed("Field changes rqd; plugin table: ".$ct); // Do the changes here $qry = 'ALTER TABLE '.MPREFIX.$ct.' '.implode(', ',$diffs[1]); if (E107_DBG_SQLDETAILS) { $message = "Update Query used: ".$qry."<br />"; $log->logMessage($message, E_MESSAGE_DEBUG); } $sql->gen($qry); $updateMessages[] = LAN_UPDATE_51.$ct; $log->logMessage(LAN_UPDATE_51.$ct, E_MESSAGE_SUCCESS); catch_error($sql); } } } } } */ // Obsolete tables (list at top) $sql->mySQLtableList = false; // clear the cached table list. foreach ($obs_tables as $ot) { if ($sql->isTable($ot)) { if ($just_check) { return update_needed("Delete table: " . $ot); } $status = $sql->gen('DROP TABLE `' . MPREFIX . $ot . '`') ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $log->logMessage(LAN_UPDATE_25 . $ot, $status); } } // Tables where IP address field needs updating to accommodate IPV6 // Set to varchar(45) - just in case something uses the IPV4 subnet (see http://en.wikipedia.org/wiki/IPV6#Notation) foreach ($ip_upgrade as $t => $f) { if ($sql->isTable($t)) { // Check for table - might add some core plugin tables in here if ($field_info = $sql->db_Field($t, $f, '', TRUE)) { if (strtolower($field_info['Type']) != 'varchar(45)') { if ($just_check) { return update_needed('Update IP address field ' . $f . ' in table ' . $t); } $status = $sql->gen("ALTER TABLE `" . MPREFIX . $t . "` MODIFY `{$f}` VARCHAR(45) NOT NULL DEFAULT '';") ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $log->logMessage(LAN_UPDATE_26 . $t . ' - ' . $f, $status); // catch_error($sql); } } else { // Got a strange error here } } } // Obsolete prefs (list at top) // Intentionally do this last - we may check some of them during the update $accum = array(); foreach ($obs_prefs as $p) { if (isset($pref[$p])) { if ($just_check) { return update_needed('Remove obsolete prefs'); } unset($pref[$p]); $do_save = TRUE; $log->addDebug('Removed obsolete pref: ' . $p); // $accum[] = $p; } } /* -------------- Upgrade Entire Table Structure - Multi-Language Supported ----------------- */ // ONLY ever add fields, never deletes. require_once e_HANDLER . "db_verify_class.php"; $dbv = new db_verify(); if ($plugUpgradeReq = e107::getPlugin()->updateRequired()) { $exclude = array_keys($plugUpgradeReq); // search xxxxx_setup.php and check for 'upgrade_required()' == true. asort($exclude); } else { $exclude = false; } $dbv->compareAll($exclude); // core & plugins, but not plugins calling for an update with xxxxx_setup.php if (count($dbv->errors)) { if ($just_check) { $mes = e107::getMessage(); $log->addDebug(print_a($dbv->errors, true)); return update_needed("Database Tables require updating."); } $dbv->compileResults(); $dbv->runFix(); // Fix entire core database structure and plugins too. } // print_a($dbv->results); // print_a($dbv->fixList); //TODO - send notification messages to Log. if ($sql->field('page', 'page_theme') && $sql->gen("SELECT * FROM `#page` WHERE page_theme != '' AND menu_title = '' LIMIT 1")) { if ($just_check) { return update_needed("Pages/Menus Table requires updating."); } if ($sql->update('page', "menu_name = page_theme, menu_title = page_title, menu_text = page_text, menu_template='default', page_title = '', page_text = '' WHERE page_theme !='' AND menu_title = '' AND menu_text = '' ")) { $sql->gen("ALTER TABLE `#page` DROP page_theme "); $mes = e107::getMessage(); $log->addDebug("Successfully updated pages/menus table to new format. "); } } if ($sql->field('plugin', 'plugin_releaseUrl')) { if ($just_check) { return update_needed('plugin_releaseUrl is deprecated and needs to be removed. '); } if ($sql->gen("ALTER TABLE `#plugin` DROP `plugin_releaseUrl`")) { $log->addDebug("Successfully removed plugin_releaseUrl. "); } } // --- Notify Prefs // $notify_prefs = $sysprefs -> get('notify_prefs'); // $notify_prefs = $eArrayStorage -> ReadArray($notify_prefs); e107::getCache()->clearAll('system'); $notify_prefs = e107::getConfig('notify', true, true)->getPref(); $nt_changed = 0; if (vartrue($notify_prefs['event'])) { foreach ($notify_prefs['event'] as $e => $d) { if (isset($d['type'])) { if ($just_check) { return update_needed('Notify pref: ' . $e . ' outdated'); } switch ($d['type']) { case 'main': $notify_prefs['event'][$e]['class'] = e_UC_MAINADMIN; break; case 'class': // Should already have class defined break; case 'email': $notify_prefs['event'][$e]['class'] = 'email'; break; case 'off': // Need to disable // Need to disable default: $notify_prefs['event'][$e]['class'] = e_UC_NOBODY; // Just disable if we don't know what else to do } $nt_changed++; $notify_prefs['event'][$e]['legacy'] = 1; unset($notify_prefs['event'][$e]['type']); } } } if ($nt_changed) { $s_prefs = $tp->toDB($notify_prefs); $s_prefs = $eArrayStorage->WriteArray($s_prefs); // Could we use $sysprefs->set($s_prefs,'notify_prefs') instead - avoids caching problems ???? $status = $sql->update("core", "e107_value='" . $s_prefs . "' WHERE e107_name='notify_prefs'") !== FALSE ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $message = str_replace('--COUNT--', $nt_changed, LAN_UPDATE_20); $log->logMessage($message, $status); } // --------------- Saved emails - copy across if (!$just_check && $sql->db_Select('generic', '*', "gen_type='massmail'")) { if ($just_check) { return update_needed('Copy across saved emails'); } require_once e_HANDLER . 'mail_manager_class.php'; $mailHandler = new e107MailManager(); $i = 0; while ($row = $sql->db_Fetch(MYSQL_ASSOC)) { $mailRecord = array('mail_create_date' => $row['gen_datestamp'], 'mail_creator' => $row['gen_user_id'], 'mail_title' => $row['gen_ip'], 'mail_subject' => $row['gen_ip'], 'mail_body' => $row['gen_chardata'], 'mail_content_status' => MAIL_STATUS_SAVED); $mailHandler->mailtoDb($mailRecord, TRUE); $mailHandler->saveEmail($mailRecord, TRUE); $sql2->delete('generic', 'gen_id=' . intval($row['gen_id'])); // Delete as we go in case operation fails part way through $i++; } unset($mailHandler); $log->logMessage(str_replace('--COUNT--', $i, LAN_UPDATE_28)); } // ------------------- Populate Plugin Table With Changes ------------------ if (!isset($pref['shortcode_legacy_list'])) { if ($just_check) { return update_needed('Legacy shortcode conversion'); } // Reset, legacy and new shortcode list will be generated in plugin update routine $pref['shortcode_legacy_list'] = array(); $pref['shortcode_list'] = array(); save_prefs(); $ep = e107::getPlugin(); $ep->update_plugins_table($mode); // scan for e_xxx changes and save to plugin table. $ep->save_addon_prefs($mode); // generate global e_xxx_list prefs from plugin table. } // This has to be done after the table is upgraded if ($sql->select('plugin', 'plugin_category', "plugin_category = ''")) { if ($just_check) { return update_needed('Update plugin table'); } require_once e_HANDLER . 'plugin_class.php'; $ep = new e107plugin(); $ep->update_plugins_table('update'); // $_pdateMessages[] = LAN_UPDATE_XX24; // catch_error($sql); } //-- Media-manger import -------------------------------------------------- // Autogenerate filetypes.xml if not found. if (!is_readable(e_SYSTEM . "filetypes.xml")) { $data = '<?xml version="1.0" encoding="utf-8"?> <e107Filetypes> <class name="253" type="zip,gz,jpg,jpeg,png,gif,xml" maxupload="2M" /> </e107Filetypes>'; file_put_contents(e_SYSTEM . "filetypes.xml", $data); } $root_media = str_replace(basename(e_MEDIA) . "/", "", e_MEDIA); $user_media_dirs = array("images", "avatars", "avatars/default", "avatars/upload", "files", "temp", "videos", "icons"); // check for old paths and rename. if (is_dir($root_media . "images") || is_dir($root_media . "temp")) { foreach ($user_media_dirs as $md) { @rename($root_media . $md, e_MEDIA . $md); } } // create sub-directories if they do not exist. if (!is_dir(e_MEDIA . "images") || !is_dir(e_MEDIA . "temp") || !is_dir(e_AVATAR_UPLOAD) || !is_dir(e_AVATAR_DEFAULT)) { foreach ($user_media_dirs as $md) { if (!is_dir(e_MEDIA . $md)) { mkdir(e_MEDIA . $md); } } } // Move Avatars to new location $av1 = e107::getFile()->get_files(e_FILE . 'public/avatars', '.jpg|.gif|.png|.GIF|.jpeg|.JPG|.PNG'); $av2 = e107::getFile()->get_files(e_IMAGE . 'avatars', '.jpg|.gif|.png|.GIF|.jpeg|.JPG|.PNG'); $avatar_images = array_merge($av1, $av2); if (count($avatar_images)) { if ($just_check) { return update_needed('Avatar paths require updating.'); } foreach ($avatar_images as $av) { $apath = strstr($av['path'], 'public/') ? e_AVATAR_UPLOAD : e_AVATAR_DEFAULT; @rename($av['path'] . $av['fname'], $apath . $av['fname']); } } // ------------------------------- if (!e107::isInstalled('download') && $sql->gen("SELECT * FROM #links WHERE link_url LIKE 'download.php%' AND link_class != '" . e_UC_NOBODY . "' LIMIT 1")) { if ($just_check) { return update_needed('Download Plugin needs to be installed.'); } // e107::getSingleton('e107plugin')->install('download',array('nolinks'=>true)); e107::getSingleton('e107plugin')->refresh('download'); } if (!e107::isInstalled('banner') && $sql->isTable('banner')) { if ($just_check) { return update_needed('Banner Table found, but plugin not installed. Needs to be refreshed.'); } e107::getSingleton('e107plugin')->refresh('banner'); } // --------------------------------- $med = e107::getMedia(); // Media Category Update if ($sql->db_Field("core_media_cat", "media_cat_nick")) { $count = $sql->gen("SELECT * FROM `#core_media_cat` WHERE media_cat_nick = '_common' "); if ($count == 1) { if ($just_check) { return update_needed('Media-Manager Categories needs to be updated.'); } $sql->update('core_media_cat', "media_cat_owner = media_cat_nick, media_cat_category = media_cat_nick WHERE media_cat_nick REGEXP '_common|news|page|_icon_16|_icon_32|_icon_48|_icon_64' "); $sql->update('core_media_cat', "media_cat_owner = '_icon', media_cat_category = media_cat_nick WHERE media_cat_nick REGEXP '_icon_16|_icon_32|_icon_48|_icon_64' "); $sql->update('core_media_cat', "media_cat_owner = 'download', media_cat_category='download_image' WHERE media_cat_nick = 'download' "); $sql->update('core_media_cat', "media_cat_owner = 'download', media_cat_category='download_thumb' WHERE media_cat_nick = 'downloadthumb' "); $sql->update('core_media_cat', "media_cat_owner = 'news', media_cat_category='news_thumb' WHERE media_cat_nick = 'newsthumb' "); $log->addDebug("core-media-cat Categories and Ownership updated"); if ($sql->gen("ALTER TABLE `" . MPREFIX . "core_media_cat` DROP `media_cat_nick`")) { $log->addDebug("core-media-cat `media_cat_nick` field removed."); } // $query = "INSERT INTO `".MPREFIX."core_media_cat` (`media_cat_id`, `media_cat_owner`, `media_cat_category`, `media_cat_title`, `media_cat_diz`, `media_cat_class`, `media_cat_image`, `media_cat_order`) VALUES // (0, 'gallery', 'gallery_1', 'Gallery 1', 'Visible to the public at /gallery.php', 0, '', 0); /// "; // // if(mysql_query($query)) // { // $log->addDebug("Added core-media-cat Gallery."); // } } } // Media Update $count = $sql->gen("SELECT * FROM `#core_media` WHERE media_category = 'newsthumb' OR media_category = 'downloadthumb' LIMIT 1 "); if ($count == 1) { if ($just_check) { return update_needed('Media-Manager Data needs to be updated.'); } $sql->update('core_media', "media_category='download_image' WHERE media_category = 'download' "); $sql->update('core_media', "media_category='download_thumb' WHERE media_category = 'downloadthumb' "); $sql->update('core_media', "media_category='news_thumb' WHERE media_category = 'newsthumb' "); $log->addDebug("core-media Category names updated"); } // Media Update - core media and core-file. $count = $sql->gen("SELECT * FROM `#core_media` WHERE media_category = '_common' LIMIT 1 "); if ($count == 1) { if ($just_check) { return update_needed('Media-Manager Category Data needs to be updated.'); } $sql->update('core_media', "media_category='_common_image' WHERE media_category = '_common' "); $log->addDebug("core-media _common Category updated"); } // Media Update - core media and core-file. CATEGORY $count = $sql->gen("SELECT * FROM `#core_media_cat` WHERE media_cat_category = '_common' LIMIT 1 "); if ($count == 1) { if ($just_check) { return update_needed('Media-Manager Category Data needs to be updated.'); } $sql->update('core_media_cat', "media_cat_category='_common_image' WHERE media_cat_category = '_common' "); $sql->gen("INSERT INTO `" . MPREFIX . "core_media_cat` VALUES(0, '_common', '_common_file', '(Common Area)', 'Media in this category will be available in all areas of admin. ', 253, '', 0);"); $sql->gen("INSERT INTO `" . MPREFIX . "core_media_cat` VALUES(0, 'download', 'download_file', 'Download Files', '', 253, '', 0);"); $log->addDebug("core-media-cat _common Category updated"); } $count = $sql->gen("SELECT * FROM `#core_media_cat` WHERE `media_cat_owner` = '_common' LIMIT 1 "); if ($count != 1) { if ($just_check) { return update_needed('Add Media-Manager Categories and Import existing images.'); } $e107_core_media_cat = array(array('media_cat_id' => 0, 'media_cat_owner' => '_common', 'media_cat_category' => '_common_image', 'media_cat_title' => '(Common Images)', 'media_cat_sef' => '', 'media_cat_diz' => 'Media in this category will be available in all areas of admin.', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '0'), array('media_cat_id' => 0, 'media_cat_owner' => '_common', 'media_cat_category' => '_common_file', 'media_cat_title' => '(Common Files)', 'media_cat_sef' => '', 'media_cat_diz' => 'Media in this category will be available in all areas of admin.', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '0'), array('media_cat_id' => 0, 'media_cat_owner' => 'news', 'media_cat_category' => 'news', 'media_cat_title' => 'News', 'media_cat_sef' => '', 'media_cat_diz' => 'Will be available in the news area.', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '1'), array('media_cat_id' => 0, 'media_cat_owner' => 'page', 'media_cat_category' => 'page', 'media_cat_title' => 'Custom Pages', 'media_cat_sef' => '', 'media_cat_diz' => 'Will be available in the custom pages area of admin.', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '0'), array('media_cat_id' => 0, 'media_cat_owner' => 'download', 'media_cat_category' => 'download_image', 'media_cat_title' => 'Download Images', 'media_cat_sef' => '', 'media_cat_diz' => '', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '0'), array('media_cat_id' => 0, 'media_cat_owner' => 'download', 'media_cat_category' => 'download_thumb', 'media_cat_title' => 'Download Thumbnails', 'media_cat_sef' => '', 'media_cat_diz' => '', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '0'), array('media_cat_id' => 0, 'media_cat_owner' => 'download', 'media_cat_category' => 'download_file', 'media_cat_title' => 'Download Files', 'media_cat_sef' => '', 'media_cat_diz' => '', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '0'), array('media_cat_id' => 0, 'media_cat_owner' => 'news', 'media_cat_category' => 'news_thumb', 'media_cat_title' => 'News Thumbnails (Legacy)', 'media_cat_sef' => '', 'media_cat_diz' => 'Legacy news thumbnails.', 'media_cat_class' => '253', 'media_cat_image' => '', 'media_cat_order' => '1')); foreach ($e107_core_media_cat as $insert) { $sql->insert('core_media_cat', $insert); } // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, '_common', '_common_image', '(Common Images)', '', 'Media in this category will be available in all areas of admin. ', 253, '', 1);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, '_common', '_common_file', '(Common Files)', '', 'Media in this category will be available in all areas of admin. ', 253, '', 2);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'news', 'news', 'News', '', 'Will be available in the news area. ', 253, '', 3);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'page', 'page', 'Custom Pages', '', 'Will be available in the custom pages area of admin. ', 253, '', 4);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'download', 'download_image','', 'Download Images', '', 253, '', 5);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'download', 'download_thumb', '', 'Download Thumbnails', '', 253, '', 6);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'download', 'download_file', '', 'Download Files', '', 253, '', 7);"); // mysql_query("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'gallery', 'gallery_1', 'Gallery', 'Visible to the public at /gallery.php', 0, '', 0);"); // $sql->gen("INSERT INTO `".MPREFIX."core_media_cat` VALUES(0, 'news', 'news_thumb', 'News Thumbnails (Legacy)', '', 'Legacy news thumbnails. ', 253, '', 8);"); $med->import('news_thumb', e_IMAGE . 'newspost_images', "^thumb_"); $med->import('news', e_IMAGE . 'newspost_images'); $med->import('page', e_IMAGE . 'custom'); } else { // $log->addDebug("Media COUNT was ".$count. " LINE: ".__LINE__); } // Check for Legacy Download Images. $fl = e107::getFile(); $dl_images = $fl->get_files(e_FILE . 'downloadimages'); if (count($dl_images) && !$sql->gen("SELECT * FROM `#core_media` WHERE `media_category` = 'download_image' ")) { if ($just_check) { return update_needed('Import Download Images into Media Manager'); } $med->import('download_image', e_FILE . 'downloadimages'); $med->import('download_thumb', e_FILE . 'downloadthumbs'); } $dl_files = $fl->get_files(e_FILE . 'downloads', "", "standard", 5); // don't use e_DOWNLOAD or a loop may occur. $publicFilter = array('_FT', '^thumbs\\.db$', '^Thumbs\\.db$', '.*\\._$', '^\\.htaccess$', '^\\.cvsignore$', '^\\.ftpquota$', '^index\\.html$', '^null\\.txt$', '\\.bak$', '^.tmp'); // Default file filter (regex format) // $publicFilter = array(1); $public_files = $fl->get_files(e_FILE . 'public', '', $publicFilter); if ((count($dl_files) || count($public_files)) && !$sql->gen("SELECT * FROM `#core_media` WHERE `media_category` = 'download_file' ")) { if ($just_check) { return update_needed('Import ' . count($dl_files) . ' Download File(s) and ' . count($public_files) . ' Public File(s) into Media Manager'); } if ($sql->gen("SELECT download_url FROM `#download` ")) { $allowed_types = array(); while ($row = $sql->fetch()) { $ext = strrchr($row['download_url'], "."); $suffix = ltrim($ext, "."); if (!isset($allowed_types[$suffix])) { $allowed_types[$suffix] = $suffix; } } $allowed_types = array_unique($allowed_types); } else { $allowed_types = array('zip', 'gz', 'pdf'); } $fmask = '[a-zA-z0-9_-]+\\.(' . implode('|', $allowed_types) . ')$'; $med->import('download_file', e_DOWNLOAD, $fmask); $med->import('_common_file', e_FILE . 'public', $fmask); } $count = $sql->gen("SELECT * FROM `#core_media_cat` WHERE media_cat_owner='_icon' "); if (!$count) { if ($just_check) { return update_needed('Add icons to media-manager'); } $query = "INSERT INTO `" . MPREFIX . "core_media_cat` (`media_cat_id`, `media_cat_owner`, `media_cat_category`, `media_cat_title`, `media_cat_diz`, `media_cat_class`, `media_cat_image`, `media_cat_order`) VALUES\r\n\t\t(0, '_icon', '_icon_16', 'Icons 16px', 'Available where icons are used in admin. ', 253, '', 0),\r\n\t\t(0, '_icon', '_icon_32', 'Icons 32px', 'Available where icons are used in admin. ', 253, '', 0),\r\n\t\t(0, '_icon', '_icon_48', 'Icons 48px', 'Available where icons are used in admin. ', 253, '', 0),\r\n\t\t(0, '_icon', '_icon_64', 'Icons 64px', 'Available where icons are used in admin. ', 253, '', 0);\r\n\t\t"; if (!$sql->gen($query)) { // echo "mysyql error"; // error or already exists. } $med->importIcons(e_PLUGIN); $med->importIcons(e_IMAGE . "icons/"); $med->importIcons(e_THEME . $pref['sitetheme'] . "/images/"); $log->addDebug("Icon category added"); } // Search Clean up ---------------------------------- $searchPref = e107::getConfig('search'); if ($searchPref->getPref('core_handlers/news')) { if ($just_check) { return update_needed('Core search handlers need to be updated.'); } $searchPref->removePref('core_handlers/news')->save(false, true, false); } if ($searchPref->getPref('core_handlers/downloads')) { if ($just_check) { return update_needed('Core search handlers need to be updated.'); } $searchPref->removePref('core_handlers/downloads')->save(false, true, false); } if ($searchPref->getPref('core_handlers/pages')) { if ($just_check) { return update_needed('Core search handlers need to be updated.'); } $searchPref->removePref('core_handlers/pages')->save(false, true, false); e107::getSingleton('e107plugin')->refresh('page'); } // Clean up news keywords. - remove spaces between commas. if ($sql->select('news', 'news_id', "news_meta_keywords LIKE '%, %' LIMIT 1")) { if ($just_check) { return update_needed('News keywords contain spaces between commas and needs to be updated. '); } $sql->update('news', "news_meta_keywords = REPLACE(news_meta_keywords, ', ', ',')"); } // Any other images should be imported manually via Media Manager batch-import. // ------------------------------------------------------------------ // Check that custompages have been imported from current theme.php file if (!$just_check) { if (!is_array($pref['sitetheme_layouts']) || !vartrue($pref['sitetheme_deflayout'])) { $th = e107::getSingleton('themeHandler'); $tmp = $th->getThemeInfo($pref['sitetheme']); if ($th->setTheme($pref['sitetheme'], false)) { $log->addDebug("Updated SiteTheme prefs"); } else { $log->addDebug("Couldn't update SiteTheme prefs"); } } $log->toFile('upgrade_v1_to_v2'); if ($do_save) { save_prefs(); $log->logMessage(LAN_UPDATE_50); // $log->logMessage(implode(', ', $accum), E_MESSAGE_NODISPLAY); //$updateMessages[] = LAN_UPDATE_50.implode(', ',$accum); // Note for admin log } $log->flushMessages('UPDATE_01'); // Write admin log entry, update message handler } else { $log->toFile('upgrade_v1_to_v2_check'); } //FIXME grab message-stack from $log for the log. //if ($just_check) return TRUE; //e107::getLog()->add('UPDATE_01',LAN_UPDATE_14.$e107info['e107_version'].'[!br!]'.implode('[!br!]',$updateMessages),E_LOG_INFORMATIVE,''); // Log result of actual update return $just_check; }
| Copyright (C) 2008-2010 e107 Inc (e107.org) | | | Released under the terms and conditions of the | GNU General Public License (http://gnu.org). | | $URL: https://e107.svn.sourceforge.net/svnroot/e107/trunk/e107_0.7/e107_plugins/links_page/links.php $ | $Revision: 11678 $ | $Id: links.php 11678 2010-08-22 00:43:45Z e107coders $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) { require_once '../../class2.php'; } if (!e107::isInstalled('links_page')) { e107::redirect(); exit; } $link_shortcodes = e107::getScBatch('links_page', TRUE); require_once e_PLUGIN . 'links_page/link_defines.php'; require_once e_HANDLER . "userclass_class.php"; $eArrayStorage = e107::getArrayStorage(); $db = e107::getDb(); $mes = e107::getMessage(); require_once e_HANDLER . "form_handler.php"; $rs = new form(); require_once e_HANDLER . "file_class.php"; $fl = new e_file(); $cobj = e107::getComment(); require_once e_PLUGIN . 'links_page/link_class.php';
function triggerHook($data = '') { $text = ''; $e_event_list = e107::getPref('e_event_list'); if (is_array($e_event_list)) { foreach ($e_event_list as $hook) { if (e107::isInstalled($hook)) { if (is_readable(e_PLUGIN . $hook . "/e_event.php")) { require_once e_PLUGIN . $hook . "/e_event.php"; $name = "e_event_{$hook}"; if (class_exists($name)) { $class = new $name(); switch ($data['method']) { //returns array('caption'=>'', 'text'=>''); case 'form': if (method_exists($class, "event_{$data['method']}")) { $text[] = $class->event_form($data); } break; //returns string message //returns string message case 'create': case 'update': case 'delete': if (method_exists($class, "event_{$data['method']}")) { $text .= call_user_func(array($class, "event_{$data['method']}"), $data); } break; } } } } } } return $text; }
function show_prefs() { global $fPref; $ns = e107::getRender(); $sql = e107::getDb(); //$e107 = e107::getInstance(); $frm = e107::getForm(); $mes = e107::getMessage(); $poll_installed = e107::isInstalled('poll'); if (!$poll_installed) { if ($fPref->get('poll') == 1) { $fPref['forum_poll'] = e_UC_NOBODY; $fPref->save(false, true); } } $text = "\n\t\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "'>\n\n\t\t<table class='table adminform'>\n \t<colgroup span='2'>\n \t\t<col class='col-label' />\n \t\t<col class='col-control' />\n \t</colgroup>\n\t\t<tr>\n\t\t\t<td>" . FORLAN_44 . ":</td>\n\t\t\t<td>" . ($fPref->get('enclose') ? "<input type='checkbox' name='forum_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='forum_enclose' value='1' />") . "<span class='field-help'>" . FORLAN_45 . "</div></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_65 . ":</td>\n\t\t\t<td><input class='tbox' type='text' name='forum_title' size='15' value='" . $fPref->get('title') . "' maxlength='100' /></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_47 . ":</td>\n\t\t\t<td>" . ($fPref->get('notify') ? "<input type='checkbox' name='email_notify' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify' value='1' />") . "<span class='field-help'>" . FORLAN_48 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_177 . ":</td>\n\t\t\t<td>" . ($fPref->get('notify_on') ? "<input type='checkbox' name='email_notify_on' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify_on' value='1' />") . "<span class='field-help'>" . FORLAN_178 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_49 . ":</td>"; if ($poll_installed) { //<td>".e107::getUserClass()->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."</td> $text .= "<td>" . e107::getUserClass()->uc_dropdown('forum_poll', $fPref->get('poll'), 'nobody,public,member,admin,main,classes') . '<span class="field-help">' . FORLAN_50 . '</span></td>'; } else { $text .= "<td>" . FORLAN_66 . "</td>"; } $text .= "\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_70 . ":"; if (!$pref['image_post']) { $text .= "<br /><b>" . FORLAN_139 . "</b>"; // TODO LAN } if (!is_writable(e_PLUGIN . 'forum/attachments')) { $text .= "<br /><b>Attachment dir (" . e_PLUGIN_ABS . 'forum/attachments' . ") is not writable!</b>"; // TODO LAN } $text .= "</td>\n\t\t\t<td>" . ($fPref->get('attach') ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />") . "<span class='field-help'>" . FORLAN_71 . " <a href='" . e_ADMIN . "upload.php'>" . FORLAN_130 . "</a> " . FORLAN_131 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_134 . ":</td>\n\t\t\t<td><input class='tbox' type='text' size='3' maxlength='5' name='forum_maxwidth' value='" . $fPref->get('maxwidth') . "' /><span class='field-help'>" . FORLAN_135 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_136 . ":</td>\n\t\t\t<td>" . ($fPref->get('linkimg') ? "<input type='checkbox' name='forum_linkimg' value='1' checked='checked' />" : "<input type='checkbox' name='forum_linkimg' value='1' />") . "<span class='field-help'>" . FORLAN_137 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_51 . ":</td>\n\t\t\t<td>" . ($fPref->get('track') ? "<input type='checkbox' name='forum_track' value='1' checked='checked' />" : "<input type='checkbox' name='forum_track' value='1' />") . "<span class='field-help'>" . FORLAN_52 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_112 . ":</td>\n\t\t\t<td>" . ($fPref->get('redirect') ? "<input type='checkbox' name='forum_redirect' value='1' checked='checked' />" : "<input type='checkbox' name='forum_redirect' value='1' />") . "<span class='field-help'>" . FORLAN_113 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_116 . ":</td>\n\t\t\t<td>" . ($fPref->get('reported_post_email') ? "<input type='checkbox' name='reported_post_email' value='1' checked='checked' />" : "<input type='checkbox' name='reported_post_email' value='1' />") . "<span class='field-help'>" . FORLAN_122 . "</span></td>\n\t\t</tr>\n\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_126 . ":</td>\n\t\t\t<td>" . ($fPref->get('forum_tooltip') ? "<input type='checkbox' name='forum_tooltip' value='1' checked='checked' />" : "<input type='checkbox' name='forum_tooltip' value='1' />") . "<span class='field-help'>" . FORLAN_127 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_128 . ":</td>\n\t\t\t<td><input class='tbox' type='text' name='forum_tiplength' size='15' value='" . $fPref->get('tiplength') . "' maxlength='20' /><span class='field-help'>" . FORLAN_129 . "</span></td>\n\t\t</tr>\n\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_53 . ":</td>\n\t\t\t<td><input class='tbox' type='text' name='forum_eprefix' size='15' value='" . $fPref->get('eprefix') . "' maxlength='20' /><span class='field-help'>" . FORLAN_54 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_55 . ":</td>\n\t\t\t<td><input class='tbox' type='text' name='forum_popular' size='3' value='" . $fPref->get('popular') . "' maxlength='3' /><span class='field-help'>" . FORLAN_56 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_57 . ":</td>\n\t\t\t<td><input class='tbox' type='text' name='forum_postspage' size='3' value='" . $fPref->get('postspage') . "' maxlength='3' /><span class='field-help'>" . FORLAN_58 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_186 . ":</td>\n\t\t\t<td><input class='tbox' type='text' name='forum_threadspage' size='3' value='" . $fPref->get('threadspage') . "' maxlength='3' /><span class='field-help'>" . FORLAN_187 . "</span></td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t<td>" . FORLAN_132 . ":</td>\n\t\t\t<td>" . ($fPref->get('hilightsticky') ? "<input type='checkbox' name='forum_hilightsticky' value='1' checked='checked' />" : "<input type='checkbox' name='forum_hilightsticky' value='1' />") . "<span class='field-help'>" . FORLAN_133 . "</span></td>\n\t\t</tr>\n\t\t</table>\n\t\n\t\t<div class='buttons-bar center'>\n\t\t\t" . $frm->admin_button('updateoptions', LAN_UPDATE, 'update') . "\n\t\t</div>\n\t\t</form>\n"; $ns->tablerender(FORLAN_7, $mes->render() . $text); }
* e107 website system * * Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Plugin - PDF Generator * * $Source: /cvs_backup/e107_0.8/e107_plugins/pdf/pdf.php,v $ * $Revision$ * $Date$ * $Author$ * */ require_once '../../class2.php'; if (!e107::isInstalled('pdf') || !e_QUERY) { header('Location: ' . e_BASE . 'index.php'); } $qs = explode('.', e_QUERY, 2); $source = $qs[0]; $parms = varset($qs[1], ''); //include_lan(e_PLUGIN.'pdf/languages/'.e_LANGUAGE.'_admin_pdf.php'); //require_once(e_PLUGIN.'pdf/tcpdf.php'); //require the ufpdf class require_once e_PLUGIN . 'pdf/e107pdf.php'; //require the e107pdf class $pdf = new e107PDF(); if (strpos($source, 'plugin:') !== FALSE) { $plugin = substr($source, 7); if (file_exists(e_PLUGIN . $plugin . '/e_emailprint.php')) { include_once e_PLUGIN . $plugin . '/e_emailprint.php'; if (function_exists('print_item_pdf')) {
/* * e107 website system * * Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * * $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/category_class.php,v $ * $Revision$ * $Date$ * $Author$ */ if (!e107::isInstalled('download')) { exit; } class downloadCategory { var $cat_tree; // Initialised with all categories in a tree structure var $cat_count; // Count visible subcats and subsubcats var $down_count; // Counts total downloads function downloadCategory($nest_level = 1, $load_class = USERCLASS_LIST, $main_cat_load = '', $accum = FALSE) { // Constructor - make a copy of the tree for re-use // $nest_level = 0 merges subsubcats with subcats. >0 creates full tree. // If load-class non-null, assumed to be a 'class set' such as USERCLASS_LIST
/** * Generate the HTML to show the mailout form. Used for both sending and editing * * @param $mailSource - array of mail information * @return text for display */ function show_mailform(&$mailSource) { global $pref, $HANDLERS_DIRECTORY; global $mailAdmin; $sql = e107::getDb(); $ns = e107::getRender(); $tp = e107::getParser(); $frm = e107::getForm(); $mes = e107::getMessage(); if (!is_array($mailSource)) { $mes = e107::getMessage(); $mes->add('Coding error - mail not array (521)', E_MESSAGE_ERROR); //$ns->tablerender('ERROR!!', ); //exit; } $email_subject = varset($mailSource['mail_subject'], ''); $email_body = $tp->toForm(varset($mailSource['mail_body'], '')); $email_id = varset($mailSource['mail_source_id'], ''); $text = ''; if (strpos($_SERVER['SERVER_SOFTWARE'], 'mod_gzip') && !is_readable(e_HANDLER . 'phpmailer/.htaccess')) { $warning = LAN_MAILOUT_40 . ' ' . $HANDLERS_DIRECTORY . 'phpmailer/ ' . LAN_MAILOUT_41; $ns->tablerender(LAN_MAILOUT_42, $warning); } $debug = e_MENU == "debug" ? "?[debug]" : ""; $text .= "<div>\n\t\t\t<form method='post' action='" . e_SELF . "?mode=makemail' id='mailout_form'>\n\t\t\t" . $this->emailSelector('all', varset($mailSource['mail_selectors'], FALSE)) . "\n\t\t\t<table class='table adminform'>\n\t\t\t<colgroup>\n\t\t\t\t<col class='col-label' />\n\t\t\t\t<col class='col-control' />\n\t\t\t</colgroup>\n\t\t\t<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_111 . ": </td>\n\t\t\t\t<td>" . $frm->text('email_title', varset($mailSource['mail_title'], '')) . "</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_01 . ": </td>\n\t\t\t\t<td>" . $frm->text('email_from_name', varset($mailSource['mail_from_name'], USERNAME)) . "</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_02 . ": </td>\n\t\t\t\t<td >" . $frm->text('email_from_email', varset($mailSource['mail_from_email'], USEREMAIL)) . "</td>\n\t\t\t</tr>"; // Add in the core and any plugin selectors here /*$text .= " <tr> <td>".LAN_MAILOUT_03.": </td> <td>".$this->emailSelector('all', varset($mailSource['mail_selectors'], FALSE))."</td> </tr>";*/ $text .= "\n\t\t\t<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_04 . ": </td>\n\t\t\t\t<td>" . $frm->text('email_cc', varset($mailSource['mail_cc'], '')) . "</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_05 . ": </td>\n\t\t\t\t<td>" . $frm->text('email_bcc', varset($mailSource['mail_bcc'], '')) . "</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_51 . ": </td>\n\t\t\t\t<td>" . $frm->text('email_subject', varset($email_subject, '')) . "</td>\n\t\t\t</tr>"; // Attachment. if (e107::isInstalled('download')) { // TODO - use download plugin API if ($sql->db_Select("download", "download_url,download_name", "download_id !='' ORDER BY download_name")) { $text .= "<tr>\n\t\t\t\t<td>" . LAN_MAILOUT_07 . ": </td>\n\t\t\t\t<td >"; $text .= "<select class='tbox' name='email_attachment' >\n\t\t\t\t<option value=''> </option>\n"; while ($row = $this->e107->sql->db_Fetch()) { $selected = $mailSource['mail_attach'] == $row['download_url'] ? "selected='selected'" : ''; // $text .= "<option value='".urlencode($row['download_url'])."' {$selected}>".htmlspecialchars($row['download_name'])."</option>\n"; $text .= "<option value='" . $row['download_url'] . "' {$selected}>" . htmlspecialchars($row['download_name']) . "</option>\n"; } $text .= " </select>"; $text .= "</td>\n\t\t\t\t</tr>"; } } // TODO File-Picker from Media-Manager. $text .= "\n\t\t\t<tr>\n\t\t\t<td>" . LAN_MAILOUT_09 . ": </td>\n\t\t\t<td >\n"; global $eplug_bb; $eplug_bb[] = array('name' => 'shortcode', 'onclick' => 'expandit', 'onclick_var' => 'sc_selector', 'icon' => e_IMAGE . 'generic/bbcode/shortcode.png', 'helptext' => LAN_MAILOUT_11, 'function' => array($this, 'sc_Select'), 'function_var' => 'sc_selector'); $text .= $this->sendStyleSelect(varset($mailSource['mail_send_style'], '')); $checked = isset($mailSource['mail_include_images']) && $mailSource['mail_include_images'] ? " checked='checked'" : ''; $text .= " <input type='checkbox' name='mail_include_images' value='1' {$checked} />" . LAN_MAILOUT_225; $text .= "\n\t\t</td></tr>\n\n\t\t\t<tr>\n\t\t\t\n\t\t\t<td colspan='2'>" . $frm->bbarea('email_body', $email_body, 'mailout', 'helpb') . "</td>\n\t\t\t</tr>"; $text .= "\n\t\t\t<tr>\n\t\t\t<td colspan='2'>\n\t\t\t<div>"; // $text .= display_help('helpb','mailout'); if (e_WYSIWYG) { $text .= "<span style='vertical-align: super;margin-left:5%;margin-bottom:auto;margin-top:auto'><input type='button' class='btn button' name='usrname' value=\"" . LAN_MAILOUT_16 . "\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|USERNAME|')\" />\n\t\t\t<input type='button' class='btn button' name='usrlink' value=\"" . LAN_MAILOUT_14 . "\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|DISPLAYNAME|')\" />\n\t\t\t<input type='button' class='btn button' name='usrlink' value=\"" . LAN_MAILOUT_17 . "\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|SIGNUP_LINK|')\" />\n\t\t\t<input type='button' class='btn button' name='usrid' value=\"" . LAN_MAILOUT_18 . "\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|USERID|')\" /></span>"; } $text .= "\n\t\t\t</div></td>\n\t\t\t</tr>\n\t\t\t</table> "; $text .= "<div class='buttons-bar center'>"; if ($email_id) { $text .= $frm->hidden('mail_source_id', $email_id); $text .= $frm->admin_button('update_email', LAN_UPDATE); //$text .= "<input type='hidden' name='mail_source_id' value='".$email_id."' />"; //$text .= "<input class='button' type='submit' name='update_email' value=\"".LAN_UPDATE."\" />"; } else { $text .= $frm->admin_button('save_email', LAN_SAVE, 'other'); } $text .= $frm->admin_button('send_email', LAN_MAILOUT_08); // $text .= "</div>\n\n\t\t</form>\n\t\t</div>"; $ns->tablerender(LAN_MAILOUT_15, $mes->render() . $text); // Render the complete form }
* Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Plugin configuration module - gsitemap * * $Source: /cvs_backup/e107_0.8/e107_plugins/gsitemap/e_module.php,v $ * $Revision$ * $Date$ * $Author$ * */ if (!defined('e107_INIT')) { exit; } if (!e107::isInstalled('gsitemap')) { return ''; } global $e_event, $e107cache, $ns; // $e_event->register("newspost", "pingit"); // $e_event->register("newsupd", "pingit"); // Disable these for now, until admin functions written function pingit($vals) { global $admin_log; require e_PLUGIN . "gsitemap/weblog_pinger.php"; $pinger = new Weblog_Pinger(); // $pinger->ping_ping_o_matic("Ekzemplo", "http://www.ekzemplo.com/"); $xml_rpc_server = "blogsearch.google.com"; $xml_rpc_port = 80; $xml_rpc_path = "/ping/RPC2"; $xml_rpc_method = "weblogUpdates.extendedPing";
* * Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Plugin administration - newsfeeds * * $Source: /cvs_backup/e107_0.8/e107_plugins/trackback/modtrackback.php,v $ * $Revision$ * $Date$ * $Author$ * */ $eplug_admin = true; require_once "../../class2.php"; if (!getperms("P") || !e107::isInstalled('trackback') || !$pref['trackbackEnabled']) { header("location:" . e_BASE . "index.php"); exit; } require_once e_ADMIN . "auth.php"; if (isset($_POST['moderate'])) { $temp = array(); if (is_array($_POST['trackback_delete'])) { while (list($key, $cid) = each($_POST['trackback_delete'])) { $cid = intval($cid); if ($cid > 0) { $sql->db_Delete("trackback", "trackback_id=" . $cid); $temp[] = $cid; } } if (count($temp)) {
<?php /* * e107 website system * * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * */ if (!defined('e107_INIT')) { require_once '../../class2.php'; } if (!e107::isInstalled('forum')) { e107::redirect(); exit; } class forumStats { private $from = 0; private $view = 20; function __construct() { //include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_stats.php'); //e107::lan('forum','front'); e107::lan('forum', "front", true); e107::css('forum', 'forum.css'); } function init() { $sql = e107::getDb();
* Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * PM plugin - main user interface * */ /** * e107 Private messenger plugin * * @package e107_plugins * @subpackage pm */ $retrieve_prefs[] = 'pm_prefs'; require_once '../../class2.php'; if (!e107::isInstalled('pm')) { e107::redirect(); exit; } if (vartrue($_POST['keyword'])) { pm_user_lookup(); } require_once e_PLUGIN . 'pm/pm_class.php'; require_once e_PLUGIN . 'pm/pm_func.php'; include_lan(e_PLUGIN . 'pm/languages/' . e_LANGUAGE . '.php'); e107::getScParser(); require_once e_PLUGIN . 'pm/pm_shortcodes.php'; define('ATTACHMENT_ICON', "<img src='" . e_PLUGIN . "pm/images/attach.png' alt='' />"); $qs = explode('.', e_QUERY); $action = varset($qs[0], 'inbox'); if (!$action) {
/** * @inheritdoc */ public function beforeUpdate($new_data, $old_data, $id) { if ($new_data['upload_active'] && !e107::isInstalled('download')) { $this->getModel()->addValidationError(UPLLAN_62); $new_data['upload_active'] = 0; return $new_data; } }
* e107 website system * * Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * * $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $ * $Revision: 12639 $ * $Date: 2012-04-20 00:28:53 -0700 (Fri, 20 Apr 2012) $ * $Author: e107coders $ */ $eplug_admin = true; require_once "../../class2.php"; if (!getperms("P") || !e107::isInstalled('gallery')) { header("location:" . e_BASE . "index.php"); exit; } $e_sub_cat = 'gallery'; class plugin_gallery_admin extends e_admin_dispatcher { /** * Format: 'MODE' => array('controller' =>'CONTROLLER_CLASS'[, 'index' => 'list', 'path' => 'CONTROLLER SCRIPT PATH', 'ui' => 'UI CLASS NAME child of e_admin_ui', 'uipath' => 'UI SCRIPT PATH']); * Note - default mode/action is autodetected in this order: * - $defaultMode/$defaultAction (owned by dispatcher - see below) * - $adminMenu (first key if admin menu array is not empty) * - $modes (first key == mode, corresponding 'index' key == action) * @var array */ protected $modes = array('main' => array('controller' => 'gallery_cat_admin_ui', 'path' => null, 'ui' => 'gallery_cat_admin_form_ui', 'uipath' => null), 'cat' => array('controller' => 'gallery_cat_ui', 'path' => null, 'ui' => 'gallery_cat_form_ui', 'uipath' => null));
<?php /* * e107 website system * * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * */ if (!defined('e107_INIT')) { require_once "../../class2.php"; } if (!e107::isInstalled('log')) { header('Location: ' . e_BASE . 'index.php'); exit; } e107::includeLan(e_PLUGIN . 'log/languages/' . e_LANGUAGE . '.php'); $bar = file_exists(THEME . 'images/bar.png') ? THEME_ABS . 'images/bar.png' : e_IMAGE_ABS . 'generic/bar.png'; $mes = e107::getMessage(); e107::css('inline', "\n/* Site Stats */\n.b { background-image: url('" . $bar . "'); border: 1px solid #999; height: 10px; font-size: 0px }\n"); require_once HEADERF; if (!check_class(e107::getPref('statUserclass'))) { $mes->addError(ADSTAT_L4); $ns->tablerender(ADSTAT_L6, $mes->render()); require_once FOOTERF; exit; } if (!e107::getPref('statActivate')) { $text = ADMIN ? "<div style='text-align:center'>" . ADSTAT_L41 . "</div>" : "<div style='text-align:center'>" . ADSTAT_L5 . "</div>"; $ns->tablerender(ADSTAT_L6, $text);
function renderBatch($allow_delete = false, $allow_copy = false, $allow_url = false, $allow_featurebox = false, $customBatchOptions = array()) { // $allow_copy = TRUE; $fields = $this->getController()->getFields(); if (!varset($fields['checkboxes'])) { $mes = e107::getMessage(); $mes->add("Cannot display Batch drop-down as 'checkboxes' was not found in \$fields array.", E_MESSAGE_DEBUG); return ''; } // FIX - don't show FB option if plugin not installed if (!e107::isInstalled('featurebox')) { $allow_featurebox = false; } // TODO - core ui-batch-option class!!! REMOVE INLINE STYLE! // XXX Quick Fix for styling - correct. $text = "\n\t\t\t<div id='admin-ui-list-batch' class='navbar navbar-inner left' >\n\t\t\t\t<div class='span6 col-md-6'>"; if (!$this->getController()->getTreeModel()->isEmpty()) { $text .= "\n\t\t\t\t\t<div class='form-inline input-inline'>\n\t \t\t<img src='" . e_IMAGE_ABS . "generic/branchbottom.gif' alt='' class='icon action' />\n\t \t\t<div class='input-group input-append'>\n\t\t\t\t\t\t" . $this->select_open('etrigger_batch', array('class' => 'tbox form-control input-large select batch e-autosubmit reset', 'id' => false)) . "\n\t\t\t\t\t\t" . $this->option(LAN_BATCH_LABEL_SELECTED, '', false) . "\n\t\t\t\t\t\t" . ($allow_copy ? $this->option(LAN_COPY, 'copy', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '') . "\t\t\t\t\t\n\t\t\t\t\t\t" . ($allow_delete ? $this->option(LAN_DELETE, 'delete', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '') . "\t\t\t\t\t\n\t\t\t\t\t " . ($allow_url ? $this->option(LAN_UI_BATCH_CREATELINK, 'url', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '') . " \n\t\t\t\t\t \t" . ($allow_featurebox ? $this->option(LAN_PLUGIN_FEATUREBOX_BATCH, 'featurebox', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''); if (!empty($customBatchOptions)) { foreach ($customBatchOptions as $key => $val) { $text .= $this->option($val, $key, false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')); } } $text .= "\n\t\t\t\t" . $this->renderBatchFilter('batch') . "\n\t\t\t\t" . $this->select_close() . "\n\t\t\t\t<div class='input-group-btn input-append'>\n\t\t\t\t" . $this->admin_button('e__execute_batch', 'e__execute_batch', 'batch e-hide-if-js', LAN_GO, array('id' => false)) . "\n\t\t\t\t</div></div></div>\n\t\t\t"; } $text .= "\n\t\t\t\t</div>\n\t\t\t\t<div id='admin-ui-list-total-records' class='span6 col-md-6 right'><span>" . e107::getParser()->lanVars(LAN_UI_TOTAL_RECORDS, number_format($this->listTotal)) . "</span></div>\n\t\t\t</div>\n\t\t"; return $text; }
<?php /* * e107 website system * * Copyright (C) 2008-2015 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) */ if (!defined('e107_INIT')) { exit; } if (!e107::isInstalled('rss_menu')) { return ''; } $sql = e107::getDb(); e107::includeLan(e_PLUGIN . "rss_menu/languages/" . e_LANGUAGE . "_admin_rss_menu.php"); $topic = ""; $caption = ""; if (e_PAGE == "news.php" && e107::getPref('rss_newscats')) { $qry = explode(".", e_QUERY); if ($qry[0] == "cat" || $qry[0] == "list") { $topic = intval($qry[1]); } } if (deftrue('e_CURRENT_PLUGIN') && ($res = $sql->retrieve("rss", "rss_path,rss_url", " rss_path = '" . e_CURRENT_PLUGIN . "' LIMIT 1"))) { $caption = e107::getParser()->lanVars(LAN_PLUGIN_RSS_SUBSCRIBE_TO, deftrue('LAN_PLUGIN_' . strtoupper(e_CURRENT_PLUGIN) . '_NAME')); $type = $res['rss_url']; $plug = $res['rss_path']; } elseif ($sql->select("rss", "rss_path", " rss_path = 'news' LIMIT 1")) { $caption = LAN_PLUGIN_RSS_SUBSCRIBE;
$thread->threadInfo = $forum->threadGet($thread->threadId); } $num = $thread->page ? $thread->page - 1 : 0; $postList = $forum->PostGet($thread->threadId, $num * $thread->perPage, $thread->perPage); // SEO - meta description (auto) if (count($postList)) { define("META_DESCRIPTION", $tp->text_truncate(str_replace(array('"', "'"), '', strip_tags($tp->toHTML($postList[0]['post_entry']))), 250, '...')); } $gen = new convert(); if ($thread->message) { //$ns->tablerender('', $thread->message, array('forum_viewtopic', 'msg')); e107::getMessage()->add($thread->message); } //if (isset($thread->threadInfo['thread_options']['poll'])) //XXX Currently Failing - misconfigured thread-options. //{ if (e107::isInstalled('poll')) { $_qry = 'SELECT * FROM `#polls` WHERE `poll_datestamp` = ' . $thread->threadId; if ($sql->gen($_qry)) { if (!defined('POLLCLASS')) { include_once e_PLUGIN . 'poll/poll_class.php'; } $poll = new poll(); $pollstr = "<div class='spacer'>" . $poll->render_poll($_qry, 'forum', 'query', true) . '</div>'; } } //} //Load forum templates // FIXME - new template paths! if (file_exists(THEME . 'forum_design.php')) { include_once THEME . 'forum_design.php'; }
<?php /* * e107 website system * * Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Plugin - newsfeeds * * $Source: /cvs_backup/e107_0.8/e107_plugins/newsfeed/e_help.php,v $ * $Revision$ * $Date$ * $Author$ * */ if (!defined('e107_INIT')) { exit; } if (!e107::isInstalled('newsfeed')) { return; } include_lan(e_PLUGIN . 'newsfeed/languages/' . e_LANGUAGE . '_admin_newsfeed.php'); $ns->tablerender(NFLAN_43, NFLAN_42);
* * Copyright (C) 2008-2009 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * * $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $ * $Revision$ * $Date$ * $Author$ */ $eplug_admin = true; define('DOWNLOAD_DEBUG', FALSE); require_once "../../class2.php"; if (!getperms("P") || !e107::isInstalled('download')) { header("location:" . e_BASE . "index.php"); exit; } e107::lan('download', 'download'); // e_PLUGIN.'download/languages/'.e_LANGUAGE.'/download.php' e107::lan('download', 'admin_download'); // e_PLUGIN.'download/languages/'.e_LANGUAGE.'/admin_download.php' // require_once(e_PLUGIN.'download/handlers/adminDownload_class.php'); require_once e_PLUGIN . 'download/handlers/download_class.php'; require_once e_HANDLER . 'upload_handler.php'; require_once e_HANDLER . 'xml_class.php'; require_once e_HANDLER . "form_handler.php"; require_once e_HANDLER . "ren_help.php"; //require_once(e_HANDLER."calendar/calendar_class.ph_"); //$cal = new DHTML_Calendar(true);
function importSme() { global $PLUGINS_DIRECTORY; $ns = e107::getRender(); $sql = e107::getDb(); $sql2 = e107::getDb('sql2'); $frm = e107::getForm(); $mes = e107::getMessage(); $existing = array(); $sql->select("gsitemap", "*"); while ($row = $sql->fetch()) { $existing[] = $row['gsitemap_name']; } $importArray = array(); /* sitelinks ... */ $sql->select("links", "*", "ORDER BY link_order ASC", "no-where"); $nfArray = $sql->db_getList(); foreach ($nfArray as $row) { if (!in_array($row['link_name'], $existing)) { $importArray[] = array('name' => $row['link_name'], 'url' => $row['link_url'], 'type' => GSLAN_1); } } /* custom pages ... */ $query = "SELECT p.page_id, p.page_title, p.page_sef, p.page_chapter, ch.chapter_sef as chapter_sef, b.chapter_sef as book_sef FROM #page as p\n\t\t\t\tLEFT JOIN #page_chapters as ch ON p.page_chapter = ch.chapter_id\n\t\t\t\tLEFT JOIN #page_chapters as b ON ch.chapter_parent = b.chapter_id\n\t\t\t\tWHERE page_title !='' ORDER BY page_datestamp ASC"; $data = $sql->retrieve($query, true); foreach ($data as $row) { if (!in_array($row['page_title'], $existing)) { $route = $row['page_chapter'] == 0 ? "page/view/other" : "page/view/index"; $importArray[] = array('name' => $row['page_title'], 'url' => e107::getUrl()->create($route, $row, array('full' => 1, 'allow' => 'page_sef,page_title,page_id, chapter_sef, book_sef')), 'type' => "Page"); } } /* forums ... */ if (e107::isInstalled('forum')) { $sql->select("forum", "*", "forum_parent!='0' ORDER BY forum_order ASC"); $nfArray = $sql->db_getList(); foreach ($nfArray as $row) { if (!in_array($row['forum_name'], $existing)) { $importArray[] = array('name' => $row['forum_name'], 'url' => e107::getUrl()->create('forum/forum/view', $row['forum_id']), 'type' => "Forum"); } } } /* DEPRECATED content pages ... if(e107::isInstalled('content')) { $sql -> select("pcontent", "content_id, content_heading", "LEFT(content_parent,1) = '0' ORDER BY content_heading"); $nfArray = $sql -> db_getList(); foreach($nfArray as $row) { $sql2 -> 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 -> 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']); } } } } */ $text = "\n\t\t<form action='" . e_SELF . "' id='form' method='post'>\n\t\t<table class='table adminlist'>\n\t\t<colgroup>\n\t\t\t<col class='center' style='width:5%;' />\n\t\t\t<col style='width:15%' />\n\t\t\t<col style='width:40%' />\n\t\t\t<col style='width:40%' />\n\t\t</colgroup>\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t<td>" . GSLAN_2 . "</td>\n\t\t\t<td>" . LAN_TYPE . "</td>\n\t\t\t<td>" . LAN_NAME . "</td>\n\t\t\t<td>" . LAN_URL . "</td>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t"; foreach ($importArray as $ia) { $text .= "\n\t\t\t<tr>\n\t\t\t\t<td><input type='checkbox' name='importid[]' value='" . $ia['name'] . "^" . $ia['url'] . "^" . $ia['type'] . "' /></td>\n\t\t\t\t<td>" . $ia['type'] . "</td>\n\t\t\t\t<td>" . $ia['name'] . "</td>\n\t\t\t\t<td><span class='smalltext'>" . str_replace(SITEURL, "", $ia['url']) . "</span></td>\n\t\t\t</tr>\n\t\t\t"; } $text .= "\n\t\t<tr>\n\t\t<td colspan='4' class='center'>\n\t\t<div> " . GSLAN_8 . " " . GSLAN_9 . " : <select class='tbox' name='import_priority' >\n"; for ($i = 0.1; $i < 1.0; $i = $i + 0.1) { $sel = vartrue($editArray['gsitemap_priority']) == number_format($i, 1) ? "selected='selected'" : ""; $text .= "<option value='" . number_format($i, 1) . "' {$sel}>" . number_format($i, 1) . "</option>\n"; } $text .= "</select> " . GSLAN_10 . "\n\n\n\t\t<select class='tbox' name='import_freq' >\n"; foreach ($this->freq_list as $k => $fq) { $sel = vartrue($editArray['gsitemap_freq']) == $k ? "selected='selected'" : ""; $text .= "<option value='{$k}' {$sel}>{$fq}</option>\n"; } $text .= "</select> <br /><br />\n\n\t\t</div>\n\t\t\n\t\t</td>\n\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t<div class='buttons-bar center'>\n\t\t" . $frm->admin_button('import_links', GSLAN_18, 'submit') . "\n\t\t</div>\n\t\t</form>\n\t\t"; $ns->tablerender(GSLAN_7, $mes->render() . $text); }
private function renderChart() { // REQUIRES Log Plugin to be installed. if (e107::isInstalled('log')) { return $this->renderStats('log'); } elseif (e107::isInstalled('awstats')) { return $this->renderStats('awstats'); } else { return $this->renderStats('demo'); } }
function sc_admin_pm($parm) { if (!e107::isInstalled('pm')) { return; } $sql = e107::getDb(); $tp = e107::getParser(); $count = $sql->count('private_msg', '(*)', 'WHERE pm_read = 0 AND pm_to=' . USERID); if ($count > 0) { $countDisp = ' <span class="label label-primary">' . $count . '</span> '; } else { $countDisp = ''; } $inboxUrl = e_PLUGIN . 'pm/admin_config.php?mode=inbox&action=list&iframe=1'; $outboxUrl = e_PLUGIN . 'pm/admin_config.php?mode=outbox&action=list&iframe=1'; $composeUrl = e_PLUGIN . 'pm/admin_config.php?mode=outbox&action=create&iframe=1'; $text = '<ul class="nav navbar-nav nav-pills"> <li class="dropdown"> <a class="dropdown-toggle" title="Messages" role="button" data-toggle="dropdown" href="#" > ' . $tp->toGlyph('fa-envelope') . $countDisp . '<b class="caret"></b> </a> <ul class="dropdown-menu" role="menu" > <li class="nav-header navbar-header dropdown-header">Private Messages</li> <li><a class="e-modal" data-cache="false" data-modal-caption="Inbox" data-target="#uiModal" href="' . $inboxUrl . '" >Inbox</a></li> <li><a class="e-modal" data-cache="false" data-modal-caption="Outbox" data-target="#uiModal" href="' . $outboxUrl . '">Outbox</a></li> <li><a class="e-modal" data-cache="false" data-modal-caption="Compose" data-target="#uiModal" href="' . $composeUrl . '">Compose</a></li> </ul> </li> </ul> '; return $text; // e107_plugins/pm/pm.php /* $text = ' <li class="dropdown"> <a class="dropdown-toggle" title="Messages" role="button" data-toggle="dropdown" href="#" > <i class="icon-envelope icon-white active"></i> 3 <b class="caret"></b> </a> <div id="dropdown" class="dropdown-menu pull-right e-noclick" style="padding:10px;width:300px"> <ul class="nav-list"> <li class="nav-header navbar-header">Unread Messages</li> <li><a href="#">Incoming Message Number 1</a></li> <li><a href="#">Incoming Message Number 2</a></li> <li><a href="#">Incoming Message Number 3</a></li> <li role="separator" class="divider"></li> </ul> <textarea class="e-tip input-block-level" title="Example Only"></textarea> <button class="dropdown-toggle btn btn-primary">Send</button> </div> </li> '; return $text; */ }
* $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/admin_prefs.php,v $ * $Revision$ * $Date$ * $Author$ */ /* Notes: - array_flip method deprecated for delete item detection. - using form handler is deprecated and present only for backwards compatibility. - using generic terms like EDIT and DELETE in Language file is deprecated, use LAN_EDIT etc. instead. - using terms like created, update, options etc..deprecated should use built in terms. - generic admin icons used. ADMIN_ICON_EDIT etc. - using $caption = "whatever", is unneccessary. */ require_once "../../class2.php"; if (!getperms("P") || !e107::isInstalled('rss_menu')) { header("location:" . e_BASE . "index.php"); exit; } include_lan(e_PLUGIN . "rss_menu/languages/" . e_LANGUAGE . "_admin_rss_menu.php"); // XXX THIS IS SET UP FOR LATER USE. class rss_admin extends e_admin_dispatcher { protected $modes = array('main' => array('controller' => 'rss_ui', 'path' => null, 'ui' => 'rss_form_ui', 'uipath' => null)); protected $adminMenu = array('main/list' => array('caption' => LAN_MANAGE, 'perm' => 'P'), 'main/import' => array('caption' => "Add New Feed", 'perm' => 'P'), 'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P')); protected $adminMenuAliases = array('main/edit' => 'main/list'); protected $menuTitle = 'RSS'; function init() { if (E107_DEBUG_LEVEL > 0) { $this->adminMenu['main/create'] = array('caption' => "Add Custom Feed", 'perm' => 'P');
<?php /* * e107 website system * * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Plugin administration - newsfeeds * * */ require_once "../../class2.php"; if (!getperms("P") || !e107::isInstalled('newsfeed')) { header("location:" . e_BASE . "index.php"); exit; } require_once e_ADMIN . "auth.php"; define('NEWSFEED_LIST_CACHE_TAG', 'nomd5_newsfeeds'); $frm = e107::getForm(); $mes = e107::getMessage(); if (e_QUERY) { list($action, $id) = explode(".", e_QUERY); $id = intval($id); } else { $action = FALSE; $id = FALSE; } if (isset($_POST['createFeed']) || isset($_POST['updateFeed'])) { if ($_POST['newsfeed_url'] && $_POST['newsfeed_name']) {