示例#1
0
if (phpbb_gallery_config::get('disp_exifdata') && $image_data['image_has_exif'] != phpbb_gallery_exif::UNAVAILABLE && substr($image_data['image_filename'], -4) == '.jpg' && function_exists('exif_read_data') && (phpbb_gallery::$auth->acl_check('m_status', $album_id, $album_data['album_user_id']) || $image_data['image_contest'] != phpbb_gallery_image::IN_CONTEST)) {
    $exif = new phpbb_gallery_exif(phpbb_gallery_url::path('upload') . $image_data['image_filename'], $image_id);
    $exif->interpret($image_data['image_has_exif'], $image_data['image_exif_data']);
    if (!empty($exif->data["EXIF"])) {
        $exif->send_to_template(phpbb_gallery::$user->get_data('user_viewexif'));
    }
    unset($exif);
}
/**
* Rating
*/
if (phpbb_gallery_config::get('allow_rates')) {
    $rating = new phpbb_gallery_image_rating($image_id, $image_data, $album_data);
    $user_rating = $rating->get_user_rating($user->data['user_id']);
    // Check: User didn't rate yet, has permissions, it's not the users own image and the user is logged in
    if (!$user_rating && $rating->is_allowed()) {
        $rating->display_box();
    }
    $template->assign_vars(array('IMAGE_RATING' => $rating->get_image_rating($user_rating), 'S_ALLOWED_TO_RATE' => $rating->is_allowed(), 'S_VIEW_RATE' => phpbb_gallery::$auth->acl_check('i_rate', $album_id, $album_data['album_user_id']) ? true : false, 'S_COMMENT_ACTION' => phpbb_gallery_url::append_sid('posting', "album_id={$album_id}&image_id={$image_id}&mode=comment&submode=rate")));
    unset($rating);
}
/**
* Posting comment
*/
if (phpbb_gallery_config::get('allow_comments') && phpbb_gallery::$auth->acl_check('c_post', $album_id, $album_data['album_user_id']) && $album_data['album_status'] != ITEM_LOCKED && ($image_data['image_status'] != phpbb_gallery_image::STATUS_LOCKED || phpbb_gallery::$auth->acl_check('m_status', $album_id, $album_data['album_user_id']))) {
    $user->add_lang('posting');
    phpbb_gallery_url::_include('functions_posting', 'phpbb');
    $bbcode_status = $config['allow_bbcode'] ? true : false;
    $smilies_status = $config['allow_smilies'] ? true : false;
    $img_status = $bbcode_status ? true : false;
    $url_status = $config['allow_post_links'] ? true : false;
示例#2
0
                 break;
         }
     }
     break;
 case 'comment':
     if ($mode == 'comment') {
         $comment = $comment_username = $s_captcha_hidden_fields = '';
         $comment_username_req = $contest_rating_msg = false;
         /**
          * Rating-System: now you can comment and rate in one form
          */
         if (phpbb_gallery_config::get('allow_rates') && $submode != 'edit') {
             $rating = new phpbb_gallery_image_rating($image_id, $image_data, $album_data);
             $user_rating = $rating->get_user_rating($user->data['user_id']);
             // Check: User didn't rate yet, has permissions, it's not the users own image and the user is logged in
             if (!$user_rating && $rating->is_allowed()) {
                 $rating->display_box();
                 // User just rated the image, so we store it
                 $rate_point = request_var('rating', 0);
                 if ($rating->rating_enabled && $rate_point > 0) {
                     $rating->submit_rating();
                     $message .= $user->lang['RATING_SUCCESSFUL'] . '<br />';
                 }
             }
             $template->assign_vars(array('S_ALLOWED_TO_RATE' => $rating->is_allowed()));
             if ($submode == 'rate') {
                 $s_album_action = '';
             }
         }
         switch ($submode) {
             case 'add':