Example #1
0
// Set the internal encoding
if (function_exists('mb_internal_encoding')) {
    @mb_internal_encoding(LOCAL_CHARSET);
}
// load graphics libraries in priority order
// once a library has concented to load, all others will
// abdicate.
$_zp_graphics_optionhandlers = array();
$try = array('lib-GD.php', 'lib-NoGraphics.php');
if (getOption('use_imagick')) {
    array_unshift($try, 'lib-Imagick.php');
}
while (!function_exists('zp_graphicsLibInfo')) {
    require_once dirname(__FILE__) . '/' . array_shift($try);
}
$_zp_cachefileSuffix = zp_graphicsLibInfo();
define('GRAPHICS_LIBRARY', $_zp_cachefileSuffix['Library']);
unset($_zp_cachefileSuffix['Library']);
unset($_zp_cachefileSuffix['Library_desc']);
$_zp_supported_images = array();
foreach ($_zp_cachefileSuffix as $key => $type) {
    if ($type) {
        $_zp_supported_images[] = strtolower($key);
    }
}
require_once dirname(__FILE__) . '/lib-encryption.php';
//NOTE: SERVER_PROTOCOL is the option PROTOCOL is what should be used in links!!!!
define('SERVER_PROTOCOL', getOption('server_protocol'));
switch (SERVER_PROTOCOL) {
    case 'https':
        define('PROTOCOL', 'https');
Example #2
0
     checkMark($mb, gettext("PHP <code>mbstring</code> package"), sprintf(gettext('PHP <code>mbstring</code> package [Your internal character set is <strong>%s</strong>]'), $charset), $m2);
 } else {
     $test = $_zp_UTF8->convert('test', 'ISO-8859-1', 'UTF-8');
     if (empty($test)) {
         $m2 = gettext("You need to install the <code>mbstring</code> package or correct the issue with <code>iconv()</code>");
         checkMark(0, '', gettext("PHP <code>mbstring</code> package [is not present and <code>iconv()</code> is not working]"), $m2);
     } else {
         $m2 = gettext("Strings generated internally by PHP may not display correctly. (e.g. dates)");
         checkMark(-1, '', gettext("PHP <code>mbstring</code> package [is not present]"), $m2);
     }
 }
 if ($environ) {
     /* Check for graphic library and image type support. */
     primeMark(gettext('Graphics library'));
     if (function_exists('zp_graphicsLibInfo')) {
         $graphics_lib = zp_graphicsLibInfo();
         if (array_key_exists('Library_desc', $graphics_lib)) {
             $library = $graphics_lib['Library_desc'];
         } else {
             $library = '';
         }
         $good = checkMark(!empty($library), sprintf(gettext("Graphics support: <code>%s</code>"), $library), gettext('Graphics support [is not installed]'), gettext('You need to install a graphics support library such as the <em>GD library</em> in your PHP')) && $good;
         if (!empty($library)) {
             $missing = array();
             if (!isset($graphics_lib['JPG'])) {
                 $missing[] = 'JPEG';
             }
             if (!isset($graphics_lib['GIF'])) {
                 $missing[] = 'GIF';
             }
             if (!isset($graphics_lib['PNG'])) {
/**
 * Expose some informations in a HTML comment
 *
 * @param string $obj the path to the page being loaded
 * @param array $plugins list of activated plugins
 * @param string $theme The theme being used
 */
function exposeZenPhotoInformations($obj = '', $plugins = '', $theme = '')
{
    global $_zp_filters;
    $a = basename($obj);
    if ($a != 'full-image.php') {
        echo "\n<!-- zenphoto version " . ZENPHOTO_VERSION . " [" . ZENPHOTO_FULL_RELEASE . "]";
        echo " THEME: " . $theme . " (" . $a . ")";
        $graphics = zp_graphicsLibInfo();
        $graphics = sanitize(str_replace('<br />', ', ', $graphics['Library_desc']), 3);
        echo " GRAPHICS LIB: " . $graphics . " { memory: " . INI_GET('memory_limit') . " }";
        echo ' PLUGINS: ';
        if (count($plugins) > 0) {
            sort($plugins);
            foreach ($plugins as $plugin) {
                echo $plugin . ' ';
            }
        } else {
            echo 'none ';
        }
        echo " -->";
    }
}
// Set the internal encoding
if (function_exists('mb_internal_encoding')) {
    if (mb_internal_encoding() != LOCAL_CHARSET) {
        @mb_internal_encoding(LOCAL_CHARSET);
    }
}
// load graphics libraries in priority order
// once a library has concented to load, all others will
// abdicate.
$_zp_graphics_optionhandlers = array();
if (version_compare(PHP_VERSION, '5.0.0') == 1) {
    require_once dirname(__FILE__) . '/lib-Imagick.php';
}
require_once dirname(__FILE__) . '/lib-GD.php';
if (function_exists('zp_graphicsLibInfo')) {
    $_zp_supported_images = zp_graphicsLibInfo();
    define('GRAPHICS_LIBRARY', $_zp_supported_images['Library']);
    unset($_zp_supported_images['Library']);
    unset($_zp_supported_images['Library_desc']);
    foreach ($_zp_supported_images as $key => $type) {
        unset($_zp_supported_images[$key]);
        if ($type) {
            $_zp_supported_images[strtolower($key)] = true;
        }
    }
    $_zp_supported_images = array_keys($_zp_supported_images);
} else {
    $_zp_supported_images = array();
}
require_once dirname(__FILE__) . '/lib-encryption.php';
switch (OFFSET_PATH) {