forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: jerx on October 28, 2005, 12:00:43 am

Title: [Solved] displayimage.php: how to make username of comment author clickable?
Post by: jerx on October 28, 2005, 12:00:43 am
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.
Title: Re: displayimage.php: how to make username of comment author clickable?
Post by: Stramm on October 28, 2005, 11:09:35 am
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
Code: [Select]
        '{OWNER_ID}' => $CURRENT_PIC_DATA['owner_id'], and in theme.php it should look like

Code: [Select]
<br>From: <a href="profile.php?uid={OWNER_ID}"><strong>{OWNER_NAME}</strong></a>
Title: Re: displayimage.php: how to make username of comment author clickable?
Post by: jerx on October 31, 2005, 11:27:15 am
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:
Code: [Select]
<b>{MSG_AUTHOR}</b>
to this:
Code: [Select]
<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.
Title: Re: [Solved] displayimage.php: how to make username of comment author clickable?
Post by: jerx on November 08, 2005, 12:48:19 pm
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?
Title: Re: [Solved] displayimage.php: how to make username of comment author clickable?
Post by: Nibbler on November 08, 2005, 01:09:53 pm
It stores both. The user_id is author_id in the db.
Title: Re: [Solved] displayimage.php: how to make username of comment author clickable?
Post by: jerx on November 08, 2005, 02:07:30 pm
Think I need an eye check. Ok, now I really solved it:

open displayimage.php:

search for (line 387):
Code: [Select]
$params = array('{MSG_AUTHOR}' => $row['msg_author'],
after add:
Code: [Select]
'{AUTHOR_ID}' => $row['author_id'],
open theme.php:

replace:
Code: [Select]
<b><a href="../profile.php?mode=viewprofile&u={MSG_AUTHOR}">{MSG_AUTHOR}</a></b>
with:
Code: [Select]
<b><a href="../profile.php?mode=viewprofile&u={AUTHOR_ID}">{MSG_AUTHOR}</a></b>
Title: Re: [Solved] displayimage.php: how to make username of comment author clickable?
Post by: dEnA on February 13, 2006, 04:11:37 pm
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"
Title: Re: [Solved] displayimage.php: how to make username of comment author clickable?
Post by: Joachim Müller on February 13, 2006, 05:32:10 pm
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.