Пример #1
0
 function install_post($var)
 {
     e107::includeLan(e_PLUGIN . 'featurebox/languages/' . e_LANGUAGE . '_admin_featurebox.php');
     $mes = e107::getMessage();
     $query = array();
     $query['fb_category_id'] = 0;
     $query['fb_category_title'] = 'General';
     $query['fb_category_template'] = 'default';
     $query['fb_category_random'] = 0;
     $query['fb_category_class'] = e_UC_PUBLIC;
     $query['fb_category_limit'] = 1;
     $inserted = e107::getDb()->db_Insert('featurebox_category', $query);
     $status = $inserted ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     $mes->add(FBLAN_INSTALL_01, $status);
     if ($inserted) {
         $query = array();
         $query['fb_id'] = 0;
         $query['fb_category'] = $inserted;
         $query['fb_title'] = 'Default Title';
         $query['fb_text'] = 'Default Message';
         $query['fb_mode'] = 0;
         $query['fb_class'] = e_UC_PUBLIC;
         $query['fb_rendertype'] = 0;
         $query['fb_template'] = 'default';
         $query['fb_order'] = 0;
         $query['fb_image'] = '';
         $query['fb_imageurl'] = '';
         $status = e107::getDb('sql2')->db_Insert('featurebox', $query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     } else {
         $status = E_MESSAGE_ERROR;
     }
     $mes->add(FBLAN_INSTALL_02, $status);
 }
Пример #2
0
function admin_update($update, $type = 'update', $success = false, $failed = false, $output = true)
{
    require_once e_HANDLER . "message_handler.php";
    $emessage = e107::getMessage();
    if ($type == 'update' && $update || $type == 'insert' && $update !== false) {
        $emessage->add($success ? $success : ($type == 'update' ? LAN_UPDATED : LAN_CREATED), E_MESSAGE_SUCCESS);
    } elseif ($type == 'delete' && $update) {
        $emessage->add($success ? $success : LAN_DELETED, E_MESSAGE_SUCCESS);
    } elseif (!mysql_errno()) {
        if ($type == 'update') {
            $emessage->add(LAN_NO_CHANGE . ' ' . LAN_TRY_AGAIN, E_MESSAGE_INFO);
        } elseif ($type == 'delete') {
            $emessage->add(LAN_DELETED_FAILED . ' ' . LAN_TRY_AGAIN, E_MESSAGE_INFO);
        }
    } else {
        switch ($type) {
            case 'insert':
                $msg = LAN_CREATED_FAILED;
                break;
            case 'delete':
                $msg = LAN_DELETED_FAILED;
                break;
            default:
                $msg = LAN_UPDATED_FAILED;
                break;
        }
        $text = ($failed ? $failed : $msg . " - " . LAN_TRY_AGAIN) . "<br />" . LAN_ERROR . " " . mysql_errno() . ": " . mysql_error();
        $emessage->add($text, E_MESSAGE_ERROR);
    }
    $emessage->addInfo("Using deprecated admin_update() which has been replaced by \$mes->autoMessage();");
    if ($output) {
        echo $emessage->render();
    }
    return $update;
}
Пример #3
0
 /**
  * For inserting default database content during install after table has been created by the test_sql.php file. 
  */
 function install_post($var)
 {
     $sql = e107::getDb();
     $mes = e107::getMessage();
     /*
     		$e107_test = array(
     			'test_id'				=>'1',
     			'test_icon'			=>'{e_PLUGIN}test/images/test_32.png',
     			'test_type'			=>'type_1',
     			'test_name'			=>'My Name',
     			'test_folder'			=>'Folder Value',
     			'test_version'			=>'1',
     			'test_author'			=>'bill',
     			'test_authorURL'		=>'http://e107.org',
     			'test_date'			=>'1352871240',
     			'test_compatibility'	=>'2',
     			'test_url'				=>'http://e107.org'
     		);
     		
     		if($sql->insert('test',$e107_test))
     		{
     			$mes->add("Custom - Install Message.", E_MESSAGE_SUCCESS);
     		}
     		else
     		{
     			$mes->add("Custom - Failed to add default table data.", E_MESSAGE_ERROR);	
     		}*/
 }
Пример #4
0
 /**
  * Update the current Repo. of this e107 installation.  (eg. e107 on github)
  */
 function gitrepo()
 {
     $mes = e107::getMessage();
     $fl = e107::getFile();
     if (is_dir(e_BASE . ".git")) {
         $gitPath = defset('e_GIT', 'git');
         // addo to e107_config.php to
         // Change Dir.
         $cmd = 'cd ' . e_ROOT;
         $mes->addDebug($cmd);
         $text = `{$cmd} 2>&1`;
         // Remove any local changes.
         $cmd = $gitPath . ' reset --hard';
         $mes->addDebug($cmd);
         $text .= `{$cmd} 2>&1`;
         // Run Pull request
         $cmd = $gitPath . ' pull';
         $mes->addDebug($cmd);
         $text .= `{$cmd} 2>&1`;
         $return = print_a($text, true);
         $mes->addSuccess($return);
         if (unlink(e_BASE . "install.php")) {
             $mes->addDebug("Removed install.php");
         }
     } else {
         $mes->addError("No git repo found");
         //TODO LAN
     }
     $fl->chmod(e_BASE . "cron.php", 0755);
     $fl->chmod(e_HANDLER . "bounce_handler.php", 0755);
 }
Пример #5
0
 function showImages($cat)
 {
     $mes = e107::getMessage();
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $template = array_change_key_case($template);
     $sc = e107::getScBatch('gallery', TRUE);
     if (defset('BOOTSTRAP') === true || defset('BOOTSTRAP') === 2) {
         $template['list_start'] = str_replace('row', 'row-fluid', $template['list_start']);
     }
     $sc->total = e107::getMedia()->countImages($cat);
     $sc->amount = 12;
     // TODO Add Pref. amount per page.
     $sc->curCat = $cat;
     $sc->from = $_GET['frm'] ? intval($_GET['frm']) : 0;
     $list = e107::getMedia()->getImages($cat, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cat]['media_cat_title'], false, 'defs');
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row);
         $inner .= $tp->parseTemplate($template['list_item'], TRUE, $sc);
     }
     $text = $tp->parseTemplate($template['list_start'], TRUE, $sc);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['list_end'], TRUE, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_GALLERY_TITLE, $mes->render() . $text);
 }
