Example #1
0
function switcher_head($ignore)
{
    global $personalities, $themecolors, $themeColor;
    $themeColor = getOption('themeSwitcher_default_color');
    if (isset($_GET['themeColor'])) {
        $new = $_GET['themeColor'];
        if (in_array($new, $themecolors)) {
            setOption('themeSwitcher_default_color', $new);
            $themeColor = $new;
        }
    }
    ?>
	<script type="text/javascript">
		// <!-- <![CDATA[
		window.onload = function() {
			$('#themeSwitcher_zenpage').html('');
		}
		function switchColors() {
			personality = $('#themeColor').val();
			window.location = '?themeColor=' + personality;
		}
		// ]]> -->
	</script>
	<?php 
    return $ignore;
}
Example #2
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;
}
 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.')));
 }
Example #4
0
 /**
  *
  * supported options
  */
 function getOptionsSupported()
 {
     global $_zp_CMS;
     $options = array(gettext('Consumer key') => array('key' => 'tweet_news_consumer', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 2, 'desc' => gettext('This <code>tweet_news</code> app for this site needs a <em>consumer key</em>, a <em>consumer key secret</em>, an <em>access token</em>, and an <em>access token secret</em>.') . '<p class="notebox">' . gettext('Get these from <a href="http://dev.twitter.com/">Twitter developers</a>') . '</p>'), gettext('Secret') => array('key' => 'tweet_news_consumer_secret', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 3, 'desc' => gettext('The <em>secret</em> associated with your <em>consumer key</em>.')), gettext('Access token') => array('key' => 'tweet_news_oauth_token', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 4, 'desc' => gettext('The application <em>oauth_token</em> token.')), gettext('Access token secret') => array('key' => 'tweet_news_oauth_token_secret', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 5, 'desc' => gettext('The application <em>oauth_token</em> secret.')), gettext('Protected objects') => array('key' => 'tweet_news_protected', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 7, 'desc' => gettext('If checked, protected items will be tweeted. <strong>Note:</strong> followers will need the password to visit the tweeted link.')));
     $list = array('<em>' . gettext('Albums') . '</em>' => 'tweet_news_albums', '<em>' . gettext('Images') . '</em>' => 'tweet_news_images');
     if (extensionEnabled('zenpage')) {
         $list['<em>' . gettext('News') . '</em>'] = 'tweet_news_news';
         $list['<em>' . gettext('Pages') . '</em>'] = 'tweet_news_pages';
     } else {
         setOption('tweet_news_news', 0);
         setOption('tweet_news_pages', 0);
     }
     $options[gettext('Tweet')] = array('key' => 'tweet_news_items', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 6, 'checkboxes' => $list, 'desc' => gettext('If a <em>type</em> is checked, a Tweet will be made when an object of that <em>type</em> is published.'));
     if (getOption('multi_lingual')) {
         $options[gettext('Tweet Language')] = array('key' => 'tweet_language', 'type' => OPTION_TYPE_SELECTOR, 'order' => 5.5, 'selections' => generateLanguageList(), 'desc' => gettext('Select the language for the Tweet message.'));
     }
     if (getOption('tweet_news_news') && is_object($_zp_CMS)) {
         $catlist = getSerializedArray(getOption('tweet_news_categories'));
         $news_categories = $_zp_CMS->getAllCategories(false);
         $catlist = array(gettext('*not categorized*') => 'tweet_news_categories_none');
         foreach ($news_categories as $category) {
             $option = 'tweet_news_categories_' . $category['titlelink'];
             $catlist[$category['title']] = $option;
             setOptionDefault($option, NULL);
         }
         $options[gettext('News categories')] = array('key' => 'tweet_news_categories', 'type' => OPTION_TYPE_CHECKBOX_UL, 'order' => 6.5, 'checkboxes' => $catlist, 'desc' => gettext('Only those <em>news categories</em> checked will be Tweeted. <strong>Note:</strong> <em>*not categorized*</em> means those news articles which have no category assigned.'));
     }
     return $options;
 }
Example #5
0
 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_hybrid')) {
         $MapTypes[gettext('Hybrid')] = 'HYBRID';
     }
     if (getOption('gmap_map_roadmap')) {
         $MapTypes[gettext('Map')] = 'ROADMAP';
     }
     if (getOption('gmap_map_satellite')) {
         $MapTypes[gettext('Satellite')] = 'SATELLITE';
     }
     if (getOption('gmap_map_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('Allowed maps') => array('key' => 'gmap_allowed_maps', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 1, 'checkboxes' => array(gettext('Hybrid') => 'gmap_map_hybrid', gettext('Map') => 'gmap_map_roadmap', gettext('Satellite') => 'gmap_map_satellite', gettext('Terrain') => 'gmap_map_terrain'), 'desc' => gettext('Select the map types that are allowed.')), gettext('Initial map display selection') => array('key' => 'gmap_starting_map', 'type' => OPTION_TYPE_SELECTOR, 'order' => 2, 'selections' => $MapTypes, 'desc' => gettext('Select the initial type of map to display.')), gettext('Map display') => array('key' => 'gmap_display', 'type' => OPTION_TYPE_SELECTOR, 'order' => 3, 'selections' => array(gettext('show') => 'show', gettext('hide') => 'hide', gettext('colorbox') => 'colorbox'), '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.')), gettext('Map controls') => array('key' => 'gmap_control_type', 'type' => OPTION_TYPE_RADIO, 'order' => 4, 'buttons' => array(gettext('None') => 'none', gettext('Default') => 'DEFAULT', gettext('Dropdown') => 'DROPDOWN_MENU', gettext('Horizontal') => 'HORIZONTAL_BAR'), 'desc' => gettext('Display options for the Map type control.')), gettext('Zoom controls') => array('key' => 'gmap_zoom_size', 'type' => OPTION_TYPE_RADIO, 'order' => 5, 'buttons' => array(gettext('Small') => 'SMALL', gettext('Default') => 'DEFAULT', gettext('Large') => 'LARGE'), 'desc' => gettext('Display options for the Zoom control.')), gettext('Max zoom level') => array('key' => 'gmap_cluster_max_zoom', 'type' => OPTION_TYPE_NUMBER, 'order' => 6, 'desc' => gettext('The max zoom level for clustering pictures on map.')), gettext('Map dimensions—width') => array('key' => 'gmap_width', 'type' => OPTION_TYPE_NUMBER, 'order' => 7, 'desc' => gettext('The default width of the map.')), gettext('Map dimensions—height') => array('key' => 'gmap_height', 'type' => OPTION_TYPE_NUMBER, 'order' => 8, 'desc' => gettext('The default height of the map.')), gettext('Map sessions') => array('key' => 'gmap_sessions', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 9, 'desc' => gettext('If checked GoogleMaps will use sessions to pass map data for the <em>colorbox</em> display option. We recommend this option be selected. It protects against reference forgery security attacks and mitigates problems with data exceeding the allowed by some browsers.')));
 }
Example #6
0
 function handleOption($option, $currentValue)
 {
     if ($option == "zenpage_homepage") {
         $unpublishedpages = query_full_array("SELECT titlelink FROM " . prefix('pages') . " WHERE `show` != 1 ORDER by `sort_order`");
         if (empty($unpublishedpages)) {
             echo gettext("No unpublished pages available");
             // clear option if no unpublished pages are available or have been published meanwhile
             // so that the normal gallery index appears and no page is accidentally set if set to unpublished again.
             setOption("zenpage_homepage", "none", true);
         } else {
             echo '<input type="hidden" name="' . CUSTOM_OPTION_PREFIX . 'selector-zenpage_homepage" value="0" />' . "\n";
             echo '<select id="' . $option . '" name="zenpage_homepage">' . "\n";
             if ($currentValue === "none") {
                 $selected = " selected = 'selected'";
             } else {
                 $selected = "";
             }
             echo "<option{$selected}>" . gettext("none") . "</option>";
             foreach ($unpublishedpages as $page) {
                 if ($currentValue === $page["titlelink"]) {
                     $selected = " selected = 'selected'";
                 } else {
                     $selected = "";
                 }
                 echo "<option{$selected}>" . $page["titlelink"] . "</option>";
             }
             echo "</select>\n";
         }
     }
 }
Example #7
0
 static function head()
 {
     if (!zp_loggedin(TAGS_RIGHTS)) {
         if (getOption('tagFromSearch_tagOnly')) {
             setOption('search_fields', 'tags', false);
         }
     }
 }
Example #8
0
 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;
 }
Example #9
0
 function getOptionsSupported()
 {
     global $_zp_RTL_css;
     if ($_zp_RTL_css) {
         setOption('tiny_mce_rtl_override', 1, false);
     }
     $configs_zenpage = gettinymceConfigFiles('zenpage');
     $configs_zenphoto = gettinymceConfigFiles('zenphoto');
     $options = array(gettext('Text editor configuration - zenphoto') => array('key' => 'tinymce_zenphoto', 'type' => OPTION_TYPE_SELECTOR, 'order' => 0, 'selections' => $configs_zenphoto, 'null_selection' => gettext('Disabled'), 'desc' => gettext('Applies to <em>admin</em> editable text other than for Zenpage pages and news articles.')), gettext('Text editor configuration - zenpage') => array('key' => 'tinymce_zenpage', 'type' => OPTION_TYPE_SELECTOR, 'order' => 1, 'selections' => $configs_zenpage, 'null_selection' => gettext('Disabled'), 'desc' => gettext('Applies to editing on the Zenpage <em>pages</em> and <em>news</em> tabs.')), gettext('Text editor text direction') => array('key' => 'tiny_mce_rtl_override', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 2, 'desc' => gettext('This option should be checked if your language writing direction is right-to-left')));
     return $options;
 }
Example #10
0
 /**
  * Standard option interface
  *
  * @return array
  */
 function getOptionsSupported()
 {
     global $_zp_imagick_present, $_zp_graphics_optionhandlers;
     if ($disabled = $this->canLoadMsg()) {
         setOption('use_imagick', 0, true);
     }
     $imagickOptions = array(gettext('Enable Imagick') => array('key' => 'use_imagick', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 0, 'disabled' => $disabled, 'desc' => $disabled ? '<p class="notebox">' . $disabled . '</p>' : gettext('Your PHP has support for Imagick. Check this option if you wish to use the Imagick graphics library.')));
     if (!$disabled) {
         $imagickOptions += array(gettext('Max height') => array('key' => 'magick_max_height', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 1, 'desc' => sprintf(gettext('The maximum height used by the site for processed images. Set to %d for unconstrained. Default is <strong>%d</strong>'), self::$ignore_size, self::$ignore_size)), gettext('Max width') => array('key' => 'magick_max_width', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 2, 'desc' => sprintf(gettext('The maximum width used by the site for processed images. Set to %d for unconstrained. Default is <strong>%d</strong>.'), self::$ignore_size, self::$ignore_size)));
     }
     return $imagickOptions;
 }
