[MOD] Link to Author's Profile Page in Comments [MOD] Link to Author's Profile Page in Comments
 

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

Main Menu

[MOD] Link to Author's Profile Page in Comments

Started by Makc666, February 20, 2007, 10:22:07 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Makc666

For this board:
http://forum.coppermine-gallery.net/index.php?board=76.0

I think this one can be/must be included in 1.4.11 ;)

########################################################
## MOD Title: Link to Author's Profile Page in Comments
## MOD Author: Makc666 < makc666@yahoo.com > (Maxim) http://makc666.tripod.com
## MOD Description: Replace author's name in comments with author's name as a link to author's profile page.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 1
## include/themes.inc.php
##
## Included Files: 0
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
#################################################################
## For security purposes, please check: http://forum.coppermine-gallery.net/index.php?board=84.0
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://forum.coppermine-gallery.net/index.php?board=84.0
##############################################################
## Author Notes:
## Tested on 1.4.10
##
##############################################################
## MOD History:
##
##   2007-02-20 - Version 1.0.0
##      - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
include/themes.inc.php
#
#-----[ FIND ]------------------------------------------
#
                                <td class="tableh2_compact" nowrap="nowrap">
                                        <b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}"></a>&nbsp;
#
#-----[ REPLACE WITH ]------------------------------------------
#
                                <td class="tableh2_compact" nowrap="nowrap">
                                        <a href ="profile.php?uid={MSG_AUTHOR_ID}"><b>{MSG_AUTHOR}</b></a><a name="comment{MSG_ID}"></a>&nbsp;
#
#-----[ FIND ]------------------------------------------
#
        $params = array('{MSG_AUTHOR}' => stripslashes($row['msg_author']),
            '{MSG_ID}' => $row['msg_id'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
            '{MSG_AUTHOR_ID}' => $row['author_id'],
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Nibbler

How does this handle anonymous comments?

include/themes.inc.php should not be modified, instead modify your theme's theme.php

photocritic


Alex Revo

Quote from: Nibbler on February 20, 2007, 02:08:02 PM
How does this handle anonymous comments?

include/themes.inc.php should not be modified, instead modify your theme's theme.php


// HTML template for the display of comments
if (!isset($template_image_comments)) { //{THEMES}
$template_image_comments = '
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td>
                        <table width="100%" cellpadding="0" cellspacing="0">
                           <tr>';

if (MSG_AUTHOR_ID==0) {
$template_image_comments .= '
<td class="tableh2_compact" nowrap="nowrap">
                                        <b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}"></a>&nbsp;';
} else {
$template_image_comments .= '
<td class="tableh2_compact" nowrap="nowrap">
                                        <a href ="profile.php?uid={MSG_AUTHOR_ID}"><b>{MSG_AUTHOR}</b></a><a name="comment{MSG_ID}"></a>&nbsp;';
}
}
$template_image_comments .= <<<EOT
<!-- BEGIN ipinfo -->
...


It does not work, where my mistake?

Makc666

Quote from: Nibbler on February 20, 2007, 02:08:02 PM
How does this handle anonymous comments?
If it is Anonymous user then the link direct you to User's Profile with ID = 0.
Like this one:
http://coppermine-gallery.net/demo/cpg14x/profile.php?uid=0

Quote from: Nibbler on February 20, 2007, 02:08:02 PM
include/themes.inc.php should not be modified, instead modify your theme's theme.php
But if I want this one to be included in all themes? ;)
Than I think I can modify include/themes.inc.php
Hope to see in 1.4.11 as default.

Joachim Müller

cpg1.4.11 will be a maintenance release and therefor will definitely not contain new features. New features can possibly only go into new versions, which would be cpg1.5.x

Stramm

That's part of the modpack since the beginning. Anon commenters aren't clickable (of course, cause the do not have a profile). Maybe you want to copy that functionality.

Joachim Müller

Feature already implemented in the devel branch  ;)

bradenkeith


jerx

This is exactly what I needed. Although I think this should be available in every template, I copied theme_html_comments function from the sample theme and modified it. I use it on a bridged cpg 1.4.19 and it works perfect!