Example #1
0
function imageflow_head()
{
    global $IMAGEFLOWSET, $CONFIG, $CPG_PHP_SELF, $JS, $template_header;
    require './plugins/imageflow/include/load_imageflowset.php';
    $imageflow_pages_array = array('index.php');
    if (in_array($CPG_PHP_SELF, $imageflow_pages_array) == TRUE) {
        if ($IMAGEFLOWSET['imageflow_useenlarge']) {
            $JS['includes'][] = "plugins/imageflow/js/imageflowenl.js";
        } else {
            $JS['includes'][] = "plugins/imageflow/js/imageflow.js";
        }
        set_js_var('cpgif_auto', $IMAGEFLOWSET['imageflow_auto']);
        set_js_var('cpgif_autotime', $IMAGEFLOWSET['imageflow_autotime']);
        set_js_var('cpgif_usewheel', $IMAGEFLOWSET['imageflow_usewheel']);
        set_js_var('cpgif_usekeys', $IMAGEFLOWSET['imageflow_usekeys']);
        $imageflow_headcode = '<link rel="stylesheet" title="Standard" href="plugins/imageflow/js/screen.css" type="text/css" media="screen" />';
        $imageflow_headcode .= '<style type="text/css">';
        $imageflow_headcode .= '  #imageflow{background-color:#' . $IMAGEFLOWSET['imageflow_bgcolor'] . ';width:' . $IMAGEFLOWSET['imageflow_width'] . ';}';
        if ($IMAGEFLOWSET['imageflow_intable']) {
            $imageflow_headcode .= '  #imgflowcontainer{margin-top:' . $IMAGEFLOWSET['imageflow_topcorrect'] . 'px;width:' . $IMAGEFLOWSET['imageflow_width'] . ';} ';
        }
        $imageflow_headcode .= '  #imgflowslider{background-image:url(\'plugins/imageflow/js/slider.gif\');}';
        $imageflow_headcode .= '</style>';
        $template_header = str_replace('{META}', '{META}' . $imageflow_headcode, $template_header);
    }
}
Example #2
0
function slider_head()
{
    global $SLIDERSET, $CONFIG, $CPG_PHP_SELF, $JS;
    require './plugins/slider/include/load_sliderset.php';
    // only insert stuff if we're on album list page
    $slider_pages_array = array('index.php');
    if (in_array($CPG_PHP_SELF, $slider_pages_array) == TRUE) {
        $JS['includes'][] = "plugins/slider/slider.js";
        set_js_var('slider_copyspeed', $SLIDERSET['slider_speed']);
        set_js_var('slider_autow', $SLIDERSET['slider_autowidth']);
    }
}
Example #3
0
function html5_display_upload_form($upload_settings)
{
    global $CONFIG, $USER_DATA, $lang_common, $lang_upload_php, $lang_plugin_html5upload, $icon_array, $h5a_upload, $lang_bbcode_help_title, $lang_bbcode_help;
    list($upload_form, $upload_select) = $upload_settings;
    if ($upload_form != 'html5_upload') {
        return $upload_settings;
    }
    $plugpath = 'plugins/html5upload';
    $grpn = USER_ID > 0 ? (int) $USER_DATA['group_id'] : 0;
    $grpc = $grpn ? $grpn : '';
    $cfg = isset($CONFIG['html5upload_config' . $grpc]) ? unserialize($CONFIG['html5upload_config' . $grpc]) : unserialize($CONFIG['html5upload_config']);
    $maxfilesizebytes = $cfg['upldsize'] ? max($cfg['upldsize'], $h5a_upload->sys_max_upl_size) : $h5a_upload->sys_max_upl_size;
    $maxfilesize = sprintf($lang_upload_php['max_fsize'], $h5a_upload->to_KMG($maxfilesizebytes));
    list($timestamp, $form_token) = getFormToken(time() + 14400);
    //allow up to 4 hours for upload to complete
    set_js_var('timestamp', $timestamp - 14400);
    //subtract those 4 hours so edits happen correctly
    set_js_var('concurrent', $cfg['concurrent']);
    set_js_var('autoedit', $cfg['autoedit']);
    set_js_var('user_id', USER_ID);
    set_js_var('guest_edit', $CONFIG['allow_guests_enter_file_details']);
    set_js_var('H5uPath', "{$plugpath}/");
    set_js_var('maxfilesize', $maxfilesizebytes);
    set_js_var('maxchunksize', $h5a_upload->sys_max_chnk_size);
    set_js_var('fup_payload', array('event' => 'picture', 'process' => 1, 'form_token' => $form_token, 'timestamp' => $timestamp, 'MFU' => 1));
    set_js_var('h5uM', array('selAlb' => $lang_plugin_html5upload['albmSelMsg'], 'aborted' => $lang_plugin_html5upload['aborted'], 'type_err' => $lang_plugin_html5upload['type_err'], 'size_err' => $lang_plugin_html5upload['size_err'], 'extallow' => $lang_plugin_html5upload['extallow'], 'q_stop' => $lang_plugin_html5upload['q_stop'], 'q_go' => $lang_plugin_html5upload['q_resume'], 'q_can' => $lang_plugin_html5upload['q_cancel']));
    $allowed_types = array_merge(explode('/', $CONFIG['allowed_img_types']), explode('/', $CONFIG['allowed_mov_types']), explode('/', $CONFIG['allowed_snd_types']), explode('/', $CONFIG['allowed_doc_types']));
    set_js_var('allowed_file_types', $allowed_types);
    // include the javascript upload engine (minified unless in debug mode)
    $jsv = $CONFIG['debug_mode'] == 1 || $CONFIG['debug_mode'] == 2 && GALLERY_ADMIN_MODE ? '' : '.min';
    js_include('plugins/html5upload/js/upload' . $jsv . '.js');
    // add our style sheet
    $h5up_meta = '<link rel="stylesheet" href="plugins/html5upload/css/upload.css" type="text/css" />';
    pageheader($lang_plugin_html5upload['title'], $h5up_meta);
    $upload_help = $h5a_upload->help_button('use');
    $upload_table_header = <<<EOT
\t<table border="0" cellspacing="0" cellpadding="0" width="100%">
\t\t<tr>
\t\t\t<td>
\t\t\t\t{$icon_array['upload']}{$lang_plugin_html5upload['upldfiles']}{$upload_help}
\t\t\t</td>
\t\t\t<td style="text-align:right">
\t\t\t\t<span id="upload_method_selector">{$upload_select}</span>
\t\t\t</td>
\t\t</tr>
\t</table>
EOT;
    starttable('100%', $upload_table_header, 2);
    echo '<tr><td colspan="2" class="tableb tableb_alternate"><strong>' . $maxfilesize . '</strong></td></tr>';
    form_alb_list_box($lang_common['album'], 'h5u_album');
    echo <<<EOT
\t<tr id="navailrow" style="text-align:center;background-color:yellow;display:none">
\t\t<td colspan="2">{$lang_plugin_html5upload['notavail']}</td>
\t</tr>
\t<tr class="H5upV">
\t\t<td class="tableb" width="30%">{$lang_plugin_html5upload['flistitl']}</td>
\t\t<td class="tableb"><input type="checkbox" id="flistitl" onchange="shide_titlrow(this);" /></td>
\t</tr>
EOT;
    if (USER_ID > 0 || $CONFIG['allow_guests_enter_file_details'] == 1) {
        if ($cfg['enabtitl']) {
            echo '<tr id="titlrow"><td class="tableb">' . $lang_upload_php['pic_title'] . '</td><td class="tableb"><input type="text" name="title" id="title" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabdesc']) {
            $desclabl = $lang_upload_php['description'];
            if ($CONFIG['show_bbcode_help']) {
                $desclabl .= '&nbsp;' . cpg_display_help('f=empty.htm&amp;base=64&amp;h=' . urlencode(base64_encode(serialize($lang_bbcode_help_title))) . '&amp;t=' . urlencode(base64_encode(serialize($lang_bbcode_help))), 470, 245);
            }
            echo '<tr><td class="tableb">' . $desclabl . '</td><td class="tableb"><textarea name="caption" rows="2" id="caption" class="textinput" style="width:90%" /></textarea></td></tr>';
        }
        if ($cfg['enabkeys']) {
            $keywordLabel = sprintf($lang_common['keywords_insert1'], $lang_common['keyword_separators'][$CONFIG['keyword_separator']]) . '<br /><a href="keyword_select.php" class="greybox">' . $lang_common['keywords_insert2'] . '</a>';
            echo '<tr><td class="tableb">' . $keywordLabel . '</td><td class="tableb"><input type="text" name="keywords" id="keywords" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr1'] && !empty($CONFIG['user_field1_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field1_name'] . '</td><td class="tableb"><input type="text" name="user1" id="user1" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr2'] && !empty($CONFIG['user_field2_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field2_name'] . '</td><td class="tableb"><input type="text" name="user2" id="user2" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr3'] && !empty($CONFIG['user_field3_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field3_name'] . '</td><td class="tableb"><input type="text" name="user3" id="user3" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr4'] && !empty($CONFIG['user_field4_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field4_name'] . '</td><td class="tableb"><input type="text" name="user4" id="user4" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
    }
    $acptmime = $cfg['acptmime'] ? "accept=\"{$cfg['acptmime']}\"" : '';
    echo <<<EOT
\t<tr id="h5upldrow">
\t\t<td class="tableb">{$lang_plugin_html5upload['files']}</td>
\t\t<td class="tableb" style="padding:1em">
\t\t\t<div style="width:480px">
\t\t\t\t<input type="file" name="userpictures" id="upload_field" multiple="multiple" {$acptmime}/>
\t\t\t\t&nbsp;<br />
\t\t\t\t<div id="dropArea">{$lang_plugin_html5upload['drop_files']}</div>
\t\t\t\t&nbsp;<br />
\t\t\t\t<div id="progress_report" style="position:relative">
\t\t\t\t\t<div id="progress_report_name"></div>
\t\t\t\t\t<div id="progress_report_status" style="font-style: italic;"></div>
\t\t\t\t\t<div id="totprogress">
\t\t\t\t\t\t<div id="progress_report_bar" style="background-color: blue; width: 0; height: 100%;"></div>
\t\t\t\t\t</div>
\t\t\t\t\t<div>
\t\t\t\t\t\t{$lang_plugin_html5upload['files_left']}<span id="qcount">0</span><div class="acti" id="qstop"><img src="plugins/html5upload/css/stop.png" title="{$lang_plugin_html5upload['q_stop']}" onclick="H5uQctrl.stop()" /></div><div class="acti" id="qgocan"><img src="plugins/html5upload/css/play-green.png" title="{$lang_plugin_html5upload['q_resume']}" onclick="H5uQctrl.go()" /><img src="plugins/html5upload/css/cross.png" title="{$lang_plugin_html5upload['q_cancel']}" onclick="H5uQctrl.cancel()" /></div>
\t\t\t\t\t</div>
\t\t\t\t\t<div id="fprogress"></div>
\t\t\t\t\t<div id="server_response"></div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</td>
\t</tr>
\t<tr id="gotoedit" style="display:none">
\t\t<td class="tableb tableb_alternate">{$lang_plugin_html5upload['continue']}</td>
\t\t<td class="tableb tableb_alternate">
\t\t\t<button type="button" onclick="window.location=redirURL">{$lang_plugin_html5upload['gotoedit']}</button>
\t\t</td>
\t</tr>
EOT;
    endtable();
    pagefooter();
    exit;
}
Example #4
0
function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb', $date = '', $filmstrip_prev_pos, $filmstrip_next_pos, $max_block_items, $thumb_width)
{
    global $CONFIG, $THEME_DIR;
    global $template_film_strip, $lang_film_strip, $lang_common, $pic_count, $mar_pic;
    $superCage = Inspekt::makeSuperCage();
    static $template = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $spacer = '';
    if (defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        set_js_var('vertstrip', 1);
    }
    if (!$template) {
        $template = $template_film_strip;
        $thumb_cell = template_extract_block($template, 'thumb_cell');
        $empty_cell = template_extract_block($template, 'empty_cell');
    }
    $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;
    $date_link = $date == '' ? '' : '&amp;date=' . $date;
    if ($superCage->get->getInt('uid')) {
        $uid_link = '&amp;uid=' . $superCage->get->getInt('uid');
    } else {
        $uid_link = '';
    }
    $i = 0;
    $thumb_strip = '';
    foreach ($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            if ($thumb['pos'] == $pos && !$superCage->get->keyExists('film_strip')) {
                $thumb['image'] = str_replace('class="image"', 'class="image middlethumb"', $thumb['image']);
            }
            // determine if thumbnail link targets should open in a pop-up
            if ($CONFIG['thumbnail_to_fullsize'] == 1) {
                // code for full-size pop-up
                if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                    $target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
                } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
                    $target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
                } else {
                    $target = 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
                }
            } elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
                $page = cpg_get_comment_page_number($thumb['msg_id']);
                $page = is_numeric($page) ? "&amp;page={$page}" : '';
                $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}&amp;msg_id={$thumb['msg_id']}{$page}#comment{$thumb['msg_id']}";
            } else {
                $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}#top_display_media";
            }
            $params = array('{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{ONE_WIDTH}' => "width:" . $thumb_width . "px; float: left");
        } else {
            $params = array('{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{ONE_WIDTH}' => "width:" . $thumb_width . "px; float: left");
        }
        $thumb_strip .= template_eval($thumb_cell, $params);
    }
    $tile1 = $THEME_DIR . 'images/tile1.gif';
    $tile2 = $THEME_DIR . 'images/tile2.gif';
    if (defined('THEME_HAS_NAVBAR_GRAPHICS')) {
        $location = $THEME_DIR;
    } else {
        $location = '';
    }
    $max_itme_width_ul = $max_block_items;
    if ($max_block_items % 2 == 0) {
        $max_itme_width_ul = $max_block_items + 1;
    }
    $set_width_to_film = "width:" . $max_block_items * ($thumb_width + 4) . "px; position:relative;";
    $params = array('{THUMB_STRIP}' => $thumb_strip, '{COLS}' => $i, '{TILE1}' => $tile1, '{TILE2}' => $tile2, '{SET_WIDTH}' => $set_width_to_film);
    ob_start();
    echo '<div id="filmstrip">';
    if (!defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        starttable($CONFIG['picture_table_width']);
    }
    echo template_eval($template, $params);
    if (!defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        endtable();
    }
    echo '</div>';
    $film_strip = ob_get_contents();
    ob_end_clean();
    return $film_strip;
}
Example #5
0
function annotate_file_data($data)
{
    global $CONFIG, $LINEBREAK, $lang_plugin_annotate, $annotate_icon_array, $REFERER;
    // Disable for mobile devices
    if ($CONFIG['plugin_annotate_disable_mobile'] && defined('MOBILE_VIEW')) {
        return $data;
    }
    // Disable for non-image files
    if (!is_image($data['filename'])) {
        return $data;
    }
    // disable on 360° panoramas
    if (function_exists(panorama_viewer_is_360_degree_panorama) && panorama_viewer_is_360_degree_panorama()) {
        return $data;
    }
    // Logged in user can view annotations? (see check for guests some lines below)
    if (USER_ID && annotate_get_level('permissions') == 0) {
        return $data;
    }
    global $cpg_udb;
    $notes = array();
    $sql = "SELECT n.*, u." . $cpg_udb->field['username'] . " AS user_name FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN " . $cpg_udb->usertable . " u ON n.user_id = u." . $cpg_udb->field['user_id'] . " WHERE n.pid = {$data['pid']} ORDER BY note ASC";
    $result = cpg_db_query($sql);
    while ($row = mysql_fetch_assoc($result)) {
        //$row['note'] = addslashes($row['note']);
        $notes[] = $row;
    }
    mysql_free_result($result);
    $nr_notes = count($notes);
    // Promote annotations to guests
    if (!USER_ID && annotate_get_level('permissions') == 0) {
        $result = cpg_db_query("SELECT MAX(value) FROM {$CONFIG['TABLE_CONFIG']} WHERE name LIKE 'plugin_annotate_permissions_%'");
        $max_permission_level = mysql_result($result, 0);
        mysql_free_result($result);
        if ($max_permission_level >= 1 && $nr_notes > 0 && $CONFIG['allow_user_registration'] != 0) {
            if ($nr_notes == 1) {
                $data['footer'] .= $lang_plugin_annotate['1_annotation_for_file'] . '<br />' . $LINEBREAK;
            } elseif ($nr_notes > 1) {
                $data['footer'] .= sprintf($lang_plugin_annotate['x_annotations_for_file'], $nr_notes) . '<br />' . $LINEBREAK;
            }
            $data['footer'] .= sprintf($lang_plugin_annotate['registration_promotion'], '<a href="login.php?referer=' . $REFERER . '">', '</a>', '<a href="register.php?referer=' . $REFERER . '">', '</a>');
        }
        return $data;
    }
    set_js_var('pid', $data['pid']);
    set_js_var('annotations', $notes);
    // Determine if the user is allowed to have that button
    if (annotate_get_level('permissions') >= 2) {
        $menu_buttons = "";
        // list existing annotations of the currently viewed album
        $btns_person = "";
        if (annotate_get_level('display_notes') == 1) {
            $superCage = Inspekt::MakeSuperCage();
            if ($superCage->get->testInt('album')) {
                $result = cpg_db_query("\n                    SELECT DISTINCT note FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n\n                    INNER JOIN {$CONFIG['TABLE_PICTURES']} p\n                    ON p.pid = n.pid\n                    WHERE p.aid = " . $superCage->get->getInt('album') . "\n                    ORDER BY note\n                ");
                if (mysql_num_rows($result)) {
                    $btns_person .= "<div id=\"btns_person\" style=\"white-space:normal; cursor:default;\"> {$lang_plugin_annotate['rapid_annotation']}: ";
                    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
                        $note = stripslashes($row[0]);
                        $btns_person .= "<button onclick=\"return addnote('{$row[0]}')\" class=\"admin_menu\" title=\"" . sprintf($lang_plugin_annotate['annotate_x_on_this_pic'], $note) . "\">{$note}</button> ";
                    }
                    $btns_person .= "</div><hr />";
                    $data['menu'] = $btns_person . $data['menu'];
                }
                mysql_free_result($result);
            }
        }
        // free text
        if ($CONFIG['plugin_annotate_type'] == 1 || $CONFIG['plugin_annotate_type'] == 3) {
            $menu_buttons .= <<<EOT
            <script type="text/javascript">
                document.write('<li><a href="javascript:void();" title="{$lang_plugin_annotate['plugin_name']}" onclick="return addnote(\\'\\');" rel="nofollow">');
                document.write('<span>{$annotate_icon_array['annotate']}{$lang_plugin_annotate['annotate']}</span>');
                document.write('</a></li>');
            </script>
EOT;
        }
        // list of annotions or user names
        if ($CONFIG['plugin_annotate_type'] != 1) {
            $select_box = '<select id="livesearch_output" size="1" class="button" style="margin-left: 12px;" onmousedown="load_annotation_list();" onmouseover="load_annotation_list();" onchange="return addnote(this.options[this.selectedIndex].value);"><option selected=\\"selected\\" disabled=\\"disabled\\">-- ' . $lang_plugin_annotate['annotate'] . ' --</option></select>';
            $loading_replacement = '<span id="livesearch_output_loading" style="display: none; margin-right: 4px;"><img src="images/loader.gif" /></span>';
            $livesearch_button = '<input id="livesearch_input" type="text" class="textinput" size="8" title="' . $lang_plugin_annotate['filter_annotations'] . '" style="cursor:help; padding-right: 16px; background-image: url(images/icons/search.png); background-repeat: no-repeat; background-position: right center;" />';
            $menu_buttons .= <<<EOT
            <script type="text/javascript">
                document.write('<li>{$select_box}{$loading_replacement}&nbsp;{$livesearch_button}</li>');
            </script>
EOT;
        }
    }
    $html =& $data['html'];
    $html = str_replace("<img ", "<img style=\"padding:0px\" ", $html);
    if (function_exists(panorama_viewer_image)) {
        $search = "/(<table.*style=\"table-layout:fixed.*<div style=\"overflow:auto.*>)(.*)(<\\/div><\\/td><\\/tr><\\/table>)/Uis";
        preg_match($search, $html, $panorama_viewer_matches);
        $html = preg_replace($search, "\\2", $html);
    }
    $container_width = $data['pwidth'];
    if ($data['mode'] == 'normal') {
        $imagesize = getimagesize($CONFIG['fullpath'] . $data['filepath'] . $CONFIG['normal_pfx'] . $data['filename']);
        $container_width = $imagesize[0];
    }
    $container_width += 4;
    set_js_var('container_width', $container_width);
    $html = '<div class="Photo fn-container" style="width:' . $container_width . 'px;" id="PhotoContainer">' . $html . '</div>';
    if (function_exists(panorama_viewer_image)) {
        $html = $panorama_viewer_matches[1] . $html . $panorama_viewer_matches[3];
    }
    // list annotations from the currently viewed picture and generate link to meta album
    if (annotate_get_level('display_links') == 1 && $nr_notes > 0) {
        set_js_var('lang_on_this_pic', $lang_plugin_annotate['on_this_pic']);
        set_js_var('lang_all_pics_of', $lang_plugin_annotate['all_pics_of']);
        $html = "<div id=\"on_this_pic\"></div>" . $html;
    }
    // Display annotation statistics of the currently viewed album
    if (annotate_get_level('display_stats') == 1) {
        $superCage = Inspekt::MakeSuperCage();
        if ($superCage->get->testInt('album')) {
            $annotations_pic = $nr_notes;
            $annotated_pics = mysql_num_rows(cpg_db_query("SELECT DISTINCT n.pid FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN {$CONFIG['TABLE_PICTURES']} p ON p.pid = n.pid WHERE p.aid = " . $superCage->get->getInt('album')));
            $annotations_album = mysql_num_rows(cpg_db_query("SELECT DISTINCT n.nid FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN {$CONFIG['TABLE_PICTURES']} p ON p.pid = n.pid WHERE p.aid = " . $superCage->get->getInt('album')));
            $annotation_stats = "\n                <span title=\"{$lang_plugin_annotate['annotations_pic']}\">({$annotations_pic})</span>\n                <span title=\"{$lang_plugin_annotate['annotations_album']}\">({$annotations_album})</span>\n                <span title=\"{$lang_plugin_annotate['annotated_pics']}\">({$annotated_pics})</span>\n            ";
            $menu_buttons .= '<li>&nbsp;' . $annotation_stats . '</li>';
        }
    }
    if (empty($data['menu']) || substr($data['menu'], -6) == '<hr />') {
        $data['menu'] .= '<div class="buttonlist align_right"><ul>' . $menu_buttons . '</ul></div>';
    } else {
        $data['menu'] = str_replace('</ul>', $menu_buttons . '</ul>', $data['menu']);
    }
    return $data;
}
            }
            $withinSectionLoopCounter++;
            $tabindexCounter++;
        }
        $admin_page .= <<<EOT
                    </table>
                </div>
            </td>
          </tr>
