[Solved] displayimage.php: how to make username of comment author clickable? [Solved] displayimage.php: how to make username of comment author clickable?
 

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

[Solved] displayimage.php: how to make username of comment author clickable?

Started by jerx, October 28, 2005, 12:00:43 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jerx

Hi,

Does anybody know how to make the username in displayimage.php view clickable?

The username is clickable (redirected to profile) on the thumbnail view, but it is not on the full size image view.

Stramm

have a look here.. http://forum.coppermine-gallery.net/index.php?topic=22915.msg105524#msg105524
that explains how to have the username there. For making the owner clickable you'll have to modify the section in theme.php a lil bit more and send it the user id... means this is missing
        '{OWNER_ID}' => $CURRENT_PIC_DATA['owner_id'], and in theme.php it should look like

<br>From: <a href="profile.php?uid={OWNER_ID}"><strong>{OWNER_NAME}</strong></a>

jerx

Thank you for your reply, Stramm!

This was not exactly what I was looking for, but it made me find a quick workaround:

I changed line 647 of theme.php:
<b>{MSG_AUTHOR}</b>

to this:
<b><a href="../profile.php?mode=viewprofile&u={MSG_AUTHOR}">{MSG_AUTHOR}</a></b>

So, instead of using the user-id in the link url, we are using the username. I don' t know if this works in a standalone coppermine gallery. If you are using a phpbb bridge it works without problems. You can even have usernames with spaces or special characters. :)

You have to change the link url to suite your server configuration. My phpbb is installed in root and coppermine is installed in a folder located in root.

jerx

I noticed a problem with this solution. Whenever a user changes his nickname you will get a syntax error. This is not really caused by this code change, but is more a problem of the comments system. It stores the username instead of the user_id.

Wouldn' t it be better to store the user_id and convert it to the username at display? Or would it cause too much load on the server?

Nibbler


jerx

Think I need an eye check. Ok, now I really solved it:

open displayimage.php:

search for (line 387):
$params = array('{MSG_AUTHOR}' => $row['msg_author'],

after add:
'{AUTHOR_ID}' => $row['author_id'],

open theme.php:

replace:
<b><a href="../profile.php?mode=viewprofile&u={MSG_AUTHOR}">{MSG_AUTHOR}</a></b>

with:
<b><a href="../profile.php?mode=viewprofile&u={AUTHOR_ID}">{MSG_AUTHOR}</a></b>

dEnA

Anyone got this working for 1.43
In search I only find some patch with a million other things and there you had to modify mysql and i dont think thats necessary for a easy(not for me) patch like this
thanks
"dEnA"

Joachim Müller

Post cpg1.4.x-related question on the board that is dedicated for this purpose (maybe with reference to this thread). Locking this thread now.