Welcome to Geeklog, Anonymous Friday, April 19 2024 @ 09:09 pm EDT

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 EDT. The time is now 09:09 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