Esempio n. 1
0
function getHookImages($hook, $count)
{
    $sql = e107::getDb();
    $pref = e107::pref('imggregator');
    $count = isset($count) ? $count : $pref['imagesToFetch'];
    $tokens = explode(';', $sql->retrieve('hooks', 'hook_tokens', 'hook_name="' . $hook . '"'));
    if ($hook == 'instagram') {
        $user_id = explode(':', $tokens[0]);
        $access_token = explode(':', $tokens[1]);
        $url = fetchData('https://api.instagram.com/v1/users/' . $user_id[1] . '/media/recent/?access_token=' . $access_token[1] . '&count=' . $count);
        $result = json_decode($url);
        $i = 0;
        foreach ($result->data as $image) {
            copy($image->images->standard_resolution->url, 'images/instagram' . $i . '.jpg');
            $i++;
            //$images[] = $image->images->standard_resolution->url;
        }
    } else {
        if ($hook == 'flickr') {
            $user_id = explode(':', $tokens[0]);
            $api_key = explode(':', $tokens[1]);
            $xml = simplexml_load_file('https://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=' . $api_key[1] . '&user_id=' . urlencode($user_id[1]) . '&format=rest');
            $i = 0;
            foreach ($xml->photos->photo as $photo) {
                if ($photo['ispublic'] == 1) {
                    copy('https://farm' . $photo['farm'] . '.staticflickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['secret'] . '.jpg', 'images/flickr' . $i . '.jpg');
                    $i++;
                    //$images[] .= 'https://farm'.$photo['farm'].'.staticflickr.com/'.$photo['server'].'/'.$photo['id'].'_'.$photo['secret'].'.jpg';
                }
            }
        }
    }
    return $images;
}
Esempio n. 2
0
 function __construct()
 {
     $pref = e107::pref('core', 'social_login');
     if (!empty($pref) && is_array($pref['Twitter'])) {
         $this->twitterActive = vartrue($pref['Twitter']['keys']['key']);
     }
 }
Esempio n. 3
0
 function unanswered()
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $limit = 25;
     $count = $sql->retrieve('faqs', 'faq_id', "faq_answer=''  ", true);
     $existing = $sql->retrieve('faqs', 'faq_id,faq_question,faq_datestamp', "faq_answer=''  ORDER BY faq_datestamp DESC LIMIT " . $limit, true);
     if (empty($existing)) {
         return;
     }
     $questions = array();
     foreach ($existing as $row) {
         $questions[] = "<i>" . $row['faq_question'] . "</i><br /><small>" . $tp->toDate($row['faq_datestamp'], 'short') . "</small>\n";
         //	$questions[] = $row['faq_question'];
     }
     //
     //	$questions = array( "<i>Test Question</i><br /><small>".$tp->toDate(time(),'short')."</small>");
     $name = SITENAME . " Automation";
     $email = e107::pref('core', 'siteadminemail');
     $name = e107::pref('core', 'siteadmin');
     $link = $tp->replaceConstants("{e_PLUGIN}faqs/admin_config.php?mode=main&action=list&filter=pending", 'full');
     $body = "<h2>" . count($count) . " Unuanswered Questions at " . SITENAME . "</h2>To answer these questions, please login to " . SITENAME . " and then <a href='{$link}'>click here</a>.<br />\n\t\t\tThe " . $limit . " most recent questions are displayed below.\n\t\t\t<ul><li>" . implode("</li><li>", $questions) . "</li></ul>";
     $eml = array('subject' => count($count) . " Unuanswered Question as of " . date('d-M-Y') . " ", 'sender_name' => SITENAME . " Automation", 'html' => true, 'template' => 'default', 'body' => $body);
     e107::getEmail()->sendEmail($email, $name, $eml);
 }
 function sc_oneliner($parm = '')
 {
     $sql = e107::getDb();
     $icon = $this->var['current']['icon'];
     $oneliners = $sql->retrieve('forecasty_oneliners', '*', "`condition`='" . $icon . "' AND `vulgarity`='" . e107::pref('forecasty', 'vulgarity') . "'", true);
     return $oneliners[array_rand($oneliners)]['line'];
 }
Esempio n. 5
0
 function __construct()
 {
     $this->forumObj = new e107forum();
     $this->plugPref = e107::pref('forum');
     // general forum preferences.
     $this->menuPref = e107::getMenu()->pref();
     // ie. popup config details from within menu-manager.
     $this->render();
 }
Esempio n. 6
0
 function sc_membersonly_signup()
 {
     $pref = e107::pref('core');
     if (intval($pref['user_reg']) === 1) {
         $srch = array("[", "]");
         $repl = array("<a class='alert-link' href='" . e_SIGNUP . "'>", "</a>");
         return str_replace($srch, $repl, LAN_MEMBERS_3);
     }
 }
Esempio n. 7
0
 function config()
 {
     $frm = e107::getForm();
     $var[0]['caption'] = "Sample configuration field";
     $var[0]['html'] = $frm->text('_blank_example', e107::pref('theme', 'example', 'default'));
     $var[0]['help'] = "Example help text for this input field";
     $var[1]['caption'] = "Sample configuration field 2";
     $var[1]['html'] = $frm->text('_blank_example2', e107::pref('theme', 'example2', 'default'));
     return $var;
 }
Esempio n. 8
0
 function checkTimezone()
 {
     $mes = e107::getMessage();
     $timezone = e107::pref('core', 'timezone');
     if (e107::getDate()->isValidTimezone($timezone) == false) {
         $mes->addWarning("Your timezone setting (" . $timezone . ") is invalid. It has been reset to UTC. To Modify, please go to Admin -> Preferences -> Date Display Options.", 'default', true);
         e107::getConfig()->set('timezone', 'UTC')->save(false, true, false);
         $this->refresh = true;
     }
 }
Esempio n. 9
0
 public function init()
 {
     $this->iconSet[e107::pref('forecasty', 'iconSet')] = e107::pref('forecasty', 'iconSet');
     foreach (glob(e_PLUGIN . 'forecasty/icons/*', GLOB_ONLYDIR) as $dir) {
         $dir = str_replace(e_PLUGIN . 'forecasty/icons/', '', $dir);
         if ($dir != e107::pref('forecasty', 'iconSet')) {
             $this->iconSet[$dir] = $dir;
         }
     }
     $this->prefs['iconSet']['writeParms'] = $this->iconSet;
 }
Esempio n. 10
0
 public function init()
 {
     $ns = e107::getRender();
     $uploadAccess = e107::pref('core', 'upload_class');
     if (!check_class($uploadAccess)) {
         $text = "<div style='text-align:center'>" . LAN_UL_002 . "</div>";
         $ns->tablerender(LAN_UL_020, $text);
         return;
     }
     if (isset($_POST['upload'])) {
         $this->processUpload();
         return;
     }
     $this->renderForm();
 }
Esempio n. 11
0
 public function init()
 {
     $engine = e107::pref('core', 'comments_engine');
     if ($engine != 'e107') {
         $this->prefs = array('comments_engine' => array('title' => "Engine", 'type' => 'dropdown', 'writeParms' => array()), 'comments_disabled' => array('title' => PRFLAN_161, 'type' => 'boolean', 'writeParms' => 'inverse=1'));
     }
     $this->prefs['comments_engine']['writeParms']['optArray'] = array('e107' => 'e107');
     $addons = e107::getAddonConfig('e_comment');
     foreach ($addons as $plugin => $config) {
         foreach ($config as $val) {
             $id = $plugin . "::" . $val['function'];
             $this->prefs['comments_engine']['writeParms']['optArray'][$id] = $val['name'];
         }
     }
     //	print_a($addons);
 }
Esempio n. 12
0
 function config()
 {
     $frm = e107::getForm();
     $brandingOpts = array('sitename' => 'Site Name', 'logo' => 'Logo', 'sitenamelogo' => 'Logo &amp; Site Name');
     $var[0]['caption'] = "Branding";
     $var[0]['html'] = $frm->select('branding', $brandingOpts, e107::pref('theme', 'branding', 'sitename'));
     $var[0]['help'] = "";
     $var[1]['caption'] = "Navbar Alignment";
     $var[1]['html'] = $frm->select('nav_alignment', array('left', 'right'), e107::pref('theme', 'nav_alignment', 'left'), 'useValues=1');
     $var[1]['help'] = "";
     $var[2]['caption'] = "Signup/Login Placement";
     $var[2]['html'] = $frm->select('usernav_placement', array('top', 'bottom'), e107::pref('theme', 'usernav_placement', 'top'), 'useValues=1');
     $var[2]['help'] = "";
     //	$var[1]['caption'] 	= "Sample configuration field 2";
     //	$var[1]['html'] 	= $frm->text('_blank_example2', e107::pref('theme', 'example2', 'default'));
     return $var;
 }
Esempio n. 13
0
 function facebook($data)
 {
     if (!deftrue('SOCIAL_FACEBOOK_INIT')) {
         return "<div class='alert alert-important alert-danger'>Unable to render comments. Missing Facebook appID.</div>";
     }
     e107::js('footer-inline', SOCIAL_FACEBOOK_INIT);
     if (E107_DEBUG_LEVEL > 0) {
         $link = "http://developers.facebook.com/docs/plugins/comments/";
     } else {
         $link = e_REQUEST_URL;
     }
     $pref = e107::pref('social');
     $limit = vartrue($pref['facebook_comments_limit'], 10);
     $theme = vartrue($pref['facebook_comments_theme'], 'light');
     $loading = vartrue($pref['facebook_comments_loadingtext'], 'Loading...');
     $text = '<div class="fb-comments" data-href="' . $link . '" data-width="100%" data-numposts="' . $limit . '" data-colorscheme="' . $theme . '">' . $loading . '</div>';
     return $text;
 }
Esempio n. 14
0
 public function init()
 {
     $sql = e107::getDb();
     $this->currency[0] = "default";
     if ($sql->select('anteup_currency')) {
         while ($row = $sql->fetch()) {
             $this->currency[$row['id']] = $row['description'] . " (" . $row['code'] . ")";
         }
     }
     $this->fields['mc_currency']['writeParms'] = $this->currency;
     $this->prefs['anteup_currency']['writeParms'] = $this->currency;
     $this->dateformat = array('short' => LAN_ANTEUP_PREFS_13, 'long' => LAN_ANTEUP_PREFS_14, 'relative' => LAN_ANTEUP_PREFS_15);
     $this->prefs['anteup_dateformat']['writeParms'] = $this->dateformat;
     $this->donateImage[e107::pref('anteup', 'anteup_button')] = e107::pref('anteup', 'anteup_button');
     foreach (glob(e_PLUGIN . "anteup/images/icons/*.gif") as $icon) {
         $icon = str_replace(e_PLUGIN . "anteup/images/icons/", "", $icon);
         if ($icon != e107::pref('anteup', 'anteup_button')) {
             $this->donateImage[$icon] = $icon;
         }
     }
     $this->prefs['anteup_button']['writeParms'] = $this->donateImage;
 }
Esempio n. 15
0
function get_info($type)
{
    $sql = e107::getDb();
    $pref = e107::pref('anteup');
    $lastDue = strtotime($pref['anteup_lastdue']);
    $currDue = strtotime($pref['anteup_due']);
    $current = 0;
    $total = 0;
    $sql->select("anteup_ipn");
    while ($row = $sql->fetch()) {
        $payDate = $row['payment_date'];
        if ($payDate > $lastDue && $payDate < $currDue) {
            $current += $row['mc_gross'];
        }
        $total += $row['mc_gross'];
    }
    if ($type == "current") {
        return $current;
    } elseif ($type == "total") {
        return $total;
    }
}
Esempio n. 16
0
 function getConfig($config = false)
 {
     $tp = e107::getParser();
     $fl = e107::getFile();
     if (getperms('0')) {
         $template = "mainadmin.xml";
     } elseif (ADMIN) {
         $template = "admin.xml";
     } elseif (USER) {
         $template = "member.xml";
     } else {
         $template = "public.xml";
     }
     $configPath = is_readable(THEME . "templates/tinymce/" . $template) ? THEME . "templates/tinymce/" . $template : e_PLUGIN . "tinymce4/templates/" . $template;
     $config = e107::getXml()->loadXMLfile($configPath, true);
     //TODO Cache!
     $this->configName = $config['@attributes']['name'];
     unset($config['@attributes']);
     $ret = array('selector' => '.e-wysiwyg', 'theme' => 'modern', 'plugins' => $this->filter_plugins($config['tinymce_plugins']), 'language' => $this->tinymce_lang());
     // Loop thru XML parms.
     foreach ($config as $k => $xml) {
         $ret[$k] = $xml;
     }
     $tPref = e107::pref('tinymce4');
     if (!empty($tPref['paste_as_text'])) {
         $ret['paste_as_text'] = true;
     }
     if (!empty($tPref['browser_spellcheck'])) {
         $ret['browser_spellcheck'] = true;
     }
     $formats = array('hilitecolor' => array('inline' => 'span', 'classes' => 'hilitecolor', 'styles' => array('backgroundColor' => '%value')));
     //@see http://www.tinymce.com/wiki.php/Configuration:formats
     $formats = "[\n                {title: 'Headers', items: [\n                    {title: 'Heading 1', block: 'h1'},\n                    {title: 'Heading 2', block: 'h2'},\n                    {title: 'Heading 3', block: 'h3'},\n                    {title: 'Heading 4', block: 'h4'},\n                    {title: 'Heading 5', block: 'h5'},\n                    {title: 'Heading 6', block: 'h6'}\n                ]},\n\n                {title: 'Inline', items: [\n                    {title: 'Bold', inline: 'b', icon: 'bold'},\n                    {title: 'Italic', inline: 'em', icon: 'italic'},\n                    {title: 'Underline', inline: 'span', styles : {textDecoration : 'underline'}, icon: 'underline'},\n                    {title: 'Strikethrough', inline: 'span', styles : {textDecoration : 'line-through'}, icon: 'strikethrough'},\n                    {title: 'Superscript', inline: 'sup', icon: 'superscript'},\n                    {title: 'Subscript', inline: 'sub', icon: 'subscript'},\n                    {title: 'Code', inline: 'code', icon: 'code'},\n                    {title: 'Small', inline: 'small', icon: ''},\n                ]},\n\n                {title: 'Blocks', items: [\n                    {title: 'Paragraph', block: 'p'},\n                    {title: 'Blockquote', block: 'blockquote'},\n                    {title: 'Div', block: 'div'},\n                    {title: 'Pre', block: 'pre'},\n                    {title: 'Code Highlighted', block: 'pre', classes: 'prettyprint linenums' }\n                ]},\n\n                {title: 'Alignment', items: [\n                    {title: 'Left', block: 'div', classes: 'text-left',  icon: 'alignleft'},\n                    {title: 'Center', block: 'div',classes: 'text-center', icon: 'aligncenter'},\n                    {title: 'Right', block: 'div', classes: 'text-right',  icon: 'alignright'},\n                    {title: 'Justify', block: 'div', classes: 'text-justify', icon: 'alignjustify'},\n                    {title: 'No-Wrap', block: 'div', classes: 'text-nowrap', icon: ''},\n                    {title: 'Image Left', selector: 'img', classes: 'pull-left', styles: {'margin': '0 10px 5px 0'  },  icon: 'alignleft'},\n                    {title: 'Image Right', selector: 'img', classes: 'pull-right', styles: { 'margin': '0 0 5px 10px'}, icon: 'alignright'}\n\n                ]},\n\n                {title: 'Bootstrap Inline', items: [\n\t\t\t\t {title: 'Label (Default)', inline: 'span', classes: 'label label-default'},\n\t\t\t\t {title: 'Label (Primary)', inline: 'span', classes: 'label label-primary'},\n                 {title: 'Label (Success)', inline: 'span', classes: 'label label-success'},\n                 {title: 'Label (Info)', inline: 'span', classes: 'label label-info'},\n                 {title: 'Label (Warning)', inline: 'span', classes: 'label label-warning'},\n                 {title: 'Label (Danger)', inline: 'span', classes: 'label label-danger'},\n                 {title: 'Muted', inline: 'span', classes: 'text-muted'},\n                ]},\n\n                 {title: 'Bootstrap Blocks', items: [\n                 {title: 'Alert (Success)', block: 'div', classes: 'alert alert-success'},\n                 {title: 'Alert (Info)', block: 'div', classes: 'alert alert-info'},\n                 {title: 'Alert (Warning)', block: 'div', classes: 'alert alert-warning'},\n                 {title: 'Alert (Danger)', block: 'div', classes: 'alert alert-block alert-danger'},\n                 {title: 'Float Clear', block: 'div', classes: 'clearfix'},\n                 {title: 'Lead', block: 'p', classes: 'lead'},\n                 {title: 'Well', block: 'div', classes: 'well'},\n                 {title: '1/4 Width Block', block: 'div', classes: 'col-md-3 col-sm-12'},\n                 {title: '3/4 Width Block', block: 'div', classes: 'col-md-9 col-sm-12'},\n                 {title: '1/3 Width Block', block: 'div', classes: 'col-md-4 col-sm-12'},\n                 {title: '2/3 Width Block', block: 'div', classes: 'col-md-8 col-sm-12'},\n                 {title: '1/2 Width Block', block: 'div', classes: 'col-md-6 col-sm-12'},\n                ]},\n\n                 {title: 'Bootstrap Buttons', items: [\n                 {title: 'Button (Default)', selector: 'a', classes: 'btn btn-default'},\n\t\t\t\t {title: 'Button (Primary)', selector: 'a', classes: 'btn btn-primary'},\n                 {title: 'Button (Success)', selector: 'a', classes: 'btn btn-success'},\n                 {title: 'Button (Info)', selector: 'a', classes: 'btn btn-info'},\n                 {title: 'Button (Warning)', selector: 'a', classes: 'btn-warning'},\n                 {title: 'Button (Danger)', selector: 'a', classes: 'btn-danger'},\n                ]},\n\n\t\t\t\t {title: 'Bootstrap Images', items: [\n\t\t\t\t {title: 'Responsive (recommended)',  selector: 'img', classes: 'img-responsive'},\n\t\t\t\t {title: 'Rounded',  selector: 'img', classes: 'img-rounded'},\n\t\t\t\t {title: 'Circle', selector: 'img', classes: 'img-circle'},\n                 {title: 'Thumbnail', selector: 'img', classes: 'img-thumbnail'},\n                ]},\n\n\t\t\t\t {title: 'Bootstrap Tables', items: [\n\t\t\t\t {title: 'Bordered',  selector: 'table', classes: 'table-bordered'},\n\t\t\t\t {title: 'Condensed', selector: 'table', classes: 'table-condensed'},\n\t\t\t\t {title: 'Hover', selector: 'table', classes: 'table-hover'},\n                 {title: 'Striped', selector: 'table', classes: 'table-striped'},\n                ]},\n\n\n            ]";
     //	$ret['style_formats_merge'] = true;
     //	$ret['visualblocks_default_state'] = true; //pref
     $ret['style_formats'] = $formats;
     // json_encode($formats);
     $ret['link_class_list'] = "[\n        {title: 'None', value: ''},\n        {title: 'Link', value: 'btn btn-link'},\n        {title: 'Alert Link', value: 'alert-link'},\n        {title: 'Button (Default)', value: 'btn btn-default'},\n        {title: 'Button (Primary)', value: 'btn btn-primary'},\n        {title: 'Button (Success)', value: 'btn btn-success'},\n        {title: 'Button (Info)', value: 'btn btn-info'},\n        {title: 'Button (Warning)', value: 'btn btn-warning'},\n        {title: 'Button (Danger)', value: 'btn btn-danger'}\n    ]";
     // https://github.com/valtlfelipe/TinyMCE-LocalAutoSave
     /*
     		$ret['setup'] = "function(ed) {
           ed.addMenuItem('test', {
              text: 'Clear Floats',
              context: 'insert',
              icon: false,
              onclick: function() {
                 ed.insertContent('<br class=\"clearfix\" />');
              }
           });
           }";
     */
     // e107 Bbcodes.
     /*
     
     		$ret['setup'] = "function(ed) {
     			ed.addButton('e107-bbcode', {
     				text: 'bbcode',
     				icon: 'emoticons',
     				onclick: function() {
     		// Open window
     
     			ed.windowManager.open({
     						title: 'Example plugin',
     						body: [
     							{type: 'listbox', name: 'code', label: 'BbCode', values: [
     								{text: 'Left', value: 'left'},
     						        {text: 'Right', value: 'right'},
     						        {text: 'Center', value: 'center'}
     						    ]},
                                 {type: 'textbox', name: 'parm', label: 'Parameters'}
     						],
     						onsubmit: function(e) {
     
     							var selected = ed.selection.getContent({format : 'text'});
     
     						//	alert(selected);
     							// Insert content when the window form is submitted
     							ed.insertContent('[' + e.data.code + ']' + selected + '[/' + e.data.code + ']');
     						}
     					});
     				}
     			});
     	}";
     */
     // Emoticon Support @see //https://github.com/nhammadi/Smileys
     if (e107::pref('core', 'smiley_activate', false)) {
         $emo = e107::getConfig("emote")->getPref();
         $pack = e107::pref('core', 'emotepack');
         $emotes = array();
         $i = 0;
         $c = 0;
         foreach ($emo as $path => $co) {
             $codes = explode(" ", $co);
             $url = SITEURLBASE . e_IMAGE_ABS . "emotes/" . $pack . "/" . str_replace("!", ".", $path);
             $emotes[$i][] = array('shortcut' => $codes, 'url' => $url, 'title' => ucfirst($path));
             if ($c == 6) {
                 $i++;
                 $c = 0;
             } else {
                 $c++;
             }
         }
         //	print_r($emotes);
         $ret['extended_smileys'] = json_encode($emotes);
     }
     //	$ret['skin']                    = 'e107admin';
     //	$ret['skin_url']                = SITEURLBASE.e_PLUGIN_ABS.'tinymce4/skins/e107admin';
     $ret['convert_fonts_to_spans'] = false;
     $ret['content_css'] = e_PLUGIN_ABS . 'tinymce4/editor.css,https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css,http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css';
     $ret['relative_urls'] = false;
     //Media Manager prefers it like this.
     $ret['preformatted'] = true;
     $ret['document_base_url'] = SITEURL;
     //	$ret['table_default_attributes'] = json_encode(array('class'=>'table table-striped' ));
     if (!empty($ret['templates'])) {
         $ret['templates'] = $tp->replaceConstants($ret['templates'], 'abs');
         // $this->getTemplates();
     }
     //	$this->config['verify_css_classes']	= 'false';
     $text = array();
     foreach ($ret as $k => $v) {
         if ($k == 'external_plugins') {
             $text[] = 'external_plugins: ' . $this->getExternalPlugins($v);
             continue;
         }
         $text[] = $k . ': ' . $this->convertBoolean($v);
     }
     $this->config = implode(",\n", $text);
     return;
     // -------------------------------------------------------------------------------------
     $cssFiles = $fl->get_files(THEME, "\\.css", '', 2);
     foreach ($cssFiles as $val) {
         $css[] = str_replace(THEME, THEME_ABS, $val['path'] . $val['fname']);
     }
     $css[] = "{e_WEB_ABS}js/bootstrap/css/bootstrap.min.css";
     $content_css = vartrue($config['content_css'], implode(",", $css));
     $content_styles = array('Bootstrap Button' => 'btn btn-primary', 'Bootstrap Table' => 'table');
     $this->config += array('dialog_type' => "modal", 'theme_advanced_resizing' => 'true', 'remove_linebreaks' => 'false', 'extended_valid_elements' => vartrue($config['extended_valid_elements']), 'apply_source_formatting' => 'true', 'invalid_elements' => 'font,align,script,applet', 'auto_cleanup_word' => 'true', 'cleanup' => 'true', 'convert_fonts_to_spans' => 'true', 'popup_css' => 'false', 'trim_span_elements' => 'true', 'inline_styles' => 'true', 'auto_resize' => 'false', 'debug' => 'true', 'force_br_newlines' => 'true', 'media_strict' => 'false', 'width' => vartrue($config['width'], '100%'), 'forced_root_block' => 'false', 'convert_newlines_to_brs' => 'true', 'entity_encoding' => 'raw', 'convert_fonts_to_styles' => 'true', 'remove_script_host' => 'true', 'relative_urls' => 'false', 'preformatted' => 'true', 'document_base_url' => SITEURL, 'verify_css_classes' => 'false');
     //		$this->config['cleanup_callback'] = 'tinymce_e107Paths';
     $paste_plugin = false;
     // (strpos($config['tinymce_plugins'],'paste')!==FALSE) ? TRUE : FALSE;
     if ($paste_plugin) {
         $this->config += array('paste_text_sticky' => 'true', 'paste_text_sticky_default' => 'true', 'paste_text_linebreaktype' => 'br', 'remove_linebreaks' => 'false', 'paste_create_paragraphs' => 'false', 'paste_create_linebreaks' => 'true', 'paste_use_dialog' => 'true', 'paste_auto_cleanup_on_paste' => 'true', 'paste_convert_middot_lists' => 'false', 'paste_unindented_list_class' => 'unindentedList', 'paste_convert_headers_to_strong' => 'true', 'paste_insert_word_content_callback' => 'convertWord', 'auto_cleanup_word' => 'true');
     }
     if (ADMIN) {
         //		$this->config['external_link_list_url'] = e_PLUGIN_ABS."tiny_mce/filelist.php";
     }
 }
Esempio n. 17
0
<?php

/*
* AnteUp - A Donation Tracking Plugin for e107
*
* Copyright (C) 2012-2015 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.mkd file.
*
*/
require_once "../../class2.php";
require_once HEADERF;
require_once e_PLUGIN . "anteup/_class.php";
e107::lan('anteup');
$pref = e107::pref('anteup');
if (!empty($pref['anteup_paypal']) || $pref['anteup_paypal'] != "*****@*****.**") {
    $frm = e107::getForm();
    $tp = e107::getParser();
    $sc = e107::getScBatch('anteup', true);
    $template = e107::getTemplate('anteup');
    $text = $frm->open('donate_form', 'post', 'https://www.paypal.com/cgi-bin/webscr');
    $text .= $tp->parseTemplate($template['donate'], false, $sc);
    $text .= $frm->hidden('cmd', '_xclick');
    $text .= $frm->hidden('business', $pref['anteup_paypal']);
    $text .= $frm->hidden('notify_url', ANTEUP_ABS . 'ipn.php');
    $text .= $frm->hidden('return', ANTEUP_ABS . 'return.php?thanks');
    $text .= $frm->hidden('cancel_return', ANTEUP_ABS . 'return.php?cancel');
    $text .= $frm->close();
} else {
    $text = "<div class='center'>" . LAN_ANTEUP_DONATE_04 . "</div>";
}
e107::getRender()->tablerender(LAN_ANTEUP_DONATE_TITLE, $text);
Esempio n. 18
0
function displaySortOrder($mode = '')
{
    global $lc, $cobj, $rowl, $qs, $from, $link_shortcodes;
    global $LINK_SORTORDER;
    static $hasBeenShown = FALSE;
    $tp = e107::getParser();
    $template = e107::getTemplate('links_page', 'links_page');
    if ($hasBeenShown) {
        return '';
    }
    $hasBeenShown = TRUE;
    if ($mode == "cat") {
        if (e107::pref('links_page', 'link_cat_sortorder')) {
            $LINK_SORTORDER = $lc->showLinkSort('cat');
        }
    } else {
        if (e107::pref('links_page', 'link_sortorder')) {
            $LINK_SORTORDER = $lc->showLinkSort();
        }
    }
    $text = $tp->parseTemplate($template['LINK_SORTORDER'], FALSE, $link_shortcodes);
    return $text;
}
Esempio n. 19
0
 /**
  * XUP Signup Method (falls-back to XUP login when existing user is detected). 
  * May be used as a simple XUP login link for existing and non-existing users.  
  */
 public function signup($redirectUrl = true, $loginAfterSuccess = true, $emailAfterSuccess = true)
 {
     if (!e107::getPref('social_login_active', false)) {
         throw new Exception("Signup failed! This feature is disabled.", 100);
         // TODO lan
     }
     if (!$this->getProvider()) {
         throw new Exception("Signup failed! Wrong provider.", 2);
         // TODO lan
     }
     if ($redirectUrl) {
         if (true === $redirectUrl) {
             $redirectUrl = SITEURL;
         } elseif (strpos($redirectUrl, 'http://') !== 0 && strpos($redirectUrl, 'https://') !== 0) {
             $redirectUrl = e107::getUrl()->create($redirectUrl);
         }
     }
     if (e107::getUser()->isUser()) {
         if ($redirectUrl) {
             e107::getRedirect()->redirect($redirectUrl);
         }
         return false;
         //	throw new Exception( "Signup failed! User already signed in. ", 1); // TODO lan
     }
     $this->adapter = $this->hybridauth->authenticate($this->getProvider());
     $profile = $this->adapter->getUserProfile();
     // returned back, if success...
     if ($profile->identifier) {
         $sql = e107::getDb();
         $userMethods = e107::getUserSession();
         $plainPwd = $userMethods->generateRandomString('************');
         // auto plain passwords
         // TODO - auto login name, shouldn't be used if system set to user_email login...
         $userdata['user_loginname'] = $this->getProvider() . $userMethods->generateUserLogin(e107::getPref('predefinedLoginName', '_..#..#..#'));
         $userdata['user_email'] = $sql->escape($profile->emailVerified ? $profile->emailVerified : $profile->email);
         $userdata['user_name'] = $sql->escape($profile->displayName);
         $userdata['user_login'] = $userdata['user_name'];
         $userdata['user_customtitle'] = '';
         // not used
         $userdata['user_password'] = $userMethods->HashPassword($plainPwd, $userdata['user_loginname']);
         // pwd
         $userdata['user_sess'] = '';
         //
         $userdata['user_image'] = $profile->photoURL;
         // avatar
         $userdata['user_signature'] = '';
         // not used
         $userdata['user_hideemail'] = 1;
         // hide it by default
         $userdata['user_xup'] = $sql->escape($this->userId());
         $pref = e107::pref('core');
         if (!empty($pref['initial_user_classes'])) {
             $userdata['user_class'] = $pref['initial_user_classes'];
         } elseif (!empty($pref['user_new_period'])) {
             $userdata['user_class'] = e_UC_NEWUSER;
         } else {
             $userdata['user_class'] = '';
         }
         //		print_a($userdata);
         // user_name, user_xup, user_email and user_loginname shouldn't match
         $insert = !empty($userdata['user_email']) ? "OR user_email='" . $userdata['user_email'] . "' " : "";
         if ($sql->count("user", "(*)", "user_xup='" . $sql->escape($this->userId()) . "' " . $insert . " OR user_loginname='{$userdata['user_loginname']}' OR user_name='{$userdata['user_name']}'")) {
             // $this->login($redirectUrl); // auto-login
             e107::getUser()->loginProvider($this->userId());
             if ($redirectUrl) {
                 e107::getRedirect()->redirect($redirectUrl);
             }
             return false;
             // throw new Exception( "Signup failed! User already exists. Please use 'login' instead.", 3);
         }
         if (empty($userdata['user_email']) && e107::getPref('disable_emailcheck', 0) == 0) {
             throw new Exception("Signup failed! Can't access user email - registration without an email is impossible." . print_a($userdata, true), 4);
             // TODO lan
         }
         // other fields
         $now = time();
         $userdata['user_id'] = null;
         $userdata['user_join'] = $now;
         $userdata['user_lastvisit'] = 0;
         $userdata['user_currentvisit'] = 0;
         $userdata['user_comments'] = 0;
         $userdata['user_ip'] = e107::getIPHandler()->getIP(FALSE);
         $userdata['user_ban'] = USER_VALIDATED;
         $userdata['user_prefs'] = '';
         $userdata['user_visits'] = 0;
         $userdata['user_admin'] = 0;
         $userdata['user_perms'] = '';
         $userdata['user_realm'] = '';
         $userdata['user_pwchange'] = $now;
         $user = e107::getSystemUser(0, false);
         $user->setData($userdata);
         $user->getExtendedModel();
         // init
         //$user->setEditor(e107::getSystemUser(1, false));
         $user->save(true);
         // user model error
         if ($user->hasError()) {
             throw new Exception($user->renderMessages(), 5);
         }
         ### Successful signup!
         //$user->set('provider', $this->getProvider());
         $userdata = $user->getData();
         $userdata['provider'] = $this->getProvider();
         //	e107::getEvent()->trigger('userveri', $userdata);	 // Trigger New verified user.
         e107::getEvent()->trigger('user_xup_signup', $userdata);
         $ret = e107::getEvent()->trigger('usersupprov', $userdata);
         // XXX - it's time to pass objects instead of array?
         if (true === $ret) {
             return $this;
         }
         // send email
         if ($emailAfterSuccess) {
             $user->set('user_password', $plainPwd)->email('signup');
         }
         e107::getUser()->setProvider($this);
         // auto login
         if ($loginAfterSuccess) {
             e107::getUser()->loginProvider($this->userId());
             // if not proper after-login, return true so user can see login screen
         }
         if ($redirectUrl) {
             e107::getRedirect()->redirect($redirectUrl);
         }
         return true;
     }
     return false;
 }
Esempio n. 20
0
    exit;
}
header('Content-type: text/html; charset=utf-8', TRUE);
if (!empty($_GET['iframe'])) {
    define('e_IFRAME', true);
}
// .e-sef-generate routine.
if (ADMIN && defset('e_ADMIN_UI') && varset($_POST['mode']) == 'sef' && !empty($_POST['source']) && e_AJAX_REQUEST) {
    $d = array('converted' => eHelper::title2sef($_POST['source']));
    echo json_encode($d);
    exit;
}
### Language files
e107::coreLan('header', true);
e107::coreLan('footer', true);
$_globalLans = e107::pref('core', 'lan_global_list');
$_plugins = e107::getPref('plug_installed');
if (!empty($_plugins) && !empty($_globalLans) && is_array($_plugins) && count($_plugins) > 0) {
    $_plugins = array_keys($_plugins);
    foreach ($_plugins as $_p) {
        if (in_array($_p, $_globalLans) && defset('e_CURRENT_PLUGIN') != $_p) {
            continue;
        }
        e107::loadLanFiles($_p, 'admin');
    }
}
// Get Icon constants, theme override (theme/templates/admin_icons_template.php) is allowed
include_once e107::coreTemplatePath('admin_icons');
if (!defset('e_ADMIN_UI') && !defset('e_PAGETITLE')) {
    $array_functions = e107::getNav()->adminLinks('legacy');
    // replacement see e107_handlers/sitelinks.php
Esempio n. 21
0
    e107::redirect();
}
unset($text);
require_once e_PLUGIN . 'links_page/link_class.php';
$lc = new linkclass();
require_once e_HANDLER . "form_handler.php";
$rs = new form();
$tp = e107::getParser();
e107::lan('links_page');
$bullet = '';
if (defined('BULLET')) {
    $bullet = '<img src="' . THEME_ABS . 'images/' . BULLET . '" alt="" style="vertical-align: middle;" />';
} elseif (file_exists(THEME . 'images/bullet2.gif')) {
    $bullet = '<img src="' . THEME_ABS . 'images/bullet2.gif" alt="" style="vertical-align: middle;" />';
}
$linkspage_pref = e107::pref('links_page');
//navigator -------------------------
$mains = "";
$text = "";
$baseurl = e107::url('links_page', 'index');
if (isset($linkspage_pref['link_menu_navigator_frontpage']) && $linkspage_pref['link_menu_navigator_frontpage']) {
    if (isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1") {
        $mains .= $rs->form_option(LAN_LINKS_14, "0", $baseurl, "");
    } else {
        $mains .= $bullet . " <a href='" . $baseurl . "'>" . LAN_LINKS_14 . "</a><br />";
    }
}
if (isset($linkspage_pref['link_menu_navigator_refer']) && $linkspage_pref['link_menu_navigator_refer']) {
    if (isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1") {
        $mains .= $rs->form_option(LAN_LINKS_12, "0", e107::url('links_page', 'top'), "");
    } else {
Esempio n. 22
0
 /**
  * @param string $parm
  * @return mixed|string
  * @see https://www.googleapis.com/youtube/v3/search
  */
 function videoTab($parm = '')
 {
     //	$apiKey = e107::pref('core','youtube_apikey');
     $searchQry = $this->getQuery('search');
     if (substr($searchQry, 0, 4) == 'url:') {
         $searchQry = $this->getYouTubeCode($searchQry);
     }
     if (!empty($searchQry)) {
         if (substr($searchQry, 0, 6) == 'video:' || substr($searchQry, 0, 2) == 'v=') {
             $searchQry = substr($searchQry, 0, 2) == 'v=' ? trim(substr($searchQry, 2)) : trim(substr($searchQry, 6));
             $extension = 'youtube';
             //	$feed = "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=".urlencode($searchQry)."&key=".$apiKey;
             $data = array();
             $data['items'][0]['id']['videoId'] = $searchQry;
             $data['items'][0]['snippet']['thumbnails']['medium']['url'] = "http://i.ytimg.com/vi/" . $searchQry . "/mqdefault.jpg";
             $data['items'][0]['snippet']['title'] = 'Specified Video';
         } elseif (substr($searchQry, 0, 9) == 'playlist:') {
             $searchQry = trim(substr($searchQry, 9));
             $feed = "https://www.googleapis.com/youtube/v3/search?part=snippet&q=" . urlencode($searchQry) . "&type=playlist&maxResults=1&key=" . $apiKey;
             $extension = 'youtubepl';
         } elseif (substr($searchQry, 0, 8) == 'channel:') {
             $searchQry = trim(substr($searchQry, 8));
             $extension = 'youtube';
             $feed = "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=" . urlencode($searchQry) . "&type=video&maxResults=20&key=" . $apiKey;
         } else {
             $feed = "https://www.googleapis.com/youtube/v3/search?part=snippet&q=" . urlencode($searchQry) . "&type=video&maxResults=20&key=" . $apiKey;
             $extension = 'youtube';
         }
     } else {
         $defaultAccount = e107::pref('core', 'youtube_default_account');
         if (empty($defaultAccount)) {
             $defaultAccount = 'e107inc';
         }
         $accFeed = "https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername="******"&key=" . $apiKey;
         $accData = e107::getFile()->getRemoteContent($accFeed);
         $accData = json_decode($accData, true);
         $channelID = null;
         foreach ($accData['items'] as $val) {
             if ($val['kind'] == 'youtube#channel') {
                 $channelID = $val['id'];
                 break;
             }
         }
         $feed = "https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=" . $channelID . "&type=video&maxResults=20&key=" . $apiKey;
         $extension = 'youtube';
     }
     if (!empty($feed)) {
         if (!empty($apiKey)) {
             $data = e107::getFile()->getRemoteContent($feed);
             $data = json_decode($data, true);
             $items = array();
         } else {
             $items = "<div class='alert alert-info'><p>Youtube search requires a (free) YouTube v3 api key.<br />\n\t\t\t\tThis key is not required unless you wish to perform a keyword, playlist or channel search.<br />\n\t\t\t\tEntering a Youtube video URL directly into the box above will still work without having an api key. <br />\n\t\t\t\t<a style='color:black' target='_blank' href='" . e_ADMIN . "image.php?mode=main&action=prefs#/tab2'>Click here for more information and to enter your api key</a>.\n\t\t\t\t</p>\n\t\t\t\t</div>";
         }
     }
     if (!empty($data)) {
         foreach ($data['items'] as $value) {
             $id = $value['id']['videoId'];
             $thumbnail = $value['snippet']['thumbnails']['medium']['url'];
             $items[] = array('previewUrl' => $thumbnail, 'saveValue' => $id . "." . $extension, 'thumbUrl' => $thumbnail, 'title' => varset($value['snippet']['title'], ''));
             if ($extension == 'youtubepl') {
                 $hiresThumbnail = $thumbnail = $value['snippet']['thumbnails']['high']['url'];
                 e107::getMedia()->saveThumb($hiresThumbnail, $id);
                 //TODO move to $tp->Video(); ?
             }
         }
     }
     //	return print_a($data,true);
     $parms = array('width' => 200, 'height' => 113, 'type' => 'image', 'bbcode' => 'video', 'tagid' => $this->getQuery('tagid'), 'action' => 'youtube', 'searchPlaceholder' => 'Search Youtube. Paste any YouTube URL here for a specific video/playlist/channel');
     $text = e107::getMedia()->browserCarousel($items, $parms);
     if (E107_DEBUG_LEVEL > 0 && !empty($feed)) {
         $text .= "<div><small>Debug: " . $feed . "</small></div>";
         if (!empty($data)) {
             $text .= print_a($data, true);
         }
     }
     return $text;
 }
Esempio n. 23
0
 function saveMailPrefs(&$mes)
 {
     if (!getperms('0')) {
         return;
     }
     //$pref = e107::getPref();
     $e107 = e107::getInstance();
     $tp = e107::getParser();
     $mes = e107::getMessage();
     $bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
     unset($temp);
     if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) {
         $_POST['mailer'] = 'php';
     }
     $temp['mailer'] = $_POST['mailer'];
     // Allow qmail as an option as well - works much as sendmail
     if (strpos($_POST['sendmail'], 'sendmail') !== FALSE || strpos($_POST['sendmail'], 'qmail') !== FALSE) {
         $temp['sendmail'] = $tp->toDB($_POST['sendmail']);
     } else {
         $temp['sendmail'] = '';
     }
     $temp['smtp_server'] = $tp->toDB($_POST['smtp_server']);
     $temp['smtp_username'] = $tp->toDB($_POST['smtp_username']);
     $temp['smtp_password'] = $tp->toDB($_POST['smtp_password']);
     $smtp_opts = array();
     switch (trim($_POST['smtp_options'])) {
         case 'smtp_ssl':
             $smtp_opts[] = 'secure=SSL';
             break;
         case 'smtp_tls':
             $smtp_opts[] = 'secure=TLS';
             break;
         case 'smtp_pop3auth':
             $smtp_opts[] = 'pop3auth';
             break;
     }
     if (vartrue($_POST['smtp_keepalive'])) {
         $smtp_opts[] = 'keepalive';
     }
     if (vartrue($_POST['smtp_useVERP'])) {
         $smtp_opts[] = 'useVERP';
     }
     $temp['smtp_options'] = implode(',', $smtp_opts);
     $temp['mail_sendstyle'] = $tp->toDB($_POST['mail_sendstyle']);
     $temp['mail_pause'] = intval($_POST['mail_pause']);
     $temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
     $temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
     $temp['mail_workpertick'] = min($temp['mail_workpertick'], 1000);
     $temp['mail_bounce'] = isset($bounceOpts[$_POST['mail_bounce']]) ? $_POST['mail_bounce'] : 'none';
     $temp['mail_bounce_auto'] = 0;
     // Make sure this is always defined
     switch ($temp['mail_bounce']) {
         case 'none':
             $temp['mail_bounce_email'] = '';
             break;
         case 'auto':
             $temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email2']);
             break;
         case 'mail':
             $temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email']);
             $temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
             break;
     }
     $temp['mail_bounce_pop3'] = $tp->toDB($_POST['mail_bounce_pop3']);
     $temp['mail_bounce_user'] = $tp->toDB($_POST['mail_bounce_user']);
     $temp['mail_bounce_pass'] = $tp->toDB($_POST['mail_bounce_pass']);
     $temp['mail_bounce_type'] = $tp->toDB($_POST['mail_bounce_type']);
     $temp['mail_bounce_delete'] = intval(varset($_POST['mail_bounce_delete'], 0));
     $temp['mailout_enabled'] = implode(',', varset($_POST['mail_mailer_enabled'], ''));
     $temp['mail_log_options'] = intval($_POST['mail_log_option']) . ',' . intval($_POST['mail_log_email']);
     foreach ($temp as &$t) {
         if ($t === NULL) {
             $t = '';
         }
     }
     $pref = e107::pref('core');
     // Core Prefs Array.
     if (e107::getAdminLog()->logArrayDiffs($temp, $pref, 'MAIL_03')) {
         e107::getConfig()->updatePref($temp);
         e107::getConfig()->save(false);
         // Only save if changes - generates its own message
     } else {
         $mes->addInfo(LAN_NO_CHANGE);
     }
 }
Esempio n. 24
0
<?php

/*
 * Forecasty - A weather plugin for e107
 *
 * Copyright (C) 2015 Patrick Weaver (http://trickmod.com/)
 * For additional information refer to the README.md file.
 *
 */
if (!defined('e107_INIT')) {
    exit;
}
require_once e_PLUGIN . 'forecasty/_class.php';
$pref = e107::pref('forecasty');
$tp = e107::getParser();
$sc = e107::getScBatch('forecasty', true);
$template = e107::getTemplate('forecasty');
// TODO: Gather the visitors location if they are a memeber, if not, utilize the fallbackLocation.
$location = $pref['fallbackLocation'];
$wf = new Forecasty($pref['apiKey'], $location);
$current = $wf->getData('current');
$hour = $wf->getData('nexthour');
$day = $wf->getData('nextday');
$week = $wf->getData('nextweek');
$sc->setVars(array('current' => array('temperature' => $current['temperature'], 'feelsLike' => $current['feelsLike'], 'icon' => $current['icon'], 'condition' => $current['condition'], 'humidity' => $current['humidity'], 'windSpeed' => $current['windSpeed'], 'visibility' => $current['visibility'], 'pressure' => $current['pressure'], 'dewPoint' => $current['dewPoint']), 'nexthour' => array('temperature' => $hour['temperature'], 'feelsLike' => $hour['feelsLike'], 'icon' => $hour['icon'], 'condition' => $hour['condition'], 'humidity' => $hour['humidity'], 'windSpeed' => $hour['windSpeed'], 'visibility' => $hour['visibility'], 'pressure' => $hour['pressure'], 'dewPoint' => $hour['dewPoint']), 'nextday' => array('temperature' => $day['temperature'], 'feelsLike' => $day['feelsLike'], 'icon' => $day['icon'], 'condition' => $day['condition'], 'humidity' => $day['humidity'], 'windSpeed' => $day['windSpeed'], 'visibility' => $day['visibility'], 'pressure' => $day['pressure'], 'dewPoint' => $day['dewPoint']), 'nextweek' => array('temperature' => $week['temperature'], 'feelsLike' => $week['feelsLike'], 'icon' => $week['icon'], 'condition' => $week['condition'], 'humidity' => $week['humidity'], 'windSpeed' => $week['windSpeed'], 'visibility' => $week['visibility'], 'pressure' => $week['pressure'], 'dewPoint' => $week['dewPoint'])));
$text = $tp->parseTemplate($template['menu'], false, $sc);
e107::getRender()->tablerender('Weather', $text);
Esempio n. 25
0
<?php

if (USER_AREA) {
    e107::css('social', 'css/fontello.css');
    $social = e107::pref('core', 'social_login');
    if (!empty($social) && is_array($social)) {
        $appID = vartrue($social['Facebook']['keys']['id']);
    }
    if (!empty($appID)) {
        e107::meta('fb:app_id', $appID);
        $locale = strtolower(CORE_LC) . "_" . strtoupper(CORE_LC2);
        $init = "\n\n\t\t\twindow.fbAsyncInit = function() {\n\t            FB.init({\n\t            appId      : '" . $appID . "',\n\t            xfbml      : true,\n\t            version    : 'v2.3'\n\t            });\n\t\t\t};\n\n\t\t\t(function(d, s, id){\n\t            var js, fjs = d.getElementsByTagName(s)[0];\n\t            if (d.getElementById(id)) {return;}\n\t            js = d.createElement(s); js.id = id;\n\t            js.src = '//connect.facebook.net/" . $locale . "/sdk.js';\n\t            fjs.parentNode.insertBefore(js, fjs);\n\t        }(document, 'script', 'facebook-jssdk'));\n\n\t        ";
        define('SOCIAL_FACEBOOK_INIT', $init);
    } else {
        define('SOCIAL_FACEBOOK_INIT', false);
    }
}
Esempio n. 26
0
 public function initialPage()
 {
     $pref = e107::pref('core');
     $mes = e107::getMessage();
     $ns = e107::getRender();
     $frm = e107::getForm();
     //		$e_userclass    = $this->getUserClassAdmin();
     $text = "";
     $initial_classes = varset($pref['initial_user_classes'], '');
     $irc = explode(',', $initial_classes);
     $icn = array();
     foreach ($irc as $i) {
         if (trim($i)) {
             $icn[] = e107::getUserClass()->getName($i);
         }
     }
     $class_text = $frm->userclass('init_classes', $initial_classes, 'checkbox', array('options' => 'classes,force'));
     //	$class_text = e107::getUserClass()->uc_checkboxes('init_classes', $initial_classes, 'classes, force', TRUE);
     //	$class_text = e107::getUserClass()->vetted_tree('init_classes',array($e_userclass,'checkbox_desc'), $initial_classes, 'classes, force, no-excludes');
     $mes->addInfo(UCSLAN_49);
     $text = "<div>\n\t\t\t<form method='post' action='" . e_SELF . "?mode=main&action=initial' id='initialForm'>\n\t\t\t<table class='table table-bordered adminform'>\n\t\t\t<tr><td>" . UCSLAN_43 . "</td><td>";
     if (count($icn) > 0) {
         //  $text .= implode(', ',$icn);
     } else {
         $text .= UCSLAN_44;
     }
     if ($class_text) {
         $text .= $class_text . "</td></tr><tr><td>";
         $sel_stage = varset($pref['init_class_stage'], 2);
         $initClassStages = array(1 => UCSLAN_47, 2 => UCSLAN_48);
         $text .= UCSLAN_45 . "<br />\t</td>\n\t\t\t\t    <td>" . $frm->select('init_class_stage', $initClassStages, $sel_stage) . "<span class='field-help'>" . UCSLAN_46 . "</span>\n\n\t\t\t\t    </td></tr></table>\n\t\t\t\t    <div class='buttons-bar'>" . $frm->admin_button('set_initial_classes', 'no-value', 'create', LAN_UPDATE) . "</div>";
     } else {
         $text .= UCSLAN_39;
     }
     $text .= "</td></tr></table></form></div>";
     return $mes->render() . $text;
     //	$ns->tablerender(ADLAN_38.SEP.UCSLAN_40, $mes->render() . $text);
 }
Esempio n. 27
0
 public function configurePage()
 {
     $ns = e107::getRender();
     $frm = e107::getForm();
     $pref = e107::pref('core');
     //	e107::getMessage()->addInfo($notice);
     $text = "<table class='table adminform'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t<col class='col-control' />\n\t\t\t\t</colgroup>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='social-login-active'>Social Signup/Login</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->radio_switch('social_login_active', $pref['social_login_active']) . "\n\t\t\t\t\t\t\t\t<div class='smalltext field-help'>Allows users to signup/login with their social media accounts. When enabled, this option will still allow users to signup/login even if the core user registration system above is disabled. </div>\n\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Application Keys and IDs <br /></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<table class='table table-bordered table-striped'>\n\t\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t\t\t\t<col class='col-control' />\n\t\t\t\t\t\t\t</colgroup>\n\n\t\t\t\t\t";
     if (!is_array($pref['social_login'])) {
         $pref['social_login'] = array();
     }
     foreach ($this->social_logins as $prov => $val) {
         $label = varset($this->social_external[$prov]) ? "<a class='e-tip' rel='external' title='Get a key from the provider' href='" . $social_external[$prov] . "'>" . $prov . "</a>" : $prov;
         $radio_label = strtolower($prov);
         $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='social-login-" . $radio_label . "-enabled'>" . $label . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t";
         foreach ($val as $k => $v) {
             switch ($k) {
                 case 'enabled':
                     $eopt = array('class' => 'e-expandit');
                     $text .= $frm->radio_switch('social_login[' . $prov . '][enabled]', vartrue($pref['social_login'][$prov]['enabled']), '', '', $eopt);
                     break;
                 case 'keys':
                     // $cls = vartrue($pref['single_login'][$prov]['keys'][$tk]) ? "class='e-hideme'" : '';
                     $sty = vartrue($pref['social_login'][$prov]['keys'][vartrue($tk)]) ? "" : "e-hideme";
                     $text .= "<div class='e-expandit-container {$sty}' id='option-{$prov}' >";
                     foreach ($v as $tk => $idk) {
                         $eopt = array('placeholder' => $tk, 'size' => 'xxlarge');
                         $text .= "<br />" . $frm->text('social_login[' . $prov . '][keys][' . $tk . ']', vartrue($pref['social_login'][$prov]['keys'][$tk]), 100, $eopt);
                     }
                     $text .= "</div>";
                     break;
                 case 'scope':
                     $text .= $frm->hidden('social_login[' . $prov . '][scope]', 'email');
                     break;
                 default:
                     break;
             }
         }
         $text .= "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t";
     }
     $text .= "</table>\n\t\t\t\t\t</td></tr>\n\n\n\t\t\t\t</tbody></table>\n\t\t\t";
     // -------------------------------
     //
     //
     $text2 = "\n\t\t\t\t\t<table class='table'>\n\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t\t\t<col class='col-control' />\n\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t";
     //XXX XURL Definitions.
     $xurls = array('facebook' => array('label' => "Facebook", "placeholder" => "eg. https://www.facebook.com/e107CMS"), 'twitter' => array('label' => "Twitter", "placeholder" => "eg. https://twitter.com/e107"), 'youtube' => array('label' => "Youtube", "placeholder" => "eg.https://youtube.com/e107Inc"), 'google' => array('label' => "Google+", "placeholder" => ""), 'linkedin' => array('label' => "LinkedIn", "placeholder" => "eg. http://www.linkedin.com/groups?home=&gid=1782682"), 'github' => array('label' => "Github", "placeholder" => "eg. https://github.com/e107inc"), 'flickr' => array('label' => "Flickr", "placeholder" => ""), 'instagram' => array('label' => "Instagram", "placeholder" => ""), 'pinterest' => array('label' => "Pinterest", "placeholder" => ""), 'vimeo' => array('label' => "Vimeo", "placeholder" => ""));
     foreach ($xurls as $k => $var) {
         $keypref = "xurl[" . $k . "]";
         $text_label = "xurl-" . $k . "";
         $def = "XURL_" . strtoupper($k);
         $opts = array('size' => 'xxlarge', 'placeholder' => $var['placeholder']);
         $text2 .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='" . $text_label . "'>Your " . $var['label'] . " page</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->text($keypref, $pref['xurl'][$k], false, $opts) . "\n\t\t\t\t\t\t\t<div class='field-help'>Used by some themes to provide a link to your " . $var['label'] . " page. (" . $def . ")</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t";
     }
     $text2 .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\n";
     $tabs = array();
     $tabs[] = array('caption' => "Apps", 'text' => $text);
     $tabs[] = array('caption' => 'Pages', 'text' => $text2);
     $ret = $frm->open('social', 'post', null, 'class=form-horizontal') . $frm->tabs($tabs);
     $ret .= "<div class='buttons-bar center'>\n\n\t\t\t" . $frm->button('save_social', 1, 'submit', LAN_SAVE) . "\n\n\t\t\t\t</div>";
     $ret .= $frm->close();
     return $ret;
 }
Esempio n. 28
0
    e107::meta('dcterms.rights', $pref['meta_copyright'][e_LANGUAGE]);
}
if (vartrue($pref['meta_author'][e_LANGUAGE])) {
    e107::meta('author', $pref['meta_author'][e_LANGUAGE]);
}
if ($pref['sitebutton']) {
    e107::meta('og:image', $tp->replaceConstants($pref['sitelogo'], 'full'));
}
if (defined("VIEWPORT")) {
    e107::meta('viewport', VIEWPORT);
}
//BC ONLY
// Load Plugin Header Files, allow them to load CSS/JSS/Meta via JS Manager early enouhg
// NOTE: e_header.php should not output content, it should only register stuff!
// e_meta.php is more appropriate for outputting header content.
$e_headers = e107::pref('core', 'e_header_list');
if ($e_headers && is_array($e_headers)) {
    foreach ($e_headers as $val) {
        // no checks fore existing file - performance
        e107_include(e_PLUGIN . $val . "/e_header.php");
    }
}
unset($e_headers);
echo e107::getUrl()->response()->renderMeta() . "\n";
// render all the e107::meta() entries.
echo "<title>" . (defined('e_PAGETITLE') ? e_PAGETITLE . ' - ' : (defined('PAGE_NAME') ? PAGE_NAME . ' - ' : "")) . SITENAME . "</title>\n\n";
//
// D: Register CSS
//
$e_js = e107::getJs();
$e_pref = e107::getConfig('core');
Esempio n. 29
0
function forum_rules($action = 'check')
{
    if (ADMIN == true) {
        $type = 'forum_rules_admin';
    } elseif (USER == true) {
        $type = 'forum_rules_member';
    } else {
        $type = 'forum_rules_guest';
    }
    $result = e107::getDb()->select('generic', 'gen_chardata', "gen_type = '{$type}' AND gen_intdata = 1");
    if ($action == 'check') {
        return $result;
    }
    if ($result) {
        $row = e107::getDb()->fetch();
        $rules_text = e107::getParser()->toHTML($row['gen_chardata'], true);
    } else {
        $rules_text = LAN_FORUM_0072;
    }
    $text = '';
    if (deftrue('BOOTSTRAP')) {
        $breadarray = array(array('text' => e107::pref('forum', 'title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum', 'index')), array('text' => LAN_FORUM_0016, 'url' => null));
        $text = e107::getForm()->breadcrumb($breadarray);
    }
    $text .= "<div id='forum-rules'>" . $rules_text . "</div>";
    $text .= "<div class='center'>" . e107::getForm()->pagination(e107::url('forum', 'index'), LAN_BACK) . "</div>";
    e107::getRender()->tablerender(LAN_FORUM_0016, $text, array('forum', 'forum_rules'));
}
Esempio n. 30
0
 function topPosters()
 {
     $pref = e107::pref('core');
     $rank = e107::getRank();
     $sql = e107::getDb();
     $sql2 = e107::getDb('sql2');
     $ns = e107::getRender();
     $tp = e107::getParser();
     define('IMAGE_rank_main_admin_image', $pref['rank_main_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_main_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_main_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/main_admin.png' alt='' />");
     define('IMAGE_rank_admin_image', $pref['rank_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/admin.png' alt='' />");
     define('IMAGE_rank_moderator_image', $pref['rank_moderator_image'] && file_exists(THEME . "forum/" . $pref['rank_moderator_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_moderator_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/moderator.png' alt='' />");
     if ($this->subaction == 'forum' || $this->subaction == 'all') {
         require_once e_PLUGIN . 'forum/forum_class.php';
         $forum = new e107forum();
         $qry = "\n\t\t\tSELECT ue.*, u.* FROM `#user_extended` AS ue\n\t\t\tLEFT JOIN `#user` AS u ON u.user_id = ue.user_extended_id\n\t\t\tWHERE ue.user_plugin_forum_posts > 0\n\t\t\tORDER BY ue.user_plugin_forum_posts DESC LIMIT {$this->from}, {$this->view}\n\t\t\t";
         //		$top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
         $text = "\n\t\t\t<div>\n\t\t\t<table style='width:95%' class='table table-striped fborder'>\n\t\t\t<tr>\n\t\t\t<th style='width:10%; text-align:center' class='forumheader3'>&nbsp;</th>\n\t\t\t<th style='width:50%' class='forumheader3'>" . TOP_LAN_1 . "</th>\n\t\t\t<th style='width:10%; text-align:center' class='forumheader3'>" . TOP_LAN_2 . "</th>\n\t\t\t<th style='width:30%; text-align:center' class='forumheader3'>" . TOP_LAN_6 . "</th>\n\t\t\t</tr>\n";
         $counter = 1 + $this->from;
         if ($sql2->gen($qry)) {
             while ($row = $sql2->fetch()) {
                 //$ldata = get_level($row['user_id'], $row['user_plugin_forum_posts'], $row['user_comments'], $row['user_chats'], $row['user_visits'], $row['user_join'], $row['user_admin'], $row['user_perms'], $pref);
                 $ldata = $rank->getRanks($row, USER && $forum->isModerator(USERID));
                 if (vartrue($ldata['special'])) {
                     $r = $ldata['special'];
                 } else {
                     $r = $ldata['pic'] ? $ldata['pic'] : defset($ldata['name'], $ldata['name']);
                 }
                 if (!$r) {
                     $r = 'n/a';
                 }
                 $text .= "<tr>\n\t\t\t\t\t<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>\n\t\t\t\t\t<td style='width:50%' class='forumheader3'><a href='" . e107::getUrl()->create('user/profile/view', 'id=' . $row['user_id'] . '&name=' . $row['user_name']) . "'>{$row['user_name']}</a></td>\n\t\t\t\t\t<td style='width:10%; text-align:center' class='forumheader3'>{$row['user_plugin_forum_posts']}</td>\n\t\t\t\t\t<td style='width:30%; text-align:center' class='forumheader3'>{$r}</td>\n\t\t\t\t\t</tr>";
                 $counter++;
             }
         }
         $text .= "</table>\n</div>";
         if ($this->subaction == 'forum') {
             $ftotal = $sql->count('user', '(*)', 'WHERE `user_forums` > 0');
             $parms = "{$ftotal},{$this->view},{$this->from}," . e_SELF . '?[FROM].top.forum.' . $this->view;
             $text .= "<div class='nextprev'>" . $tp->parseTemplate("{NEXTPREV={$parms}}") . '</div>';
         }
         $ns->tablerender(TOP_LAN_0, $text);
     }
 }