EOT;
        $sectionLoopCounter++;
    }
    // foreach-loop through the config sections
}
// "Regular" config page --- start
set_js_var('default_values_check', $js_default_values);
pageheader($lang_admin_php['title']);
echo $admin_page;
if ($superCage->get->keyExists('restore') != TRUE) {
    echo <<<EOT
          <tr>
            <td align="left" class="tablef" colspan="2">
                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                        <td width="33%">
                            <button type="button" class="button detail_expand_all" name="expandallbottom" id="expandallbottom" onclick="return false">
                                <img src="images/tree/plus.gif" width="9" height="9" border="0" alt="" title="{$lang_admin_php['expand_all']}" />
                                {$lang_admin_php['expand_all']}
                            </button>
                            <button type="button" class="button detail_collapse_all" name="collapseallbottom" id="collapseallbottom" style="display:none;" onclick="return false">
                                <img src="images/tree/minus.gif" width="9" height="9" border="0" alt="" title="{$lang_admin_php['collapse_all']}" />
Example #7
0
function social_bookmarks_page_meta($var)
{
    global $CONFIG, $JS, $lang_plugin_social_bookmarks, $LINEBREAK;
    require_once './plugins/social_bookmarks/init.inc.php';
    $var = '<link rel="stylesheet" href="plugins/social_bookmarks/style.css" type="text/css" />' . $LINEBREAK . $var;
    if ($CONFIG['plugin_social_bookmarks_position'] == '2' || $CONFIG['plugin_social_bookmarks_position'] == '3') {
        // define some vars that need to exist in JS
        set_js_var('bookmarks_position', $CONFIG['plugin_social_bookmarks_position']);
        set_js_var('bookmarks_visibility', $CONFIG['plugin_social_bookmarks_visibility']);
        set_js_var('bookmarks_layout', $CONFIG['plugin_social_bookmarks_layout']);
        set_js_var('bookmarks_greyout', $CONFIG['plugin_social_bookmarks_greyout']);
        set_js_var('bookmarks_content', social_bookmarks_content());
    }
    return $var;
}
    }
    $ALBUM_DATA = mysql_fetch_assoc($results);
    $CLEAN['album'] = $ALBUM_DATA['aid'];
} else {
    $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$CLEAN['album']}'");
    if (!mysql_num_rows($results)) {
        cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
    }
    $ALBUM_DATA = mysql_fetch_assoc($results);
}
$cat = $ALBUM_DATA['category'];
$actual_cat = $cat;
//////////// main code start ///////////////////
js_include('js/modifyalb.js');
set_js_var('reset_views_confirm', $lang_modifyalb_php['reset_views_confirm']);
set_js_var('cursor_stop', $icon_array['stop']);
pageheader(sprintf($lang_modifyalb_php['upd_alb_n'], $ALBUM_DATA['title']));
$album_lb = alb_list_box();
echo <<<EOT
    <form method="post" name="modifyalbum" action="db_input.php">
    <input type="hidden" name="event" value="album_update" />
    <input type="hidden" name="aid" value="{$CLEAN['album']}" />
EOT;
starttable("100%", cpg_fetch_icon('modifyalb', 1) . $lang_common['album_properties'] . ' - ' . $lang_modifyalb_php['update'] . $help['table'], 2, 'cpg_zebra');
echo <<<EOT
    <tr>
        <td class="tableh2">
            <strong>{$lang_modifyalb_php['related_tasks']}</strong>{$help['related_tasks']}
        </td>
        <td class="tableh2" align="center">
            <a href="editpics.php?album={$CLEAN['album']}" class="admin_menu">{$icon_array['edit_files']}{$lang_modifyalb_php['edit_files']}</a>
Example #9
0
}
if (!GALLERY_ADMIN_MODE && USER_ADMIN_MODE) {
    if ($cat == 0) {
        if (USER_CAN_CREATE_PRIVATE_ALBUMS) {
            $cat = USER_ID + FIRST_USER_CAT;
        } else {
            // user is only allowed to create public albums - get first category the user is allowed to create albums in
            $result = cpg_db_query("SELECT cm.cid FROM {$CONFIG['TABLE_CATMAP']} AS cm INNER JOIN {$CONFIG['TABLE_CATEGORIES']} AS c ON cm.cid = c.cid WHERE cm.group_id in (" . implode(",", $USER_DATA['groups']) . ") ORDER BY pos LIMIT 1");
            $cat = $result->result(0, 0, true);
        }
    }
    // only list the albums owned by the user
    $user_id = USER_ID;
}
// set the cat value
set_js_var('category', $cat);
pageheader($lang_albmgr_php['title']);
echo <<<EOT
        <form name="album_menu" id="cpg_form_album" method="post" action="delete.php?what=albmgr">
            <input type="hidden" name="form_token" value="{$form_token}" />
            <input type="hidden" name="timestamp" value="{$timestamp}" />

EOT;
starttable('100%', cpg_fetch_icon('alb_mgr', 2) . $lang_albmgr_php['title'] . '&nbsp;' . cpg_display_help('f=albums.htm&amp;as=albmgr&amp;ae=albmgr_end&amp;top=1', '600', '400'), 1, '');
echo <<<EOT
        <tr class="noscript">
            <td class="tableh2">
                <noscript>
                    {$lang_common['javascript_needed']}
                </noscript>
            </td>
Example #10
0
$raw_ip = $superCage->server->testIp('REMOTE_ADDR') ? $superCage->server->getEscaped('REMOTE_ADDR') : '0.0.0.0';
if ($superCage->server->testIp('HTTP_CLIENT_IP')) {
    $hdr_ip = $superCage->server->getEscaped('HTTP_CLIENT_IP');
} else {
    if ($superCage->server->testIp('HTTP_X_FORWARDED_FOR')) {
        $hdr_ip = $superCage->server->getEscaped('X_FORWARDED_FOR');
    } else {
        $hdr_ip = $raw_ip;
    }
}
/*if (!preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $raw_ip)) $raw_ip = '0.0.0.0';
if (!preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $hdr_ip)) $hdr_ip = '0.0.0.0';*/
// Reference 'site_url' to 'ecards_more_pic_target'
$CONFIG['site_url'] =& $CONFIG['ecards_more_pic_target'];
// Set the site_url in js_vars so that it can be used in js
set_js_var('site_url', rtrim($CONFIG['site_url'], '/'));
// Set default language (set up by the admin) as a constant, since it might get replaced during runtime
define('DEFAULT_LANGUAGE', $CONFIG['lang']);
// Include logger functions
include_once 'include/logger.inc.php';
// Include media functions
require 'include/media.functions.inc.php';
// Check for GD GIF Create support
if ($CONFIG['thumb_method'] == 'im' || function_exists('imagecreatefromgif')) {
    $CONFIG['GIF_support'] = 1;
} else {
    $CONFIG['GIF_support'] = 0;
}
// Include plugin API
require 'include/plugin_api.inc.php';
if ($CONFIG['enable_plugins'] == 1) {
Example #11
0
$lang_meta_album_names['lastupby'] = $lang_meta_album_names['lastup'];
$lang_meta_album_names['lastcomby'] = $lang_meta_album_names['lastcom'];
if (isset($album) && is_numeric($album)) {
    $result = cpg_db_query("SELECT category, title, aid, keyword, description, alb_password_hint FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = {$album}");
    if ($result->numRows() > 0) {
        $CURRENT_ALBUM_DATA = $result->fetchAssoc();
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
        $CURRENT_ALBUM_KEYWORD = $CURRENT_ALBUM_DATA['keyword'];
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
        $cat = -$album;
    }
    $result->free();
    if ($CONFIG['custom_sortorder_thumbs']) {
        //show sort options only when not a meta album
        $js_sort_vars = array('aid' => $album, 'page' => $page, 'sort_name' => $lang_thumb_view['name'], 'sort_title' => $lang_common['title'], 'sort_date' => $lang_thumb_view['date'], 'sort_position' => $lang_thumb_view['position'], 'sort_ta' => $lang_thumb_view['sort_ta'], 'sort_td' => $lang_thumb_view['sort_td'], 'sort_na' => $lang_thumb_view['sort_na'], 'sort_nd' => $lang_thumb_view['sort_nd'], 'sort_da' => $lang_thumb_view['sort_da'], 'sort_dd' => $lang_thumb_view['sort_dd'], 'sort_pa' => $lang_thumb_view['sort_pa'], 'sort_pd' => $lang_thumb_view['sort_pd']);
        set_js_var('sort_vars', $js_sort_vars);
        js_include('js/thumbnails.js');
    }
    // Meta albums, we need to restrict the albums to the current category
    // except lastupby and lastcomby as CPG currently restricts these to the user's albums
} elseif (isset($cat) && $album != 'lastupby' && $album != 'lastcomby') {
    if ($cat < 0) {
        $result = cpg_db_query("SELECT category, title, aid, keyword, description, alb_password_hint FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = " . -$cat);
        if ($result->numRows() > 0) {
            $CURRENT_ALBUM_DATA = $result->fetchAssoc();
            $actual_cat = $CURRENT_ALBUM_DATA['category'];
            $CURRENT_ALBUM_KEYWORD = $CURRENT_ALBUM_DATA['keyword'];
        }
        $result->free();
        get_meta_album_set($cat);
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
Example #12
0
/**
 * display_slideshow()
 *
 * gets data for thumbnails in an album for the film stript using Ajax call
 *
 * this added by Nuwan Sameera Hettiarachchi
 *
 * @param integer $album
 * @param integer $cat
 * @param integer $pos
 **/
function &display_slideshow($pos, $ajax_show = 0)
{
    global $CONFIG, $lang_display_image_php, $template_display_media, $lang_common, $album, $pid, $slideshow;
    global $cat, $date;
    print $Pid;
    $Pic = array();
    $Pid = array();
    $Title = array();
    $i = 0;
    $j = 0;
    $a = 0;
    //$pid = (int)$_GET['pid'];
    $start_img = '';
    $pic_data = get_pic_data($album, $pic_count, $album_name, -1, -1, false);
    foreach ($pic_data as $picture) {
        if ($CONFIG['thumb_use'] == 'ht' && $picture['pheight'] > $CONFIG['picture_width']) {
            // The wierd comparision is because only picture_width is stored
            $condition = true;
        } elseif ($CONFIG['thumb_use'] == 'wd' && $picture['pwidth'] > $CONFIG['picture_width']) {
            $condition = true;
        } elseif ($CONFIG['thumb_use'] == 'any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']) {
            $condition = true;
            //thumb cropping
        } elseif ($CONFIG['thumb_use'] == 'ex' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']) {
            $condition = true;
        } else {
            $condition = false;
        }
        if (is_image($picture['filename'])) {
            if ($CONFIG['make_intermediate'] && $condition) {
                $picture_url = get_pic_url($picture, 'normal');
            } else {
                $picture_url = get_pic_url($picture, 'fullsize');
            }
            if ($picture['title']) {
                $Title_get = $picture['title'];
            } else {
                $Title_get = $picture['filename'];
            }
            $Pic[$i] = htmlspecialchars($picture_url, ENT_QUOTES);
            $Pid[$i] = $picture['pid'];
            $Title[$i] = $Title_get;
            if ($picture['pid'] == $pid) {
                $j = $i;
                $start_img = $picture_url;
            }
            $i++;
        }
    }
    $Pic_length = count($Pic);
    set_js_var('Time', $slideshow);
    set_js_var('Pic_count', $Pic_length);
    set_js_var('Pid', $pid);
    if (!$i) {
        echo "Pic[0] = 'images/thumb_document.jpg'\n";
    }
    if ($ajax_show == 0) {
        theme_slideshow($Pic[$pos], $Title[$pos]);
    }
    $a = array('url' => $Pic[$pos], 'title' => $Title[$pos], 'pid' => $Pid[$pos]);
    $a_jons = json_encode($a);
    if ($ajax_show == 1) {
        echo $a_jons;
    }
}
Example #13
0
                    $select .= "</optgroup>\n";
                }
                $select .= '<optgroup label="' . $val['cat'] . '">' . "\n";
                $alb_cat = $val['cat'];
            }
            $select .= '<option value="' . $val['aid'] . '"' . ($val['aid'] == $aid ? ' selected="selected"' : '') . '>   ' . $val['title'] . "</option>\n";
        }
        if ($alb_cat) {
            $select .= "</optgroup>\n";
        }
    }
    return "\n<select name=\"{$id}\" class=\"listbox\"  >\n{$select}</select>\n";
}
/**set js variable to changes albums*/
$change_album = $lang_picmgr_php['change_album'];
set_js_var('change_album', $change_album);
pageheader($lang_picmgr_php['pic_mgr']);
?>


<form name="picture_menu" id="cpgformPic" method="post" action="delete.php?what=picmgr" >
<?php 
starttable("100%", $lang_picmgr_php['pic_mgr'], 1);
?>
<noscript>
<tr>
                <td colspan="2" class="tableh2">
                <?php 
echo $lang_common['javascript_needed'];
?>
                </td>
Example #14
0
    function lightbox_notes_for_net_header($html)
    {
        global $CONFIG, $JS, $THEME_DIR, $lang_plugin_lightbox_notes_for_net, $template_header, $USER;
        require_once './plugins/lightbox_notes_for_net/init.inc.php';
        if (in_array('plugins/lightbox_notes_for_net/script.js', $JS['includes']) != TRUE) {
            $JS['includes'][] = 'plugins/lightbox_notes_for_net/script.js';
        }
        set_js_var('plugin_lightbox_nfn_border', $CONFIG['plugin_lightbox_nfn_border']);
        set_js_var('plugin_lightbox_nfn_sizespeed', $CONFIG['plugin_lightbox_nfn_sizespeed']);
        set_js_var('plugin_lightbox_nfn_slidetime', $CONFIG['plugin_lightbox_nfn_slidetime']);
        set_js_var('plugin_lightbox_nfn_imagefade', $CONFIG['plugin_lightbox_nfn_imagefade']);
        set_js_var('plugin_lightbox_nfn_containerfade', $CONFIG['plugin_lightbox_nfn_containerfade']);
        set_js_var('plugin_lightbox_nfn_notimer', $CONFIG['plugin_lightbox_nfn_notimer']);
        set_js_var('plugin_lightbox_nfn_image_exit', $CONFIG['plugin_lightbox_nfn_image_exit']);
        set_js_var('plugin_lightbox_nfn_nocorner', $CONFIG['plugin_lightbox_nfn_nocorner']);
        set_js_var('plugin_lightbox_nfn_fade_swap', $CONFIG['plugin_lightbox_nfn_fade_swap']);
        set_js_var('plugin_lightbox_nfn_resize', $CONFIG['plugin_lightbox_nfn_resize']);
        if ($CONFIG['plugin_lightbox_nfn_buttonset'] == '1') {
            set_js_var('plugin_lightbox_nfn_image_loading', 'plugins/lightbox_notes_for_net/images/loading.gif');
            set_js_var('plugin_lightbox_nfn_image_btnprev', 'plugins/lightbox_notes_for_net/images/prev.png');
            set_js_var('plugin_lightbox_nfn_image_btnnext', 'plugins/lightbox_notes_for_net/images/next.png');
            set_js_var('plugin_lightbox_nfn_image_btnclose', 'plugins/lightbox_notes_for_net/images/close.png');
            set_js_var('plugin_lightbox_nfn_image_btnbottomprev', 'plugins/lightbox_notes_for_net/images/back_bot.png');
            set_js_var('plugin_lightbox_nfn_image_btnbottomnext', 'plugins/lightbox_notes_for_net/images/start.png');
            set_js_var('plugin_lightbox_nfn_image_btnplay', 'plugins/lightbox_notes_for_net/images/start.png');
            set_js_var('plugin_lightbox_nfn_image_btnstop', 'plugins/lightbox_notes_for_net/images/pause.png');
        } else {
            if (defined('THEME_HAS_NAVBAR_GRAPHICS')) {
                $theme_navbar_folder = $THEME_DIR;
            } else {
                $theme_navbar_folder = '';
            }
            if (defined('THEME_HAS_PROGRESS_GRAPHICS')) {
                $theme_image_folder = $THEME_DIR;
            } else {
                $theme_image_folder = '';
            }
            set_js_var('plugin_lightbox_nfn_image_loading', $theme_image_folder . 'images/loader.gif');
            set_js_var('plugin_lightbox_nfn_image_btnprev', $theme_navbar_folder . 'images/icons/left.png');
            set_js_var('plugin_lightbox_nfn_image_btnnext', $theme_navbar_folder . 'images/icons/right.png');
            set_js_var('plugin_lightbox_nfn_image_btnclose', $theme_navbar_folder . 'images/icons/close.png');
            set_js_var('plugin_lightbox_nfn_image_btnbottomprev', $theme_navbar_folder . 'images/icons/left.png');
            set_js_var('plugin_lightbox_nfn_image_btnbottomnext', $theme_navbar_folder . 'images/icons/right.png');
            set_js_var('plugin_lightbox_nfn_image_btnplay', $theme_navbar_folder . 'images/icons/slideshow.png');
            set_js_var('plugin_lightbox_nfn_image_btnstop', $theme_navbar_folder . 'images/icons/cancel.png');
        }
        set_js_var('lang_lightbox_nfn_image', $lang_plugin_lightbox_notes_for_net['image']);
        set_js_var('lang_lightbox_nfn_of', $lang_plugin_lightbox_notes_for_net['of']);
        set_js_var('lang_lightbox_nfn_previous', $lang_plugin_lightbox_notes_for_net['previous']);
        set_js_var('lang_lightbox_nfn_next', $lang_plugin_lightbox_notes_for_net['next']);
        set_js_var('lang_lightbox_nfn_close', $lang_plugin_lightbox_notes_for_net['close']);
        set_js_var('lang_lightbox_nfn_start_slideshow', $lang_plugin_lightbox_notes_for_net['start_slideshow']);
        set_js_var('lang_lightbox_nfn_pause_slideshow', $lang_plugin_lightbox_notes_for_net['pause_slideshow']);
        set_js_var('lang_lightbox_nfn_downloadtext', $lang_plugin_lightbox_notes_for_net['download_text']);
        set_js_var('lang_lightbox_nfn_downloadtitle', $lang_plugin_lightbox_notes_for_net['download_title']);
        $border = $CONFIG['plugin_lightbox_nfn_border'];
        $lightbox_meta = <<<EOT
<link rel="stylesheet" href="plugins/lightbox_notes_for_net/style.css" type="text/css" media="screen" /> 
<style type="text/css"> #lightbox-container-image {height: 100%; padding: {$border}px;} </style>
EOT;
        return $lightbox_meta . $html;
    }
Example #15
0
    $redirector = '';
    $countdown = '';
} else {
    $redirector = '<meta http-equiv="refresh" content="' . $CONFIG['plugin_newsletter_page_refresh_delay'] . '; URL=index.php?file=newsletter/send&amp;time=' . $timestamp_start . '&amp;counter=' . $processed_records_counter . '" />';
    $countdown = <<<EOT
    <tr>
        <td class="tableb tableb_alternate">
EOT;
    $countdown .= sprintf($lang_plugin_newsletter['page_will_refresh_in_x'], '<span id="countdown"></span>');
    $countdown .= <<<EOT
        </td>
    </tr>
EOT;
    set_js_var('page_refresh_delay', $CONFIG['plugin_newsletter_page_refresh_delay']);
    set_js_var('reloading', strtoupper($lang_plugin_newsletter['reloading']));
    set_js_var('reload_url', 'index.php?file=newsletter/send&time=' . $timestamp_start . '&counter=' . $processed_records_counter);
    if (in_array('plugins/newsletter/js/jquery.countdown.js', $JS['includes']) != TRUE) {
        $JS['includes'][] = 'plugins/newsletter/js/jquery.countdown.js';
    }
}
pageheader($lang_plugin_newsletter['send_mailings'], $redirector);
if ($CONFIG['plugin_newsletter_mails_per_page'] == '1') {
    $mails_per_page = $lang_plugin_newsletter['one_email'];
} else {
    $mails_per_page = sprintf($lang_plugin_newsletter['x_emails'], $CONFIG['plugin_newsletter_mails_per_page']);
}
if ($CONFIG['plugin_newsletter_page_refresh_delay'] == '1') {
    $page_refresh_delay = $lang_plugin_newsletter['second'];
} elseif ($CONFIG['plugin_newsletter_page_refresh_delay'] == '60') {
    $page_refresh_delay = $lang_plugin_newsletter['minute'];
} elseif ($CONFIG['plugin_newsletter_page_refresh_delay'] > '60' && $CONFIG['plugin_newsletter_page_refresh_delay'] / 60 == floor($CONFIG['plugin_newsletter_page_refresh_delay'] / 60)) {
define('IN_COPPERMINE', true);
define('CONTACT_PHP', true);
require_once 'include/init.inc.php';
require_once 'include/mailer.inc.php';
if (USER_ID) {
    $USER_DATA = array_merge($USER_DATA, $cpg_udb->get_user_infos(USER_ID));
}
$icon_array['ok'] = cpg_fetch_icon('ok', 1);
$js_contact['check']['one'] = !USER_ID && $CONFIG['contact_form_guest_name_field'] == 2 ? true : false;
$js_contact['check']['two'] = !USER_ID ? true : false;
$js_contact['check']['three'] = !USER_ID && $CONFIG['contact_form_guest_email_field'] == 2 ? true : false;
$js_contact['check']['four'] = $CONFIG['contact_form_subject_field'] == 2 ? true : false;
$js_contact['your_name'] = $lang_contact_php['your_name'];
$js_contact['name_field_invalid'] = $lang_contact_php['name_field_invalid'];
$js_contact['email_field_invalid'] = $lang_contact_php['email_field_invalid'];
set_js_var('contact', $js_contact);
unset($js_contact);
js_include('js/contact.js');
// determine if the visitor is allowed to access
if (!USER_ID) {
    // visitor is guest
    if ($CONFIG['contact_form_guest_enable'] == 0) {
        cpg_die($lang_common['error'], $lang_errors['access_denied'], __FILE__, __LINE__);
        //guests are not allowed
    }
} else {
    // visitor is a registered user
    if ($CONFIG['contact_form_registered_enable'] == 0 && !GALLERY_ADMIN_MODE) {
        cpg_die($lang_common['error'], $lang_errors['access_denied'], __FILE__, __LINE__);
        //registered users are not allowed
    }
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.

  ********************************************
  Coppermine version: 1.5.40
  $HeadURL: https://svn.code.sf.net/p/coppermine/code/trunk/cpg1.5.x/profile.php $
  $Revision: 8830 $
**********************************************/
define('IN_COPPERMINE', true);
define('PROFILE_PHP', true);
define('USERMGR_PHP', true);
require 'include/init.inc.php';
include "include/smilies.inc.php";
set_js_var('lang_really_delete', $lang_register_php['really_delete']);
js_include('js/profile.js');
$cpg_udb->view_profile($superCage->get->getInt('uid'));
$icon_array = array('ok' => cpg_fetch_icon('ok', 0), 'password' => cpg_fetch_icon('key_enter', 0), 'delete' => cpg_fetch_icon('delete', 0), 'edit' => cpg_fetch_icon('edit', 2));
function cpgUserPicCount($uid)
{
    global $CONFIG;
    $result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = {$uid}");
    list($pic_count) = mysql_fetch_row($result);
    mysql_free_result($result);
    return $pic_count;
}
function cpgUserThumb($uid)
{
    global $CONFIG, $FORBIDDEN_SET;
    $query = "SELECT COUNT(*), MAX(pid) FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE owner_id = '{$uid}' AND approved = 'YES' {$FORBIDDEN_SET}";
}
if ($CONFIG['user_field3_name'] != '') {
    $THUMB_ROWSPAN++;
}
if ($CONFIG['user_field4_name'] != '') {
    $THUMB_ROWSPAN++;
}
$public_can_edit_pics = GALLERY_ADMIN_MODE ? 1 : $CONFIG['users_can_edit_pics'];
set_js_var('confirm_move', $lang_editpics_php['confirm_move']);
set_js_var('note_approve_public', $lang_editpics_php['note_approve_public']);
set_js_var('note_approve_private', $lang_editpics_php['note_approve_private']);
set_js_var('note_edit_control', $lang_editpics_php['note_edit_control']);
set_js_var('public_need_approval', $USER_DATA['pub_upl_need_approval']);
set_js_var('private_need_approval', $USER_DATA['priv_upl_need_approval']);
set_js_var('public_can_edit_pics', $public_can_edit_pics);
set_js_var('pic_currently_public', $CURRENT_PIC['category'] < FIRST_USER_CAT ? 1 : 0);
pageheader($lang_editpics_php['edit_pic']);
if ($superCage->post->keyExists('apply_changes')) {
    starttable('100%', cpg_fetch_icon('info', 2) . $lang_common['information'], 1);
    echo <<<EOT
    <tr>
        <td class="tableb">
            <ul>
                <li style="list-style-image:url(images/icons/ok.png)">{$lang_editpics_php['success_changes']}</li>
            </ul>
        </td>
    </tr>
EOT;
    endtable();
}
echo <<<EOT
    case 'da':
        $sortBy = 'date';
        $sortDirection = 'ASC';
        break;
}
if ($sortDirection == 'ASC') {
    $sortDirectionText = $lang_db_ecard_php['ecard_ascending'];
}
// determine the total number of entries
$result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_ECARDS']}");
list($totalEcards) = mysql_fetch_row($result);
mysql_free_result($result);
if ($totalEcards == 0) {
    cpg_die(INFORMATION, $lang_errors['ecards_empty'], __FILE__, __LINE__, false);
}
set_js_var('ecards_delete_confirm', $lang_db_ecard_php['ecards_delete_confirm']);
js_include('js/db_ecard.js');
pageheader($lang_db_ecard_php['title']);
$formTarget = cpgGetUrlVars('count');
print '<form method="post" name="ecardselect" id="cpgform" action="' . $formTarget . '" onsubmit="return defaultagree(this)">';
// create tabbed display (non-coppermine standard); maybe this could be changed later using the coppermine standard method
// step 1: calculate the number of pages
$pageTotal = ceil($totalEcards / $countTo);
// step 2: get the current url without 'start' and 'count'
$urlWithoutStart = $CPG_PHP_SELF . "?";
foreach ($eid as $key => $value) {
    if ($key != 'start' && $key != 'count') {
        $urlWithoutStart .= $key . "=" . $value . "&";
    }
}
//step 3: loop through the pages & create the links
Example #20
0
            alb_get_subcat_data($subcat['cid'], $ident . '&nbsp;&nbsp;&nbsp;');
        }
    }
}
/**set the message varialble to javascript file*/
$confirm_modifs = $lang_albmgr_php['confirm_modifs'];
set_js_var('confirm_modifs', $confirm_modifs);
/**Albums delete confirem message*/
$confirm_delete = $lang_albmgr_php['confirm_delete1'] . "\n" . $lang_albmgr_php['confirm_delete2'];
set_js_var("confirm_delete", $confirm_delete);
/**When user try to delete albums without any selections*/
$delete_not_selected = $lang_albmgr_php['select_first'];
set_js_var('dontDelete', $delete_not_selected);
/**when user change the category*/
$category_change = $lang_albmgr_php['category_change'];
set_js_var('category_change', $category_change);
pageheader($lang_albmgr_php['alb_mrg']);
?>
<form name="album_menu" id="cpgformAlbum" method="post" action="delete.php?what=albmgr" >