Пример #6
0
 function invalidURL()
 {
     $mes = e107::getMessage();
     $mes->addWarning("Invalid URL");
     echo "<div class='container'>" . $mes->render() . "</div>";
     return;
 }
Пример #7
0
 function upgrade_post($var)
 {
     $sql = e107::getDb();
     if ($sql->isEmpty('forum_thread') === true && $sql->isTable('forum_t') && $sql->isEmpty('forum_t') === false) {
         $mes = e107::getMessage();
         $mes->addSuccess("Migration is required. Please click 'Continue'.<br /><a class='btn btn-primary' href='" . e_PLUGIN . "forum/forum_update.php'>Continue</a>");
     }
 }
Пример #8
0
 function install_post($var)
 {
     $sql = e107::getDb();
     $mes = e107::getMessage();
     $query = "INSERT INTO #pcontent VALUES \n\t\t(1, 'content', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '" . time() . "', '0', '0', '', '1', '0', '', '') ,\n\t\t(2, 'article', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '" . time() . "', '0', '0', '', '2', '0', '', ''),\n\t\t(3, 'review', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '" . time() . "', '0', '0', '', '3', '0', '', '')";
     $status = $sql->gen($query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     $mes->add("Adding Default table categories to table: content ", $status);
 }
Пример #9
0
 function install_post($var)
 {
     $sql = e107::getDb();
     $mes = e107::getMessage();
     $insert = array(array('rss_id' => 0, 'rss_name' => 'News', 'rss_url' => 'news', 'rss_topicid' => '', 'rss_path' => 'news', 'rss_text' => 'The rss feed of the news', 'rss_datestamp' => time(), 'rss_class' => '0', 'rss_limit' => '9'));
     $status = $sql->insert('rss', $insert) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     $mes->add("Adding Default table data to table: rss", $status);
     //TODO Generic LAN "LAN_DEFAULT_TABLE_DATA"
 }
Пример #10
0
 public function config()
 {
     $engine = e107::pref('core', 'comments_engine', 'e107');
     if ($engine == 'social::facebook' && empty($this->facebookActive)) {
         e107::getMessage()->addInfo("Facebook comments requires that you have a facebook App ID. See the 'social login' area in admin-preferences to add one.");
     }
     $config = array();
     $config[] = array('name' => "Facebook", 'function' => 'facebook');
     return $config;
 }
Пример #11
0
 public function beforeCreate($new_data)
 {
     if (empty($new_data['pm_to'])) {
         e107::getMessage()->addError('Please enter a recipient in the "To" field.');
         return false;
     }
     $new_data['pm_size'] = strlen($new_data['pm_text']);
     $new_data['pm_from'] = USERID;
     return $new_data;
 }
Пример #12
0
 function init()
 {
     $mes = e107::getMessage();
     if (vartrue($_POST['bloggerUrl'])) {
         $this->feedUrl = rtrim($_POST['bloggerUrl'], "/") . "/feeds/posts/default?max-results=999&alt=rss";
     }
     if (vartrue($_POST['bloggerCleanup'])) {
         $this->cleanupHtml = true;
     }
     $mes->addDebug("Blogger Feed:" . $this->feedUrl);
 }
Пример #13
0
 /**
  * Process Posted Data.
  * @param $ui admin-ui object
  */
 public function process($ui, $id = 0)
 {
     $data = $ui->getPosted();
     $action = $ui->getAction();
     // current mode: create, edit, list
     //e107::getHybridAuth('twitter');
     e107::getMessage()->addDebug("e107_plugins/social/e_admin.php :: process method called.");
     e107::getMessage()->addDebug("ID: " . $id);
     e107::getMessage()->addDebug("Action: " . $action);
     e107::getMessage()->addDebug(print_a($data, true));
 }
Пример #14
0
 function install_post($var)
 {
     $sql = e107::getDb();
     $mes = e107::getMessage();
     $query = "INSERT INTO #faqs (`faq_id`, `faq_parent`, `faq_question`, `faq_answer`, `faq_comment`, `faq_datestamp`, `faq_author`, `faq_order`) VALUES \n\t\t\t(1, 1, 'What is FAQs?', 'FAQs is a plugin that you can use on your e107 0.8+ website to manage Frequently Asked Questions', 0, 1230918231, 1, 0),\n\t\t\t(2, 1, 'How can I use e107?', 'You can use e107 if you have a running server with PHP and MySQL installed. Read more about installation requirements.\r\n\r\ne107 is a Content Management System (CMS). You can use it to make consistent web pages. The advantage is you don''t have to write HTML or create CSS files. The programs of e107 take care of all the presentation through the theme. All your entered data is saved into a MySQL database.\r\n\r\ne107 has active plugin and theme resources which grow every day. The software is completely and totally free and always will be, you don''t even need to register anywhere to download it. There are hundreds of content management systems to choose from, if you''re not sure e107 suits your needs, head over to OpenSourceCMS and try a few out.\r\n\r\nWith e107 you are totally in control with a powerful but easy to understand Admin Area and you can add functionalities to your website by adding plugins. e107 has an easy step-by-step installation procedure to install it on your server. ', 0, 0, 1, 1),\n\t\t\t(3, 1, 'What is a plugin?', 'A plugin is an additional program that integrates with the e107 core system.\r\n\r\nActually plugins are enhancements to the existing system. Some other CMS systems call it extensions, components or modules.\r\n\r\nAlready some core plugins are included in the full install package of e107.\r\n\r\nYou can activate them using Admin > Plugin Manager, and click on Install for the ones you want. They will appear in your Admin Area for configuration.\r\n\r\nThere are all kinds of plugins: small and large, core plugins and third party plugins. There are plugins for all kinds of purposes. ', 0, 123123123, 1, 2);\n\t\t";
     $status = $sql->db_Select_gen($query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     $mes->add("Adding Default table data to table: faqs", $status);
     $query2 = "INSERT INTO #faqs_info (`faq_info_id`, `faq_info_title`, `faq_info_about`, `faq_info_parent`, `faq_info_class`, `faq_info_order`, `faq_info_icon`, `faq_info_metad`, `faq_info_metak`) VALUES \n\t\t\t(1, 'General', 'General Faqs', 0, 0, 0, '', '', ''),\n\t\t\t(2, 'Misc', 'Other FAQs', 0, 0, 1, '', '', '');\n\t\t";
     $status = $sql->db_Select_gen($query2) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     $mes->add("Adding Default table data to table: faqs_info", $status);
 }
Пример #15
0
 function init()
 {
     $mes = e107::getMessage();
     if (vartrue($_POST['siteUrl'])) {
         $domain = preg_replace("/https?:\\/\\//i", '', $_POST['siteUrl']);
         list($site, $dom, $tld) = explode(".", $domain);
         $this->feedUrl = "http://" . $site . ".livejournal.com/data/rss";
     }
     if (vartrue($_POST['siteCleanup'])) {
         $this->cleanupHtml = true;
     }
     $mes->addDebug("LiveJournal Feed:" . $this->feedUrl);
 }
Пример #16
0
 function __construct()
 {
     // DO Not translate - debug info only.
     $log = e107::getAdminLog();
     if (E107_DEBUG_LEVEL > 0 || e107::getPref('developer')) {
         $dep = debug_backtrace(false);
         foreach ($dep as $d) {
             $log->addDebug("Deprecated ArrayStorage Class called by " . str_replace(e_ROOT, "", $d['file']) . " on line " . $d['line']);
         }
         $log->save('DEPRECATED', E_LOG_NOTICE, '', false, LOG_TO_ROLLING);
         e107::getMessage()->addDebug("Please remove references to <b>arraystorage_class.php</b> and use e107::serialize() and e107::unserialize() instead.");
     }
 }
Пример #17
0
 function upgrade_required()
 {
     $list = e107::getConfig()->get('e_meta_list');
     if (in_array('tinymce4', $list)) {
         return true;
     }
     if (file_exists(e_PLUGIN . "tinymce4/e_meta.php")) {
         e107::getMessage()->addInfo("Please delete the outdated file <b>" . e_PLUGIN . "tinymce4/e_meta.php</b> and then run the updating process.");
         //	print_a(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,8));
         return true;
     }
     return false;
 }
Пример #18
0
 /**
  * Available parameters (GET string format)
  * - cols (integer): number of items per column, default 1
  * - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
  * - tablestyle (string): mode to be used with <code>tablerender()</code>, default 'featurebox'
  * - notablestyle (null): if isset - disable <code>tablerender()</code>
  * - force (boolean): force category model load , default false
  * - ids (string): comma separated id list - load specific featurebox items, default empty 
  * 
  * @param string $parm parameters
  * @param string $mod category template
  * @example {FEATUREBOX=cols=2|tabs}
  */
 function sc_featurebox($parm = null, $mod = '')
 {
     if ($parm == null && $mod == '') {
         $type = vartrue(e107::getPlugPref('featurebox', 'menu_category'), 'bootstrap_carousel');
         $text = e107::getParser()->parseTemplate("{FEATUREBOX|" . $type . "}");
         return $text;
     }
     // TODO cache
     if (!e107::isInstalled('featurebox')) {
         return '';
     }
     if (!$mod) {
         $ctemplate = 'default';
     } else {
         $ctemplate = $mod;
     }
     parse_str($parm, $parm);
     $category = $this->getCategoryModel($ctemplate, vartrue($parm['force']) ? true : false);
     $defopt = array('force' => 0, 'no_fill_empty' => 0, 'tablestyle' => 'featurebox', 'cols' => 1, 'ids' => '', 'notablestyle' => null);
     // reset to default, update current
     $category->setParams($defopt)->updateParams($parm);
     if (!$category->hasData()) {
         return '';
     }
     $tmpl = $this->getFboxTemplate($ctemplate);
     $type = vartrue($tmpl['js_type'], '');
     // Legacy support (prototype.js)
     if (vartrue($tmpl['js'])) {
         $tmp = explode(',', $tmpl['js']);
         foreach ($tmp as $file) {
             e107::js('footer', $file, $type);
         }
     }
     $tp = e107::getParser();
     if (vartrue($tmpl['js_inline'])) {
         $data = $tp->toText($category->getData('fb_category_parms'));
         $jsInline = str_replace("{FEATUREBOX_PARMS}", "{" . trim($data) . "}", $tmpl['js_inline']);
         e107::js('footer-inline', $jsInline, $type, 3);
     }
     // Fix - don't use tablerender if no result (category could contain hidden items)
     $ret = $this->render($category, $ctemplate, $parm);
     if (empty($ret)) {
         e107::getMessage()->addDebug('Featurebox returned nothing.')->addDebug('Category: ' . print_a($category, true))->addDebug('Template: ' . $ctemplate)->addDebug('Param: ' . print_a($parm, true));
         return '';
     }
     $ret = $tp->parseTemplate($tmpl['list_start'], true, $category) . $ret . $tp->parseTemplate($tmpl['list_end'], true, $category);
     if (isset($parm['notablestyle'])) {
         return $ret;
     }
     return e107::getRender()->tablerender(LAN_PLUGIN_FEATUREBOX_NAME, $ret, vartrue($parm['tablestyle'], 'featurebox'), true);
 }
Пример #19
0
 /**
  * Process Posted Data.
  * @param $ui admin-ui object
  */
 public function process($ui)
 {
     $data = $ui->getPosted();
     e107::getMessage()->addDebug(print_a($data, true));
     if ($data['news_id'] && $this->active) {
         $excerpt = e107::getParser()->text_truncate(strip_tags(e107::getParser()->post_toHTML($data['news_body'])), 100, '...');
         //			$id=mysql_insert_id();
         $permLink = e107::getInstance()->base_path . "comment.php?comment.news." . intval($data['news_id']);
         require_once e_PLUGIN . "trackback/trackbackClass.php";
         $trackback = new trackbackClass();
         if ($data['x_trackback_urls']) {
             $urlArray = explode("\n", $data['x_trackback_urls']);
             foreach ($urlArray as $pingurl) {
                 if (!($terror = $trackback->sendTrackback($permLink, $pingurl, $data['news_title'], $excerpt))) {
                     e107::getMessage()->add("Successfully pinged {$pingurl}.", E_MESSAGE_SUCCESS);
                 } else {
                     e107::getMessage()->add("was unable to ping {$pingurl}<br />[ Error message returned was : '{$terror}'. ]", E_MESSAGE_ERROR);
                 }
             }
         }
         /*
         	if(isset($_POST['pingback_urls']))
         	{
         		if ($urlArray = $trackback->getPingUrls($data['news_body'])) //FIXME - missing method!!!
         		{
         			foreach($urlArray as $pingurl)
         			{
         
         				if ($trackback->sendTrackback($permLink, $pingurl, $data['news_title'], $excerpt))
         				{
         
         					e107::getMessage()->add("Successfully pinged {$pingurl}.", E_MESSAGE_SUCCESS);
         				}
         				else
         				{
         
         					e107::getMessage()->add("Pingback to {$pingurl} failed ...", E_MESSAGE_ERROR);
         				}
         			}
         		}
         		else
         		{
         
         			e107::getMessage()->add("No pingback addresses were discovered", E_MESSAGE_INFO, $smessages);
         		}
         	}
         */
     }
     /* end trackback */
 }
Пример #20
0
 function init()
 {
     if (!empty($_POST['version'])) {
         $this->version = $_POST['version'];
     }
     if (!empty($_POST['baseUrl'])) {
         $this->baseUrl = $_POST['baseUrl'];
     }
     if (!empty($_POST['basePath'])) {
         $this->basePath = $_POST['basePath'];
     }
     if (!empty($_POST)) {
         e107::getMessage()->addDebug(print_a($_POST, true));
     }
 }
Пример #21
0
 function upgrade_post($needed)
 {
     /*
      * Currently Installed version (prior to upgrade): $needed->current_plug['plugin_version'];
      * Add "IF" statements as needed, and other upgrade_x_y() methods as required. 
      * eg.	if($needed->current_plug['plugin_version'] == '1.0')
      * 		{
      * 			$this->upgrade_from_1();
      * 		}
      */
     $sql = e107::getDb();
     $mes = e107::getMessage();
     $qry = "SELECT * FROM #download WHERE download_image !='' AND SUBSTRING(download_image, 1, 3) != '{e_' ";
     if ($sql->db_Select_gen($qry)) {
         if ($needed == TRUE) {
             return "Incorrect download image paths";
         }
         // Signal that an update is required.
         if ($sql->db_Update("download", "download_image = CONCAT('{e_FILE}downloadimages/',download_image) WHERE download_image !='' ")) {
             $mes->addSuccess("Updated Download-Image paths");
         } else {
             $mes->addError("Failed to update Download-Image paths");
         }
         if ($sql->db_Update("download", " download_thumb = CONCAT('{e_FILE}downloadthumbs/',download_thumb) WHERE download_thumb !='' ")) {
             $mes->addSuccess("Updated Download-Thumbnail paths");
         } else {
             $mes->addError("Failed to update Download-Thumbnail paths");
         }
     }
     $qry = "SELECT * FROM #download_category WHERE download_category_icon !='' AND SUBSTRING(download_category_icon, 1, 3) != '{e_' ";
     if ($sql->db_Select_gen($qry)) {
         // Signal that an update is required.
         if ($needed == TRUE) {
             return "Downloads-Category icon paths need updating";
         }
         // Must have a value if an update is needed. Text used for debug purposes.
         if ($sql->db_Update("download_category", "download_category_icon = CONCAT('{e_IMAGE}icons/',download_category_icon) WHERE download_category_icon !='' ")) {
             $mes->addSuccess("Updated Download-Image paths");
         } else {
             $mes->addError("Failed to update Download-Image paths");
         }
     }
     if ($needed == TRUE) {
         return FALSE;
     }
 }
Пример #22
0
 public function releaseCheck($mode = 'plugin', $cache = TRUE)
 {
     global $e107cache;
     if (!$this->getOption('releaseUrl')) {
         return;
     }
     $cacheString = $mode . 'UpdateCheck';
     $e107cache->CachePageMD5 = md5($cacheString . $this->getOption('curFolder') . $this->getOption('curVersion', 1.0));
     if ($cache == TRUE && ($cacheData = $e107cache->retrieve($cacheString, 3600, TRUE))) {
         $mes = e107::getMessage();
         $mes->addInfo($cacheData);
         $e107cache->CachePageMD5 = "";
         return;
     }
     $xml = e107::getXml();
     $feed = $this->getOption('releaseUrl');
     if (substr($feed, -4) == ".php") {
         $feed .= "?folder=" . $this->getOption('curFolder') . "&version=" . $this->getOption('curVersion');
     }
     if ($rawData = $xml->loadXMLfile($feed, TRUE)) {
         if (!$rawData[$mode][1]) {
             $rawData[$mode] = $rawData;
         }
         $txt = "";
         $lan_text = $mode == "theme" ? ADLAN_162 : ADLAN_163;
         foreach ($rawData[$mode] as $val) {
             $name = $val['@attributes']['name'];
             $folder = $val['@attributes']['folder'];
             $version = $val['@attributes']['version'];
             $url = $val['@attributes']['url'];
             if ($folder == $this->getOption('curFolder') && version_compare($version, $this->getOption('curVersion')) == 1) {
                 $txt .= $lan_text . " <a href='" . $url . "'>" . $name . " v" . $version . "</a><br />";
                 break;
             }
         }
         if ($txt) {
             $mes->addInfo($txt);
             if ($cache == TRUE) {
                 $e107cache->set($cacheString, $txt, TRUE);
             }
             $e107cache->CachePageMD5 = "";
         }
     }
 }
Пример #23
0
 function render2()
 {
     $mes = e107::getMessage();
     $admin_cat = e107::getNav()->adminCats();
     $text = "<div class='center'>\n        \t   \n        \t\t\t<ul class='nav nav-tabs'>";
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         // $text .= "<li id='tab-main_".$cat_key."' ><span style='white-space:nowrap'><img class='icon S16' src='".$admin_cat['img'][$cat_key]."' alt='' style='margin-right:3px' /><a href='#core-main_".$cat_key."'>".$admin_cat['title'][$cat_key]."</a></span></li>";
         $text .= "<li id='tab-main_" . $cat_key . "' ><a data-toggle='tab' href='#core-main_" . $cat_key . "'>" . $admin_cat['title'][$cat_key] . "</a></li>";
     }
     $text .= "</ul>";
     $text .= "<div id='tab-content'>";
     print_a($admin_cat);
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         $text_check = FALSE;
         $text_cat = "";
         if ($cat_key != 5) {
             foreach ($newarray as $key => $funcinfo) {
                 if ($funcinfo[4] == $cat_key) {
                     $text_rend = e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], 'div');
                     if ($text_rend) {
                         $text_check = TRUE;
                     }
                     $text_cat .= $text_rend;
                 }
             }
         } else {
             $text_rend = e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "div");
             if ($text_rend) {
                 $text_check = TRUE;
             }
             $text_cat .= $text_rend;
         }
         //$text_cat .= render_clean();
         if ($text_check) {
             $text .= "<div class='tab-pane adminform' id='core-main_" . $cat_key . "'>\n";
             $text .= " <div class='main_caption bevel'><b>" . $admin_cat['title'][$cat_key] . "</b></div>";
             $text .= $text_cat;
             $text .= "</div><!-- End tab-pane -->";
         }
     }
     $text .= "</div></div>";
     $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
 }
Пример #24
0
 function init()
 {
     $mes = e107::getMessage();
     if (E107_DEBUG_LEVEL > 0) {
         $this->action = 'preview';
         // changes default action to 'preview' method below. (for testing)
     }
     if (vartrue($_POST['bloggerUrl'])) {
         $this->feedUrl = rtrim($_POST['bloggerUrl'], "/") . "/feeds/posts/default?max-results=999&alt=rss";
     }
     if (vartrue($_POST['bloggerCleanup'])) {
         $this->cleanupHtml = true;
     }
     $mes->addDebug("Blogger Feed:" . $this->feedUrl);
     if (!empty($_POST['preview'])) {
         $this->preview();
         return;
     }
 }
Пример #25
0
 /**
  * This function is called after plugin table has been created
  * by the plugin_sql.php file.
  *
  * @param array $var
  */
 function install_post($var)
 {
     $db = e107::getDb();
     $mes = e107::getMessage();
     $categories = array();
     /* TODO to add question if load demo content */
     if ($db->count('links_page_cat') == 0) {
         $categories[] = array('link_category_id' => 1, 'link_category_name' => 'Default Link Category', 'link_category_description' => 'Default category for demo purpose', 'link_category_icon' => '{e_PLUGIN}links_page/images/linkspage_32.png', 'link_category_order' => '1', 'link_category_class' => '0', 'link_category_datestamp' => time());
         foreach ($categories as $category) {
             $status = $db->insert('links_page_cat', $category) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
             $mes->add("Adding Default table data to table: links_page_cat", $status);
         }
         $links[] = array('link_id' => NULL, 'link_name' => 'Developer Reference Manual', 'link_url' => 'http://e107.org/developer-manual', 'link_description' => 'e107 v2.x Plugin and Theme developer manual', 'link_button' => '1', 'link_category' => '1', 'link_order' => '1', 'link_refer' => '', 'link_open' => '1', 'link_class' => '0', 'link_datestamp' => time(), 'link_author' => '1', 'link_active' => '1');
         foreach ($links as $link) {
             $status = $db->insert('links_page', $link) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
             $mes->add("Adding Default table data to table: links_page", $status);
         }
     }
 }
Пример #26
0
 function setupQuery($task, $blank_user = FALSE)
 {
     if ($this->ourDB == NULL) {
         return FALSE;
     }
     switch ($task) {
         case 'users':
             // Set up Userclasses.
             if ($this->ourDB && $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}membergroups WHERE group_name = 'Jr. Member' ")) {
                 e107::getMessage()->addDebug("Userclasses Found");
             }
             $result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}members WHERE `is_activated`=1");
             if ($result === FALSE) {
                 return FALSE;
             }
             break;
         case 'forum':
             $result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}boards`");
             if ($result === FALSE) {
                 return FALSE;
             }
             break;
         case 'forumthread':
             $result = $this->ourDB->gen("SELECT t.*,m.* FROM `{$this->DBPrefix}topics` AS t LEFT JOIN `{$this->DBPrefix}messages` AS m ON t.id_first_msg = m.id_msg GROUP BY t.id_topic");
             if ($result === FALSE) {
                 return FALSE;
             }
             break;
         case 'forumpost':
             //$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}posts`");
             //if ($result === FALSE) return FALSE;
             break;
         case 'forumtrack':
             //$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}forums_track`");
             //if ($result === FALSE) return FALSE;
             break;
         default:
             return FALSE;
     }
     $this->copyUserInfo = false;
     $this->currentTask = $task;
     return TRUE;
 }
