forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Comments => Topic started by: Makc666 on February 20, 2007, 10:22:07 am

Title: [MOD] Link to Author's Profile Page in Comments
Post by: Makc666 on February 20, 2007, 10:22:07 am
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 ;)

Code: [Select]
########################################################
## 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
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: 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
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: photocritic on February 20, 2007, 03:26:22 pm
Thanks! Very easy install.
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: Alex Revo on February 21, 2007, 09:38:52 am
How does this handle anonymous comments?

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

Code: [Select]
// 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?
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: Makc666 on February 21, 2007, 01:20:57 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

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.
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: Joachim Müller on February 21, 2007, 04:23:31 pm
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
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: Stramm on February 21, 2007, 05:23:24 pm
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.
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: Joachim Müller on February 22, 2007, 09:10:04 am
Feature already implemented in the devel branch  ;)
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: bradenkeith on December 14, 2007, 12:07:52 am
bro i really like this
Title: Re: [MOD] Link to Author's Profile Page in Comments
Post by: jerx on November 17, 2008, 09:35:50 am
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!