Question Gallery

Status
Not open for further replies.

Aussie

Customer
Gallery Issues

I am noticing problems.

I have my permissions set up so only admin can edit and delete images but registered members can also edit and delete images.

I also removed the code that shows the camera info when uploading photos and since doing this my photo will not upload but instead they are showing up in gallery>my profile> my inactive images

Permissions.jpg
Inactive Images.jpg
 
Last edited:
I have also noticed registered users can delete own images even though permissions are set to allow admin only.

I also want to remove the camera info when uploading images

Camera Info.jpg
 
Unfortunately Dylan is rather busy, he'll get to it as soon as possible. Thank you for your patience and understanding :)
 
I'm sorry, I found the delete problem. I'll fix it in the next update but for now, you can fix it quick by dropping the attached file into dbtech/gallery/actions and edit the following template
ACP->Styles & Templates->Style Manager->DragonByte Tech: Gallery Templates->dbtech_gallery_image_edit

Near the bottom find

Code:
            <vb:if condition="$editimage">
            <div style="float: {vb:stylevar right}; vertical-align: top; margin-bottom: 15px;">
                <form class="vbform block" id="delete_image_form" action="javascript:void(0)" method="post" name="vbform">
                <input type="submit" class="button" value="{vb:rawphrase delete}" onclick="DBTech_Gallery.popup_overlay('img-del-overlay')" />
                <input type="hidden" name="imageid" id="imageid" value="{vb:raw image_data.imageid}" />
                <input type="hidden" id="gal" name="gal" value="{vb:raw show.gal}" />
                <input type="hidden" name="securitytoken" value="{vb:var bbuserinfo.securitytoken}" />
                </form>
            </div>
            <div style="clear: {vb:stylevar right};"></div>
            </vb:if>
and replace it with
Code:
             <vb:if condition="$candel">
            <div style="float: {vb:stylevar right}; vertical-align: top; margin-bottom: 15px;">
                <form class="vbform block" id="delete_image_form" action="javascript:void(0)" method="post" name="vbform">
                <input type="submit" class="button" value="{vb:rawphrase delete}" onclick="DBTech_Gallery.popup_overlay('img-del-overlay')" />
                <input type="hidden" name="imageid" id="imageid" value="{vb:raw image_data.imageid}" />
                <input type="hidden" id="gal" name="gal" value="{vb:raw show.gal}" />
                <input type="hidden" name="securitytoken" value="{vb:var bbuserinfo.securitytoken}" />
                </form>
            </div>
            <div style="clear: {vb:stylevar right};"></div>
            </vb:if>

When you say you removed the camera info code, what did you do? If you remove it from the template it should work fine and not display any camera info on add/edit/view.
 

Attachments

  • edit_image.php
    4.9 KB · Views: 11
I cant open the attached file.

When I removed the code for the camera info as displayed in this TOPIC, admin and users were unable to upload photos to the gallery and instead they were placed in the inactive images area of their gallery profile

Inactive Images.jpg
 
I added the code you supplied but im getting this message when saving

The following error occurred when attempting to evaluate this template:
Unclosed Tag
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
 
That's weird, I downloaded the file fine and opened it with notepad to make sure it was ok. What does it look like for you?

Not sure why you'd get a tag issue, the only thing you're really doing is replace the $editimage variable with $candel
 
were you able to download that file? I fixed the camera info making it go inactive. I can't fix the delete problem until you can download the file and upload it, otherwise no one will be able to delete heh.
 
I downloaded the file and opened it with notepad but I'm not sure where I have to upload it to.

I am not sure what to do when it comes to this sort of stuff, that is why I pay for it to be installed. I didn't think there would be issues with the gallery once installed by DBT staff.

This is the code that was in the file for download

<?php

/**
* Dragonbyte-Tech.com Gallery Mod
*
* @author Dylan Wheeler
* @copyright 2012
*
* You may not copy/reproduce any part of this file in whole or significant part.
*
* All rights reserved.
*/

$vbulletin->input->clean_array_gpc('r', array(
'imageid' => TYPE_UINT
));

$imageid = $vbulletin->GPC['imageid'] ? $vbulletin->GPC['imageid'] : 0;
$thisdate = time();
$editimage = true;
$pageid = 1;

$navbits[] = $vbphrase['dbtech_gallery_edit_image'];

if ($imageid == 0)
{
// No image id
eval(standard_error($vbphrase['dbtech_gallery_err_no_id']));
}

$image_data = $vbulletin->db->query_first("
SELECT
*
FROM " . TABLE_PREFIX . "dbtech_gallery_images
WHERE
imageid = " . intval($imageid)
);

$instance = DBTECH_GALLERY::fetch_current_instance_from_id($im age_data['instanceid']);

if (!DBTECH_GALLERY::fetch_gallery_perms('admin', $instance) && !DBTECH_GALLERY::fetch_gallery_perms('del_other', $instance) && $image_data['userid'] != $vbulletin->userinfo['userid'])
{
// No image id
eval(standard_error($vbphrase['dbtech_gallery_no_perm_edit']));
}

if ((DBTECH_GALLERY::fetch_gallery_perms('del_other', $instance) && $image_data['userid'] != $vbulletin->userinfo['userid']) || (DBTECH_GALLERY::fetch_gallery_perms('del', $instance) && $image_data['userid'] == $vbulletin->userinfo['userid']))
{
$candel = true;
}

($hook = vBulletinHook::fetch_hook('dbtech_gallery_edit_ima ge_start')) ? eval($hook) : false;

$cam_info_array = unserialize($image_data['custom_data']);

$image_data['camera_make'] = $cam_info_array['Make'];
$image_data['camera_model'] = $cam_info_array['Model'];
$image_data['aperture'] = $cam_info_array['aperture'];
$image_data['iso'] = $cam_info_array['ISO'];
$image_data['img_datetime'] = $cam_info_array['DateTime'];

$cust_field_data = DBTECH_GALLERY::fetch_custom_fields($image_data['instanceid'], 1, $image_data['cust_field_data'], 'edit');

$categories = DBTECH_GALLERY::category_select_list(DBTECH_GALLER Y::$current_instance['instanceid'], 0);

foreach((array)$categories AS $catid => $catname)
{
if ($catid == $image_data['catid'])
{
$category_select .= "<option value="" . $catid . "" selected="selected">" . $catname . "</option>\n";
} else {
$category_select .= "<option value="" . $catid . "">" . $catname . "</option>\n";
}
}

$albums = DBTECH_GALLERY::album_select_list(DBTECH_GALLERY:: $current_instance['instanceid'], $image_data['userid'], array(0 => $vbphrase['none']));

foreach((array)$albums AS $albumid => $albumname)
{
if ($albumid == $image_data['albumid'])
{
$album_select .= "<option value="" . $albumid . "" selected="selected">" . $albumname . "</option>\n";
} else {
$album_select .= "<option value="" . $albumid . "">" . $albumname . "</option>\n";
}
}

$allow_txt['html'] = $vbulletin->options['dbtech_vbquiz_use_html'] ? $vbphrase['on'] : $vbphrase['off'];
$allow_txt['smilies'] = $vbulletin->options['dbtech_vbquiz_use_smilies'] ? $vbphrase['on'] : $vbphrase['off'];
$allow_txt['bbcode'] = $vbulletin->options['dbtech_vbquiz_use_bbcode'] ? $vbphrase['on'] : $vbphrase['off'];
$allow_txt['imgcode'] = $vbulletin->options['dbtech_vbquiz_use_imgcode'] ? $vbphrase['on'] : $vbphrase['off'];

if (intval($vbulletin->versionnumber) == 3)
{
$vbphrase['bb_code_is_x'] = construct_phrase($vbphrase['bb_code_is_x'], $session[sessionurl], $allow_txt['bbcode']);
$vbphrase['smilies_are_x'] = construct_phrase($vbphrase['smilies_are_x'], $session[sessionurl], $allow_txt['smilies']);
$vbphrase['img_code_is_x'] = construct_phrase($vbphrase['img_code_is_x'], $session[sessionurl], $allow_txt['imgcode']);
$vbphrase['html_code_is_x'] = construct_phrase($vbphrase['html_code_is_x'], $allow_txt['html']);
}

if (file_exists(DBTECH_GALLERY::fetch_image_path($ima ge_data['imageid'])))
{
$image_exists = true;
}

require_once(DIR . '/includes/functions_editor.php');
$editorid = construct_edit_toolbar($image_data['text'], false, 'nonforum', true, true, false, 'fe', 'vB_Gallery_Editor');

$image_data['file_location'] = DBTECH_GALLERY::fetch_file_path(0, 'plain');
$image_data['img_location'] = DBTECH_GALLERY::fetch_file_path($image_data['imageid'], 'gallery_thumb', $gal);

($hook = vBulletinHook::fetch_hook('dbtech_gallery_edit_ima ge_complete')) ? eval($hook) : false;

//Finally done
$templater = vB_Template::create('dbtech_gallery_image_edit');
$templater->register('messagearea' , $messagearea);
$templater->register('editorid' , $editorid);
$templater->register('image_exists' , $image_exists);
$templater->register('image_data' , $image_data);
$templater->register('cust_field_data' , $cust_field_data);
$templater->register('category_select' , $category_select);
$templater->register('album_select' , $album_select);
$templater->register('editimage' , $editimage);
$templater->register('candel' , $candel);
$templater->register('template_hook' , $template_hook);
$HTML .= $templater->render();

?>
 
Sorry about that, I didn't realize you had us install the application for you. I had Fillip upload the file and I modified the template. It looks like it's working now. I removed admin ability to delete their own images and the delete button was gone then I switched it back.
 
Status
Not open for further replies.

Legacy DragonByte Gallery

vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
865
Customer rating
0.00 star(s) 0 ratings
Back
Top