当前位置: 首页>>代码示例>>PHP>>正文


PHP e107::pref方法代码示例

本文整理汇总了PHP中e107::pref方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::pref方法的具体用法?PHP e107::pref怎么用?PHP e107::pref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在e107的用法示例。


在下文中一共展示了e107::pref方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHookImages

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;
}
开发者ID:septor,项目名称:imggregator,代码行数:34,代码来源:_class.php

示例2: __construct

 function __construct()
 {
     $pref = e107::pref('core', 'social_login');
     if (!empty($pref) && is_array($pref['Twitter'])) {
         $this->twitterActive = vartrue($pref['Twitter']['keys']['key']);
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:7,代码来源:e_admin.php

示例3: unanswered

 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);
 }
开发者ID:armpit,项目名称:e107,代码行数:25,代码来源:e_cron.php

示例4: sc_oneliner

 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'];
 }
开发者ID:gitter-badger,项目名称:forecasty,代码行数:7,代码来源:forecasty_shortcodes.php

示例5: __construct

 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();
 }
开发者ID:KonzolozZ,项目名称:e107,代码行数:9,代码来源:newforumposts_menu.php

示例6: sc_membersonly_signup

 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);
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:9,代码来源:membersonly.php

示例7: config

 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;
 }
开发者ID:armpit,项目名称:e107,代码行数:10,代码来源:theme_config.php

示例8: checkTimezone

 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;
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:10,代码来源:admin.php

示例9: init

 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;
 }
开发者ID:gitter-badger,项目名称:forecasty,代码行数:11,代码来源:admin_config.php

示例10: init

 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();
 }
开发者ID:armpit,项目名称:e107,代码行数:15,代码来源:upload.php

示例11: init

 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);
 }
开发者ID:gitter-badger,项目名称:e107,代码行数:16,代码来源:comment.php

示例12: facebook

 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;
 }
开发者ID:JBeezygit,项目名称:e107,代码行数:18,代码来源:e_comment.php

示例13: init

 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;
 }
开发者ID:gitter-badger,项目名称:anteup,代码行数:22,代码来源:admin_config.php

示例14: get_info

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;
    }
}
开发者ID:gitter-badger,项目名称:anteup,代码行数:22,代码来源:_class.php

示例15: getConfig

 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++;
//.........这里部分代码省略.........
开发者ID:hgz5w,项目名称:e107,代码行数:101,代码来源:wysiwyg.php


注:本文中的e107::pref方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。