Example #11
0
 /**
  * Standard option interface
  *
  * @return array
  */
 function getOptionsSupported()
 {
     global $_zp_imagick_present, $_zp_graphics_optionhandlers;
     if ($disabled = $this->canLoadMsg()) {
         setOption('use_imagick', 0, true);
     }
     $imagickOptions = array(gettext('Enable Imagick') => array('key' => 'use_imagick', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 0, 'disabled' => $disabled, 'desc' => $disabled ? '<p class="notebox">' . $disabled . '</p>' : gettext('Your PHP has support for Imagick. Check this option if you wish to use the Imagick graphics library.')));
     if (!$disabled) {
         $imagickOptions += array(gettext('Max height') => array('key' => 'magick_max_height', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 1, 'desc' => sprintf(gettext('The maximum height used by the site for processed images. Set to %d for unconstrained. Default is <strong>%d</strong>'), self::$ignore_size, self::$ignore_size)), gettext('Max width') => array('key' => 'magick_max_width', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 2, 'desc' => sprintf(gettext('The maximum width used by the site for processed images. Set to %d for unconstrained. Default is <strong>%d</strong>.'), self::$ignore_size, self::$ignore_size)), gettext('Chroma sampling') => array('key' => 'magick_sampling_factor', 'type' => OPTION_TYPE_ORDERED_SELECTOR, 'null_selection' => '', 'selections' => array(gettext('no sampling') => '1x1 1x1 1x1', gettext('horizontally halved') => '4x1 2x1 2x1', gettext('vertically halved') => '1x4 1x2 1x2', gettext('horizontally and vertically halved') => '4x4 2x2 2x2'), 'order' => 3, 'desc' => gettext('Select a Chroma sampling pattern. Leave empty for the image default.')));
     }
     return $imagickOptions;
 }
