vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Allow Your Users to Post Anonymously Without Logging Out (https://vborg.vbsupport.ru/showthread.php?t=78410)

amykhar 03-21-2005 01:41 PM

Quote:

Originally Posted by Challenge
What about some pics of postbit?

OK. I added one to the first post

https://vborg.vbsupport.ru/attachmen...chmentid=24951

Lionel 03-21-2005 01:46 PM

:up: :up: Hack works as described. You people don't cease to amaze me. Every time I think that vb has been hacked out totally, you keep on coming up with something very useful...

amykhar 03-21-2005 04:37 PM

A long time ago, one of my members took the avatar I was using and modified it. I got to looking at it today and realized it would be the perfect avatar to use with your anonymous user account. I am posting it here just in case you would like to use it.

Leah 03-23-2005 09:24 AM

Quote:

Originally Posted by Lionel
Yes it is available. Problem is somehow permissions related, because when I do $postanonoption="whatever"; instead of $postanonoption="";
whatever is displayed below the smilies

I'm having the same problem.

Leah 03-23-2005 10:13 AM

Quote:

Originally Posted by Leah
I'm having the same problem.

Nevermind.
I seem to have missed step 5b. :)

adielsh 03-24-2005 08:37 AM

I arrive to strp 6 i finish this step and i try to test
and this what i recived
Code:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/borecas/domains/borecas.net/public_html/forum/includes/functions_newpost.php on line 420
and now i can't to write message
pliz help me

nexialys 03-24-2005 10:26 AM

can you add a feature or two if i don't add them myself?!:
1- admins can see the users realname and userid with link-redirect to their profile...
2- a tag on forumlist to display where we can post as anonymous

... this hack is just great for most boards ...

adielsh 03-24-2005 10:46 AM

Quote:

Originally Posted by adielsh
I arrive to strp 6 i finish this step and i try to test
and this what i recived
Code:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/borecas/domains/borecas.net/public_html/forum/includes/functions_newpost.php on line 420
and now i can't to write message
pliz help me

never mind i found the problem but why i can't writ anonymi when i use administration user?

Greebo 03-24-2005 02:38 PM

Great hack so far - I'm on step 7 now - but one omission in your instructions:

Step 6r is missing instructions to upload showthread.php -- took me a while to figure out why I couldn't see who I was posting as when logged in as my admin account. :)

amykhar 03-24-2005 03:35 PM

Quote:

Originally Posted by nexialys
can you add a feature or two if i don't add them myself?!:
1- admins can see the users realname and userid with link-redirect to their profile...
2- a tag on forumlist to display where we can post as anonymous

... this hack is just great for most boards ...

The first thing you requested is built into it.

amykhar 03-24-2005 03:36 PM

Quote:

Originally Posted by adielsh
never mind i found the problem but why i can't writ anonymi when i use administration user?

You have to enable it for the user group that you want to be allowed to use it. You also have to run that query to update the permissions of existing users.

amykhar 03-24-2005 03:37 PM

Quote:

Originally Posted by Greebo
Great hack so far - I'm on step 7 now - but one omission in your instructions:

Step 6r is missing instructions to upload showthread.php -- took me a while to figure out why I couldn't see who I was posting as when logged in as my admin account. :)

Thank you. I'll fix that in a few minutes.

Greebo 03-24-2005 04:27 PM

This is an excellent hack! I really needed this for my forums. Can I make a contribution?

I do have one question tho - for some reason my "anon" post still shows my avatar to me - but others see the avatar I specified (I liked the eyes listed above). What am I missing?

amykhar 03-24-2005 05:16 PM

You should be seeing your own user profile - avatar and all. But, others should see the profile for the anon user. So, what you are describing is how it should work.

Greebo 03-24-2005 05:38 PM

Ok your statements:
ALTER TABLE `post` ADD `postanon` TINYINT( 4 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `post` ADD `anonname` VARCHAR( 50 ) NOT NULL ;
ALTER TABLE `forum` ADD `postanon` TINYINT( 4 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `forum` ADD `anonname` VARCHAR( 50 ) NOT NULL ;
ALTER TABLE `thread` ADD `postanon` TINYINT( 4 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `thread` ADD `anonname` VARCHAR( 50 ) NOT NULL ;

Should *NOT* be TINYINT.

My tester account user id is 257 but its being changed to 127 because the column is too small. Change it to standard int :)

Greebo 03-24-2005 05:56 PM

Should users who have posted anonymously be able to edit their anonymous post?

My test account sees the edit button, but gets a permissions error when attempting to edit. However, if my admin account goes in to edit, it works.

I'm guessing there's a test in editpost thats not taking anonymity into account? Or is this intended?

Greebo 03-24-2005 06:13 PM

Ok, here's what I ended up doing to make this work:

In editpost.php I replaced:
PHP Code:

    if ($bbuserinfo['userid'] != $postinfo['userid'])
   {
    
// check user owns this post
    
print_no_permission();
   }
   else
   {
    
// check for time limits
    
if ($postinfo['dateline'] < (TIMENOW - ($vboptions['edittimelimit'] * 60)) AND $vboptions['edittimelimit'] != 0)
    {
     eval(
print_standard_error('error_edittimelimit'));
    }
   } 

With
PHP Code:

   if ($postinfo['postanon'])
   {
    if (
$bbuserinfo['userid'] != $postinfo['postanon'])
    {
     
// check user owns this post
     
print_no_permission();
    }
   }
   else
   {
    if (
$bbuserinfo['userid'] != $postinfo['userid'])
    {
     
// check user owns this post
     
print_no_permission();
    }
   }
   
// check for time limits
   
if ($postinfo['dateline'] < (TIMENOW - ($vboptions['edittimelimit'] * 60)) AND $vboptions['edittimelimit'] != 0)
   {
    eval(
print_standard_error('error_edittimelimit'));
   } 

Hope that helps if anyone else is having this issue. I suspect the install instructions just missed a step here...unless I missed them but I checked several times. :)

amykhar 03-24-2005 07:03 PM

Quote:

Originally Posted by Greebo
Ok your statements:
ALTER TABLE `post` ADD `postanon` TINYINT( 4 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `post` ADD `anonname` VARCHAR( 50 ) NOT NULL ;
ALTER TABLE `forum` ADD `postanon` TINYINT( 4 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `forum` ADD `anonname` VARCHAR( 50 ) NOT NULL ;
ALTER TABLE `thread` ADD `postanon` TINYINT( 4 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `thread` ADD `anonname` VARCHAR( 50 ) NOT NULL ;

Should *NOT* be TINYINT.

My tester account user id is 257 but its being changed to 127 because the column is too small. Change it to standard int :)

Doh. Can't believe I did the tinyint thing. I'll change the directions right now.

amykhar 03-24-2005 07:05 PM

Quote:

Originally Posted by Greebo
Ok, here's what I ended up doing to make this work:

In editpost.php I replaced:
PHP Code:

    if ($bbuserinfo['userid'] != $postinfo['userid'])
   {
    
// check user owns this post
    
print_no_permission();
   }
   else
   {
    
// check for time limits
    
if ($postinfo['dateline'] < (TIMENOW - ($vboptions['edittimelimit'] * 60)) AND $vboptions['edittimelimit'] != 0)
    {
     eval(
print_standard_error('error_edittimelimit'));
    }
   } 

With
PHP Code:

   if ($postinfo['postanon'])
   {
    if (
$bbuserinfo['userid'] != $postinfo['postanon'])
    {
     
// check user owns this post
     
print_no_permission();
    }
   }
   else
   {
    if (
$bbuserinfo['userid'] != $postinfo['userid'])
    {
     
// check user owns this post
     
print_no_permission();
    }
   }
   
// check for time limits
   
if ($postinfo['dateline'] < (TIMENOW - ($vboptions['edittimelimit'] * 60)) AND $vboptions['edittimelimit'] != 0)
   {
    eval(
print_standard_error('error_edittimelimit'));
   } 

Hope that helps if anyone else is having this issue. I suspect the install instructions just missed a step here...unless I missed them but I checked several times. :)

Good catch. Editing has been the bane of my existance from day one. I'll test your tweaks and see how it goes on my test board.

adielsh 03-24-2005 09:30 PM

Quote:

Originally Posted by amykhar
You have to enable it for the user group that you want to be allowed to use it. You also have to run that query to update the permissions of existing users.

I enable the permission of the administarator user group to write anonymous
and i run all query and it dosn't work, all user group can write as anonymous but only administarator user group can't
mybe i don't run right the query which query i need to run for the administarator user group?

amykhar 03-24-2005 10:03 PM

The query at the end updates the permissions for all user groups. You're going to have to double check your permission settings at every level. There is no difference in the code between admins and any other user group. If it works for one, it works for all if you have your settings correct.

Greebo 03-25-2005 09:36 AM

I just want to thank you again for developing this hack!! This is working great so far!

Greebo 03-28-2005 03:49 PM

Ok, the modification to editpost.php has a logic error in it.

You test two conditions in a nested double test:
Was post made anon?
- Yes
-- was it anon before?
---Yes set a bunch of vars incl $threadupdate
---No set a bunch of vars incl $threadupdate
- No
-- was it anon before?
---Yes set a bunch of vars incl $threadupdate
---No set a bunch of vars incl $threadupdate

Then you later have logic twice to update the thread
// if (!empty($threadupdate))

$threadupdate will never be empty in either case.

Net effect: When a thread is posted and someone replies to it and then edits their reply, thread.postusername and thread.postuserid are overwridden inappropriately and the 2nd threadupdate . Thread should only be updated with anon/real user names and IDs if the OP is edited.


This is the change I made to the entire code set of editpost.php following delete_post_index($postid);
PHP Code:

  // The post is made anonymously
  
if ($edit['postanon'])
  {
   
// Check to see if it was made anonymously BEFORE the edit
   
if ($postinfo['postanon'])
   {
    
$edit['postusername']= $postinfo['username'];
    
$edit['userid'] = $postinfo['userid'];
    
$edit['postanon'] = $postinfo['postanon'];
    
$edit['anonname'] = $postinfo['username'];
    if(
$threadinfo[firstpostid] == $postinfo[postid])
    {
     
$threadupdate[] = "postusername = '" addslashes(htmlspecialchars_uni($edit['postusername'])) . "',anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
    }
    
$forumupdate "anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
   }
   
// If not, we need to set the values.
   
else
   {
    
// This isn't exactly right. But, most times, it will work.
    
$edit['postusername']= $usergroupcache["$bbuserinfo[usergroupid]"]['anonname'];
    
$edit['postusername']= $threadinfo[postusername];
    
$edit['userid'] = 256;
    
$edit['postanon'] = $postinfo['userid'];
    
$edit['anonname'] = $postinfo['username'];
    if(
$threadinfo[firstpostid] == $postinfo[postid])
    {
     
$threadupdate[] = "postusername = '" addslashes(htmlspecialchars_uni($edit['postusername'])) . "',anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
    }
    
$forumupdate "anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
   }
  }
  
// The post is no longer made anonymously
  
else
  {
   
// Check to see if it was made anonymously BEFORE the edit.
   
if ($postinfo['postanon'])
   {
    
$edit['postusername']= $postinfo['anonname'];
    
$edit['userid'] = $postinfo['postanon'];
    
$edit['postanon'] = 0;
    
$edit['anonname'] = "";
    if(
$threadinfo[firstpostid] == $postinfo[postid])
    {
     
$threadupdate[] = "postusername = '" addslashes(htmlspecialchars_uni($edit['postusername'])) . "',anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
    }
    
$forumupdate "anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
   }
   else
   {
    
$edit['postanon'] = 0;
    
$edit['anonname'] = "";
    
$edit['userid'] = $postinfo['userid'];
    
$edit['postusername'] = $postinfo['username'];
    if(
$threadinfo[firstpostid] == $postinfo[postid])
    {
     
$threadupdate[] = "postusername = '" addslashes(htmlspecialchars_uni($edit['postusername'])) . "',anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
    }
    
$forumupdate "anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
   }
  }
  if (!empty(
$threadupdate))
  {
   
// do thread update
   
$DB_site->query("
    UPDATE " 
TABLE_PREFIX "thread
    SET " 
implode(', '$threadupdate) . "
    WHERE threadid = 
$threadinfo[threadid]
   "
);
  }
  if (
$foruminfo['lastposter'] == $postinfo['username'])
  {
   
// this thread is the one being displayed as the thread with the last post...
    
$forumupdate "lastposter = '" addslashes(htmlspecialchars_uni($edit['postusername'])) . "', postanon = $edit[postanon]";
  }
  if (
$threadinfo['lastposter'] == $postinfo['username'])
  {
   
// this post is the one being displayed as the thread with the last post...
     
$threadupdate[] = "lastposter = '" addslashes(htmlspecialchars_uni($edit['postusername'])) . "',anonname = '" addslashes(htmlspecialchars_uni($edit['anonname'])) . "', postanon = $edit[postanon]";
  }
  if (!empty(
$threadupdate))
  {
   
// do thread update
   
$DB_site->query("
    UPDATE " 
TABLE_PREFIX "thread
    SET " 
implode(', '$threadupdate) . "
    WHERE threadid = 
$threadinfo[threadid]
   "
);
  } 

You will see, I wrapped all updates to $threadupdate in a conditional validating that the post edited is the first post in the thread.

I also removed "postuserid = $edit[userid]" in all spots in that code (it was in every update to $threadupdate).

ThePimp 03-31-2005 12:32 PM

Ok, I've installed this hack, and it seems as though it's not functioning properly... can someone please assist me with this?

Here's what's happening...
I can post as anon via New Thread, Reply & Quick Reply.
Anon shows up as the username, however, the avatars still show, even when logged out. Also, the "location" shows up, and for some reason, the Anon avatar doesn't work, and the anon user title doesn't either. The other issue is that when you click on the Anonymous username, and view profile, it shows the REAL poster's profile.

I've tested this as Admin / Mod & User. Even Not Logged In users can see the Anon's REAL avatar / location etc...

Did I miss a step somewhere around the Postbit or showthread? I'm using the Postbit Legacy, on vb3.07.

amykhar 03-31-2005 04:29 PM

Well, if you have followed the directions, you have not completely installed the hack because this problem would have shown up during testing. What step are you on? That makes it easier to diagnose what could be going on. Also, I need a link to a thread that is having the problem.

Tsukasa2k5 04-01-2005 06:51 AM

Hi,

Excellent work, but I've a question:
If more users than one can answer anonymous a thread it will be usefull, that the users know, who had answerd. Maybe with a random number after the "Anonymous Registered User" username.

For example:

1. Post:
Anonymous Registered User [777]
Hi there

2. Post:
Anonymous Registered User [888]
What are you doing ?

3. Post:
Anonymous Registered User [777]
Nothing

So the other users know that the 1. and 3. post was posted by the same user.

I hope you understand what i mean :nervous:

spence2 04-01-2005 12:16 PM

I understand what you mean...and it sounds like a useful mod to the hack. Less confusion in the thread regarding who's replying to whom.

amykhar 04-01-2005 02:08 PM

Feel free to do it as an addon, but this hack is already massively complicated. I'm not sure users could take any more changes; so I won't be implementing that at this juncture.

MrZeropage 04-01-2005 05:30 PM

I just found this hack today and *funny* I am working on the same for some months now and will be going to finish it soon.

But it is less complicated, I just took a look on your instructions and how you did it *wow*

My "Anonymity-Hack" will bring that requested feature along with it and even some more, while it also does not need any additional table in the database and less queries.



I just started beta-testing my hack ...



Anyway - nice work, when mine is finished we should compare them ;)

ThePimp 04-01-2005 09:23 PM

Quote:

Originally Posted by amykhar
Well, if you have followed the directions, you have not completely installed the hack because this problem would have shown up during testing. What step are you on? That makes it easier to diagnose what could be going on. Also, I need a link to a thread that is having the problem.

I went top to bottom of your instructions, but it may be possible that something got missed, as it was around 4:00AM when I installed it, and I was starting to get tired. Let me ask you this... DOES your hack change the AVATAR for the Anon posters to the one being used in the Anon profile, as well as change the user title? If so, could you point me to which step in your instructions these functions are located?

Thanks

ThePimp 04-01-2005 09:24 PM

The only things that don't seem to be working are profile related.

amykhar 04-01-2005 10:17 PM

Quote:

Originally Posted by ThePimp
I went top to bottom of your instructions, but it may be possible that something got missed, as it was around 4:00AM when I installed it, and I was starting to get tired. Let me ask you this... DOES your hack change the AVATAR for the Anon posters to the one being used in the Anon profile, as well as change the user title? If so, could you point me to which step in your instructions these functions are located?

Thanks

It changes the whole userid. When installed properly, normal users and logged out people see the profile of the Anonymous user that you created. Admins and mods see the profile of the true user.

Lionel 04-01-2005 10:41 PM

I do have a small problem. Although permissions are set, new users are not allowed

Lionel 04-01-2005 10:49 PM

I am able to fix when I go to user in admincp. I see that permissions are there. But he is not allowed. I save, then it's ok. Problem is I can't do that every time :-)

Lionel 04-01-2005 10:54 PM

Perhaps the profilefield is not updating? As admin I can see private field. I noticed all new users had nothing for anonymous permissions until I manually update user in control panel. Just click save without doing anything else, then I can see it in profile.

Lionel 04-01-2005 11:10 PM

It would have been nice to be able to use another set of new status icons for forums and subforums like forum_new.gif, forum_old.gif to indicate that forum accepts anonymous posting (anon_new.gif, anon_old.gif)

mrsbuzzy 04-05-2005 01:20 AM

Hello, I think this looks awesome! I just have one quick question before we start to install. Can we set it up so that only a specified forum allows anonymous posts? I have 2 forums I would like that option.

My other question is (I don't think this was mentioned in this thread, but I may have missed it) will people's signature show up when they're set to anonymous?

I greatly appreciate the work you put into this.
Dawn

amykhar 04-05-2005 08:04 PM

Quote:

Originally Posted by mrsbuzzy
Hello, I think this looks awesome! I just have one quick question before we start to install. Can we set it up so that only a specified forum allows anonymous posts? I have 2 forums I would like that option.

My other question is (I don't think this was mentioned in this thread, but I may have missed it) will people's signature show up when they're set to anonymous?

I greatly appreciate the work you put into this.
Dawn

1. Yes. It's done so you can control it at forum, usergroup, user and even board level.
2. No. The sig of the Anonymous user account you create shows, not the true user's.

amykhar 04-05-2005 08:05 PM

Quote:

Originally Posted by Lionel
It would have been nice to be able to use another set of new status icons for forums and subforums like forum_new.gif, forum_old.gif to indicate that forum accepts anonymous posting (anon_new.gif, anon_old.gif)

You can. Because you can check to see if the post is anonymous in the template, you can use conditionals to set it up.

Lionel 04-16-2005 03:25 AM

Quote:

Originally Posted by Greebo
Ok, the modification to editpost.php has a logic error in it.

You test two conditions in a nested double test:
Was post made anon?
- Yes
-- was it anon before?
---Yes set a bunch of vars incl $threadupdate
---No set a bunch of vars incl $threadupdate
- No
-- was it anon before?
---Yes set a bunch of vars incl $threadupdate
---No set a bunch of vars incl $threadupdate

Then you later have logic twice to update the thread
// if (!empty($threadupdate))

$threadupdate will never be empty in either case.

Net effect: When a thread is posted and someone replies to it and then edits their reply, thread.postusername and thread.postuserid are overwridden inappropriately and the 2nd threadupdate . Thread should only be updated with anon/real user names and IDs if the OP is edited.


[/php]
You will see, I wrapped all updates to $threadupdate in a conditional validating that the post edited is the first post in the thread.

I also removed "postuserid = $edit[userid]" in all spots in that code (it was in every update to $threadupdate).

I seemed to have the same problem. I pinpointed it to editpost.php, where whenever someone edits his post, he will appear as the thread originator. I constantly have to rebuild threads. I am going to try your fix.


All times are GMT. The time now is 01:21 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03076 seconds
  • Memory Usage 1,924KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (5)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete