PDA

View Full Version : Logged in users post anonymously


Gary King
06-27-2002, 07:10 PM
Could someone make a hack to allow logged in users to be able to post anonymously in ONE forum?

Thanks :D

Xenon
06-27-2002, 07:21 PM
open newreply.php

find this:
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,at tachmentid,pagetext,allowsmilie,showsignature,ipad dress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconi d','$visible')");

and replace with:
if($forumid!=X) {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,at tachmentid,pagetext,allowsmilie,showsignature,ipad dress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconi d','$visible')");
} else {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,at tachmentid,pagetext,allowsmilie,showsignature,ipad dress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','Anonym','0','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconi d','$visible')");
}

then find
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");[php]

and replace with
[php]if($forumid!=x) {
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='Anonym' WHERE threadid='$threadid'");
}

then find$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
and replace withif($forumid!=x) {
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='Anonym' WHERE threadid='$threadid'");
}

replace the x with your forum id

@filburt: thats also an idea ;)

filburt1
06-27-2002, 07:22 PM
/me is intrigued by the idea
If the admin can see who actually posted the message then it would be cool. You could always just edit the template set for that one forum so there's no reference of the username or userid.

Gary King
06-27-2002, 07:27 PM
Interesting - much thx Xenon :D

Xenon
06-27-2002, 07:37 PM
you're welcome :)

Logician
06-27-2002, 10:13 PM
* Logician feels urge to assist team mate Xenon :)

Maybe using

if($forumid==x) {
$bbuserinfo[userid]=0;
$bbuserinfo[username]='Anomy';
}


can save some typing and also the effort to hack email notification part, because after db insert, his userid is sent to sendnotification function and thread subscribers learn his real identity if we dont clear it. :)

@Blak n Wite: BTW I wonder why you dont just enable guest posting in that forum? So if someone wants to post without his username, he can just log off and post with a guest account.

@filburt1: nice idea but does not work: an insistent user can still track the post user with Search function (show posts), user profile (which shows the last post of user), also search all posts by user option. So database modification as Xenon suggested is necessary and this makes hard to learn his identity for admins too. Your one chance may be enabling email notification for mods in this forum and send his real username with new post notification mail. Other solution would require db alteration which is not recommended for this small hack..

Xenon
06-27-2002, 10:52 PM
lool, yes better do what my team mate logician said, its much easier :)

@filburt: when you create an extra field to the post-table then this could be done easili, but without changes to the database it'll be very hard.

Gary King
06-27-2002, 10:56 PM
Originally posted by Logician
* Logician feels urge to assist team mate Xenon :)

Maybe using

if($forumid==x) {
$bbuserinfo[userid]=0;
$bbuserinfo[username]='Anomy';
}


can save some typing and also the effort to hack email notification part, because after db insert, his userid is sent to sendnotification function and thread subscribers learn his real identity if we dont clear it. :)

@Blak n Wite: BTW I wonder why you dont just enable guest posting in that forum? So if someone wants to post without his username, he can just log off and post with a guest account.

@filburt1: nice idea but does not work: an insistent user can still track the post user with Search function (show posts), user profile (which shows the last post of user), also search all posts by user option. So database modification as Xenon suggested is necessary and this makes hard to learn his identity for admins too. Your one chance may be enabling email notification for mods in this forum and send his real username with new post notification mail. Other solution would require db alteration which is not recommended for this small hack..

I don't want to enable guests for that forum, because guests can't see the forums :) Only registered members can :D