Пример #27
0
function show_admins()
{
    $sql = e107::getDb();
    $frm = e107::getForm();
    $ns = e107::getRender();
    $mes = e107::getMessage();
    $tp = e107::getParser();
    $prm = e107::getUserPerms();
    $sql->db_Select("user", "*", "user_admin='1'");
    $text = "\n\t<form action='" . e_SELF . "' method='post' id='del_administrator'>\n\t\t<fieldset id='core-administrator-list'>\n\t\t\t<legend class='e-hideme'>" . ADMSLAN_13 . "</legend>\n\t\t\t<table class='table adminlist'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col style='width:  5%' />\n\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t<col style='width: 65%' />\n\t\t\t\t\t<col style='width: 10%' />\n\t\t\t\t</colgroup>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>ID</th>\n\t\t\t\t\t\t<th>" . ADMSLAN_56 . "</th>\n\t\t\t\t\t\t<th>" . ADMSLAN_18 . "</th>\n\t\t\t\t\t\t<th class='center last'>" . LAN_OPTIONS . "</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\n\t";
    while ($row = $sql->db_Fetch()) {
        //$permtxt = "";
        $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . $row['user_id'] . "</td>\n\t\t\t\t\t\t<td><a href='" . e107::getUrl()->create('user/profile/view', array('id' => $row['user_id'], 'name' => $row['user_name'])) . "'>" . $row['user_name'] . "</a></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $prm->renderperms($row['user_perms'], $row['user_id'], "words") . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='center'>\n\t\t";
        if ($row['user_id'] != "1") {
            $text .= "\n\t\t\t\t\t\t\t" . $frm->submit_image("edit_admin[{$row['user_id']}]", 'edit', 'edit', LAN_EDIT) . "\n\t\t\t\t\t\t\t" . $frm->submit_image("del_admin[{$row['user_id']}]", 'del', 'delete', $tp->toJS(ADMSLAN_59 . "? [" . $row['user_name'] . "]")) . "\n\n\t\t\t";
        }
        $text .= "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t";
    }
    $text .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t" . $frm->hidden('del_administrator_confirm', '1') . "\n\t\t</fieldset>\n\t</form>\n\n\t";
    $ns->tablerender(ADMSLAN_13, $mes->render() . $text);
}
Пример #28
0
 /**
  * Scan plugin directories and get information from e_libraries.php files.
  */
 function pluginsPage()
 {
     e107_require_once(e_PLUGIN . 'libraries/libraries.php');
     $mes = e107::getMessage();
     $tpl = e107::getTemplate('libraries');
     $sc = e107::getScBatch('libraries', true);
     $tp = e107::getParser();
     $addonsList = libraries_update_addon_list();
     $summ = count($addonsList);
     $message = str_replace('[summ]', $summ, LAN_PLUGIN_LIBRARIES_ADMIN_03);
     $mes->addInfo($message);
     $this->addTitle(LAN_PLUGIN_LIBRARIES_ADMIN_02);
     $output = $mes->render();
     $libraries = libraries_info();
     $output .= $tp->parseTemplate($tpl['TABLE']['HEADER']);
     foreach ($libraries as $machine_name => $info) {
         $details = libraries_detect($machine_name);
         $sc->setVars(array('name' => $details['name'], 'plugin' => varset($details['plugin'], false), 'theme' => varset($details['theme'], false), 'vendor' => $details['vendor url'], 'download' => $details['download url'], 'installed' => array('status' => $details['installed'], 'error' => varset($details['error'], ''), 'message' => varset($details['error message'], ''))));
         $output .= $tp->parseTemplate($tpl['TABLE']['ROW'], true, $sc);
     }
     $output .= $tp->parseTemplate($tpl['TABLE']['FOOTER']);
     return $output;
 }
Пример #29
0
 function showImages($cat)
 {
     $mes = e107::getMessage();
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $sc = e107::getScBatch('gallery', TRUE);
     $sc->total = e107::getMedia()->countImages($cat);
     $sc->amount = 12;
     // TODO Add Pref. amount per page.
     $sc->curCat = $cat;
     $sc->from = $_GET['frm'] ? intval($_GET['frm']) : 0;
     $list = e107::getMedia()->getImages($cat, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cat]['media_cat_title'], false, 'defs');
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row);
         $inner .= $tp->parseTemplate($template['LIST_ITEM'], TRUE);
     }
     $text = $tp->parseTemplate($template['LIST_START'], TRUE);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['LIST_END'], TRUE);
     e107::getRender()->tablerender("Gallery :: " . $catname, $mes->render() . $text);
 }
Пример #30
0
function show_updates($dbupdate, $what)
{
    global $frm;
    $mes = e107::getMessage();
    $caption = constant('LAN_UPDATE_CAPTION_' . strtoupper($what));
    $text = "\n\t<form method='post' action='" . e_SELF . "'>\n\t\t<fieldset id='core-e107-update-{$what}'>\n\t\t<legend>{$caption}</legend>\n\t\t\t<table class='table adminlist'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col style='width: 60%' />\n\t\t\t\t\t<col style='width: 40%' />\n\t\t\t\t</colgroup>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>" . LAN_UPDATE_55 . "</th>\n\t\t\t\t\t\t<th class='last'>" . LAN_UPDATE_2 . "</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t";
    $updates = 0;
    asort($dbupdate);
    foreach ($dbupdate as $func => $rmks) {
        if (function_exists("update_" . $func)) {
            $text .= "<tr><td>{$rmks}</td>";
            if (call_user_func("update_" . $func)) {
                $text .= "<td>" . LAN_UPDATE_3 . "</td>";
            } else {
                $updates++;
                $text .= "<td>" . $frm->admin_button('update_core[' . $func . ']', LAN_UPDATE, 'update', '', "id=e-{$func}") . "</td>";
            }
            $text .= "</tr>\n";
        } elseif (class_exists($func . '_setup')) {
            $text .= "<tr><td>{$rmks}</td>";
            $reason = run_updates_plugin($func, TRUE);
            // TRUE = Just check if needed.
            if (!$reason) {
                $text .= "<td>" . LAN_UPDATE_3 . "</td>";
            } else {
                $updates++;
                $mes->addDebug($reason);
                $text .= "<td>" . $frm->admin_button('update[' . $func . ']', LAN_UPDATE, 'update') . "</td>";
            }
            $text .= "</tr>\n";
        }
    }
    $text .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</fieldset>\n\t</form>\n\t\t";
    echo $text;
    return $updates;
    // Number of updates to do
}