Welcome to Geeklog, Anonymous Friday, September 22 2023 @ 04:41 pm EDT

Geeklog Forums

Non-public comments hack with Gallery 1.4-pl2

Status: offline


Forum User
Registered: 11/15/03
Posts: 7

I just wanted to contribute with a hack for those who use Geeklog with Gallery 1.4-pl2 integration wanting geeklog
to pass current username to the add comment form - no
more anonymous comments Smile

The hack consists of changing a bit in ../gallery/add_comment.php like below;
Text Formatted Code
if (isset($save)) {
                require_once($GEEKLOG_DIR . '/lib-common.php');
                global $_USER, $_CONF;
                $commenter_name = '<a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $_USER['uid'] . '">' . $_USER['usern ame'] . '</a>';
                if (!$_USER['uid'] >= 2) {$commenter_name = "";};
        if ($commenter_name && $comment_text) {
                $comment_text = removeTags($comment_text);
//              $commenter_name = removeTags($commenter_name);
                $IPNumber = $HTTP_SERVER_VARS['REMOTE_ADDR'];
                $gallery->album->addComment($index, stripslashes($comment_text), $IPNumber, $commenter_name);
        } else {
                $error_text = _("Name and comment are both required to save a new comment!");


Then you should also delete the html-part for the username field in the html-part of ../gallery/add_comment.php like below;
Text Formatted Code
  <td><?php echo _("Name or email:") ?></td>
  <td><input name="commenter_name" value="<?php echo $commenter_name ?>" size=30></td>

And at last, change the affected add_comments messages in your ../gallery/po/xx_xx-gallery.po and compile it !

Good luck !

All times are EDT. The time is now 04:41 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content