Example #12
0
 /**
  * Standard option interface
  *
  * @return array
  */
 function getOptionsSupported()
 {
     $listi = array();
     foreach (get_AnyFile_suffixes() as $suffix) {
         $listi[$suffix] = 'AnyFile_file_list_' . $suffix;
     }
     if ($suffix = getOption('AnyFile_file_new')) {
         setOption('AnyFile_file_new', '');
         $listi[$suffix] = 'AnyFile_file_list_' . $suffix;
         setOption('AnyFile_file_list_' . $suffix, 1);
     }
     return array(gettext('Watermark default images') => array('key' => 'AnyFile_watermark_default_images', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Check to place watermark image on default thumbnail images.')), gettext('Handled files') => array('key' => 'AnyFile_file_list', 'type' => OPTION_TYPE_CHECKBOX_UL, 'checkboxes' => $listi, 'desc' => gettext('File suffixes to be handled.')), gettext('Add file suffix') => array('key' => 'AnyFile_file_new', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext('Add a file suffix to be handled by the plugin')));
 }
Example #13
0
 /**
  * class instantiation function
  *
  * @return zp_PHPMailer
  */
 function __construct()
 {
     setOptionDefault('PHPMailer_mail_protocol', 'sendmail');
     setOptionDefault('PHPMailer_server', '');
     setOptionDefault('PHPMailer_pop_port', '110');
     setOptionDefault('PHPMailer_smtp_port', '25');
     setOptionDefault('PHPMailer_user', '');
     setOptionDefault('PHPMailer_password', '');
     setOptionDefault('PHPMailer_secure', 0);
     if (getOption('PHPMailer_secure') == 1) {
         setOption('PHPMailer_secure', 'ssl');
     }
 }
Example #14
0
 function handleOptionSave($themename, $themealbum)
 {
     if (isset($_POST['AnyFile_file_list'])) {
         $mysetoptions = sanitize($_POST['AnyFile_file_list']);
     } else {
         $mysetoptions = array();
     }
     if ($new = getOption('AnyFile_file_new')) {
         $mysetoptions[] = $new;
     }
     purgeOption('AnyFile_file_new');
     setOption('AnyFileSuffixList', serialize($mysetoptions));
     return false;
 }
Example #15
0
/**
 * Обработчик события "Создание раздела".
 *
 * @param string $section Полный строковой идентификатор раздела.
 * @param array $params Параметры события.
 */
function archive_createSection($section, $params)
{
    if ($params['module'] == 'archive') {
        $ids = A::$DB->getCol("\r\r\n    SELECT id FROM " . getDomain($section) . "_sections\r\r\n\tWHERE module='catalog' AND (lang='" . A::$LANG . "' OR lang='all')");
        setOption($section, 'sections', serialize($ids));
    } elseif ($params['module'] == 'catalog') {
        if ($archive = getSectionByModule('archive')) {
            $ids = getOption($archive, 'sections');
            $ids = !empty($ids) ? unserialize($ids) : array();
            $ids[] = $params['id'];
            setOption($archive, 'sections', serialize($ids));
        }
    }
}
Example #16
0
 function __construct()
 {
     setThemeOptionDefault('albums_per_row', 3);
     setThemeOptionDefault('albums_per_page', 9);
     setThemeOptionDefault('images_per_row', 5);
     setThemeOptionDefault('images_per_page', 20);
     setThemeOptionDefault('thumb_size', 150);
     setThemeOptionDefault('thumb_crop', 1);
     setThemeOptionDefault('thumb_crop_width', 150);
     setThemeOptionDefault('thumb_crop_height', 150);
     setThemeOptionDefault('image_size', 700);
     setThemeOptionDefault('image_use_side', 'longest');
     setThemeOptionDefault('use_image_logo_filename', 'banniere3.jpg');
     setThemeOptionDefault('show_image_logo_on_image', false);
     setThemeOptionDefault('css_style', 'dark');
     setThemeOptionDefault('links_style', 'default');
     setThemeOptionDefault('zenpage_homepage', 'none');
     setThemeOptionDefault('show_archive', false);
     setThemeOptionDefault('allow_search', true);
     setThemeOptionDefault('show_tag', true);
     setThemeOptionDefault('image_statistic', 'random');
     setThemeOptionDefault('use_galleriffic', true);
     setThemeOptionDefault('galleriffic_delai', 3000);
     setThemeOptionDefault('use_colorbox_album', false);
     setThemeOptionDefault('use_colorbox_image', false);
     setThemeOptionDefault('show_exif', true);
     setOption('colorbox_zpArdoise_album', 1);
     setOption('colorbox_zpArdoise_archive', 1);
     setOption('colorbox_zpArdoise_contact', 1);
     setOption('colorbox_zpArdoise_favorites', 1);
     setOption('colorbox_zpArdoise_gallery', 1);
     setOption('colorbox_zpArdoise_image', 1);
     setOption('colorbox_zpArdoise_index', 1);
     setOption('colorbox_zpArdoise_news', 1);
     setOption('colorbox_zpArdoise_pages', 1);
     setOption('colorbox_zpArdoise_password', 1);
     setOption('colorbox_zpArdoise_register', 1);
     setOption('colorbox_zpArdoise_search', 1);
     if (class_exists('cacheManager')) {
         $me = basename(dirname(__FILE__));
         cacheManager::deleteThemeCacheSizes($me);
         cacheManager::addThemeCacheSize($me, getThemeOption('thumb_size'), NULL, NULL, getThemeOption('thumb_crop_width'), getThemeOption('thumb_crop_height'), NULL, NULL, true);
         if (getOption('use_galleriffic')) {
             cacheManager::addThemeCacheSize($me, 85, NULL, NULL, 85, 85, NULL, NULL, true);
             cacheManager::addThemeCacheSize($me, 525, NULL, NULL, NULL, NULL, NULL, NULL, false);
         }
         cacheManager::addThemeCacheSize($me, getThemeOption('image_size'), NULL, NULL, NULL, NULL, NULL, NULL, false);
     }
 }
Example #17
0
 /**
  * Option instantiation
  */
 function __construct()
 {
     global $_zp_authority;
     setOptionDefault('federated_login_group', 'viewers');
     $mailinglist = $_zp_authority->getAdminEmail(ADMIN_RIGHTS);
     if (count($mailinglist) == 0) {
         //	no one to send the notice to!
         setOption('register_user_notify', 0);
     } else {
         setOptionDefault('register_user_notify', 1);
     }
     $files = getPluginFiles('*_logon.php', 'federated_logon');
     foreach ($files as $key => $link) {
         setOptionDefault('federated_logon_handler' . $key, 1);
     }
 }
Example #18
0
 function handleOptionSave($themename, $themealbum)
 {
     $mysetoptions = array();
     foreach ($_POST as $key => $option) {
         if (strpos($key, 'AnyFile_file_list_') === 0) {
             $mysetoptions[] = str_replace('AnyFile_file_list_', '', $key);
             purgeOption($key);
         }
     }
     if ($_POST['AnyFile_file_new']) {
         $mysetoptions[] = sanitize($_POST['AnyFile_file_new']);
         $suffix = getOption('AnyFile_file_new');
         purgeOption('AnyFile_file_new');
     }
     setOption('AnyFileSuffixList', serialize($mysetoptions));
     return false;
 }
Example #19
0
 public function __call($func, $argv)
 {
     if (substr($func, 0, 3) == 'get') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         return getOption($key);
     } elseif (substr($func, 0, 3) == 'set') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         $value = Arrays::first($argv);
         setOption($key, $value);
         return $this;
     } elseif (substr($func, 0, 3) == 'has') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         return null !== getOption($key);
     }
 }
