Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12358
Latest: KekoWorld
New This Month: 1
New This Week: 2
New Today: 0
Stats
Total Posts: 40094
Total Topics: 7059
Most Online Today: 95
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 34
Total: 34

Author Topic: Edit picture problems  (Read 5934 times)

0 Members and 1 Guest are viewing this topic.

Offline iosarian

  • Newbie
  • *
  • 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: 15050
    • 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

  • Newbie
  • *
  • 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: 15050
    • 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

  • Newbie
  • *
  • 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: 15050
    • 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

  • Newbie
  • *
  • 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: 15050
    • 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
3296 Views
Last post September 17, 2009, 03:10:11 am
by Doughboy99
0 Replies
3339 Views
Last post October 16, 2010, 02:23:48 am
by morokat
0 Replies
2226 Views
Last post March 20, 2014, 04:12:32 pm
by Michel68
1 Replies
1918 Views
Last post October 28, 2014, 09:46:32 pm
by SMFHacks
1 Replies
410 Views
Last post August 27, 2019, 11:52:06 am
by SMFHacks

+- Recent Topics

BUG Message Editor Pro1.0.5 by marcimila
Today at 09:01:21 am

MOVED: BUG Message Editor Pro1.0.5 by SMFHacks
April 03, 2020, 07:54:07 pm

[Mod]SMF2WPBridge - Wordpress Login Bridge by SMFHacks
April 03, 2020, 01:41:05 pm

Only variables should be passed by reference by Zaphod
April 02, 2020, 11:19:11 am

Cannot install Gallery Pro on SMF 2.1 RC2 by Hatshepsut
March 19, 2020, 12:55:00 am

Newbie questions by SMFHacks
March 08, 2020, 09:28:17 am

Update detect mobile mode PHP5 to PHP7 by Plus
March 05, 2020, 11:19:05 am

Just a hello by Plus
March 05, 2020, 11:05:56 am

Enotify Copyright Problem by SMFHacks
March 04, 2020, 09:21:09 pm

Cannot import by shawnb
March 02, 2020, 12:17:00 pm

Powered by EzPortal