vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   anonymous mod (https://vborg.vbsupport.ru/showthread.php?t=294270)

Vishaaldesiking 01-22-2013 09:36 PM

anonymous mod
 
Hello,

I just made a custom mod inspired from https://vborg.vbsupport.ru/showthread.php?t=177694
but facing few minor problems with this.

Code:

$template_hook['newthread_start'] = 'Post Anonymous: <input type="checkbox" name="anonymous" value="1" tabindex="1" title="Post Anonymous">';
The Above code is for a Check box in the thread but

now the main thing:

I need to write a IF clause where i need to see

If the check box is checked then it must show ANONYMOUS (That is it should Hide the USER Details)... ELSE show the username like a regular Post.

Code:

if (anonymous == "1")
  {
$template_hook['postbit'] = '<center><span class="username guest"><b>Anonymous</b></span><img src="images/anon.gif" /></center>';
}else
{
$template_hook['postbit'] = 'test';
}

This code is added in: postbit_display_start



Is there someone who can help me with complete this mod?

kh99 01-22-2013 11:03 PM

I'm not sure, but you could try this:

Code:

global $vbulletin;
$vbulletin->input->clean_gpc('r', 'anonymous', TYPE_INT);
if ($vbulletin->GPC['anonymous'] == 1)
  {
$template_hook['postbit'] = '<center><span class="username guest"><b>Anonymous</b></span><img src="images/anon.gif" /></center>';
}else
{
$template_hook['postbit'] = 'test';
}


Vishaaldesiking 01-22-2013 11:11 PM

Let me begin by thanking you for your reply....but uinfortunately it didnt help,,

Any more ideas........??

I think it has something to do with inserting the value 1 to the data base colum where this values are saved and the function is triggered

i want a query or code which inserts a value when the USER selects the CHECK BOX before clicking SUBMIT button

kh99 01-22-2013 11:26 PM

Oh, right. I didn't really look at the mod, I just took a guess. But I think you're right, you would need to save that value with the post, maybe by making a new column called anonymous in the post table. If you did that then you should be able to use $post['anonymous'] in your 'if'.

Edit: I haven't thought about it a lot, but maybe another approach to anonymous posting is to set the userid to 0 (like for guests or deleted users), then set the username to Anonymous. Of course if you did that, the user who wrote it wouldn't be able to edit or delete it (and I guess you'd have no record of who wrote it, so maybe it's not such a good idea).

Vishaaldesiking 01-24-2013 10:36 AM

Quote:

Originally Posted by kh99 (Post 2398837)
Oh, right. I didn't really look at the mod, I just took a guess. But I think you're right, you would need to save that value with the post, maybe by making a new column called anonymous in the post table. If you did that then you should be able to use $post['anonymous'] in your 'if'.

Edit: I haven't thought about it a lot, but maybe another approach to anonymous posting is to set the userid to 0 (like for guests or deleted users), then set the username to Anonymous. Of course if you did that, the user who wrote it wouldn't be able to edit or delete it (and I guess you'd have no record of who wrote it, so maybe it's not such a good idea).

I need a Query or a Function so that when some one clicks the Check box in the Post before posting, the Value in the Database table for a column should be changed from 0 to 1.

o indicating REGULAR post
1 Indicating ANONYMOUS post

Kindly some one help me in this regard.

--------------- Added [DATE]1359044891[/DATE] at [TIME]1359044891[/TIME] ---------------

thanks for all the support mine mod is done:D
and its works perfect


All times are GMT. The time now is 02:43 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.01223 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete