2010-10-29, 03:41 PM
If anyone is interested in a code modification (no plugin, sorry)
to allow anonymous posting (without enabling guest posting), here it is :
Create a new registered user (in the admin cp) that will be used as sock puppet.
Take note of the User ID.
HINT : I suggest to set the options for the sock puppet to disallow users to send PM and eMails, etc
Edit the following templates :
newreply
newthread
Find :
Add :
Edit the following PHPs in the forum root
newreply.php
newthread.php
Find in newreply.php:
Add BELOW it
Replace XXXX with the plain user id of the created sock puppet.
You have to do this twice in the script. (just search it)
Now edit newthread.php
Find :
Add BELOW it :
Again, replace XXXX with the userid of the sock puppet
And again : do it twice in the php file.
DONE!
Addition :
If you want to hide that sock puppet from the member list, hack the memberlist.php file
Look for :
Add right before it :
Again, replace XXXX with the User ID from the sock puppet.
I use this mod myself. It should work.
to allow anonymous posting (without enabling guest posting), here it is :
Create a new registered user (in the admin cp) that will be used as sock puppet.
Take note of the User ID.
HINT : I suggest to set the options for the sock puppet to disallow users to send PM and eMails, etc
Edit the following templates :
newreply
newthread
Find :
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
Add :
<label><input type="checkbox" class="checkbox" name="postoptions[anonymous]" value="1" tabindex="6" /> Anonymously</label>
Edit the following PHPs in the forum root
newreply.php
newthread.php
Find in newreply.php:
$post = array(
"tid" => $mybb->input['tid'],
"replyto" => $mybb->input['replyto'],
"fid" => $thread['fid'],
"subject" => $mybb->input['subject'],
"icon" => $mybb->input['icon'],
"uid" => $uid,
"username" => $username,
"message" => $mybb->input['message'],
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']
);
Add BELOW it
if ($mybb->input['postoptions']['anonymous'] == 1)
{
$post = array(
"tid" => $mybb->input['tid'],
"replyto" => $mybb->input['replyto'],
"fid" => $thread['fid'],
"subject" => $mybb->input['subject'],
"icon" => $mybb->input['icon'],
"uid" => XXXX,
"username" => 'Anonymous',
"message" => $mybb->input['message'],
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']
);
}
Replace XXXX with the plain user id of the created sock puppet.
You have to do this twice in the script. (just search it)
Now edit newthread.php
Find :
$new_thread = array(
"fid" => $forum['fid'],
"subject" => $mybb->input['subject'],
"prefix" => $mybb->input['threadprefix'],
"icon" => $mybb->input['icon'],
"uid" => $uid,
"username" => $username,
"message" => $mybb->input['message'],
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']
);
Add BELOW it :
if($mybb->input['postoptions']['anonymous'] == 1)
{
$new_thread = array(
"fid" => $forum['fid'],
"subject" => $mybb->input['subject'],
"prefix" => $mybb->input['threadprefix'],
"icon" => $mybb->input['icon'],
"uid" => XXXX,
"username" => 'Anonymous',
"message" => $mybb->input['message'],
"ipaddress" => get_ip(),
"posthash" => $mybb->input['posthash']
);
}
Again, replace XXXX with the userid of the sock puppet
And again : do it twice in the php file.
DONE!
Addition :
If you want to hide that sock puppet from the member list, hack the memberlist.php file
Look for :
$query = $db->query("
Add right before it :
$search_query .= " AND u.uid <> XXXX ";
$search_query .= " AND u.username <> 'Anonymous'";
Again, replace XXXX with the User ID from the sock puppet.
I use this mod myself. It should work.