Example #1
0
    echo '<div class="c"><small class="box date">' . getImageDate('%d.%m.%y %H:%M') . '</small></div>';
}
?>
				</div>
			</div>
<?php 
include_once 'footer.php';
?>
		</div>
<?php 
include_once 'analytics.php';
?>

<?php 
zp_apply_filter('theme_body_close');
if (extensionEnabled('colorbox_js') && zp_has_filter('theme_head', 'colorbox::css')) {
    ?>
<script type="text/javascript">
$( document ).ready(function() {
	$(".fullimage").colorbox({
		maxWidth: "98%",
		maxHeight: "98%",
		rel: function() { return $(this).data('rel') },
		current: "{current}/{total}",
		photo: true,
		close: '<?php 
    echo gettext("close");
    ?>
'
	});
})
Example #2
0
<?php

/**
 * Colorbox personality
 */
// initialization stuff
if (zp_has_filter('theme_head', 'colorbox::css')) {
    $handler = new ef_colorbox();
} else {
    require_once SERVERPATH . '/' . THEMEFOLDER . '/effervescence_plus/image_page/functions.php';
}
class ef_colorbox
{
    function __construct()
    {
    }
    function onePage()
    {
        return false;
    }
    function theme_head($_zp_themeroot)
    {
        ?>
		<script type="text/javascript">
			// <!-- <![CDATA[
			$(document).ready(function() {
				$("a.thickbox").colorbox({
					maxWidth: "98%",
					maxHeight: "98%",
					photo: true,
					close: '<?php 
Example #3
0
function printThemeInfo()
{
    list($personality, $themeColor) = getPersonality();
    if ($themeColor == 'effervescence') {
        $themeColor = '';
    }
    if ($personality == 'Image page') {
        $personality = '';
    } else {
        if ($personality == 'Simpleviewer' && !class_exists('simpleviewer') || $personality == 'Colorbox' && !zp_has_filter('admin_head', 'colorbox::css')) {
            $personality = "<strike>{$personality}</strike>";
        }
    }
    $personality = str_replace('_', ' ', $personality);
    if (empty($themeColor) && empty($personality)) {
        echo '<p><small>Effervescence</small></p>';
    } else {
        if (empty($themeColor)) {
            echo '<p><small>' . sprintf(gettext('Effervescence %s'), $personality) . '</small></p>';
        } else {
            if (empty($personality)) {
                echo '<p><small>' . sprintf(gettext('Effervescence %s'), $themeColor) . '</small></p>';
            } else {
                echo '<p><small>' . sprintf(gettext('Effervescence %1$s %2$s'), $themeColor, $personality) . '</small></p>';
            }
        }
    }
}
Example #4
0
/**
 * Output the google map
 *
 * @param string $text text for the "toggle" link that shows/hides the map. Set empty to omit (then Map is always displayed)
 * @param string $id used to set the IDs for the toggle href element ($id_toggle) and the map element ($id_data)
 * @param string $hide initial map state: "hide", "show", or "colorbox"
 * @param object $obj optional image/album object. Pass string for generic map and use callback to set points
 * @param function $callback optional callback function to set map options.
 */
function printGoogleMap($text = NULL, $id = NULL, $hide = NULL, $obj = NULL, $callback = NULL)
{
    global $_zp_current_album, $_zp_current_image, $_x, $_y, $_z, $_n;
    /* controls of parameters */
    if (is_null($obj)) {
        if (is_null($_zp_current_image)) {
            $obj = $_zp_current_album;
        } else {
            $obj = $_zp_current_image;
        }
    }
    if (is_null($obj)) {
        return false;
    }
    if (is_object($obj)) {
        $type = $obj->table;
        $typeid = $obj->getID();
    } else {
        $type = $obj;
        $typeid = '';
    }
    if (is_null($text)) {
        $text = gettext('Google Map');
    }
    if (empty($text)) {
        $hide = 'show';
    }
    if (is_null($hide)) {
        $hide = getOption('gmap_display');
    }
    if (!is_string($hide)) {
        if ($hide) {
            $hide = 'hide';
        } else {
            $hide = 'show';
        }
    }
    /* map configuration */
    $mapControls = getOption('gmap_control_type');
    if ($mapControls == 'none') {
        $mapTypeControl = false;
    } else {
        $mapTypeControl = true;
        $map_control_type = $mapControls;
        $allowedMapTypes = array();
        if (getOption('gmap_map_hybrid')) {
            $allowedMapTypes[] = 'HYBRID';
        }
        if (getOption('gmap_map_roadmap')) {
            $allowedMapTypes[] = 'ROADMAP';
        }
        if (getOption('gmap_map_satellite')) {
            $allowedMapTypes[] = 'SATELLITE';
        }
        if (getOption('gmap_map_terrain')) {
            $allowedMapTypes[] = 'TERRAIN';
        }
    }
    $config['center'] = '0, 0';
    $config['zoom'] = 'auto';
    $config['cluster'] = true;
    $config['zoomControlStyle'] = getOption('gmap_zoom_size');
    if ($mapTypeControl) {
        $config['map_type'] = getOption('gmap_starting_map');
        $config['map_types_available'] = $allowedMapTypes;
    } else {
        $config['disableMapTypeControl'] = true;
    }
    $config['map_width'] = getOption('gmap_width') . "px";
    $config['map_height'] = getOption('gmap_height') . "px";
    $config['clusterMaxZoom'] = getOption('gmap_cluster_max_zoom');
    $config['clusterAverageCenter'] = true;
    $config['onclick'] = "iw.close();";
    $config['minifyJS'] = !TEST_RELEASE;
    $map = new Googlemaps($config);
    /* add markers from geocoded pictures */
    switch ($type) {
        case 'images':
            if (getImageGeodata($obj, $map)) {
                break;
            } else {
                $map = NULL;
                return false;
            }
        case 'albums':
            if (getAlbumGeodata($obj, $map)) {
                break;
            } else {
                $map = NULL;
                return false;
            }
        default:
            break;
    }
    if ($_n == 1) {
        $map->zoom = 13;
    }
    if ($_n) {
        $_x = $_x / $_n;
        $_y = $_y / $_n;
        $_z = $_z / $_n;
        $lon = number_format(atan2($_y, $_x) * 180 / M_PI, 12, '.', '');
        $hyp = sqrt($_x * $_x + $_y * $_y);
        $lat = number_format(atan2($_z, $hyp) * 180 / M_PI, 12, '.', '');
        $map->center = $lat . ', ' . $lon;
    }
    if (!is_null($callback)) {
        call_user_func($callback, $map);
    }
    /* map display */
    if (is_null($id)) {
        $id = $type . $typeid . '_googlemap';
    }
    $id_toggle = $id . '_toggle';
    $id_data = $id . '_data';
    switch ($hide) {
        case 'show':
            $map->create_map();
            ?>
			<script type="text/javascript">
				//<![CDATA[
			<?php 
            echo $map->output_js_contents;
            echo omsAdditions();
            ?>

				function image(album, image) {
					window.location = '<?php 
            echo WEBPATH;
            ?>
/index.php?album=' + album + '&image=' + image;
				}
				//]]>
			</script>
			<div id="<?php 
            echo $id_data;
            ?>
">
				<?php 
            echo $map->output_html;
            ?>
			</div>
			<?php 
            break;
        case 'hide':
            $map->create_map();
            ?>
			<script type="text/javascript">
				//<![CDATA[
			<?php 
            echo $map->output_js_contents;
            echo omsAdditions();
            ?>

				function image(album, image) {
					window.location = '<?php 
            echo WEBPATH;
            ?>
/index.php?album=' + album + '&image=' + image;
				}

				function toggle_<?php 
            echo $id_data;
            ?>
() {
					if ($('#<?php 
            echo $id_data;
            ?>
').hasClass('hidden_map')) {
						$('#<?php 
            echo $id_data;
            ?>
').removeClass('hidden_map');
					} else {
						$('#<?php 
            echo $id_data;
            ?>
').addClass('hidden_map');
					}
				}
				//]]>
			</script>
			<a id="<?php 
            echo $id_toggle;
            ?>
" href="javascript:toggle_<?php 
            echo $id_data;
            ?>
();" title="<?php 
            echo gettext('Display or hide the Google Map.');
            ?>
">
				<?php 
            echo $text;
            ?>
			</a>
			<div id="<?php 
            echo $id_data;
            ?>
" class="hidden_map">
				<?php 
            echo $map->output_html;
            ?>
			</div>
			<?php 
            break;
        case 'colorbox':
            if (zp_has_filter('theme_head', 'colorbox::css')) {
                $map->create_map();
                $map_data["output_js_contents"] = $map->output_js_contents;
                $map_data["output_html"] = $map->output_html;
                if (getOption('gmap_sessions')) {
                    $param = '';
                    $_SESSION['GoogleMapVars'] = $map_data;
                } else {
                    $serializedData = serialize($map_data);
                    if (function_exists('bzcompress')) {
                        $data = bzcompress($serializedData);
                    } else {
                        $data = gzcompress($serializedData);
                    }
                    $param = '?map_data=' . base64_encode($data);
                }
                ?>
				<a href="<?php 
                echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/googleMap/map.php' . $param;
                ?>
" title="<?php 
                echo $text;
                ?>
" class="google_map">
					<?php 
                echo $text;
                ?>
				</a>
				<script type="text/javascript">
					//<![CDATA[
					$(document).ready(function () {
						$(".google_map").colorbox({
							iframe: true,
							innerWidth: '<?php 
                echo (int) (getOption('gmap_width') + 20);
                ?>
px',
							innerHeight: '<?php 
                echo (int) ($cbox_h = getOption('gmap_height') + 20);
                ?>
px',
							close: '<?php 
                echo gettext("close");
                ?>
'
						});
					});
					//]]>
				</script>
				<?php 
            }
            break;
    }
}
/**
 * Prints the Metadata data of the current image
 *
 * @param string $title title tag for the class
 * @param bool $toggle set to true to get a javascript toggle on the display of the data
 * @param string $id style class id
 * @param string $class style class
 * @author Ozh
 */
function printImageMetadata($title = NULL, $toggle = true, $id = 'imagemetadata', $class = null, $span = NULL)
{
    global $_zp_exifvars, $_zp_current_image;
    if (false === ($exif = getImageMetaData($_zp_current_image, true))) {
        return;
    }
    if (is_null($title)) {
        $title = gettext('Image Info');
    }
    if ($class) {
        $class = ' class="' . $class . '"';
    }
    if (!$span) {
        $span = 'exif_link';
    }
    $dataid = $id . '_data';
    if ($id) {
        $id = ' id="' . $id . '"';
    }
    $refh = $refa = $style = '';
    if ($toggle == 'colorbox' && zp_has_filter('theme_head', 'colorbox::css')) {
        $refh = '<a href="#" class="colorbox" title="' . $title . '">';
        $refa = '</a>';
        $style = ' style="display:none"';
    } else {
        if ($toggle) {
            $refh = '<a href="javascript:toggle(\'' . $dataid . '\');" title="' . $title . '">';
            $refa = '</a>';
            $style = ' style="display:none"';
        }
    }
    ?>
	<span id="<?php 
    echo $span;
    ?>
" class="metadata_title">
		<?php 
    echo $refh;
    echo $title;
    echo $refa;
    ?>
	</span>
	<div id="<?php 
    echo $dataid;
    ?>
"<?php 
    echo $style;
    ?>
>
		<div<?php 
    echo $id . $class;
    ?>
>
			<table>
				<?php 
    foreach ($exif as $field => $value) {
        $label = $_zp_exifvars[$field][2];
        echo "<tr><td class=\"label\">{$label}:</td><td class=\"value\">";
        switch ($_zp_exifvars[$field][6]) {
            case 'time':
                echo zpFormattedDate(DATE_FORMAT, strtotime($value));
                break;
            default:
                echo html_encode($value);
                break;
        }
        echo "</td></tr>\n";
    }
    ?>
			</table>
		</div>
	</div>
	<?php 
}
Example #6
0
/**
 *
 * emit the javascript seojs() function
 */
function seoFriendlyJS()
{
    if (zp_has_filter('seoFriendly_js')) {
        echo zp_apply_filter('seoFriendly_js');
    } else {
        ?>
		function seoFriendlyJS(fname) {
		fname=fname.trim();
		fname=fname.replace(/\s+\.\s*/,'.');
		fname = fname.replace(/\s+/g, '-');
		fname = fname.replace(/[^a-zA-Z0-9_.-]/g, '-');
		fname = fname.replace(/--*/g, '-');
		return fname;
		}
		<?php 
    }
}
<?php

/**
 * Provides the means to set an limit of the number of images that can be uploaded to an album in total.
 * Of course this is bypassed if using FTP upload or ZIP files!
 * If you want to limit the latter you need to use the quota_managment plugin additionally.
 * NOTE: The http browser single file upload is disabled if using this plugin!
 *
 * @author Malte Müller (acrylian)
 * @package plugins
 * @subpackage users
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext("Limits the number of images that can be uploaded to an album via the Zenphoto upload.");
$plugin_author = "Malte Müller (acrylian)";
$plugin_disable = zp_has_filter('get_upload_header_text') && !getoption('zp_plugin_image_upload_limiter') ? sprintf(gettext('<a href="#%1$s"><code>%1$s</code></a> is already enabled.'), stripSuffix(get_filterScript('get_upload_header_text'))) : '';
$option_interface = 'uploadlimit';
if ($plugin_disable) {
    setOption('zp_plugin_image_upload_limiter', 0);
} else {
    zp_register_filter('upload_helper_js', 'uploadLimiterJS');
    zp_register_filter('get_upload_header_text', 'uploadLimiterHeaderMessage');
    zp_register_filter('upload_filetypes', 'limitUploadFiletypes');
    zp_register_filter('upload_handlers', 'limitUploadHandlers', 0);
}
/**
 * Option handler class
 *
 */
class uploadlimit
{
Example #8
0
 * Because of the difficulty of policing quotas when ZIP files are uploaded this plugin
 * has an option to diable ZIP file upload.
 *
 * Since uploads via the <var>files</var> tab are like FTP uploads and are not assigned to the user, you should not assign <var>files</var> rights
 * to users with upload limits.
 *
 * @author Stephen Billard (sbillard)
 *
 * @package plugins
 * @subpackage users
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext("Provides a quota management system to limit the sum of sizes of images a user uploads.");
$plugin_notice = gettext("<strong>Note:</strong> if FTP is used to upload images, manual user assignment is necessary. ZIP file upload is disabled by default as quotas are not applied to the files contained therein.");
$plugin_author = "Stephen Billard (sbillard)";
$plugin_disable = zp_has_filter('get_upload_header_text') && !extensionEnabled('quota_manager') ? sprintf(gettext('<a href="#%1$s"><code>%1$s</code></a> is already enabled.'), stripSuffix(get_filterScript('get_upload_header_text'))) : '';
$option_interface = 'quota_manager';
if ($plugin_disable) {
    enableExtension('quota_manager', 0);
} else {
    zp_register_filter('save_admin_custom_data', 'quota_manager::save_admin');
    zp_register_filter('edit_admin_custom_data', 'quota_manager::edit_admin');
    zp_register_filter('new_image', 'quota_manager::new_image');
    zp_register_filter('image_refresh', 'quota_manager::image_refresh');
    zp_register_filter('check_upload_quota', 'quota_manager::checkQuota');
    zp_register_filter('get_upload_limit', 'quota_manager::getUploadLimit');
    zp_register_filter('get_upload_header_text', 'quota_manager::get_header');
    zp_register_filter('upload_filetypes', 'quota_manager::upload_filetypes');
    zp_register_filter('upload_helper_js', 'quota_manager::upload_helper_js');
}
/**
Example #9
0
/**
 * Removes a function from a specified filter hook.
 *
 * This function removes a function attached to a specified filter hook. This
 * method can be used to remove default functions attached to a specific filter
 * hook and possibly replace them with a substitute.
 *
 * To be removed the $function_to_remove and $priority arguments must match
 * when the hook was added.
 *
 * global array $_zp_filters storage for all of the filters
 * @param string $hook The filter hook to which the function to be removed is hooked.
 * @param callback $function_to_remove The name of the function which should be removed.
 * @param int $priority optional. The priority of the function. If not supplied we will get it from zp_has_filter
 * @param int $accepted_args optional. The number of arguments the function accpets (default: 1).
 * @return boolean Whether the function was registered as a filter before it was removed.
 */
function zp_remove_filter($hook, $function_to_remove, $priority = NULL, $accepted_args = 1)
{
    global $_zp_filters;
    if (is_null($priority)) {
        $priority = zp_has_filter($hook, $function_to_remove);
    }
    $function_to_remove = zp_filter_unique_id($hook, $function_to_remove, $priority);
    $remove = isset($_zp_filters[$hook][$priority][$function_to_remove]);
    if ($remove) {
        unset($_zp_filters[$hook][$priority][$function_to_remove]);
        if (empty($_zp_filters[$hook][$priority])) {
            unset($_zp_filters[$hook][$priority]);
        }
        if (empty($_zp_filters[$hook])) {
            unset($_zp_filters[$hook]);
        }
        if (DEBUG_FILTERS) {
            debugLog($function_to_remove . ' removed from ' . $hook);
        }
    }
    return $remove;
}
Example #10
0
/**
 * @deprecated
 * @since 1.4.0
 */
function addPluginScript($script)
{
    deprecated_functions::notify(gettext('Register a “theme_head” filter.'));
    global $_zp_plugin_scripts;
    $_zp_plugin_scripts[] = $script;
    if (!zp_has_filter('theme_head', 'deprecated_functions::addPluginScript()')) {
        zp_register_filter('theme_head', 'deprecated_functions::addPluginScript()');
    }
}
Example #11
0
/**
 * Prints the logout link if the user is logged in.
 * This is for album passwords only, not admin users;
 *
 * @param string $before before text
 * @param string $after after text
 * @param int $showLoginForm to display a login form
 * 				to not display a login form, but just a login link, set to 0
 * 				to display a login form set to 1
 * 				to display a link to a login form in colorbox, set to 2, but you must have colorbox enabled for the theme pages where this link appears.)
 * @param string $logouttext optional replacement text for "Logout"
 */
function printUserLogin_out($before = '', $after = '', $showLoginForm = NULL, $logouttext = NULL)
{
    global $_zp_gallery, $__redirect, $_zp_current_admin_obj, $_zp_login_error, $_zp_gallery_page;
    $excludedPages = array('password.php', 'register.php', 'favorites.php', '404.php');
    $logintext = gettext('Login');
    if (is_null($logouttext)) {
        $logouttext = gettext("Logout");
    }
    $params = array("'userlog=0'");
    if (!empty($__redirect)) {
        foreach ($__redirect as $param => $value) {
            $params[] .= "'" . $param . '=' . urlencode($value) . "'";
        }
    }
    if (is_null($showLoginForm)) {
        $showLoginForm = getOption('user_logout_login_form');
    }
    if (is_object($_zp_current_admin_obj)) {
        if (!$_zp_current_admin_obj->logout_link) {
            return;
        }
    }
    $cookies = Zenphoto_Authority::getAuthCookies();
    if (empty($cookies) || !zp_loggedin()) {
        if (!in_array($_zp_gallery_page, $excludedPages)) {
            switch ($showLoginForm) {
                case 1:
                    ?>
					<div class="passwordform">
						<?php 
                    printPasswordForm('', true, false);
                    ?>
					</div>
					<?php 
                    break;
                case 2:
                    if (getOption('colorbox_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page)) && zp_has_filter('theme_head', 'colorbox::css')) {
                        ?>
					<script type="text/javascript">
						// <!-- <![CDATA[
						$(document).ready(function() {
							$(".logonlink").colorbox({
								inline: true,
								innerWidth: "400px",
								href: "#passwordform",
								close: '<?php 
                        echo gettext("close");
                        ?>
',
								open: $('#passwordform_enclosure .errorbox').length
							});
						});
						// ]]> -->
					</script>
					<?php 
                        if ($before) {
                            echo '<span class="beforetext">' . html_encodeTagged($before) . '</span>';
                        }
                        ?>
					<a href="#" class="logonlink" title="<?php 
                        echo $logintext;
                        ?>
"><?php 
                        echo $logintext;
                        ?>
</a>
					<span id="passwordform_enclosure" style="display:none">
					<div class="passwordform">
						<?php 
                        printPasswordForm('', true, false);
                        ?>
					</div>
					</span>
					<?php 
                        if ($after) {
                            echo '<span class="aftertext">' . html_encodeTagged($after) . '</span>';
                        }
                    }
                    break;
                default:
                    if ($loginlink = zp_apply_filter('login_link', getCustomPageURL('password'))) {
                        if ($before) {
                            echo '<span class="beforetext">' . html_encodeTagged($before) . '</span>';
                        }
                        ?>
						<a href="<?php 
                        echo $loginlink;
                        ?>
" title="<?php 
                        echo $logintext;
                        ?>
"><?php 
                        echo $logintext;
                        ?>
</a>
						<?php 
                        if ($after) {
                            echo '<span class="aftertext">' . html_encodeTagged($after) . '</span>';
                        }
                    }
            }
        }
    } else {
        if ($before) {
            echo '<span class="beforetext">' . html_encodeTagged($before) . '</span>';
        }
        $logoutlink = "javascript:launchScript('" . FULLWEBPATH . "/',[" . implode(',', $params) . "]);";
        ?>
		<a href="<?php 
        echo $logoutlink;
        ?>
" title="<?php 
        echo $logouttext;
        ?>
"><?php 
        echo $logouttext;
        ?>
</a>
		<?php 
        if ($after) {
            echo '<span class="aftertext">' . html_encodeTagged($after) . '</span>';
        }
    }
}
Example #12
0
/**
 * Print the header for all admin pages. Starts at <DOCTYPE> but does not include the </head> tag,
 * in case there is a need to add something further.
 *
 * @param string $tab the album page
 * @param string $subtab the sub-tab if any
 */
function printAdminHeader($tab, $subtab = NULL)
{
    global $_zp_admin_tab, $_zp_admin_subtab, $_zp_gallery, $zenphoto_tabs, $_zp_RTL_css;
    $_zp_admin_tab = $tab;
    if (isset($_GET['tab'])) {
        $_zp_admin_subtab = sanitize($_GET['tab'], 3);
    } else {
        $_zp_admin_subtab = $subtab;
    }
    $tabtext = $_zp_admin_tab;
    $tabrow = NULL;
    foreach ($zenphoto_tabs as $key => $tabrow) {
        if ($key == $_zp_admin_tab) {
            $tabtext = $tabrow['text'];
            break;
        }
        $tabrow = NULL;
    }
    if (empty($_zp_admin_subtab) && $tabrow && isset($tabrow['default'])) {
        $_zp_admin_subtab = $zenphoto_tabs[$_zp_admin_tab]['default'];
    }
    $subtabtext = '';
    if ($_zp_admin_subtab && $tabrow && array_key_exists('subtabs', $tabrow) && $tabrow['subtabs']) {
        foreach ($tabrow['subtabs'] as $key => $link) {
            $i = strpos($link, '&tab=');
            if ($i !== false) {
                $text = substr($link, $i + 9);
                if ($text == $_zp_admin_subtab) {
                    $subtabtext = '-' . $key;
                    break;
                }
            }
        }
    }
    if (empty($subtabtext)) {
        if ($_zp_admin_subtab) {
            $subtabtext = '-' . $_zp_admin_subtab;
        }
    }
    header('Last-Modified: ' . ZP_LAST_MODIFIED);
    header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
    zp_apply_filter('admin_headers');
    ?>
	<!DOCTYPE html>
	<html>
		<head>
			<meta http-equiv="content-type" content="text/html; charset=<?php 
    echo LOCAL_CHARSET;
    ?>
" />
			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/toggleElements.css" type="text/css" />
			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jqueryui/jquery-ui-zenphoto.css" type="text/css" />
			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/admin.css" type="text/css" />
			<?php 
    if ($_zp_RTL_css) {
        ?>
				<link rel="stylesheet" href="<?php 
        echo WEBPATH . '/' . ZENFOLDER;
        ?>
/admin-rtl.css" type="text/css" />
				<?php 
    }
    ?>
			<title><?php 
    echo sprintf(gettext('%1$s %2$s: %3$s%4$s'), html_encode($_zp_gallery->getTitle()), gettext('admin'), html_encode($tabtext), html_encode($subtabtext));
    ?>
</title>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jquery.js" type="text/javascript"></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jqueryui/jquery-ui-zenphoto.js" type="text/javascript"></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/zenphoto.js" type="text/javascript" ></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/admin.js" type="text/javascript" ></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jquery.scrollTo.js" type="text/javascript"></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jquery.are-you-sure.js" type="text/javascript"></script>
			<script type="text/javascript">
				// <!-- <![CDATA[

				$(document).ready(function() {
	<?php 
    if (zp_has_filter('admin_head', 'colorbox::css')) {
        ?>
						$("a.colorbox").colorbox({
							maxWidth: "98%",
							maxHeight: "98%",
							close: '<?php 
        echo addslashes(gettext("close"));
        ?>
'
						});

		<?php 
    }
    ?>
					$('form.dirty-check').areYouSure({
						'message': '<?php 
    echo addslashes(gettext('You have unsaved changes!'));
    ?>
',
						'addRemoveFieldsMarksDirty':false
					});
				});
				$(function() {
					$(".tooltip ").tooltip({
						show: 1000,
						hide: 1000,
						position: {
							my: "center bottom-20",
							at: "center top",
							using: function(position, feedback) {
								$(this).css(position);
								$("<div>")
												.addClass("arrow")
												.addClass(feedback.vertical)
												.addClass(feedback.horizontal)
												.appendTo(this);
							}
						}
					});
					$(".page-list_icon").tooltip({
						show: 1000,
						hide: 1000,
						position: {
							my: "center bottom-20",
							at: "center top",
							using: function(position, feedback) {
								$(this).css(position);
								$("<div>")
												.addClass("arrow")
												.addClass(feedback.vertical)
												.addClass(feedback.horizontal)
												.appendTo(this);
							}
						}
					});
				});
				jQuery(function($) {
					$(".fade-message").fadeTo(5000, 1).fadeOut(1000);
				})
				// ]]> -->
			</script>
			<?php 
    zp_apply_filter('admin_head');
}
Example #13
0
<?php

/**
 * Changes <i>white space</i> characters to hyphens.
 *
 * @author Stephen Billard (sbillard)
 * 
 * @package plugins
 * @subpackage seo
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext('SEO <em>Null</em> filter.');
$plugin_notice = gettext('The only translation performed is one or more <em>white space</em> characters are converted to a <em>hyphen</em>.');
$plugin_author = "Stephen Billard (sbillard)";
$plugin_disable = zp_has_filter('seoFriendly') && !extensionEnabled('seo_null') ? sprintf(gettext('Only one SEO filter plugin may be enabled. <a href="#%1$s"><code>%1$s</code></a> is already enabled.'), stripSuffix(get_filterScript('seoFriendly'))) : '';
zp_register_filter('seoFriendly', 'null_seo::filter');
zp_register_filter('seoFriendly_js', 'null_seo::js');
/**
 * Option handler class
 *
 */
class null_seo
{
    /**
     * class instantiation function
     *
     * @return zenphoto_seo
     */
    function __construct()
    {
    }
<?php

/**
 * PHP sendmail mailing handler
 *
 * @author Stephen Billard (sbillard)
 *
 * @package plugins
 * @subpackage mail
 */
$plugin_is_filter = defaultExtension(5 | CLASS_PLUGIN);
$plugin_description = gettext("Outgoing mail handler based on the PHP <em>mail</em> facility.");
$plugin_author = "Stephen Billard (sbillard)";
$plugin_disable = zp_has_filter('sendmail') && !extensionEnabled('zenphoto_sendmail') ? sprintf(gettext('Only one Email handler plugin may be enabled. <a href="#%1$s"><code>%1$s</code></a> is already enabled.'), stripSuffix(get_filterScript('sendmail'))) : '';
if ($plugin_disable) {
    enableExtension('zenphoto_sendmail', 0);
} else {
    zp_register_filter('sendmail', 'zenphoto_sendmail');
}
function zenphoto_sendmail($msg, $email_list, $subject, $message, $from_mail, $from_name, $cc_addresses, $replyTo, $html = false)
{
    $headers = sprintf('From: %1$s <%2$s>', $from_name, $from_mail) . "\n";
    if (count($cc_addresses) > 0) {
        $cclist = '';
        foreach ($cc_addresses as $cc_name => $cc_mail) {
            $cclist .= ',' . $cc_mail;
        }
        $headers .= 'Cc: ' . substr($cclist, 1) . "\n";
    }
    if ($replyTo) {
        $headers .= 'Reply-To: ' . array_shift($replyTo) . "\n";
Example #15
0
/**
 * Print the header for all admin pages. Starts at <DOCTYPE> but does not include the </head> tag,
 * in case there is a need to add something further.
 *
 * @param string $tab the album page
 * @param string $subtab the sub-tab if any
 */
function printAdminHeader($tab, $subtab = NULL)
{
    global $_zp_admin_tab, $_zp_admin_subtab, $_zp_gallery, $zenphoto_tabs, $_zp_RTL_css;
    $_zp_admin_tab = $tab;
    if (isset($_GET['tab'])) {
        $_zp_admin_subtab = sanitize($_GET['tab'], 3);
    } else {
        $_zp_admin_subtab = $subtab;
    }
    $tabtext = $_zp_admin_tab;
    $tabrow = NULL;
    foreach ($zenphoto_tabs as $key => $tabrow) {
        if ($key == $_zp_admin_tab) {
            $tabtext = $tabrow['text'];
            break;
        }
        $tabrow = NULL;
    }
    if (empty($_zp_admin_subtab) && $tabrow && isset($tabrow['default'])) {
        $_zp_admin_subtab = $zenphoto_tabs[$_zp_admin_tab]['default'];
    }
    $subtabtext = '';
    if ($_zp_admin_subtab && $tabrow && array_key_exists('subtabs', $tabrow) && $tabrow['subtabs']) {
        foreach ($tabrow['subtabs'] as $key => $link) {
            $i = strpos($link, '&tab=');
            if ($i !== false) {
                $text = substr($link, $i + 9);
                if ($text == $_zp_admin_subtab) {
                    $subtabtext = '-' . $key;
                    break;
                }
            }
        }
    }
    if (empty($subtabtext)) {
        if ($_zp_admin_subtab) {
            $subtabtext = '-' . $_zp_admin_subtab;
        }
    }
    header('Last-Modified: ' . ZP_LAST_MODIFIED);
    header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
    zp_apply_filter('admin_headers');
    ?>
	<!DOCTYPE html>
	<html>
		<head>
			<?php 
    printStandardMeta();
    ?>
			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/toggleElements.css" type="text/css" />
			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jqueryui/jquery-ui-zenphoto.css" type="text/css" />
			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/admin.css" type="text/css" />

			<link rel="stylesheet" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/facebox/facebox.css" type="text/css" />

			<?php 
    if ($_zp_RTL_css) {
        ?>
				<link rel="stylesheet" href="<?php 
        echo WEBPATH . '/' . ZENFOLDER;
        ?>
/admin-rtl.css" type="text/css" />
				<?php 
    }
    ?>
			<title><?php 
    echo sprintf(gettext('%1$s %2$s: %3$s%4$s'), html_encode($_zp_gallery->getTitle()), gettext('admin'), html_encode($tabtext), html_encode($subtabtext));
    ?>
</title>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jquery.js" type="text/javascript"></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jqueryui/jquery-ui-zenphoto.js" type="text/javascript"></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/zenphoto.js" type="text/javascript" ></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/admin.js" type="text/javascript" ></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/jquery.scrollTo.js" type="text/javascript"></script>

			<?php 
    if (extensionEnabled('touchPunch')) {
        ?>
				<script src="<?php 
        echo WEBPATH . '/' . ZENFOLDER;
        ?>
/js/jquery.ui.touch-punch.min.js"></script>
				<?php 
    }
    ?>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/dirtyforms/jquery.dirtyforms.min.js" type="text/javascript"></script>
			<script src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/facebox/facebox.js" type="text/javascript"></script>


			<script type="text/javascript">
				// <!-- <![CDATA[
				function setClean(id) {
					$('form#' + id).dirtyForms('setClean');
					$('form#' + id).removeClass('tinyDirty');
				}
				$(document).ready(function () {
	<?php 
    if (zp_has_filter('admin_head', 'colorbox::css')) {
        ?>
						$("a.colorbox").colorbox({
							maxWidth: "98%",
							maxHeight: "98%",
							close: '<?php 
        echo addslashes(gettext("close"));
        ?>
'
						});
		<?php 
    }
    ?>
					$.DirtyForms.ignoreClass = 'ignoredirty';
					$.DirtyForms.message = '<?php 
    echo gettext('You have unsaved changes!');
    ?>
';
					$.DirtyForms.title = '<?php 
    echo gettext('Are you sure you want to leave this page?');
    ?>
';
					$.DirtyForms.continueText = '<?php 
    echo gettext('Leave');
    ?>
';
					$.DirtyForms.stopText = '<?php 
    echo gettext('Stay');
    ?>
';
					$.facebox.settings.closeImage = '<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/js/facebox/closelabel.png';
					$('#modal').facebox();
					$('form.dirtylistening').dirtyForms();
				});
				jQuery(function ($) {
					$(".fade-message").fadeTo(5000, 1).fadeOut(1000);
				})
				// ]]> -->
			</script>
			<?php 
    zp_apply_filter('admin_head');
}
    printSubtabs('Mailing');
    ?>
				<div class="tabbox">
					<?php 
    zp_apply_filter('admin_note', 'user_mailing', '');
    ?>
					<h1><?php 
    echo gettext('User mailing list');
    ?>
</h1>
					<p><?php 
    echo gettext("A tool to send e-mails to all registered users who have provided an e-mail address. There is always a copy sent to the current admin and all e-mails are sent as <em>blind copies</em>.");
    ?>
</p>
					<?php 
    if (!zp_has_filter('sendmail')) {
        $disabled = ' disabled="disabled"';
        ?>
						<p class="notebox">
							<?php 
        echo gettext("<strong>Note: </strong>No <em>sendmail</em> filter is registered. You must activate and configure a mailer plugin.");
        ?>
						</p>
						<?php 
    } else {
        $disabled = '';
    }
    if (isset($_GET['sendmail'])) {
        //form handling stuff to add...
        $subject = NULL;
        $message = NULL;
Example #17
0
/**
 * Strips out and/or replaces characters from the string that are not "soe" friendly
 *
 * @param string $source
 * @return string
 */
function seoFriendly($source)
{
    if (zp_has_filter('seoFriendly')) {
        $string = zp_apply_filter('seoFriendly', $source);
    } else {
        // no filter, do basic cleanup
        $string = preg_replace("/&([a-zA-Z])(uml|acute|grave|circ|tilde|ring),/", "", $source);
        $string = preg_replace("/[^a-zA-Z0-9_.-]/", "", $string);
        $string = str_replace(array('---', '--'), '-', $string);
    }
    return $string;
}