forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: Ravage on February 29, 2004, 06:13:15 pm

Title: Upload as User
Post by: Ravage on February 29, 2004, 06:13:15 pm
This feature was very helpful when I used photopost was wondering if there was a mod for this feature for admins to use.
Title: Upload as User
Post by: Casper on February 29, 2004, 08:59:52 pm
Not exactly sure what you want.  If it is simply to be able to upload the same way as your users, that is already here, just use the 'upload picture' link.
Title: Upload as User
Post by: Ravage on March 01, 2004, 02:31:31 am
I have it intergrated with VB3 and it doesn't give an options to do that.

Only options are:

Album
Picture    
Picture title    
Picture description    
Keywords (separate with spaces)
Title: Upload as User
Post by: Omen on March 01, 2004, 06:41:54 am
I think he means he wants the ability to make it look like someone else uploaded the file...

A dropdown list of all members.... He selects "Joe" and upload a file...
Then when viewing the file, "Joe" will be listed as the person who uploaded it...

(i think)
Title: Upload as User
Post by: Ravage on March 01, 2004, 06:55:22 am
Omen exactly.
Title: Upload as User
Post by: Nibbler on March 01, 2004, 05:17:05 pm
OK, there are several changes for this...

1) Upload.php

Under:

Code: [Select]

array($lang_upload_php['picture'], 'userpicture', 1),


add:

Code: [Select]

array('Upload as','upload_as',4,32),


( 'Upload as' can be in your own langauge)

Under:

Code: [Select]

case 3 :
form_textarea($element[0], $element[1], $element[3]);
break;


add:

Code: [Select]

case 4 :
if (GALLERY_ADMIN_MODE) form_input($element[0], $element[1], $element[3]);
break;


2) db_input.php

Under:

Code: [Select]

$keywords = addslashes($HTTP_POST_VARS['keywords']);


add:

Code: [Select]

$upload_as = addslashes($HTTP_POST_VARS['upload_as']);


find:

Code: [Select]

$result = add_picture($album, $filepath, $picture_name, $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $raw_ip, $hdr_ip);


change it to:

Code: [Select]

$result = add_picture($album, $filepath, $picture_name, $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $raw_ip, $hdr_ip, $upload_as);


3) picmgmt.inc.php

find:

Code: [Select]

function add_picture($aid, $filepath, $filename, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '')


change it to:

Code: [Select]

function add_picture($aid, $filepath, $filename, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '',$upload_as)


find:

Code: [Select]

            // User ID is not recorded when in admin mode (ie. for batch uploads)
            $user_id = GALLERY_ADMIN_MODE ? 0 : USER_ID;
                        $username=$USER_DATA['user_name'] ;


replace it with

Code: [Select]

            // User ID is not recorded when in admin mode (ie. for batch uploads)
            If (GALLERY_ADMIN_MODE)
                {
                 $username = $upload_as;
                 If (defined('UDB_INTEGRATION'))
                        {
                         $result = db_query("SELECT user_id FROM phpbb_users WHERE username = '$username'");
                        } else {
                                $result = db_query("SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '$username'");
                                }
                 $record = mysql_fetch_array($result);
                 $user_id = $record[0];
                } else {
                $user_name = $USER_DATA['user_name'];
                $user_id = $USER_DATA['user_id'];
                }


(change phpbb_users to your own user table if you use a non-phpbb integration)

Just enter the name of the user you are uploading as, and it should work  :D
Title: Upload as User
Post by: Ravage on March 02, 2004, 10:33:53 pm
Error Popped up.

There was an error while processing a database query

I did do the edits correct and changed phpbb_users to userbecuase of the VB3 intergration.

I think becuase I'm using the VB3 intergration but it may still be looking into the coppermine databae for the user.
Title: Upload as User
Post by: Nibbler on March 02, 2004, 10:50:48 pm
It should cope with db integration, worked with my phpbb setup, so I suggest you enable debug mode and see what the actual error is. I am not familiar with vb3, so I dont know what the user table looks like.
Title: Upload as User
Post by: Casper on March 02, 2004, 10:50:09 pm
Did you change the 'phpbb_users' to 'vb3_users' (or whatever your vb3 users table is called), or just to 'users'
Title: Upload as User
Post by: Ravage on March 02, 2004, 11:23:27 pm
my table is only called user

there is no prefix on my database.
any ideas?

I did the debug mode. Its looking in the coppermine database for user not the vbulletin database.
Title: Upload as User
Post by: Nibbler on March 03, 2004, 01:06:03 pm
Somewhere at the start of your init.inc.php there should be an uncommented line defining UDB_INTEGRATION. It is this that the mod will check to decide which table to look in. This should have been set as part of your integration procedure. If all else fails just change the "SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '$username'" to whatever it needs to be for vb3.
Title: Upload as User
Post by: Ravage on March 03, 2004, 06:18:22 pm
my vb3 database is called VBulletin
the user table is called user

what do I change the line to?
Title: Upload as User
Post by: Casper on March 03, 2004, 06:25:52 pm
That means this line in the mod above;
Code: [Select]
$result = db_query("SELECT user_id FROM phpbb_users WHERE username = '$username'");

needs to be changed to this;
Code: [Select]
$result = db_query("SELECT user_id FROM VBulletin_user WHERE username = '$username'");
Title: Upload as User
Post by: Nibbler on March 03, 2004, 06:33:12 pm
EDIT:

Looking at the bridge file, it should be:

"SELECT userid FROM VBulletin.user WHERE username = '$username'"
Title: Upload as User
Post by: Ravage on March 03, 2004, 07:29:00 pm
Ok I got it to work. Is wasn't the second select it was the first one.

Code: [Select]
$result = db_query("SELECT user_id FROM phpbb_users WHERE username = '$username'");

I replace that one with the edited line and it work. When I replace the second one same error popped up. Thx for the help.
Title: Upload as User
Post by: Nibbler on March 03, 2004, 07:36:29 pm
Ah, I didn't take into account the possibility of seperate databases when I wrote that.
Title: Re: Upload as User
Post by: Zeitgeist on November 09, 2004, 01:45:23 pm
Is there any way to get this mod t o work with the current version? I've cleanly put in all parts except the last and I can't seem to get it to work, tried some different ways to put it in but none worked and I got database error when trying to upload with it.
Title: Re: Upload as User
Post by: Nibbler on November 09, 2004, 01:50:41 pm
It won't work with 1.3 as the upload system is all changed.
Title: Re: Upload as User
Post by: WitchyMama on August 20, 2005, 02:49:59 pm
so there is no way to have something similar to this in the current release? damn  :-\\
Title: Re: Upload as User
Post by: Scottie32 on May 23, 2006, 07:57:16 am
Does any one no how to get a forgotton PW lol ???
Title: Re: Upload as User
Post by: Joachim Müller on May 23, 2006, 09:03:44 am
1) Don't hijack a thread that deals with completely different issues
2) Don't ask for support for cpg1.2.x - support has run out for it. Upgrade!
3) Search the board - there are many postings that explain how to retrieve forgotten passwords

Locking this thread...