<?php 
starttable("100%", $lang_albmgr_php['alb_mrg'] . '&nbsp;' . cpg_display_help('f=albums.htm&as=albmgr&ae=albmgr_end&top=1', '600', '400'), 1);
?>
	<noscript>
		<tr>
			<td colspan="2" class="tableh2">
			 <?php 
echo $lang_common['javascript_needed'];
?>
			</td>
		</tr>
Example #21
0
                </td>
        </tr>
        <tr>
                <td class="tablef" colspan="4" align="center">
                {$add_more_folder}
                </td>
        </tr>
EOT;
    endtable();
    pagefooter();
    //} elseif (isset($_GET['startdir'])) {
} elseif ($superCage->get->keyExists('startdir') && ($matches = $superCage->get->getMatched('startdir', '/^[0-9A-Za-z\\/\\\\_\\-\\s]+$/'))) {
    $startdir = str_replace('\\', '/', $matches[0]);
    set_js_var('no_album_selected', $lang_search_new_php['no_album']);
    set_js_var('no_file_selected', $lang_search_new_php['no_file']);
    set_js_var('proc_limit', $CONFIG['batch_proc_limit']);
    pageheader($lang_search_new_php['page_title']);
    $help = '&nbsp;' . cpg_display_help('f=uploading.htm&amp;as=ftp&amp;ae=ftp_end&amp;top=1#ftp_select_file', '550', '400');
    echo <<<EOT
        <form method="post" action="{$CPG_PHP_SELF}?insert=1" name="selectPics" id="cpgform" style="margin:0px;padding:0px">
EOT;
    echo '<div id="queue">';
    starttable("100%");
    echo <<<EOT
        <tr>
                <td colspan="4" class="tableh1"><h2>{$lang_search_new_php['list_new_pic']}{$help}</h2></td>
        </tr>

EOT;
    $expic_array = array();
    getallpicindb($expic_array, $startdir);
Example #22
0
 function generate_bbcode_tags($form = 'post', $field = 'icon')
 {
     $html = "";
     // check if plugin 'bbcode_control' is installed
     if (function_exists(get_bbcode_tags) && function_exists(special_open_tag) && function_exists(special_close_tag)) {
         // language detection
         $lang = isset($CONFIG['lang']) ? $CONFIG['lang'] : 'english';
         include 'plugins/bbcode_control/lang/english.php';
         if (in_array($lang, $enabled_languages_array) == TRUE && file_exists('plugins/bbcode_control/lang/' . $lang . '.php')) {
             include 'plugins/bbcode_control/lang/' . $lang . '.php';
         }
         set_js_var('lang_please_enter_text', $lang_plugin_bbcode_control['please_enter_text']);
         set_js_var('lang_insert_at_position', $lang_plugin_bbcode_control['insert_at_position']);
         $bbcode_tags = get_bbcode_tags('enabled');
         foreach ($bbcode_tags as $tag) {
             $opentag = special_open_tag($tag);
             $closetag = special_close_tag($tag);
             $html .= "<img onclick=\"javascript:insert_bbcode_tag('{$opentag}', '{$closetag}', '{$form}', '{$field}')\" src=\"plugins/bbcode_control/images/{$tag}.png\" title=\"{$lang_plugin_bbcode_control[$tag]}\" alt=\"{$tag}\" class=\"button\" style=\"cursor:pointer;\" width=\"20\" height=\"16\" /> ";
         }
     } else {
         $bbcode_tags = array('b', 'u', 'i', 'img', 'url', 'email');
         foreach ($bbcode_tags as $tag) {
             $html .= "<input type=\"button\" class=\"button\" value=\"{$tag}\" onclick=\"javascript:insert_bbcode_tag('[{$tag}]', '[/{$tag}]', '{$form}', '{$field}');\"> ";
         }
     }
     return $html;
 }
function theme_html_rating_box()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR, $USER_DATA, $USER, $LINEBREAK;
    global $template_image_rating, $template_image_rating_oldstyle, $lang_rate_pic, $raw_ip;
    if (!(USER_CAN_RATE_PICTURES && $CURRENT_ALBUM_DATA['votes'] == 'YES')) {
        return '';
    } else {
        //check if the users already voted or if this user is the owner
        $user_md5_id = USER_ID ? md5(USER_ID) : $USER['ID'];
        $result_votes = cpg_db_query("SELECT null FROM {$CONFIG['TABLE_VOTES']} WHERE pic_id= {$CURRENT_PIC_DATA['pid']} AND user_md5_id='{$user_md5_id}'");
        $result_vote_stats = cpg_db_query("SELECT null FROM {$CONFIG['TABLE_VOTE_STATS']} WHERE pid = {$CURRENT_PIC_DATA['pid']} AND ip = '{$raw_ip}'");
        $user_can_vote = 'false';
        if ($CURRENT_PIC_DATA['owner_id'] == $USER_DATA['user_id'] && $USER_DATA['user_id'] != 0 && ($CONFIG['rate_own_files'] == 0 || $CONFIG['rate_own_files'] == 2 && !USER_IS_ADMIN)) {
            // user is owner
            $rate_title = $lang_rate_pic['forbidden'];
        } elseif (!mysql_num_rows($result_votes) && !mysql_num_rows($result_vote_stats)) {
            // user hasn't voted yet, show voting things
            $rate_title = $lang_rate_pic['rate_this_pic'];
            $user_can_vote = 'true';
        } else {
            //user has voted
            $rate_title = $lang_rate_pic['already_voted'];
        }
        mysql_free_result($result_votes);
        mysql_free_result($result_vote_stats);
        $rating_stars_amount = $CONFIG['old_style_rating'] ? 5 : $CONFIG['rating_stars_amount'];
        $votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], round($CURRENT_PIC_DATA['pic_rating'] / 2000 / (5 / $rating_stars_amount), 1), $rating_stars_amount, $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
        $pid = $CURRENT_PIC_DATA['pid'];
        if (defined('THEME_HAS_RATING_GRAPHICS')) {
            $location = $THEME_DIR;
        } else {
            $location = '';
        }
        $superCage = Inspekt::makeSuperCage();
        $params = array('{TITLE}' => $rate_title, '{VOTES}' => $votes, '{LOCATION}' => $location, '{WIDTH}' => $CONFIG['picture_table_width'] == "100%" ? $CONFIG['main_table_width'] : $CONFIG['picture_table_width']);
        if ($CONFIG['old_style_rating']) {
            // use old-style rating
            $start_td = '<td class="tableb" width="17%" align="center">';
            $end_td = '</td>';
            $empty_star = '<img style="cursor:pointer" id="' . $pid . '_0" title="0" src="' . $location . 'images/rate_empty.png" alt="' . $lang_rate_pic['rubbish'] . '" onclick="rate(this)" />';
            $rating_images = $start_td . $empty_star . $empty_star . $empty_star . $empty_star . $empty_star . $end_td . $LINEBREAK;
            $empty_star = '<img style="cursor:pointer" id="' . $pid . '_1" title="1" src="' . $location . 'images/rate_empty.png" alt="' . $lang_rate_pic['poor'] . '" onclick="rate(this)" />';
            $full_star = '<img style="cursor:pointer" id="' . $pid . '_1" title="1" src="' . $location . 'images/rate_full.png" alt="' . $lang_rate_pic['poor'] . '" onclick="rate(this)" />';
            $rating_images .= $start_td . $full_star . $empty_star . $empty_star . $empty_star . $empty_star . $end_td . $LINEBREAK;
            $empty_star = '<img style="cursor:pointer" id="' . $pid . '_2" title="2" src="' . $location . 'images/rate_empty.png" alt="' . $lang_rate_pic['fair'] . '" onclick="rate(this)" />';
            $full_star = '<img style="cursor:pointer" id="' . $pid . '_2" title="2" src="' . $location . 'images/rate_full.png" alt="' . $lang_rate_pic['fair'] . '" onclick="rate(this)" />';
            $rating_images .= $start_td . $full_star . $full_star . $empty_star . $empty_star . $empty_star . $end_td . $LINEBREAK;
            $empty_star = '<img style="cursor:pointer" id="' . $pid . '_3" title="3" src="' . $location . 'images/rate_empty.png" alt="' . $lang_rate_pic['good'] . '" onclick="rate(this)" />';
            $full_star = '<img style="cursor:pointer" id="' . $pid . '_3" title="3" src="' . $location . 'images/rate_full.png" alt="' . $lang_rate_pic['good'] . '" onclick="rate(this)" />';
            $rating_images .= $start_td . $full_star . $full_star . $full_star . $empty_star . $empty_star . $end_td . $LINEBREAK;
            $empty_star = '<img style="cursor:pointer" id="' . $pid . '_4" title="4" src="' . $location . 'images/rate_empty.png" alt="' . $lang_rate_pic['excellent'] . '" onclick="rate(this)" />';
            $full_star = '<img style="cursor:pointer" id="' . $pid . '_4" title="4" src="' . $location . 'images/rate_full.png" alt="' . $lang_rate_pic['excellent'] . '" onclick="rate(this)" />';
            $rating_images .= $start_td . $full_star . $full_star . $full_star . $full_star . $empty_star . $end_td . $LINEBREAK;
            $full_star = '<img style="cursor:pointer" id="' . $pid . '_5" title="5" src="' . $location . 'images/rate_full.png" alt="' . $lang_rate_pic['great'] . '" onclick="rate(this)" />';
            $rating_images .= $start_td . $full_star . $full_star . $full_star . $full_star . $full_star . $end_td . $LINEBREAK;
            set_js_var('stars_amount', 'fallback');
            set_js_var('lang_rate_pic', $rate_title);
            $params['{RATING_IMAGES}'] = $rating_images;
            $template_rating = $template_image_rating_oldstyle;
        } else {
            //use new rating
            set_js_var('stars_amount', $rating_stars_amount);
            set_js_var('lang_rate_pic', $lang_rate_pic['rollover_to_rate']);
            $params['{JS_WARNING}'] = $lang_rate_pic['js_warning'];
            $template_rating = $template_image_rating;
        }
        set_js_var('rating', round($CURRENT_PIC_DATA['pic_rating'] / 2000 / (5 / $rating_stars_amount), 0));
        set_js_var('theme_dir', $location);
        set_js_var('can_vote', $user_can_vote);
        list($timestamp, $form_token) = getFormToken();
        set_js_var('form_token', $form_token);
        set_js_var('timestamp', $timestamp);
        return template_eval($template_rating, $params);
    }
}
/**
 * display_slideshow()
 *
 * gets data for thumbnails in an album for the film stript using Ajax call
 *
 * this added by Nuwan Sameera Hettiarachchi
 *
 * @param integer $album
 * @param integer $cat
 * @param integer $pos
 **/
