[ADDED RC3] Show username of who uploaded pic [ADDED RC3] Show username of who uploaded pic
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[ADDED RC3] Show username of who uploaded pic

Started by iamcanadian, November 16, 2003, 03:28:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iamcanadian

I tried the fix proposed for 1.1 and it doesn't work :(

I need to see who is uploading the pics on my site.

Thanks

iamcanadian

Found a simple fix for this....

Make sure in your configuration that :: Picture information are visible by default is set to YES

Then..

In displayimage.php

After:

if ($CONFIG['picinfo_display_filename']) {
                $info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
            }


Add::



//-----------------------------------------------------------------
        //Added by Vitor Freitas on 2003-09-01.
        //Hack version: 1.1
        //Display the name of the user that upload the image whit the image information.
        //Iam using PHP-Nuke 6.5.
        global $db;
       
        $vf_Fields = 'username';
        $vf_sql = "SELECT ".$vf_Fields." FROM nuke_users WHERE user_id='".$CURRENT_PIC_DATA['owner_id']."'";
        $vf_result = $db->sql_query($vf_sql);
        $vf_row = $db->sql_fetchrow($vf_result);
       
        $info['Upload by'] = '<a href="modules.php?name=Forums&file=profile&mode=viewprofile&u='.$CURRENT_PIC_DATA['owner_id'].'" target="_blank">'.$vf_row['username'].'</a>';
       
        //End -- Vitor Freitas on 2003-08-29.
        //-----------------------------------------------------------------



Hope this helps someone out and saves them endless hours of frustration...