Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2013, 09:36 PM
Vishaaldesiking Vishaaldesiking is offline
 
Join Date: Feb 2009
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 01-22-2013, 11:03 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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';
}
Reply With Quote
  #3  
Old 01-22-2013, 11:11 PM
Vishaaldesiking Vishaaldesiking is offline
 
Join Date: Feb 2009
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 01-22-2013, 11:26 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #5  
Old 01-24-2013, 10:36 AM
Vishaaldesiking Vishaaldesiking is offline
 
Join Date: Feb 2009
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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
and its works perfect
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:31 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04120 seconds
  • Memory Usage 2,201KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete