Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 01:33 am EST

Geeklog Forums

Non-public comments hack with Gallery 1.4-pl2


Status: offline

pernas

Forum User
Newbie
Registered: 11/15/03
Posts: 7
Hi!

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);
                $gallery->album->save();
                dismissAndReload();
                return;
        } 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
<tr>
  <td><?php echo _("Name or email:") ?></td>
  <td><input name="commenter_name" value="<?php echo $commenter_name ?>" size=30></td>
</tr>
 


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

Good luck !
Regards,
Per
 Quote

All times are EST. The time is now 01:33 am.

  • 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