Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
4 - 1 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: module CBB - a question of anonymous posting
by winfred on 2006/8/17 0:10:20

Here is my implementation:

1. insert a column named uid_r into xoops_bb_posts to backup the poster's uid
le="color: #000000"><?php ALTER TABLE `xoops_bb_posts` ADD `uid_r` INT UNSIGNED DEFAULT '0' NOT NULL AFTER `uid` ;


2. modify xoops/modules/newbb/post.php -> record id in uid_r whenever the anonymous option checked
le="color: #000000"><?php --- post.php.orig 2006-08-15 20:13:58.000000000 +0800 +++ post.php 2006-08-15 20:15:59.000000000 +0800 @@ -173,9 +173,11 @@ $isnew = 1; if ( is_object($xoopsUser) && empty($_POST['noname']) ) { $uid = $xoopsUser->getVar("uid"); + $uid_r = 0; } else { $uid = 0; + $uid_r = $xoopsUser->getVar("uid"); } if (isset($pid) && $pid != "") { $forumpost->setVar('pid', $pid); @@ -187,6 +189,7 @@ //$post_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']))?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR']; $forumpost->setVar('poster_ip', newbb_getIP()); $forumpost->setVar('uid', $uid); + $forumpost->setVar('uid_r', $uid_r); } if($topic_handler->getPermission($forum, $topic_status, 'noapprove')) $approved = 1; @@ -453,4 +456,4 @@ include XOOPS_ROOT_PATH.'/footer.php'; -?> No newline at end of file +?>


3. modify xoops/modules/newbb/class/post.php -> write uid_r into database
le="color: #000000"><?php --- post.php.orig 2006-08-15 20:14:08.000000000 +0800 +++ post.php 2006-08-15 20:18:14.000000000 +0800 @@ -44,6 +44,7 @@ $this->initVar('dosmiley', XOBJ_DTYPE_INT, 1); $this->initVar('doxcode', XOBJ_DTYPE_INT, 1); $this->initVar('uid', XOBJ_DTYPE_INT, 1); + $this->initVar('uid_r', XOBJ_DTYPE_INT, 1); $this->initVar('icon', XOBJ_DTYPE_TXTBOX); $this->initVar('attachsig', XOBJ_DTYPE_INT); $this->initVar('approved', XOBJ_DTYPE_INT, 1); @@ -633,9 +634,9 @@ $post_id = $this->db->genId($this->db->prefix("bb_posts") . "_post_id_seq"); $sql = "INSERT INTO " . $this->db->prefix("bb_posts") . " - ( post_id, pid, topic_id, forum_id, post_time, uid, poster_ip, poster_name, subject, dohtml, dosmiley, doxcode, doimage, dobr, icon, attachsig, attachment, approved, post_karma, require_reply) VALUES - ($post_id, $pid, $topic_id, $forum_id, $post_time, $uid, $poster_ip, $poster_name, $subject, $dohtml, $dosmiley, $doxcode, $doimage, $dobr, $icon, $attachsig, $attachment, $approved, $post_karma, $require_reply)"; + ($post_id, $pid, $topic_id, $forum_id, $post_time, $uid, $uid_r, $poster_ip, $poster_name, $subject, $dohtml, $dosmiley, $doxcode, $doimage, $dobr, $icon, $attachsig, $attachment, $approved, $post_karma, $require_reply)"; if (!$result = $this->db->queryF($sql)) { newbb_message("Insert post error:" . $sql); @@ -897,4 +898,4 @@ } } -?> No newline at end of file +?>


so that only admin with right reading database would know who the original poster is
Re: module CBB - a question of anonymous posting
by Djiman on 2006/8/3 14:35:45

try some other tricks then!
If you don't want viewers to view the username of the post in your forum,
You can either stop echo-ing the username in the template -remove it manually.

Or should you wish it to be visible only to admin .
Set your forum to
- register to post ,
- then in the forum's templates, in-between ,, our famous IF! - you can exploit the if xoops_isadmin show me the username else hide the secret.
and that should show the username only to admin and the regis are tricked a little, --but their username wont be visible to none-admin.

Winfred; don't kill me for that now.
as the say it in the trade, back up and back up.
Re: module CBB - a question of anonymous posting
by winfred on 2006/8/3 14:08:46

Yes,
comparing IP address to registered accounts is a way finding out who is the original owner of the 'existing' anonymous posts.

However,
What I would like to do is: keep a id records of anonymous posts 'after'.

First, one must login first in order to see posts.
-> It is done by configuration.
Second, he have to click the anonymous in the Options Checkbox.
-> It is also done by configuration.

Than, before the post being stored in database,
-> I would like to keep his id somewhere only admin could acess.
-> This part, it seems that I need to write my own patches.
Re: module CBB - a question of anonymous posting
by Djiman on 2006/8/3 13:16:44

if you really want to know who is posting what as ano...
try one trick , get the IP of that anony.. ' if there is one ' and compare .. to your registered.
other than that ain't have any idea.
Re: module CBB - a question of anonymous posting
by winfred on 2006/8/3 12:52:21

If I am going to write patches myself,
is there any suggestion?

For example, where should I start?
or which place is best would I save information?

Who's Online

190 user(s) are online (142 user(s) are browsing Support Forums)


Members: 0


Guests: 190


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits