コード例 #1
0
ファイル: simple.php プロジェクト: hatone/zenphoto-1.4.1.4
 /**
  * The function for processing a message to see if it might be SPAM
  *       returns:
  *         0 if the message is SPAM
  *         1 if the message might be SPAM (it will be marked for moderation)
  *         2 if the message is not SPAM
  *
  * @param string $author Author field from the posting
  * @param string $email Email field from the posting
  * @param string $website Website field from the posting
  * @param string $body The text of the comment
  * @param object $receiver The object on which the post was made
  * @param string $ip the IP address of the comment poster
  *
  * @return int
  */
 function filterMessage($author, $email, $website, $body, $receiver, $ip)
 {
     if (strpos(getOption('Banned_IP_list'), $ip) !== false) {
         return 0;
     }
     $forgive = getOption('Forgiving');
     $list = getOption('Words_to_die_on');
     $list = strtolower($list);
     $this->wordsToDieOn = explode(',', $list);
     $list = getOption('Patterns_to_die_on');
     $list = strtolower($list);
     $this->patternsToDieOn = explode(' ', $list);
     $this->excessiveURLCount = getOption('Excessive_URL_count');
     $die = 2;
     // good comment until proven bad
     foreach (array($author, $email, $website, $body) as $check) {
         if ($check) {
             if (($num = substr_count($check, 'http://')) >= $this->excessiveURLCount) {
                 // too many links
                 $die = $forgive;
             } else {
                 if ($pattern = $this->hasSpamPattern($check)) {
                     $die = $forgive;
                 } else {
                     if ($spamWords = $this->hasSpamWords($check)) {
                         $die = $forgive;
                     }
                 }
             }
         }
     }
     return $die;
 }
コード例 #2
0
ファイル: fileSystemFTPExt.php プロジェクト: Trideon/gigolo
 function connect()
 {
     if (!$this->options['hostname'] || !$this->options['username'] || !$this->options['password']) {
         if (!defined('SUPPORT_URL')) {
             define('SUPPORT_URL', getOption('supportURL'));
         }
         appUpdateMsg('<a href="' . SUPPORT_URL . 'solution/articles/195233-asking-for-ftp-sftp-details-during-update/" target="_blank">See how to add the FTP details</a>.');
         return false;
     }
     if (isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect')) {
         $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
     } else {
         $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
     }
     if (!$this->link) {
         //$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
         appUpdateMsg(sprintf('Failed to connect to the FTP server "%1$s:%2$s"', $this->options['hostname'], $this->options['port']));
         return false;
     }
     if (!@ftp_login($this->link, $this->options['username'], $this->options['password'])) {
         //$this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username']));
         appUpdateMsg(sprintf('FTP username or password incorrect for "%s"', $this->options['username']));
         return false;
     }
     //Set the Connection to use Passive FTP
     if ($this->options['passive']) {
         @ftp_pasv($this->link, true);
     }
     if (@ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT) {
         @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT);
     }
     return true;
 }
コード例 #3
0
ファイル: comment_form.php プロジェクト: ariep/ZenPhoto20-DEV
 /**
  * class instantiation function
  *
  */
 function __construct()
 {
     if (OFFSET_PATH == 2) {
         $old = getOption('tinymce_comments');
         setOptionDefault('email_new_comments', 1);
         setOptionDefault('comment_name_required', 'required');
         setOptionDefault('comment_email_required', 'required');
         setOptionDefault('comment_web_required', 'show');
         setOptionDefault('Use_Captcha', false);
         setOptionDefault('comment_form_addresses', 0);
         setOptionDefault('comment_form_require_addresses', 0);
         setOptionDefault('comment_form_members_only', 0);
         setOptionDefault('comment_form_albums', 1);
         setOptionDefault('comment_form_images', 1);
         setOptionDefault('comment_form_articles', 1);
         setOptionDefault('comment_form_pages', 1);
         setOptionDefault('comment_form_rss', 1);
         setOptionDefault('comment_form_private', 1);
         setOptionDefault('comment_form_anon', 1);
         setOptionDefault('comment_form_showURL', 1);
         setOptionDefault('comment_form_comments_per_page', 10);
         setOptionDefault('comment_form_pagination', true);
         setOptionDefault('comment_form_toggle', 1);
         setOptionDefault('tinymce_comments', 'comment-ribbon.php');
         setOptionDefault('tinymce_admin_comments', 'comment-ribbon.php');
     }
 }
コード例 #4
0
ファイル: functions.php プロジェクト: roxanne/penguin-cms
function getSidebar()
{
    if (getOption('sidebar_active') == TRUE) {
        include TEMPDIR . '/sidebar.php';
    } else {
    }
}
コード例 #5
0
 function ThemeOptions()
 {
     setThemeOptionDefault('zenpage_zp_index_news', false);
     setThemeOptionDefault('Allow_search', true);
     setThemeOptionDefault('Use_thickbox', true);
     setThemeOptionDefault('zenpage_homepage', 'none');
     setThemeOptionDefault('zenpage_contactpage', true);
     setThemeOptionDefault('zenpage_custommenu', false);
     setThemeOptionDefault('albums_per_row', 2);
     setThemeOptionDefault('images_per_row', 5);
     setThemeOptionDefault('thumb_transition', 1);
     setOptionDefault('zp_plugin_colorbox', 1);
     setOptionDefault('colorbox_zenpage_album', 1);
     setOptionDefault('colorbox_zenpage_image', 1);
     setOptionDefault('colorbox_zenpage_search', 1);
     if (getOption('zp_plugin_zenpage')) {
         setThemeOption('custom_index_page', 'gallery', NULL, NULL, false);
     } else {
         setThemeOption('custom_index_page', '', NULL, NULL, false);
     }
     if (function_exists('createMenuIfNotExists')) {
         $menuitems = array(array('type' => 'menulabel', 'title' => gettext('News Articles'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All news'), 'link' => 'printAllNewsCategories("All news",TRUE,"","menu-active",false,false,false,"list",false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'menulabel', 'title' => gettext('Gallery'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery index'), 'link' => 'gallery', 'show' => 1, 'nesting' => 1), array('type' => 'menufunction', 'title' => gettext('All Albums'), 'link' => 'printAlbumMenuList("list",NULL,"","menu-active","submenu","menu-active","",false,false,false,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'menulabel', 'title' => gettext('Pages'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All pages'), 'link' => 'printPageMenu("list","","menu-active","submenu","menu-active","",0,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1));
         createMenuIfNotExists($menuitems, 'zenpage');
     }
 }
コード例 #6
0
 function getOptionsSupported()
 {
     $MapTypes = array();
     // order matters here because the first allowed map is selected if the 'gmaps_starting_map' is not allowed
     if (getOption('gmaps_maptype_map')) {
         $MapTypes[gettext('Map')] = 'G_NORMAL_MAP';
     }
     if (getOption('gmaps_maptype_hyb')) {
         $MapTypes[gettext('Hybrid')] = 'G_HYBRID_MAP';
     }
     if (getOption('gmaps_maptype_sat')) {
         $MapTypes[gettext('Satellite')] = 'G_SATELLITE_MAP';
     }
     if (getOption('gmaps_maptype_P')) {
         $MapTypes[gettext('Terrain')] = 'G_PHYSICAL_MAP';
     }
     if (getOption('gmaps_maptype_3D')) {
         $MapTypes[gettext('Google Earth')] = 'G_SATELLITE_3D_MAP';
     }
     $defaultmap = getOption('gmaps_starting_map');
     if (array_search($defaultmap, $MapTypes) === false) {
         // the starting map is not allowed, pick a new one
         $temp = $MapTypes;
         $defaultmap = array_shift($temp);
         setOption('gmaps_starting_map', $defaultmap);
     }
     return array(gettext('Google Maps API key') => array('key' => 'gmaps_apikey', 'type' => 0, 'desc' => gettext('If you are going to be using Google Maps, <a	href="http://www.google.com/apis/maps/signup.html" target="_blank">get an API key</a> and enter it here.')), gettext('All album points') => array('key' => 'gmaps_show_all_album_points', 'type' => 1, 'desc' => gettext('Controls which image points are shown on an album page. Check to show points for all images in the album. If not checked points are shown only for those images whose thumbs are on the page.')), gettext('Map dimensions—width') => array('key' => 'gmaps_width', 'type' => 0, 'desc' => gettext('The default width of the map.')), gettext('Map dimensions—height') => array('key' => 'gmaps_height', 'type' => 0, 'desc' => gettext('The default height of the map.')), gettext('Allowed maps') => array('key' => 'gmaps_allowed_maps', 'type' => 6, 'checkboxes' => array(gettext('Map') => 'gmaps_maptype_map', gettext('Satellite') => 'gmaps_maptype_sat', gettext('Hybrid') => 'gmaps_maptype_hyb', gettext('Terrain') => 'gmaps_maptype_P', gettext('Google Earth') => 'gmaps_maptype_3D'), 'desc' => gettext('Select the map types that are allowed.')), gettext('Map type selector') => array('key' => 'gmaps_control_maptype', 'type' => 4, 'buttons' => array(gettext('Buttons') => 1, gettext('List') => 2), 'desc' => gettext('Use buttons or list for the map type selector.')), gettext('Map controls') => array('key' => 'gmaps_control', 'type' => 4, 'buttons' => array(gettext('None') => 'None', gettext('Small') => 'Small', gettext('Large') => 'Large'), 'desc' => gettext('Select the kind of map controls.')), gettext('Map background') => array('key' => 'gmaps_background', 'type' => 0, 'desc' => gettext('Set the map background color to match the one of your theme. (Use the same <em>color</em> values as in your CSS background statements.)')), gettext('Initial map display selection') => array('key' => 'gmaps_starting_map', 'type' => 5, 'selections' => $MapTypes, 'desc' => gettext('Select the initial type of map to display. <br /><strong>Note:</strong> If <code>Google Earth</code> is selected the <em>toggle</em> function which initially hides the map is ignored. The browser <em>Google Earth Plugin</em> does not initialize properly when the map is hidden.')));
 }
コード例 #7
0
 function viewer_size_image_options()
 {
     $default = getOption('image_size');
     setOptionDefault('viewer_size_image_sizes', '$s=' . ($default - 200) . '; $s=' . ($default - 100) . '; $s=' . $default . '; $s=' . ($default + 100) . '; $s=' . ($default + 200) . ';');
     setOptionDefault('viewer_size_image_default', '$s=' . $default);
     setOptionDefault('viewer_size_image_radio', 2);
 }
コード例 #8
0
ファイル: tinymce.php プロジェクト: ariep/ZenPhoto20-DEV
function tinymceConfigJS($mode)
{
    global $_editorconfig, $MCEskin, $MCEdirection, $MCEcss, $MCEspecial, $MCEimage_advtab, $MCEtoolbars;
    $MCEskin = $MCEdirection = $MCEcss = $MCEspecial = $MCEimage_advtab = $MCEtoolbars = NULL;
    if (empty($_editorconfig)) {
        // only if we get here first!
        $locale = 'en';
        $loc = str_replace('_', '-', getOption("locale"));
        if ($loc) {
            if (file_exists(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/tinymce/langs/' . $loc . '.js')) {
                $locale = $loc;
            } else {
                $loc = substr($loc, 0, 2);
                if (file_exists(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/tinymce/langs/' . $loc . '.js')) {
                    $locale = $loc;
                }
            }
        }
        $_editorconfig = getOption('tinymce_' . $mode);
        if (!empty($_editorconfig)) {
            $_editorconfig = getPlugin('tinymce/config/' . $_editorconfig, true);
            if (!empty($_editorconfig)) {
                require_once $_editorconfig;
            }
        }
    }
    return $mode;
}
コード例 #9
0
ファイル: akismet.php プロジェクト: ItsHaden/epicLanBootstrap
 /**
  * The function for processing a message to see if it might be SPAM
  *       returns:
  *         0 if the message is SPAM
  *         1 if the message might be SPAM (it will be marked for moderation)
  *         2 if the message is not SPAM
  *
  * @param string $author Author field from the posting
  * @param string $email Email field from the posting
  * @param string $website Website field from the posting
  * @param string $body The text of the comment
  * @param string $imageLink A link to the album/image on which the post was made
  * @param string $ip the IP address of the comment poster
  * 
  * @return int
  */
 function filterMessage($author, $email, $website, $body, $imageLink, $ip)
 {
     $commentData = array('author' => $author, 'email' => $email, 'website' => $website, 'body' => $body, 'permalink' => $imageLink);
     $zp_galUrl = FULLWEBPATH;
     // Sets the webpath for the Akismet server
     $zp_akismetKey = getOption('Akismet_key');
     $forgive = getOption('Forgiving');
     $die = 2;
     // good comment until proven bad
     $akismet = new Akismet($zp_galUrl, $zp_akismetKey, $commentData);
     if ($akismet->errorsExist()) {
         // TODO: Add more improved error handling (maybe)
         // echo "Couldn't connected to Akismet server!";
         // print_r ($akismet->getErrors());
         $die = 1;
         // mark for moderation if we can't check for Spam
     } else {
         if ($akismet->isSpam()) {
             // Message is spam according to Akismet
             // echo 'Spam detected';
             // echo "bad message.";
             $die = $forgive;
         } else {
             // Message is not spam according to Akismet
             // echo "spam filter is true. good message.";
         }
     }
     return $die;
 }
コード例 #10
0
ファイル: GoogleMap.php プロジェクト: hatone/zenphoto-1.4.1.4
 function getOptionsSupported()
 {
     $MapTypes = array();
     // order matters here because the first allowed map is selected if the 'gmap_starting_map' is not allowed
     if (getOption('gmap_map')) {
         $MapTypes[gettext('Map')] = 'map';
     }
     if (getOption('gmap_hybrid')) {
         $MapTypes[gettext('Hybrid')] = 'hybrid';
     }
     if (getOption('gmap_satellite')) {
         $MapTypes[gettext('Satellite')] = 'satellite';
     }
     if (getOption('gmap_terrain')) {
         $MapTypes[gettext('Terrain')] = 'terrain';
     }
     $defaultmap = getOption('gmap_starting_map');
     if (array_search($defaultmap, $MapTypes) === false) {
         // the starting map is not allowed, pick a new one
         $temp = $MapTypes;
         $defaultmap = array_shift($temp);
         setOption('gmap_starting_map', $defaultmap);
     }
     return array(gettext('Map dimensions—width') => array('key' => 'gmap_width', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 6, 'desc' => gettext('The default width of the map.')), gettext('Map dimensions—height') => array('key' => 'gmap_height', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 6.5, 'desc' => gettext('The default height of the map.')), gettext('Initial Zoom') => array('key' => 'gmap_zoom', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 7, 'desc' => gettext('The initial zoom of the map.')), gettext('Allowed maps') => array('key' => 'gmap_allowed_maps', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 1, 'checkboxes' => array(gettext('Map') => 'gmap_map', gettext('Satellite') => 'gmap_satillite', gettext('Hybrid') => 'gmap_hybrid', gettext('Terrain') => 'gmap_terrain'), 'desc' => gettext('Select the map types that are allowed.')), gettext('Map control size') => array('key' => 'gmap_control_size', 'type' => OPTION_TYPE_RADIO, 'buttons' => array(gettext('Small') => 'small', gettext('Large') => 'large'), 'order' => 4, 'desc' => gettext('Use buttons or list for the map type selector.')), gettext('Map controls') => array('key' => 'gmap_control', 'type' => OPTION_TYPE_RADIO, 'buttons' => array(gettext('None') => 'none', gettext('Dropdown') => 'dropdown', gettext('Horizontal') => 'horizontal'), 'order' => 3, 'desc' => gettext('Select the kind of map controls.')), gettext('Initial map display selection') => array('key' => 'gmap_starting_map', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $MapTypes, 'order' => 2, 'desc' => gettext('Select the initial type of map to display.')), gettext('Map display') => array('key' => 'gmap_display', 'type' => OPTION_TYPE_SELECTOR, 'selections' => array(gettext('show') => 'show', gettext('hide') => 'hide', gettext('colorbox') => 'colorbox'), 'order' => 2.5, 'desc' => gettext('Select <em>hide</em> to initially hide the map. Select <em>colorbox</em> for the map to display in a colorbox. Select <em>show</em> and the map will display when the page loads.')));
 }
コード例 #11
0
ファイル: themeoptions.php プロジェクト: ariep/ZenPhoto20-DEV
 function getOptionsSupported()
 {
     global $personalities;
     require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_effects.php';
     $note = '<p class="notebox">' . gettext('<strong>Note:</strong> This option is valid only if the Zenpage plugin is enabled or the Separate gallery index option is checked. Of course the <em>menu_manager</em> plugin must also be enabled.') . '</p>';
     if (!extensionEnabled('print_album_menu') && (($m = getOption('effervescence_menu')) == 'effervescence' || $m == 'zenpage' || $m == 'garland')) {
         $note .= '<p class="notebox">' . sprintf(gettext('<strong>Note:</strong> The <em>%s</em> custom menu makes use of the <em>print_album_menu</em> plugin.'), $m) . '</p>';
     }
     $options = array(gettext('Separate gallery index') => array('key' => 'gallery_index', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 1, 'desc' => gettext('Check to move the gallery index from the home page to gallery.php.') . '<p class="notebox">' . gettext('<strong>Note:</strong> this is assumed if the zenpage plugin is enabled.') . '</p>'), gettext('Theme logo') => array('key' => 'Theme_logo', 'type' => OPTION_TYPE_TEXTBOX, 'multilingual' => 1, 'order' => 8, 'desc' => gettext('The text for the theme logo')), gettext('Watermark head image') => array('key' => 'Watermark_head_image', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 11, 'desc' => gettext('Check to place a watermark on the heading image. (Image watermarking must be set.)')), gettext('Daily image') => array('key' => 'effervescence_daily_album_image', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 3, 'desc' => gettext('If checked the heading image will change daily rather than on each page load.')), gettext('Allow search') => array('key' => 'Allow_search', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 3.5, 'desc' => gettext('Check to enable search form.')), gettext('Slideshow') => array('key' => 'Slideshow', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 6, 'desc' => gettext('Check to enable slideshow for the <em>Smoothgallery</em> personality.')), gettext('Graphic logo') => array('key' => 'Graphic_logo', 'type' => OPTION_TYPE_CUSTOM, 'order' => 4, 'desc' => sprintf(gettext('Select a logo (PNG files in the <em>%s/images</em> folder) or leave empty for text logo.'), UPLOAD_FOLDER)), gettext('Theme personality') => array('key' => 'effervescence_personality', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $personalities, 'order' => 9, 'desc' => gettext('Select the theme personality')), gettext('Theme colors') => array('key' => 'Theme_colors', 'type' => OPTION_TYPE_CUSTOM, 'order' => 7, 'desc' => gettext('Select the colors of the theme')), gettext('Custom menu') => array('key' => 'effervescence_menu', 'type' => OPTION_TYPE_CUSTOM, 'order' => 2, 'desc' => gettext('Set this to the <em>menu_manager</em> menu you wish to use.') . $note));
     if (getOption('effervescence_personality') == 'Image_gallery') {
         $options[gettext('Image gallery transition')] = array('key' => 'effervescence_transition', 'type' => OPTION_TYPE_SELECTOR, 'selections' => array(gettext('None') => '', gettext('Fade') => 'fade', gettext('Shrink/grow') => 'resize', gettext('Horizontal') => 'slide-hori', gettext('Vertical') => 'slide-vert'), 'order' => 10, 'desc' => gettext('Transition effect for Image gallery'));
         $options[gettext('Image gallery caption')] = array('key' => 'effervescence_caption_location', 'type' => OPTION_TYPE_RADIO, 'buttons' => array(gettext('On image') => 'image', gettext('Separate') => 'separate', gettext('Omit') => 'none'), 'order' => 10.5, 'desc' => gettext('Location for Image gallery picture caption'));
     }
     $effects = new image_effects();
     $effectOptions = $effects->getOptionsSupported();
     $effect = array_shift($effectOptions);
     while ($effect && !array_key_exists('selections', $effect)) {
         $effect = array_shift($effectOptions);
     }
     if ($effect && array_key_exists('selections', $effect)) {
         $options[gettext('Index Image')] = array('key' => 'effervescence_daily_album_image_effect', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $effect['selections'], 'null_selection' => gettext('none'), 'order' => 5, 'desc' => gettext('Apply this effect to the index page image.'));
         if (!extensionEnabled('image_effects')) {
             $options[gettext('Index Image')]['disabled'] = true;
             $options[gettext('Index Image')]['desc'] .= '<p class="notebox">' . gettext('This option requires the <em>image_effects</em> plugin to be enabled.') . '</p>';
         }
     }
     return $options;
 }
コード例 #12
0
ファイル: Extensions.php プロジェクト: linhntaim/katniss
 public function __construct()
 {
     $this->defines = array_merge(config('katniss.extensions'), HomeThemeFacade::extensions());
     $this->statics = config('katniss.static_extensions');
     $this->activated = array_unique(array_merge((array) getOption('activated_extensions', []), $this->staticExtensions()));
     $this->adminExcepts = config('katniss.admin_except_extensions');
 }
コード例 #13
0
ファイル: themeoptions.php プロジェクト: ariep/ZenPhoto20-DEV
 function getOptionsSupported()
 {
     global $personalities;
     if (!extensionEnabled('print_album_menu') && (($m = getOption('garland_menu')) == 'garland' || $m == 'zenpage' || $m == 'garland')) {
         $note = '<p class="notebox">' . sprintf(gettext('<strong>Note:</strong> The <em>%s</em> custom menu makes use of the <em>print_album_menu</em> plugin.'), $m) . '</p>';
     } else {
         $note = '';
     }
     $options = array(gettext('Theme personality') => array('key' => 'garland_personality', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $personalities, 'desc' => gettext('Select the theme personality')), gettext('Allow search') => array('key' => 'Allow_search', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Set to enable search form.')), gettext('Allow cloud') => array('key' => 'Allow_cloud', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Set to enable tag cloud for album page.')), gettext('Custom menu') => array('key' => 'garland_menu', 'type' => OPTION_TYPE_CUSTOM, 'desc' => gettext('Set this to the <em>menu_manager</em> menu you wish to use.') . $note));
     if (extensionEnabled('zenpage')) {
         global $_zp_CMS;
         $pages = $_zp_CMS->getPages(false);
         $list = array();
         foreach ($pages as $page) {
             $pageObj = newPage($page['titlelink']);
             if (!$pageObj->getShow()) {
                 $list[getBare(get_language_string($page['title']))] = $page['titlelink'];
             }
         }
         $options[gettext('Custom Homepage')] = array('key' => 'garland_customHome', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $list, 'null_selection' => gettext('none'), 'desc' => gettext('Select the <em>pages</em> titlelink for the home page. Only unpublished pages are offered for selection.'));
     }
     if (getOption('garland_personality') == 'image_gallery') {
         $options[gettext('Image gallery transition')] = array('key' => 'garland_transition', 'type' => OPTION_TYPE_SELECTOR, 'selections' => array(gettext('None') => '', gettext('Fade') => 'fade', gettext('Shrink/grow') => 'resize', gettext('Horizontal') => 'slide-hori', gettext('Vertical') => 'slide-vert'), 'order' => 10, 'desc' => gettext('Transition effect for Image gallery'));
         $options[gettext('Image gallery caption')] = array('key' => 'garland_caption_location', 'type' => OPTION_TYPE_RADIO, 'buttons' => array(gettext('On image') => 'image', gettext('Separate') => 'separate', gettext('Omit') => 'none'), 'order' => 10.5, 'desc' => gettext('Location for Image gallery picture caption'));
     }
     return $options;
 }
コード例 #14
0
/**
 * Handles the periodic start of the backup/restore utility to backup the database
 * @param string $discard
 */
function auto_backup_timer_handler($discard)
{
    setOption('last_backup_run', time());
    $curdir = getcwd();
    $folder = SERVERPATH . "/" . BACKUPFOLDER;
    if (!is_dir($folder)) {
        mkdir($folder, CHMOD_VALUE);
    }
    chdir($folder);
    $filelist = safe_glob('*' . '.zdb');
    $list = array();
    foreach ($filelist as $file) {
        $list[$file] = filemtime($file);
    }
    chdir($curdir);
    asort($list);
    $list = array_flip($list);
    $keep = getOption('backups_to_keep');
    while (count($list) >= $keep) {
        $file = array_shift($list);
        unlink(SERVERPATH . "/" . BACKUPFOLDER . '/' . $file);
    }
    cron_starter(SERVERPATH . '/' . ZENFOLDER . '/' . UTILITIES_FOLDER . '/backup_restore.php', array('backup' => 1, 'compress' => sprintf('%u', getOption('backup_compression')), 'XSRFTag' => 'backup'));
    return $discard;
}
コード例 #15
0
ファイル: themeoptions.php プロジェクト: ckfreeman/libratus
 function ThemeOptions()
 {
     // force core theme options for this theme
     setThemeOption('albums_per_row', 3, null, 'libratus');
     setThemeOption('images_per_row', 6, null, 'libratus');
     setThemeOption('image_use_side', 'longest', null, 'libratus');
     setThemeOptionDefault('image_size', 800, null, 'libratus');
     setThemeOption('image_use_side', 'longest', null, 'libratus');
     setThemeOption('thumb_size', 300, null, 'libratus');
     // set core theme option defaults
     setThemeOptionDefault('albums_per_page', 15);
     setThemeOptionDefault('images_per_page', 30);
     setThemeOptionDefault('thumb_crop', false);
     // set libratus option defaults
     setThemeOptionDefault('libratus_maxwidth', '1400');
     setThemeOptionDefault('libratus_ss_type', 'random');
     setThemeOptionDefault('libratus_ss_album', '');
     setThemeOptionDefault('libratus_ss_interval', 5000);
     setThemeOptionDefault('libratus_index_fullwidth', false);
     setThemeOptionDefault('libratus_date_albums', true);
     setThemeOptionDefault('libratus_date_images', true);
     setThemeOptionDefault('libratus_date_news', true);
     setThemeOptionDefault('libratus_date_pages', true);
     setThemeOptionDefault('libratus_social', true);
     setThemeOptionDefault('libratus_download', true);
     setThemeOptionDefault('libratus_customcss', '');
     setThemeOptionDefault('libratus_facebook', '');
     setThemeOptionDefault('libratus_twitter', '');
     setThemeOptionDefault('libratus_google', '');
     setThemeOptionDefault('libratus_copy', '© ' . date("Y"));
     setThemeOptionDefault('libratus_analytics', '');
     setThemeOptionDefault('libratus_analytics_type', 'universal');
     setThemeOptionDefault('libratus_stats_images_popular', true);
     setThemeOptionDefault('libratus_stats_images_latestbyid', true);
     setThemeOptionDefault('libratus_stats_images_mostrated', true);
     setThemeOptionDefault('libratus_stats_images_toprated', true);
     setThemeOptionDefault('libratus_stats_albums_popular', true);
     setThemeOptionDefault('libratus_stats_albums_latestbyid', true);
     setThemeOptionDefault('libratus_stats_albums_mostrated', true);
     setThemeOptionDefault('libratus_stats_albums_toprated', true);
     setThemeOptionDefault('libratus_stats_albums_latestupdated', true);
     setThemeOptionDefault('libratus_stats_number', 30);
     setThemeOptionDefault('libratus_bottom_stats_number', 5);
     setThemeOptionDefault('libratus_bottom_stats_perrow', 3);
     setThemeOptionDefault('libratus_stats_images_popular_bottom', true);
     setThemeOptionDefault('libratus_stats_images_latestbyid_bottom', true);
     setThemeOptionDefault('libratus_stats_images_toprated_bottom', true);
     setThemeOptionDefault('libratus_related_maxnumber', 10);
     if (class_exists('cacheManager')) {
         $me = basename(dirname(__FILE__));
         cacheManager::deleteThemeCacheSizes($me);
         cacheManager::addThemeCacheSize($me, getThemeOption('image_size'), NULL, NULL, NULL, NULL, NULL, NULL, false, getOption('fullimage_watermark'), NULL, NULL);
         // full image size
         cacheManager::addThemeCacheSize($me, getThemeOption('thumb_size'), NULL, NULL, NULL, NULL, NULL, NULL, true, getOption('Image_watermark'), NULL, NULL);
         // default thumb
         cacheManager::addThemeCacheSize($me, NULL, getThemeOption('libratus_maxwidth'), 550, NULL, NULL, NULL, NULL, true, getOption('Image_watermark'), NULL, NULL);
         //big header images
     }
 }
コード例 #16
0
ファイル: Extension.php プロジェクト: linhntaim/katniss
 public function __construct()
 {
     if ($this::EXTENSION_EDITABLE) {
         $this->data = (array) getOption($this->EXTENSION_OPTION(), []);
         $this->params = [];
         $this->__init();
     }
 }
コード例 #17
0
 /**
  * Reports the supported options
  *
  * @return array
  */
 function getOptionsSupported()
 {
     $checkboxes = array(gettext('Albums') => 'comment_form_albums', gettext('Images') => 'comment_form_images');
     if (getOption('zp_plugin_zenpage')) {
         $checkboxes = array_merge($checkboxes, array(gettext('Pages') => 'comment_form_pages', gettext('News') => 'comment_form_articles'));
     }
     return array(gettext('Address fields') => array('key' => 'comment_form_addresses', 'type' => OPTION_TYPE_RADIO, 'order' => 0, 'buttons' => array(gettext('Omit') => 0, gettext('Show') => 1, gettext('Require') => 'required'), 'desc' => gettext('If <em>Address fields</em> are shown or required, the form will include positions for address information. If required, the poster must supply data in each address field.')), gettext('Allow comments on') => array('key' => 'comment_form_allowed', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 5, 'checkboxes' => $checkboxes, 'desc' => gettext('Comment forms will be presented on the checked pages.')), gettext('Toggled comment block') => array('key' => 'comment_form_toggle', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 6, 'desc' => gettext('If checked, existing comments will be initially hidden. Clicking on the provided button will show them.')), gettext('Show author URL') => array('key' => 'comment_form_showURL', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 1, 'desc' => gettext('To discourage SPAM, uncheck this box and the author URL will not be revealed.')), gettext('Only members can comment') => array('key' => 'comment_form_members_only', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 2, 'desc' => gettext('If checked, only logged in users will be allowed to post comments.')), gettext('Allow private postings') => array('key' => 'comment_form_private', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 3, 'desc' => gettext('If checked, posters may mark their comments as private (not for publishing).')), gettext('Allow anonymous posting') => array('key' => 'comment_form_anon', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 4, 'desc' => gettext('If checked, posters may exclude their personal information from the published post.')), gettext('Include RSS link') => array('key' => 'comment_form_rss', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 8, 'desc' => gettext('If checked, an RSS link will be included at the bottom of the comment section.')));
 }
コード例 #18
0
ファイル: functions.php プロジェクト: ariep/ZenPhoto20-DEV
function iconColor($icon)
{
    global $themeColor;
    if (getOption('css_style') == 'dark') {
        $icon = stripSuffix($icon) . '-white.png';
    }
    return $icon;
}
コード例 #19
0
 static function head()
 {
     if (!zp_loggedin(TAGS_RIGHTS)) {
         if (getOption('tagFromSearch_tagOnly')) {
             setOption('search_fields', 'tags', false);
         }
     }
 }
コード例 #20
0
    function handleOption($option, $currentValue)
    {
        $list = unserialize(getOption('filterIPAccess_IP_list'));
        if (getOption('zp_plugin_filterIPAccess')) {
            $disabled = '';
        } else {
            $disabled = ' disabled="disabled"';
        }
        $key = 0;
        foreach ($list as $key => $range) {
            ?>
			<input type="textbox" size="20" name="filterIPAccess_ip_start_<?php 
            echo $key;
            ?>
" value="<?php 
            echo html_encode($range['start']);
            ?>
"<?php 
            echo $disabled;
            ?>
 />
			-
			<input type="textbox" size="20" name="filterIPAccess_ip_end_<?php 
            echo $key;
            ?>
" value="<?php 
            echo html_encode($range['end']);
            ?>
"<?php 
            echo $disabled;
            ?>
 />
			<br />
			<?php 
        }
        $i = $key;
        while ($i < $key + 4) {
            $i++;
            ?>
			<input type="textbox" size="20" name="filterIPAccess_ip_start_<?php 
            echo $i;
            ?>
" value=""<?php 
            echo $disabled;
            ?>
 />
			-
			<input type="textbox" size="20" name="filterIPAccess_ip_end_<?php 
            echo $i;
            ?>
" value=""<?php 
            echo $disabled;
            ?>
 />
			<br />
			<?php 
        }
    }
コード例 #21
0
ファイル: googleVerify.php プロジェクト: ariep/ZenPhoto20-DEV
function googleVerifyHead()
{
    ?>
	<meta name="google-site-verification" content="<?php 
    echo getOption('google-site-verification');
    ?>
" />
	<?php 
}
コード例 #22
0
ファイル: tinymce4.php プロジェクト: rb26/zenphoto
 function tinymce4Options()
 {
     setOptionDefault('tinymce4_zenphoto', 'zenphoto-ribbon.js.php');
     setOptionDefault('tinymce4_zenpage', 'zenpage-slim.js.php');
     if (getOption('zp_plugin_tiny_mce')) {
         setOptionDefault('zp_plugin_tinymce4', 5 | ADMIN_PLUGIN);
         purgeOption('zp_plugin_tiny_mce');
     }
 }
コード例 #23
0
 function getOptionsSupported()
 {
     if (!getOption('zp_plugin_print_album_menu') && (($m = getOption('effervescence_menu')) == 'effervescence' || $m == 'zenpage' || $m == 'garland')) {
         $note = '<p class="notebox">' . sprintf(gettext('<strong>Note:</strong> The <em>%s</em> custom menu makes use of the <em>print_album_menu</em> plugin.'), $m) . '</p>';
     } else {
         $note = '';
     }
     return array(gettext('Allow search') => array('key' => 'Allow_search', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Set to enable search form.')), gettext('Allow cloud') => array('key' => 'Allow_cloud', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Set to enable tag cloud for album page.')), gettext('Custom menu') => array('key' => 'garland_menu', 'type' => OPTION_TYPE_CUSTOM, 'desc' => gettext('Set this to the <em>menu_manager</em> menu set you wish to use.') . $note));
 }
コード例 #24
0
ファイル: statistic.php プロジェクト: procivam/s-mir-new
 /**
  * Формирование данных доступных в шаблоне.
  */
 function createData()
 {
     $this->Assign("categories_count", A::$DB->getOne("SELECT COUNT(*) FROM {$this->section}_categories"));
     $this->Assign("items_count", A::$DB->getOne("SELECT COUNT(*) FROM {$this->section}_catalog"));
     if ($usecomments = getOption($this->section, "usecomments")) {
         $idsec = getSectionId($this->section);
         $this->Assign("usecomments", $usecomments);
         $this->Assign("comments_count", A::$DB->getOne("SELECT COUNT(*) FROM " . DOMAIN . "_comments WHERE idsec={$idsec}"));
     }
 }
コード例 #25
0
 static function sendMail()
 {
     $subject = sanitize($_POST['subject']);
     $message = sanitize($_POST['message'], 1);
     $headers = sanitize($_POST['headers']);
     $mailaddress = sanitize($_POST['mailaddress']);
     $contactform_mailaddress = getOption("contactform_mailaddress");
     $contactform_mailaddress = str_replace(" ", "", $contactform_mailaddress);
     zp_mail($subject, $message, $headers, array($contactform_mailaddress, $mailaddress));
 }
コード例 #26
0
ファイル: classes.php プロジェクト: ariep/ZenPhoto20-DEV
 /**
  * Class instantiator
  */
 function __construct()
 {
     $allcategories = query_full_array("SELECT * FROM " . prefix('news_categories') . " ORDER by sort_order");
     $this->categoryStructure = array();
     foreach ($allcategories as $cat) {
         $this->categoryStructure[$cat['id']] = $cat;
     }
     $this->news_enabled = getOption('zenpage_enabled_items') & 1;
     $this->pages_enabled = getOption('zenpage_enabled_items') & 2;
 }
コード例 #27
0
ファイル: none.php プロジェクト: ItsHaden/epicLanBootstrap
 /**
  * The function for processing a message to see if it might be SPAM
  *       returns:
  *         0 if the message is SPAM
  *         1 if the message might be SPAM (it will be marked for moderation)
  *         2 if the message is not SPAM
  *
  * @param string $author Author field from the posting
  * @param string $email Email field from the posting
  * @param string $website Website field from the posting
  * @param string $body The text of the comment
  * @param string $imageLink A link to the album/image on which the post was made
  * @param string $ip the IP address of the comment poster
  * 
  * @return int
  */
 function filterMessage($author, $email, $website, $body, $imageLink, $ip)
 {
     $strategy = getOption('Action');
     switch ($strategy) {
         case 'reject':
             return 0;
         case 'moderate':
             return 1;
     }
     return 2;
 }
コード例 #28
0
ファイル: lib-Imagick.php プロジェクト: ariep/ZenPhoto20-DEV
 function __construct()
 {
     setOptionDefault('magick_max_height', self::$ignore_size);
     setOptionDefault('magick_max_width', self::$ignore_size);
     if (!sanitize_numeric(getOption('magick_max_height'))) {
         setOption('magick_max_height', self::$ignore_size);
     }
     if (!sanitize_numeric(getOption('magick_max_width'))) {
         setOption('magick_max_width', self::$ignore_size);
     }
 }
コード例 #29
0
ファイル: request.php プロジェクト: procivam/s-mir-new
 function getEditForm()
 {
     $form = new A_Form("plugin_courier_edit.tpl");
     $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE);
     $form->data['data'] = !empty($form->data['data']) ? unserialize($form->data['data']) : array();
     $form->data['data'] = array_pad($form->data['data'], 6, array());
     if ($section = getSectionByModule('shoplite')) {
         $form->data['valute'] = getOption($section, 'valute');
     }
     $this->RESULT['html'] = $form->getContent();
 }
コード例 #30
0
ファイル: contact_form.php プロジェクト: rb26/zenphoto
 function getOptionsSupported()
 {
     global $_zp_captcha;
     $mailinglist = explode(';', getOption("contactform_mailaddress"));
     array_walk($mailinglist, 'contactformOptions::trim_value');
     setOption('contactform_mailaddress', implode(';', $mailinglist));
     $list = array(gettext("required") => "required", gettext("show") => "show", gettext("omitted") => "omitted");
     $mailfieldinstruction = gettext("Set if the <code>%s</code> field should be required, just shown or omitted");
     $options = array(gettext('Intro text') => array('key' => 'contactform_introtext', 'type' => OPTION_TYPE_TEXTAREA, 'order' => 13, 'desc' => gettext("The intro text for your contact form")), gettext('Confirm text') => array('key' => 'contactform_confirmtext', 'type' => OPTION_TYPE_TEXTAREA, 'order' => 14, 'desc' => gettext("The text that asks the visitor to confirm that he really wants to send the message.")), gettext('Thanks text') => array('key' => 'contactform_thankstext', 'type' => OPTION_TYPE_TEXTAREA, 'order' => 15, 'desc' => gettext("The text that is shown after a message has been confirmed and sent.")), gettext('New message link text') => array('key' => 'contactform_newmessagelink', 'type' => OPTION_TYPE_TEXTAREA, 'order' => 16, 'desc' => gettext("The text for the link after the thanks text to return to the contact page to send another message.")), gettext('Require confirmation') => array('key' => 'contactform_confirm', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 0.1, 'desc' => gettext("If checked, a confirmation form will be presented before sending the contact message.")), gettext('Send copy') => array('key' => 'contactform_sendcopy', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 0.3, 'desc' => gettext("If checked, a copy of the message will be sent to the address provided. <p class='notebox'><strong>Caution: </strong> If you check this option it is strongly recommend to use Captcha and the confirmation option. Be aware that someone could misuse the e-mail address entered for spamming with this form and that in some countries’ jurisdictions(e.g. most European countries) you may be made responsible for this then!</p>")), gettext('Send copy note text') => array('key' => 'contactform_sendcopy_text', 'type' => OPTION_TYPE_TEXTAREA, 'order' => 0.2, 'desc' => gettext("The text for the note about sending a copy to the address provided in case that option is set.")), gettext('Contact recipients') => array('key' => 'contactform_mailaddress', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 17, 'desc' => gettext("The e-mail address the messages should be sent to. Enter one or more address separated by semicolons.")), gettext('Title') => array('key' => 'contactform_title', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 1, 'desc' => sprintf($mailfieldinstruction, gettext("Title"))), gettext('Name') => array('key' => 'contactform_name', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 2, 'desc' => sprintf($mailfieldinstruction, gettext("Name"))), gettext('Company') => array('key' => 'contactform_company', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 3, 'desc' => sprintf($mailfieldinstruction, gettext("Company"))), gettext('Street') => array('key' => 'contactform_street', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 4, 'desc' => sprintf($mailfieldinstruction, gettext("Street"))), gettext('City') => array('key' => 'contactform_city', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 5, 'desc' => sprintf($mailfieldinstruction, gettext("City"))), gettext('State') => array('key' => 'contactform_state', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 5.1, 'desc' => sprintf($mailfieldinstruction, gettext("State"))), gettext('Postal code') => array('key' => 'contactform_postal', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 5.2, 'desc' => sprintf($mailfieldinstruction, gettext("Postal code"))), gettext('Country') => array('key' => 'contactform_country', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 6, 'desc' => sprintf($mailfieldinstruction, gettext("Country"))), gettext('E-mail') => array('key' => 'contactform_email', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 7, 'desc' => sprintf($mailfieldinstruction, gettext("E-mail"))), gettext('Website') => array('key' => 'contactform_website', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 8, 'desc' => sprintf($mailfieldinstruction, gettext("Website"))), gettext('CAPTCHA') => array('key' => 'contactform_captcha', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 9, 'desc' => $_zp_captcha->name ? gettext('If checked, the form will include a Captcha verification.') : '<span class="notebox">' . gettext('No captcha handler is enabled.') . '</span>'), gettext('Phone') => array('key' => 'contactform_phone', 'type' => OPTION_TYPE_RADIO, 'buttons' => $list, 'order' => 10, 'desc' => sprintf($mailfieldinstruction, gettext("Phone number"))));
     return $options;
 }