function &display_slideshow($pos, $ajax_show = 0)
{
    global $CONFIG, $album, $pid, $slideshow, $USER;
    $superCage = Inspekt::makeSuperCage();
    $Pic = array();
    $Pid = array();
    $Title = array();
    $i = 0;
    $j = 0;
    /** get the pic details by querying database*/
    $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
    /** calculate total amount of pic a perticular album */
    if ($ajax_show == 0) {
        set_js_var('Pic_count', $pic_count);
    }
    foreach ($pic_data as $picture) {
        if (is_image($picture['filename'])) {
            if ($CONFIG['make_intermediate'] && cpg_picture_dimension_exceeds_intermediate_limit($picture['pwidth'], $picture['pheight'])) {
                $picture_url = get_pic_url($picture, 'normal');
            } else {
                $picture_url = get_pic_url($picture, 'fullsize');
            }
            $Pic[$i] = htmlspecialchars($picture_url, ENT_QUOTES);
            /*if ($picture['pid'] == $pid) {
                  $j         = $i;
                  $start_img = $picture_url;
              }*/
            //$j and $start_img are never used
        } else {
            $pic_url = get_pic_url($picture, 'thumb');
            $Pic[$i] = htmlspecialchars($pic_url);
        }
        $Pid[$i] = $picture['pid'];
        $Title[$i] = $picture['title'] ? $picture['title'] : $picture['filename'];
        $i++;
    }
    /** set variables to jquery.slideshow.js */
    set_js_var('Time', $slideshow);
    set_js_var('Pid', $pid);
    /*if (!$i) {
          $Pic[0] = 'images/thumb_document.jpg';
      }*/
    // Add the hit if slideshow hits are enabled in config
    if ((!USER_IS_ADMIN && $CONFIG['count_admin_hits'] == 0 || $CONFIG['count_admin_hits'] == 1) && $CONFIG['slideshow_hits'] != 0) {
        // Add 1 to hit counter
        if (!in_array($Pid['0'], $USER['liv']) && $superCage->cookie->keyExists($CONFIG['cookie_name'] . '_data')) {
            add_hit($Pid['0']);
            if (count($USER['liv']) > 4) {
                array_shift($USER['liv']);
            }
            array_push($USER['liv'], $Pid['0']);
            user_save_profile();
        }
    }
    /** show slide show on first time*/
    if ($ajax_show == 0) {
        theme_slideshow($Pic['0'], $Title['0']);
    }
    /** now we make a array to encode*/
    $dataArray = array('url' => $Pic['0'], 'title' => $Title['0'], 'pid' => $Pid['0']);
    $dataJson = json_encode($dataArray);
    /** send variable to javascript script*/
    if ($ajax_show == 1) {
        header("Content-Type: text/plain");
        echo $dataJson;
    }
}
Example #25
0
function image_manipulation_include_js()
{
    global $JS, $CONFIG, $lang_plugin_image_manipulation;
    require_once './plugins/image_manipulation/init.inc.php';
    if ($CONFIG['transparent_overlay'] != '1') {
        if ($CONFIG['plugin_image_manipulation_reset'] == '1') {
            set_js_var('im_strreset', $lang_plugin_image_manipulation['reset']);
        } else {
            set_js_var('im_strreset', '');
        }
        if ($CONFIG['plugin_image_manipulation_bw_sepia'] == '1') {
            set_js_var('im_strbw', $lang_plugin_image_manipulation['black_and_white']);
            set_js_var('im_strsepia', $lang_plugin_image_manipulation['sepia']);
        } else {
            set_js_var('im_strbw', '');
            set_js_var('im_strsepia', '');
        }
        if ($CONFIG['plugin_image_manipulation_flip_v'] == '1') {
            set_js_var('im_strflipv', $lang_plugin_image_manipulation['flip_vertically']);
        } else {
            set_js_var('im_strflipv', '');
        }
        if ($CONFIG['plugin_image_manipulation_flip_h'] == '1') {
            set_js_var('im_strfliph', $lang_plugin_image_manipulation['flip_horizontally']);
        } else {
            set_js_var('im_strfliph', '');
        }
        if ($CONFIG['plugin_image_manipulation_invert'] == '1') {
            set_js_var('im_strinvert', $lang_plugin_image_manipulation['invert']);
        } else {
            set_js_var('im_strinvert', '');
        }
        if ($CONFIG['plugin_image_manipulation_emboss'] == '1') {
            set_js_var('im_stremboss', $lang_plugin_image_manipulation['emboss']);
        } else {
            set_js_var('im_stremboss', '');
        }
        if ($CONFIG['plugin_image_manipulation_blur'] == '1') {
            set_js_var('im_strblur', $lang_plugin_image_manipulation['blur']);
        } else {
            set_js_var('im_strblur', '');
        }
        if ($CONFIG['plugin_image_manipulation_brightness'] == '1') {
            set_js_var('im_strlightness', $lang_plugin_image_manipulation['brightness']);
        } else {
            set_js_var('im_strlightness', '');
        }
        if ($CONFIG['plugin_image_manipulation_contrast'] == '1') {
            set_js_var('im_strcontrast', $lang_plugin_image_manipulation['contrast']);
        } else {
            set_js_var('im_strcontrast', '');
        }
        if ($CONFIG['plugin_image_manipulation_saturation'] == '1') {
            set_js_var('im_strsatur', $lang_plugin_image_manipulation['saturation']);
        } else {
            set_js_var('im_strsatur', '');
        }
        if ($CONFIG['plugin_image_manipulation_sharpness'] == '1') {
            set_js_var('im_strsharpen', $lang_plugin_image_manipulation['sharpness']);
        } else {
            set_js_var('im_strsharpen', '');
        }
        set_js_var('im_useurlvalues', $CONFIG['plugin_image_manipulation_urlvalues']);
        set_js_var('im_usecookies', $CONFIG['plugin_image_manipulation_cookies']);
        set_js_var('im_icon_reset', $image_manipulation_icon_array['reset']);
        set_js_var('im_icon_bw', $image_manipulation_icon_array['black_and_white']);
        set_js_var('im_icon_sepia', $image_manipulation_icon_array['sepia']);
        set_js_var('im_icon_flipv', $image_manipulation_icon_array['flip_vertically']);
        set_js_var('im_icon_fliph', $image_manipulation_icon_array['flip_horizontally']);
        set_js_var('im_icon_invert', $image_manipulation_icon_array['invert']);
        set_js_var('im_icon_emboss', $image_manipulation_icon_array['emboss']);
        set_js_var('im_icon_blur', $image_manipulation_icon_array['blur']);
        set_js_var('im_icon_brightness', $image_manipulation_icon_array['brightness']);
        set_js_var('im_icon_contrast', $image_manipulation_icon_array['contrast']);
        set_js_var('im_icon_saturation', $image_manipulation_icon_array['saturation']);
        set_js_var('im_icon_sharpness', $image_manipulation_icon_array['sharpness']);
        $client_array = cpg_determine_client();
        if (in_array($client_array['browser'], array('IE8', 'IE7', 'IE6', 'IE5.5', 'IE5')) == TRUE) {
            $JS['includes'][] = "./plugins/image_manipulation/js/pixastic_compatible.js";
        } elseif ($CONFIG['plugin_image_manipulation_contrast'] != '1' && $CONFIG['plugin_image_manipulation_saturation'] != '1' && $CONFIG['plugin_image_manipulation_sharpness'] != '1') {
            $JS['includes'][] = "./plugins/image_manipulation/js/pixastic_compatible.js";
        } else {
            $JS['includes'][] = "./plugins/image_manipulation/js/pixastic.js";
        }
        $JS['includes'][] = "./plugins/image_manipulation/js/image_manipulation.js";
    }
}
Example #26
0
function set_allowed_file_extensions_swf()
{
    global $CONFIG;
    $allowed_types = '';
    $allowed_img_types = explode('/', $CONFIG['allowed_img_types']);
    if (count($allowed_img_types)) {
        $allowed_types = '*.' . implode(';*.', $allowed_img_types) . ';';
    }
    $allowed_mov_types = explode('/', $CONFIG['allowed_mov_types']);
    if (count($allowed_mov_types)) {
        $allowed_types .= '*.' . implode(';*.', $allowed_mov_types) . ';';
    }
    $allowed_snd_types = explode('/', $CONFIG['allowed_snd_types']);
    if (count($allowed_snd_types)) {
        $allowed_types .= '*.' . implode(';*.', $allowed_snd_types) . ';';
    }
    $allowed_doc_types = explode('/', $CONFIG['allowed_doc_types']);
    if (count($allowed_doc_types)) {
        $allowed_types .= '*.' . implode(';*.', $allowed_doc_types) . ';';
    }
    set_js_var('allowed_file_types', $allowed_types);
}
    }
} else {
    unset($USER['lang']);
}
if (!file_exists("lang/{$CONFIG['lang']}.php")) {
    $CONFIG['lang'] = 'english';
}
// We finally load the chosen language file if it differs from English
if ($CONFIG['lang'] != 'english') {
    require 'lang/' . $CONFIG['lang'] . '.php';
}
set_js_var('lang_close', $lang_common['close']);
if (defined('THEME_HAS_MENU_ICONS')) {
    set_js_var('icon_close_path', $THEME_DIR . 'images/icons/close.png');
} else {
    set_js_var('icon_close_path', 'images/icons/close.png');
}
// ********************************************************
// * Language processing --- end
// ********************************************************
// See if the fav cookie is set; else set it
if ($superCage->cookie->keyExists($CONFIG['cookie_name'] . '_fav')) {
    $FAVPICS = @unserialize(@base64_decode($superCage->cookie->getRaw($CONFIG['cookie_name'] . '_fav')));
    foreach ($FAVPICS as $key => $id) {
        $FAVPICS[$key] = (int) $id;
        //protect against sql injection attacks
    }
} else {
    $FAVPICS = array();
}
// If the person is logged in get favs from DB those in the DB have precedence
Example #28
0
/** sort the piture manager**/
js_include('js/jquery.sort.js');
js_include('js/albmgr.js');
if (!(GALLERY_ADMIN_MODE || USER_ADMIN_MODE)) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
$icon_array = array();
$icon_array['ok'] = cpg_fetch_icon('ok', 0);
$icon_array['up'] = cpg_fetch_icon('up', 1);
$icon_array['down'] = cpg_fetch_icon('down', 1);
$icon_array['upup'] = cpg_fetch_icon('upup', 1);
$icon_array['downdown'] = cpg_fetch_icon('downdown', 1);
$icon_array['thumbnail'] = cpg_fetch_icon('thumbnails', 1);
// set js variable to changes albums
set_js_var('change_album', $lang_picmgr_php['change_album']);
set_js_var('confirm_modifs', $lang_picmgr_php['confirm_modifs']);
if ($CONFIG['default_sort_order'] != 'pa' && $CONFIG['default_sort_order'] != 'pd') {
    $help_picture_manager = <<<EOT
            <ul>
                <li>{$lang_picmgr_php['explanation1']}</li>
                <li>{$lang_picmgr_php['explanation2']}</li>
            </ul>
EOT;
    $help_picture_manager = '&nbsp;' . cpg_display_help('f=empty.html&amp;base=64&amp;h=' . urlencode(base64_encode(serialize($lang_picmgr_php['explanation_header'] . ':&nbsp;'))) . '&amp;t=' . urlencode(base64_encode(serialize($help_picture_manager))), 500, 300);
} else {
    $help_picture_manager = '';
}
pageheader($lang_picmgr_php['pic_mgr']);
echo <<<EOT

