Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved] displayimage.php: how to make username of comment author clickable?  (Read 8931 times)

0 Members and 1 Guest are viewing this topic.

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85

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.
« Last Edit: October 31, 2005, 11:28:26 am by GauGau »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: displayimage.php: how to make username of comment author clickable?
« Reply #1 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>

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: displayimage.php: how to make username of comment author clickable?
« Reply #2 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.
Logged

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85

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?
Logged

Nibbler

  • Guest

It stores both. The user_id is author_id in the db.
Logged

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85

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>
Logged

dEnA

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20

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"
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.