Advanced search  

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

Pages: [1]   Go Down

Author Topic: [MOD] Link to Author's Profile Page in Comments  (Read 18856 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page
[MOD] Link to Author's Profile Page in Comments
« 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
« Last Edit: February 21, 2007, 01:39:00 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #1 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
Logged

photocritic

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #2 on: February 20, 2007, 03:26:22 pm »

Thanks! Very easy install.
Logged

Alex Revo

  • LocalSupporter
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 637
    •  --
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #3 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?
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #4 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.
Logged

Joachim Mller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #5 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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #6 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.

Joachim Mller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #7 on: February 22, 2007, 09:10:04 am »

Feature already implemented in the devel branch  ;)
Logged

bradenkeith

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • Braden Keith.com
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #8 on: December 14, 2007, 12:07:52 am »

bro i really like this
Logged

jerx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: [MOD] Link to Author's Profile Page in Comments
« Reply #9 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!
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 21 queries.