<form name="picture_menu" id="cpgformPic" method="post" action="delete.php?what=picmgr" >
Example #29
0
    This means the page is much smaller and is usable with lots of categories.

    Without this, the dropdown boxes grow exponentially as each category has the
    option to be moved into all other categories.

    If you make major changes to this page, please test with 200-300 categories
    nested several levels deep.
*/
define('IN_COPPERMINE', true);
define('CATMGR_PHP', true);
require 'include/init.inc.php';
set_js_var('lang_confirm_delete', $lang_catmgr_php['confirm_delete']);
list($timestamp, $form_token) = getFormToken();
set_js_var('form_token', $form_token);
set_js_var('timestamp', $timestamp);
js_include('js/catmgr.js');
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
$CAT_LIST = array(0 => array('cid' => 0, 'cat_count' => 0));
$icon_array['submit'] = cpg_fetch_icon('ok', 1);
function get_subcat_data($parent, $ident = '')
{
    global $CONFIG, $CAT_LIST;
    $sql = "SELECT rgt, cid, parent, name, pos FROM {$CONFIG['TABLE_CATEGORIES']} ORDER BY lft ASC";
    $result = cpg_db_query($sql);
    if ($result->numRows() > 0) {
        $rowset = cpg_db_fetch_rowset($result, true);
        $right = array();
        foreach ($rowset as $subcat) {
Example #30
0
        } else {
            $num_URI_boxes = $filtered_request;
        }
    }
} else {
    //Use the default settings for the number of boxes.
    $num_URI_boxes = NUM_URI_BOXES;
    $num_file_boxes = NUM_FILE_BOXES;
}
if (empty($num_URI_boxes) && empty($num_file_boxes)) {
    $num_URI_boxes = 0;
    $num_file_boxes = 1;
}
//send the number of amx files and url to jUpload.js
set_js_var('maxFiles', $num_file_boxes);
set_js_var('maxUrls', $num_URI_boxes);
// Get public and private albums, and set maximum individual file size.
pub_user_albums();
global $public_albums_list, $user_albums_list;
if (!count($public_albums_list) && !count($user_albums_list)) {
    // there's no album where the user is allowed to upload to
    if (USER_CAN_CREATE_ALBUMS) {
        // cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'].'<br />&nbsp;<br /><a href="albmgr.php" title="'.$lang_user_admin_menu['albmgr_title'].'" class="admin_menu">'.$lang_user_admin_menu['albmgr_lnk'].'</a>', __FILE__, __LINE__);
    } else {
        cpg_die(ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__);
    }
}
// Assign maximum file size for browser crontrols.
$max_file_size = $CONFIG['max_upl_size'] << 10;
// Create the upload forms using the upload congfiguration.
if (!$superCage->post->keyExists('control')) {