Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
Make guests give a name when posting or replying Details »»
Make guests give a name when posting or replying
Version: 1.00, by bairy bairy is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Version: 3.0.9 Rating:
Released: 12-20-2005 Last Update: Never Installs: 0
Template Edits
 
No support by the author.

One of the big problems with guest postings is the majority of them show up as "Unregistered" due to the user's laziness.

With a little checking you can 'make' them give a name. Simply put when the user submits the form, it checks the username field (which only shows when you're not logged in) for 'Unregistered' or emptyness, and if it's either, shows an alert to the user.


There are two usable methods:
1. Javascript based. This checks the username as soon as you click submit and pops up a dialog if it's 'Unregistered' or blank. This method is more instant but screws up wysiwyg input. If you use or plan to use wysiwyg, go the second option.
2. vB checking based. This allows the submit (or preview) to go and produces an error in the same way as 'post too short' or similar.

For 1, see post 2.
For 2, see post 3.


Click install if you like. Don't if you don't want to. I don't really care

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-22-2005, 09:17 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Javascript version:


Open newpost_usernamecode

Find (near the bottom)
Code:
<td class="smallfont" colspan="2"><input type="text" class="bginput" name="username" value="$bbuserinfo[username]" size="50" style="margin-top:1px" /></td>
Replace with
Code:
<td class="smallfont" colspan="2"><input type="text" class="bginput" name="username" value="$bbuserinfo[username]" size="50" style="margin-top:1px" onfocus="javascript: if (this.value == 'Unregistered') { this.value = ''; }" /></td>

Open newthread

Find (almost at the top)
Code:
<form action="newthread.php" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="return validatePost(this, this.subject.value, $vboptions[postminchars], $vboptions[postmaxchars]);" onreset="vB_RESET(this);"</if>>
Replace with
Code:
<form action="newthread.php" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="javascript:if ((document.vbform.username.value == 'Unregistered') || (document.vbform.username.value == '')) { alert('Please insert a nickname or an online name you use, so that you can be identified from other unregistered users'); document.vbform.username.focus(); return false; }  return validatePost(this, this.subject.value, $vboptions[postminchars], $vboptions[postmaxchars]);" onreset="vB_RESET(this);"</if>>

Open newreply
Find (again, near the top)
Code:
<form action="newreply.php" name="vbform" method="post"<if condition="!is_browser('webtv')"> onsubmit="return validatePost(this, 0, $vboptions[postminchars], $vboptions[postmaxchars]);" onreset="vB_RESET(this);"</if>>
Replace with
Code:
<form action="newreply.php" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="javascript:if ((document.vbform.username.value == 'Unregistered') || (document.vbform.username.value == '')) { alert('Please insert a nickname or an online name you use, so that you can be identified from other unregistered users'); document.vbform.username.focus(); return false; }  return validatePost(this, this.subject.value, $vboptions[postminchars], $vboptions[postmaxchars]);" onreset="vB_RESET(this);"</if>>
Reply With Quote
  #3  
Old 01-07-2006, 10:05 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vB checking version:


Step 1.
Add phrase

Phrase Type: Front-End Error Messages
Varname: notuniqueusername
Text: Using the "Your username" input box just below, please insert a nickname or an online name you use, so that you can be identified from other unregistered users.

(The Text can be whatever you like)



Step 2.
Open includes/functions_newpost.php

Find (around line 767):
Code:
		if (empty($post['username']))
		{

			eval('$errors[] = "' . fetch_phrase('nousername', PHRASETYPEID_ERROR) . '";');

		}
Add under:
Code:
		else if ($post['username'] == 'Unregistered' OR $post['username'] == '')
		{

			eval('$errors[] = "'. fetch_phrase('notuniqueusername', PHRASETYPEID_ERROR) . '";');

		}

Step 3 - optional. It simply clears the "Your username" box if it's clicked on and says 'Unregistered'
Open template newpost_usernamecode

Find (near the bottom)
Code:
<td class="smallfont" colspan="2"><input type="text" class="bginput" name="username" value="$bbuserinfo[username]" size="50" style="margin-top:1px" /></td>
Replace with:
Code:
<td class="smallfont" colspan="2"><input type="text" class="bginput" name="username" value="$bbuserinfo[username]" size="50" style="margin-top:1px" onfocus="javascript: if (this.value == 'Unregistered') { this.value = ''; }" /></td>
Reply With Quote
Reply

Thread Tools

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:21 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.06507 seconds
  • Memory Usage 2,211KB
  • Queries Executed 16 (?)
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
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)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_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