Example #20
0
 function __construct()
 {
     global $_zp_imagick_present;
     if ($_zp_imagick_present) {
         $this->defaultFilter = 'FILTER_LANCZOS';
         $this->defaultFontSize = 18;
         // setOptionDefault('use_imagick', $_zp_imagick_present);
         setOptionDefault('imagick_filter', $this->defaultFilter);
         setOptionDefault('magick_font_size', $this->defaultFontSize);
         if (!sanitize_numeric(getOption('magick_font_size'))) {
             setOption('magick_font_size', $this->defaultFontSize);
         }
         $mem_lim = getOption('magick_mem_lim');
         if (!is_numeric($mem_lim) || $mem_lim < 0) {
             setOption('magick_mem_lim', 0);
         }
     }
 }
Example #21
0
 static function handleOptionSave($themename, $themealbum)
 {
     $x = str_replace(':', '.', getOption('accessThreshold_SENSITIVITY'));
     $sensitivity = 0;
     foreach (explode('.', $x) as $v) {
         if ($v) {
             $sensitivity++;
         } else {
             break;
         }
     }
     if (getOption('accessThreshold_CLEAR')) {
         $recentIP = array();
         setOption('accessThreshold_CLEAR', 0);
     } else {
         $recentIP = getSerializedArray(@file_get_contents(SERVERPATH . '/' . DATA_FOLDER . '/recentIP'));
     }
     $recentIP['config'] = array('accessThreshold_IP_RETENTION' => getOption('accessThreshold_IP_RETENTION'), 'accessThreshold_THRESHOLD' => getOption('accessThreshold_THRESHOLD'), 'accessThreshold_IP_ACCESS_WINDOW' => getOption('accessThreshold_IP_ACCESS_WINDOW'), 'accessThreshold_LocaleCount' => getOption('accessThreshold_LocaleCount'), 'accessThreshold_SENSITIVITY' => $sensitivity);
     file_put_contents(SERVERPATH . '/' . DATA_FOLDER . '/recentIP', serialize($recentIP));
 }
Example #22
0
 /**
  * Checks if a Captcha string matches the Captcha attached to the comment post
  * Returns true if there is a match.
  *
  * @param string $key
  * @param string $code
  * @param string $code_ok
  * @return bool
  */
 function checkCaptcha($code, $code_ok)
 {
     $captcha_len = getOption('zenphoto_captcha_lenght');
     $key = $this->getCaptchaKey();
     $code_cypher = md5(bin2hex(rc4($key, trim($code))));
     $code_ok = trim($code_ok);
     if ($code_cypher != $code_ok || strlen($code) != $captcha_len) {
         return false;
     }
     query('DELETE FROM ' . prefix('captcha') . ' WHERE `ptime`<' . (time() - 3600));
     // expired tickets
     $result = query('DELETE FROM ' . prefix('captcha') . ' WHERE `hash`="' . $code_cypher . '"');
     $count = mysql_affected_rows();
     if ($count == 1) {
         $len = rand(0, strlen($key) - 1);
         $key = md5(substr($key, 0, $len) . $code . substr($key, $len));
         setOption('zenphoto_captcha_key', $key);
         return true;
     }
     return false;
 }
