vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Tiny hack: Custom nopermission message to unactivated users (https://vborg.vbsupport.ru/showthread.php?t=18140)

Mas*Mind 05-25-2001 10:00 PM

Description: This hack prints a custom message to users that want to take an action they can't because they didn't activated their account yet. This probably saves you alot of emails from users who didn't properly read their activation-email asking you why they can't post while they did register.

VB-Version: Probably every version, certainly every 2.0 version

Instructions:
  1. open (and backup first) admin/functions.php
  2. Do a search for ###################### Start show_nopermission #######################
  3. replace
    PHP Code:

      if ($bbuserinfo[userid]==0) {
        eval(
    "standarderror(\"".gettemplate("error_nopermission_loggedout")."\");");
      } else {
        eval(
    "standarderror(\"".gettemplate("error_nopermission_loggedin")."\");");
      }
      exit; 

  4. with
    PHP Code:

      if ($bbuserinfo[userid]==0) {
        eval(
    "standarderror(\"".gettemplate("error_nopermission_loggedout")."\");");
      } else {
          if(
    $bbuserinfo[usergroupid] == 3) {
          eval(
    "standarderror(\"".gettemplate("error_nopermission_awaiting_moderation")."\");");
        }
        else {
          eval(
    "standarderror(\"".gettemplate("error_nopermission_loggedin")."\");");
        }
      }
      exit; 

  5. create a new template called error_nopermission_awaiting_moderation
  6. add the following content in it:
    PHP Code:

    You have recently registered at $bbtitle but not yet activated your accountYou can find the link to activate your account in your welcome-email.

    <
    p align="center">
    <
    table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
    $logincode
    </table>
    </
    p>

    <
    p><smallfont>If you didn't received the activation-email <a href="register.php?s=$session[sessionhash]&action=requestemail">click here</a> to resend it. <a href="member.php?s=$session[sessionhash]&action=lostpw">Forgotten your password?</a></smallfont> 

  7. save and upload admin/functions.php
  8. enjoy :)

eva2000 05-25-2001 10:30 PM

great :D

Mas*Mind 05-25-2001 11:46 PM

For those who allready installed this hack: You might wanna remove the
PHP Code:

You can activate your account <a href="register.php?s=$session[sessionhash]&a=act&u=$bbuserinfo[userid]&i=$bbuserinfo[joindate]">here</ain case you deleted the email

bit from your template because it totally defeats the purpose of email-verification :o. Totally forgot about that :D

Put this bit in it instead:

If you didn't received the activation-email <a href="register.php?s=$session[sessionhash]&action=requestemail">click here</a> to resend it.

eva2000 05-25-2001 11:50 PM

Quote:

Originally posted by Mas*Mind
because it totally defeats the purpose of email-verification :o. Totally forgot about that :D
LOL :D

Mas*Mind 05-26-2001 10:33 AM

Doesn't anyone (besides eva ;)) find this hack usefull?

eva2000 05-26-2001 11:41 AM

Quote:

Originally posted by Mas*Mind
Doesn't anyone (besides eva ;)) find this hack usefull?
probably for most people the default template message is sufficient :)

Joshs 05-27-2001 12:38 AM

I installed it, Thanks!

Mas*Mind 05-28-2001 06:55 PM

I'm quite surprised this hack isn't that popular. Since I installed this hack I haven't got any email from members who are asking why they can post while they registered just because they didn't read their activation email properly (thus didn't activated their account). Before that I got a couple of them each day... Saves me alot of explanation.

Robert Basil 05-28-2001 10:49 PM

Mas,

I just added this hack, thanks!

BluSmurf 05-29-2001 01:41 PM

installed in mine :D cheers!

kirck 06-04-2001 07:43 PM

I installed it too! Thanks!:D

Devices 06-06-2001 06:39 PM

So far so good.

This should be very usefull. I am getting loads of emails at the moment from people who can not be bothered to read their emails or they may have not recieved it for some reason. Now they can help themselfs by getting the email resent.

I have added it in and tested it and all seems well.

One thing though which is not this hack but a problem with VB in general.

If you do not allow viewing to unregistered or users awaiting confirmation then they are asked to login when they come to your VB. So they are allowed to login but then get the above permission hack displayed.

When they go to the resend activation email link they just keep getting the same page as they do not have permission to view the remail page ?

Maybe i missed a setting.

Devices 06-06-2001 07:00 PM

So far so good.

This should be very usefull. I am getting loads of emails at the moment from people who can not be bothered to read their emails or they may have not recieved it for some reason. Now they can help themselfs by getting the email resent.

I have added it in and tested it and all seems well.

One thing though which is not this hack but a problem with VB in general.

If you do not allow viewing to unregistered or users awaiting confirmation then they are asked to login when they come to your VB. So they are allowed to login but then get the above permission hack displayed.

When they go to the resend activation email link they just keep getting the same page as they do not have permission to view the remail page ?

Maybe i missed a setting.

kdog316 06-07-2001 03:51 AM

ok iget these erorrs after i installed it and now i try to access my board and here is what comes up

Quote:

Parse error: parse error in ./functions.php on line 1805

Warning: Cannot add header information - headers already sent by (output started at ./functions.php:1805) in ./functions.php on line 1187

Warning: Cannot add header information - headers already sent by (output started at ./functions.php:1805) in ./functions.php on line 1187

Fatal error: Call to undefined function: vbdate() in ./sessions.php on line 354
:confused:

Mas*Mind 06-07-2001 06:01 AM

you backed up your functions.php right?

Then revert it and apply the changes again...You did something wrong (can't figure out what)

kdog316 06-07-2001 01:06 PM

it works thanks

Typhon 06-07-2001 06:10 PM

I'm about to install it.. but I just wanted to let youknwo this is a nice hack... will certainly save me the trouble of resending them manually. Thanks!

daydreamer 06-07-2001 09:08 PM

Installed the hack. Went to test it, "clicked here" to resend it and got a 404:(

Any ideas?

dd

Mas*Mind 06-07-2001 09:31 PM

do the same as kdog316: revert and re-apply...

You probably did something wrong...

btw: Since I installed this hack I never got one of those emails again, so it definitely helps :)

daydreamer 06-07-2001 09:35 PM

DUH!

I didn't change the file extensions to .php3...:rolleyes:

dd

daydreamer 06-07-2001 11:29 PM

Hello again,

I think this hack may have caused some problems with links on showthread pages such as this:
http://forums.dreamsweb.net/showthre...s=&threadid=12

Notice the "general forums" and "Sales Questions" links at top. The refer to .php33 pages.

Anyone who has installed this hack please check to see if you are having the same problem.

Thankx

dd

daydreamer 06-07-2001 11:46 PM

DUH! AGAIN... I need some sleep.

Okay, As in my post earlier. I forgot to rename all file extensions to .php3

I am usually very careful when doing so while using Note Tab Lite. Having said that, I rename all to .php33

All is not my fault as that was the first thing I thought of to check, but the program's search feature did not find them. I had to locate them all myself. Only about nine or so.

I will now reinstall Note Tab Lite....

Mods, please delete my post here today :D

dd

Castel 06-08-2001 03:48 AM

Wow, didn't see this til now. Very useful Mas*Mind, I will install it shortly. Even after adding additional lines to the normal error template I still get mail daily about stuff like this. Great little hack!

Mas*Mind 06-08-2001 06:55 AM

Glad y'all like it :)

I slightly changed the error_nopermission_awaiting_moderation -template to make it even more clear:

PHP Code:

You have recently registered at $bbtitle but not yet activated your account
You can find the link to activate your account in your welcome-email
If 
you didn't received the activation-email or you've allready deleted it, <a href="register.php?s=$session[sessionhash]&action=requestemail&email=$bbuserinfo[email]">click here</ato resend it to you're email-adress ($bbuserinfo[email]). 
If you still don'
t receive it thenyou probably have entered an incorrect addresyou can correct it by editing your <a href="member.php?s=$session[sessionhash]&action=editprofile">profile</a>.

<
p align="center">
<
table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
$logincode
</table>
</
p>

<
p><smallfont><a href="member.php?s=$session[sessionhash]&action=lostpw">Forgotten your password?</a></smallfont

then change

<input type="text" class="bginput" name="email" size="35" maxlength="90">

to

<input type="text" class="bginput" name="email" size="35" maxlength="90" value="$email">

in your activate_requestemail-template

Dakota 06-08-2001 07:01 AM

I have to say that I like your hack too. Good Job :D

robertusss 06-10-2001 04:06 PM

great one!

this one must be in 2.1 - no doubt!

Jujubee 07-01-2001 06:10 AM

Thanks Mas! Was thinking of pouring through the code to get something like this to work, but you've done everything already!

Great stuff. :)

Alex 08-11-2001 06:51 AM

Just installed it... works like a charm and (my oppinion) is a very helpful thing for User awaiting Email Confirmation. :-)

JJR512 08-11-2001 04:52 PM

I have taken the liberty of re-wording the new template, as well as adding a new part to it. The re-wording was done to improve the English a bit (and that is not said to be critical). I added a line to say that maybe the user supplied the wrong address, and should contact the webmaster if he/she still does not get the activation email.

PHP Code:

You have recently registered at $bbtitlebut have not yet activated your accountYou can find the link to activate your account in your welcome-email.

<
p align="center">
<
table border="0" bgcolor="#555576" cellpadding="4" cellspacing="1" align="center">
$logincode
</table>
</
p>

<
p><smallfont>If you haven't received the activation email, <a href="register.php?s=$session[sessionhash]&action=requestemail">click here</a> and it will be resent. If you still do not receive the activation email, you may have mistyped your email address. If you suspect you used the incorrect email address, please contact the <a href="mailto:webmaster@jjr512.com">Webmaster</a>. <a href="member.php?s=$session[sessionhash]&action=lostpw">Forgotten your password?</a> 

Does anyone know the variable to use for the webmaster email, rather than hard-coding it as I have done?

pran 08-29-2001 03:02 AM

Thanks Mas*Mind, great hack!

aldamon 08-30-2001 12:05 PM

Great stuff! Thanks!

MarkB 08-31-2001 04:31 AM

I finally got around to adding this to my forums, and it's been a godsend. Thanks! :D

web 09-03-2001 02:42 AM

Nice job. This was the first hack I installed since I start using vBulletin. It works fine with one exception. The link to go to 'profile' and edit the password did not work. It kept returning to the new 'not activated' page. Not a problem, I just removed that portion of the template. I also removed the portion for "forgot password." The user is already logged in, so they could not have forgotten their password ;) .

Thanks for sharing the work and it will definitely save me some time responding to emails and voice mails.

Regards,

web

Grover 09-19-2001 05:23 AM

Hi Mas*Mind,

Are there plans to release this very useful hack in a future version of Vbulletin? I think that this HAS TO BE part of the standard VBulletin-features in the future: it is one of the most useful (and can I even say: NECESSARY) hacks I have ever seen.

I hope they put it in! It really just saves us so much work........

Grover.

aldamon 10-30-2001 06:21 PM

Please make sure this works in 2.2.0! This hack is fabulous!!!

ixian 11-28-2001 04:56 PM

I have tried this over and over and I keep getting an error in functions.php:

Code:

Parse error: parse error in /home/httpd/www.mysite/xxx/forums/admin/functions.php on line 2232
Yes, I replaced my actual site with "mysite"

I am using 2.21. I have cut and pasted the code exactly (I use PHPCoder Pro as my text editor, so no extra breaks/crap is inserted) but no go.

Has anyone gotten this to work with 2.21?

stilger 12-05-2001 05:56 AM

Does anyone know if the hack works in 2.2.1? I have tried to install it but when going to the page after registering to test and see what it would do to a user awaiting registration it automatically activates my account.

cfscfs 12-06-2001 11:10 AM

It works for me under 2.2.1
So far I havent had any problem at all with it.
(less than one day)

stilger 12-06-2001 12:00 PM

Did you try and register a user then try to log in without activating your account and see if you get the message to click to resend activation code etc?

cfscfs 12-06-2001 12:32 PM

Yep.
Everything works the way it should.
Created new user and did not activate account.
Than I tried to create a new thread or post a reply, the new message is shown. After clicking on the link I enter my email and I recive a new email with my acctivationcode and I am still listed as"User Awaiting Email Confirmation"


All times are GMT. The time now is 06:23 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.01413 seconds
  • Memory Usage 1,845KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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