Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12401
Latest: xyiguran
New This Month: 7
New This Week: 2
New Today: 2
Stats
Total Posts: 39914
Total Topics: 7026
Most Online Today: 58
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 36
Total: 36

Author Topic: Edit picture problems  (Read 5869 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: 14965
    • 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: 14965
    • 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: 14965
    • 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: 14965
    • 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
3253 Views
Last post September 17, 2009, 03:10:11 am
by Doughboy99
0 Replies
3293 Views
Last post October 16, 2010, 02:23:48 am
by morokat
0 Replies
2167 Views
Last post March 20, 2014, 04:12:32 pm
by Michel68
1 Replies
1863 Views
Last post October 28, 2014, 09:46:32 pm
by SMFHacks
1 Replies
221 Views
Last post August 27, 2019, 11:52:06 am
by SMFHacks

+- Recent Topics

PHP error by SMFHacks
November 11, 2019, 03:55:24 pm

Message Editor Pro Issues by SMFHacks
November 06, 2019, 09:58:33 pm

most popular categories doesnt work by fussilet
November 02, 2019, 02:51:42 pm

Change colors of Halloween theme by SMFHacks
October 24, 2019, 11:44:59 am

prettyurls - TroubleShooting.wiki by Rock Lee
October 10, 2019, 11:37:09 am

Some issues with adding and editing a listing by ajac63
October 07, 2019, 04:16:40 am

Problem update 1.1.21 to 2.0.15 by Rock Lee
October 06, 2019, 06:09:16 pm

[Mod]SMF 2.0.x PHP 7.2 Support by sah62
October 04, 2019, 01:46:00 pm

Ideas by shuban
October 03, 2019, 10:19:06 pm

How to space icons and multiple reacts? by shadav
October 03, 2019, 04:20:07 pm

Powered by EzPortal