Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2   Go Down

Author Topic: Upload as User  (Read 26432 times)

0 Members and 1 Guest are viewing this topic.

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« 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.
« Last Edit: May 04, 2006, 11:54:41 pm by GauGau »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Upload as User
« Reply #1 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« Reply #2 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)
Logged

Omen

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
    • http://mods.modpros.com
Upload as User
« Reply #3 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)
Logged

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« Reply #4 on: March 01, 2004, 06:55:22 am »

Omen exactly.
Logged

Nibbler

  • Guest
Upload as User
« Reply #5 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
Logged

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« Reply #6 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.
Logged

Nibbler

  • Guest
Upload as User
« Reply #7 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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Upload as User
« Reply #8 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'
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« Reply #9 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.
Logged

Nibbler

  • Guest
Upload as User
« Reply #10 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.
Logged

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« Reply #11 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?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Upload as User
« Reply #12 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'");
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Nibbler

  • Guest
Upload as User
« Reply #13 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'"
Logged

Ravage

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Upload as User
« Reply #14 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.
Logged

Nibbler

  • Guest
Upload as User
« Reply #15 on: March 03, 2004, 07:36:29 pm »

Ah, I didn't take into account the possibility of seperate databases when I wrote that.
Logged

Zeitgeist

  • Coppermine regular visitor
  • **
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 71
Re: Upload as User
« Reply #16 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.
Logged
I love GauGau!

Nibbler

  • Guest
Re: Upload as User
« Reply #17 on: November 09, 2004, 01:50:41 pm »

It won't work with 1.3 as the upload system is all changed.
Logged

WitchyMama

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Upload as User
« Reply #18 on: August 20, 2005, 02:49:59 pm »

so there is no way to have something similar to this in the current release? damn  :-\\
Logged

Scottie32

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Upload as User
« Reply #19 on: May 23, 2006, 07:57:16 am »

Does any one no how to get a forgotton PW lol ???
Logged
Pages: [1] 2   Go Up
 

Page created in 0.024 seconds with 19 queries.