Example #23
0
 function __construct()
 {
     setThemeOptionDefault('albums_per_row', 3);
     setThemeOptionDefault('albums_per_page', 9);
     setThemeOptionDefault('images_per_row', 4);
     setThemeOptionDefault('images_per_page', 16);
     setThemeOptionDefault('thumb_size', 220);
     setThemeOptionDefault('thumb_crop', 1);
     setThemeOptionDefault('thumb_crop_width', 220);
     setThemeOptionDefault('thumb_crop_height', 220);
     setThemeOptionDefault('image_size', 800, NULL);
     setThemeOptionDefault('image_use_side', 'longest');
     setThemeOptionDefault('zpB_homepage', true);
     setThemeOptionDefault('allow_search', true);
     setThemeOptionDefault('zpB_show_archive', true);
     setThemeOptionDefault('zpB_show_tags', true);
     setThemeOptionDefault('zpB_social_links', true);
     setThemeOptionDefault('zpB_show_exif', true);
     // configure some zenphoto plugin options
     setOption('colorbox_zpBootstrap_album', 1);
     setOption('colorbox_zpBootstrap_favorites', 1);
     setOption('colorbox_zpBootstrap_image', 1);
     setOption('colorbox_zpBootstrap_search', 1);
     setOption('slideshow_zpBootstrap_album', 1);
     setOption('slideshow_zpBootstrap_image', 1);
     setOption('slideshow_zpBootstrap_favorites', 1);
     setOption('slideshow_zpBootstrap_search', 1);
     setOption('cycle_zpBootstrap_album', 1);
     setOption('cycle_zpBootstrap_image', 1);
     setOption('cycle_zpBootstrap_favorites', 1);
     setOption('cycle_zpBootstrap_search', 1);
     if (class_exists('cacheManager')) {
         $me = basename(dirname(__FILE__));
         cacheManager::deleteThemeCacheSizes($me);
         cacheManager::addThemeCacheSize($me, getThemeOption('thumb_size'), NULL, NULL, getThemeOption('thumb_crop_width'), getThemeOption('thumb_crop_height'), NULL, NULL, true);
         cacheManager::addThemeCacheSize($me, getThemeOption('image_size'), NULL, NULL, NULL, NULL, NULL, NULL, false);
     }
 }
Example #24
0
 function handleOptionSave()
 {
     if (isset($_POST['saverssoptions'])) {
         setOption('RSS_items', sanitize($_POST['RSS_items'], 3));
         setOption('RSS_imagesize', sanitize($_POST['RSS_imagesize'], 3));
         setOption('RSS_sortorder', sanitize($_POST['RSS_sortorder'], 3));
         setOption('RSS_items_albums', sanitize($_POST['RSS_items_albums'], 3));
         setOption('RSS_imagesize_albums', sanitize($_POST['RSS_imagesize_albums'], 3));
         setOption('RSS_sortorder_albums', sanitize($_POST['RSS_sortorder_albums'], 3));
         setOption('RSS_title', sanitize($_POST['RSS_title'], 3));
         setOption('RSS_cache_expire', sanitize($_POST['RSS_cache_expire'], 3));
         setOption('RSS_enclosure', (int) isset($_POST['RSS_enclosure']));
         setOption('RSS_mediarss', (int) isset($_POST['RSS_mediarss']));
         setOption('RSS_cache', (int) isset($_POST['RSS_cache']));
         setOption('RSS_album_image', (int) isset($_POST['RSS_album_image']));
         setOption('RSS_comments', (int) isset($_POST['RSS_comments']));
         setOption('RSS_articles', (int) isset($_POST['RSS_articles']));
         setOption('RSS_pages', (int) isset($_POST['RSS_pages']));
         setOption('RSS_article_comments', (int) isset($_POST['RSS_article_comments']));
         setOption('RSS_hitcounter', (int) isset($_POST['RSS_hitcounter']));
         setOption('RSS_portable_link', (int) isset($_POST['RSS_portable_link']));
         $returntab = "&tab=rss";
     }
 }
Example #25
0
				<div id="center">
					<div id="squeeze">
						<div class="right-corner">
							<div class="left-corner"><!-- begin content -->
								<div class="main section" id="main">
									<h3 id="gallerytitle"><?php 
printHomeLink('', ' » ');
printGalleryIndexURL(' » ');
?>
</h3>
									<?php 
printCodeblock(1);
?>
									<div id="albums">
										<?php 
setOption('albums_per_page', 12, false);
while (next_album()) {
    ?>
											<div class="album">
												<a class="albumthumb" href="<?php 
    echo getAlbumURL();
    ?>
" title="<?php 
    printf(gettext('View album:  %s'), getBareAlbumTitle());
    ?>
">
													<?php 
    printCustomAlbumThumbImage(getAlbumTitle(), 85, NULL, NULL, 85, 85);
    ?>
												</a>
												<div class="albumdesc">
Example #26
0
<?php

// force UTF-8 Ø
if (!defined('WEBPATH')) {
    die;
}
?>
<!DOCTYPE html>
<html>
	<head>

		<?php 
zp_apply_filter('theme_head');
if (getOption('effervescence_daily_album_image_effect')) {
    setOption('image_custom_images', getOption('effervescence_daily_album_image_effect'), false);
}
?>

	</head>

	<body onload="blurAnchors()">
		<?php 
zp_apply_filter('theme_body_open');
?>

		<!-- Wrap Header -->
		<div id="header">
			<div id="gallerytitle">

				<!-- Logo -->
				<div id="logo">
Example #27
0
/**
 * Handles features defined in config.inc.php
 *
 * @since 1.2
 * @package facileManager
 */
function handleHiddenFlags()
{
    global $fm_name;
    /** Recover authentication in case of lockout */
    if (defined('FM_NO_AUTH') && FM_NO_AUTH) {
        setOption('auth_method', 0);
        @addLogEntry(_('Manually reset authentication method.'), $fm_name);
    }
}
Example #28
0
	<?php 
}
?>

	<?php 
if (getPrevPageURL() || getNextPageURL()) {
    printPageListWithNav('« ' . gettext('Prev'), gettext('Next') . ' »', false, 'true', 'page-nav', '', true, '5');
}
?>

	<?php 
if (function_exists('printGoogleMap')) {
    ?>
			<div class="gmap">
		<?php 
    setOption('gmap_width', 600, false);
    printGoogleMap();
    ?>
			</div>
	<?php 
}
?>
	<?php 
printCodeblock();
?>
	<?php 
if (function_exists('printCommentForm')) {
    printCommentForm();
}
?>
Example #29
0
 static function createDataComments()
 {
     $sql = "\r\n  \t\t CREATE TABLE IF NOT EXISTS `" . PREFIX . "comments` (\r\n  \t\t\t`id` INT AUTO_INCREMENT NOT NULL,\r\n        `name` VARCHAR(45) NOT NULL,\r\n        `email` VARCHAR(45) NOT NULL,\r\n        `comment` TEXT NoT NULL,\r\n        `date` TIMESTAMP NOT NULL,\r\n        `uri` VARCHAR(255) NOT NULL,\r\n        `approved` TINYINT NOT NULL DEFAULT 0, \r\n        PRIMARY KEY(`id`)\r\n  \t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
     DB::query($sql);
     setOption('countPrintRowsComments', 10);
 }
Example #30
0
?>
			</div>
		</div>
		<?php 
if (function_exists('printAddToFavorites')) {
    echo '<div class="section">';
    printAddToFavorites($_zp_current_album);
    echo '</div>';
}
?>

		<?php 
if (function_exists('printGoogleMap')) {
    ?>
<div class="section"><?php 
    setOption('gmap_width', 550, false);
    printGoogleMap();
    ?>
</div><?php 
}
?>
		<?php 
if (function_exists('printRating')) {
    ?>
<div class="section"><?php 
    printRating();
    ?>
</div><?php 
}
?>
		<?php