Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 186
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 175
Total: 175

Author Topic: Edit picture problems  (Read 7874 times)

0 Members and 1 Guest are viewing this topic.

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Edit picture problems
« on: December 06, 2007, 02:44:48 pm »
1. After I edit picture uploaded by other administrator, it shows to me that the picture is uploaded by "guest".
2. The members can Bulk upload pictures without titles. But in edit view the titles are required.
3. When member edits picture and replaces the picture file, "next" and "previous" don't work.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Edit picture problems
« Reply #1 on: December 06, 2007, 09:53:46 pm »
On list of things to look into this weekend
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Re: Edit picture problems
« Reply #2 on: December 07, 2007, 05:23:41 pm »
In function EditPicture2(),                
// Update the Database entry
The query updates the ID_CAT and when user edits picture the ID_CAT in database is not "0". I think there is no need to update ID_CAT.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Edit picture problems
« Reply #3 on: December 08, 2007, 11:32:23 am »
Couldn't recreate number #1, #3 on my test gallery using the latest version.

#2 added in next update to for non gallery admin's to require the title.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Re: Edit picture problems
« Reply #4 on: December 08, 2007, 02:08:05 pm »
#3: If member edits pictire and replace the file in gallery smf_gallery_pic table for this picture that ID_CAT is the same USER_ID_CAT. It happens after editing.
And if I have picture 1, 2, 3, 4 in one category and edit number 3, with "next" link in picture view it takes from number 2 to number 4 (skiping number 3)
I removed ID_CAT in update query and for now it seems it works.

#1: I only can tell you what happens in the database. After editing it show that ID_MEMBER is 99999.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Edit picture problems
« Reply #5 on: December 08, 2007, 02:15:56 pm »
For #3. USER_ID_CAT and ID_CAT can not be both set one needs to be zero otherwise it would cause problems.

For #1 This is the only portion of the code that deals with changing the picture owner and only updates if that member's name is found.
Code: [Select]
// Change the picture owner if selected
if (allowedTo('smfgallery_manage') && isset($_REQUEST['pic_postername']))
{
$pic_postername = str_replace('"','', $_REQUEST['pic_postername']);
$pic_postername = str_replace("'",'', $pic_postername);
$pic_postername = str_replace('\\','', $pic_postername);
$pic_postername = htmlspecialchars($pic_postername, ENT_QUOTES);

$memid = 0;

$dbresult = db_query("
SELECT
realName, ID_MEMBER
FROM {$db_prefix}members
WHERE realName = '$pic_postername' OR memberName = '$pic_postername'  LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
mysql_free_result($dbresult);

if (db_affected_rows() != 0)
{
// Member found update the picture owner

$memid = $row['ID_MEMBER'];
db_query("UPDATE {$db_prefix}gallery_pic
SET ID_MEMBER = $memid WHERE ID_PICTURE = $id LIMIT 1", __FILE__, __LINE__);


}

}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline iosarian

  • Member
  • *
  • Posts: 24
    • View Profile
Re: Edit picture problems
« Reply #6 on: December 08, 2007, 02:41:20 pm »
For #3. USER_ID_CAT and ID_CAT can not be both set one needs to be zero otherwise it would cause problems.
In EditPicture2():
$cat = (int) $_REQUEST['cat'] but the link is "action=gallery;su=user;u=XXXX;cat=YYY" and I think $cat takes the YYY value which in this case is user category ID.
After that udate query updates the ID_CAT with $cat.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Edit picture problems
« Reply #7 on: December 08, 2007, 03:06:32 pm »
Fixed for next update

Open Sources/Gallery.php

Find
Code: [Select]
// Update the Database entry
$t = time();

db_query("UPDATE {$db_prefix}gallery_pic
SET ID_CAT = $cat, filesize = $filesize, filename = '" . $extrafolder . $filename . "',  thumbfilename = '" . $extrafolder . $thumbname . "', height = $sizes[1], width = $sizes[0], approved = $approved, date =  $t, title = '$title', description = '$description', keywords = '$keywords', allowcomments = $allowcomments, sendemail = $sendemail WHERE ID_PICTURE = $id LIMIT 1", __FILE__, __LINE__);


Change to
Code: [Select]

// Update the Database entry
$t = time();
if ($row['USER_ID_CAT'] == 0)
{
db_query("UPDATE {$db_prefix}gallery_pic
SET ID_CAT = $cat, filesize = $filesize, filename = '" . $extrafolder . $filename . "',  thumbfilename = '" . $extrafolder . $thumbname . "', height = $sizes[1], width = $sizes[0], approved = $approved, date =  $t, title = '$title', description = '$description', keywords = '$keywords', allowcomments = $allowcomments, sendemail = $sendemail WHERE ID_PICTURE = $id LIMIT 1", __FILE__, __LINE__);
}
else
{
db_query("UPDATE {$db_prefix}gallery_pic
SET USER_ID_CAT = $cat, filesize = $filesize, filename = '" . $extrafolder . $filename . "',  thumbfilename = '" . $extrafolder . $thumbname . "', height = $sizes[1], width = $sizes[0], approved = $approved, date =  $t, title = '$title', description = '$description', keywords = '$keywords', allowcomments = $allowcomments, sendemail = $sendemail WHERE ID_PICTURE = $id LIMIT 1", __FILE__, __LINE__);
}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
4814 Views
Last post September 17, 2009, 03:10:11 am
by guest3817
0 Replies
5066 Views
Last post October 16, 2010, 02:23:48 am
by morokat
0 Replies
3812 Views
Last post March 20, 2014, 04:12:32 pm
by Michel68
1 Replies
3505 Views
Last post October 28, 2014, 09:46:32 pm
by SMFHacks
4 Replies
3661 Views
Last post August 21, 2021, 09:46:05 am
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal