PDA

View Full Version : Tiny hack: Custom nopermission message to unactivated users


Mas*Mind
25 May 2001, 23:22
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:


open (and backup first) admin/functions.php
Do a search for ###################### Start show_nopermission #######################
replace if ($bbuserinfo[userid]==0) {
eval("standarderror(\"".gettemplate("error_nopermission_loggedout")."\");");
} else {
eval("standarderror(\"".gettemplate("error_nopermission_loggedin")."\");");
}
exit;
with 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;
create a new template called error_nopermission_awaiting_moderation
add the following content in it: 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.

<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>
save and upload admin/functions.php
enjoy :)

eva2000
25 May 2001, 23:30
great :D

Mas*Mind
26 May 2001, 00:46
For those who allready installed this hack: You might wanna remove the You can activate your account <a href="register.php?s=$session[sessionhash]&a=act&u=$bbuserinfo[userid]&i=$bbuserinfo[joindate]">here</a> in 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
26 May 2001, 00:50
Originally posted by Mas*Mind
because it totally defeats the purpose of email-verification :o. Totally forgot about that :D LOL :D

Mas*Mind
26 May 2001, 11:33
Doesn't anyone (besides eva ;)) find this hack usefull?

eva2000
26 May 2001, 12:41
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
27 May 2001, 01:38
I installed it, Thanks!

Mas*Mind
28 May 2001, 19:55
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
28 May 2001, 23:49
Mas,

I just added this hack, thanks!

BluSmurf
29 May 2001, 14:41
installed in mine :D cheers!

kirck
04 Jun 2001, 20:43
I installed it too! Thanks!:D

Devices
06 Jun 2001, 19:39
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 Jun 2001, 20:00
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
07 Jun 2001, 04:51
ok iget these erorrs after i installed it and now i try to access my board and here is what comes up

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
07 Jun 2001, 07:01
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
07 Jun 2001, 14:06
it works thanks

Typhon
07 Jun 2001, 19:10
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
07 Jun 2001, 22:08
Installed the hack. Went to test it, "clicked here" to resend it and got a 404:(

Any ideas?

dd

Mas*Mind
07 Jun 2001, 22:31
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
07 Jun 2001, 22:35
DUH!

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

dd

daydreamer
08 Jun 2001, 00:29
Hello again,

I think this hack may have caused some problems with links on showthread pages such as this:
http://forums.dreamsweb.net/showthread.php3?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
08 Jun 2001, 00:46
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
08 Jun 2001, 04:48
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
08 Jun 2001, 07:55
Glad y'all like it :)

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

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</a> to resend it to you're email-adress ($bbuserinfo[email]).
If you still don't receive it then, you probably have entered an incorrect addres, you 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
08 Jun 2001, 08:01
I have to say that I like your hack too. Good Job :D

robertusss
10 Jun 2001, 17:06
great one!

this one must be in 2.1 - no doubt!

Jujubee
01 Jul 2001, 07:10
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
11 Aug 2001, 07:51
Just installed it... works like a charm and (my oppinion) is a very helpful thing for User awaiting Email Confirmation. :-)

JJR512
11 Aug 2001, 17:52
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.

You have recently registered at $bbtitle, but have not yet activated your account. You 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
29 Aug 2001, 04:02
Thanks Mas*Mind, great hack!

aldamon
30 Aug 2001, 13:05
Great stuff! Thanks!

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

web
03 Sep 2001, 03:42
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
19 Sep 2001, 06:23
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
30 Oct 2001, 19:21
Please make sure this works in 2.2.0! This hack is fabulous!!!

ixian
28 Nov 2001, 17:56
I have tried this over and over and I keep getting an error in functions.php:

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
05 Dec 2001, 06:56
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
06 Dec 2001, 12:10
It works for me under 2.2.1
So far I havent had any problem at all with it.
(less than one day)

stilger
06 Dec 2001, 13:00
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
06 Dec 2001, 13:32
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"

Chris
17 Jan 2002, 22:20
Doesn't anyone (besides eva ) find this hack usefull?

You saved my day!

Yes, I found it very useful!! Thanks!!!

Shenlong
17 Jan 2002, 23:08
Parse error: parse error in /usr/home/teleblaze/public_html/phpforums/admin/functions.php on line 792

Fatal error: Call to undefined function: vbdate() in /usr/home/teleblaze/public_html/phpforums/admin/sessions.php on line 357


Plz help, dont know whats wrong

Shenlong
17 Jan 2002, 23:10
just for ur information, this hack totally ****ed up my forums, i cant even delete stuff in admin cp. so, im ****ed up now (language, sorry, im mad)

Shenlong
17 Jan 2002, 23:16
sorry, that copy of functions.php I used was totally corrupt, just installed, works WONDERFUL! thanks so much!

Jawelin
18 Jan 2002, 18:30
Sorry, but don't manage to make 'resend activation' works for group=3 users.... :surprised

.. runnin' 2.2.1

???

Thanks a lot

Stretchr
18 Jan 2002, 18:59
I believe you want
$contactuslink

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

Arathorn
18 Jan 2002, 19:54
Thanks! This DEFINATELY should be part of the next vb release. Some users can be such a pain.

Jawelin
18 Jan 2002, 22:09
Originally posted by stilger
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?
Resend doesn't work for me on 2.2.1 .... :noid: I think the hacked code intercepts the flow before an user could enter the register.php to resend himself the activation email...
Does it ?

mvigod
26 Jan 2002, 14:59
This little hack is a godsend! :)

Thanks.

Have it on 2.2.1 and the resend email works fine for me...just tested it.

marc

Nam
05 Feb 2002, 23:17
this doesn't work on 2.2.2, I click on resend, nothing happened, the page flash a bit and go back to the way it is.

Jawelin
06 Feb 2002, 07:32
Originally posted by mvigod
This little hack is a godsend! :)

Thanks.

Have it on 2.2.1 and the resend email works fine for me...just tested it.

marc
I have email verification and new users moderation.
When a new user clicks 'resend activation', he is shown again the same 'unregistered' page from he came.
:confused:

Mas*Mind
12 Feb 2002, 11:42
The title says it was meant to be for version 2.2.1, but that's not correct (bug?). If I remember correctly I made it for version 2.01 and since then a couple of thing change. So beware of that! Currently I don't have time and resources to update it, so you have to do it with this I'm afraid

aldamon
07 Mar 2002, 14:53
Good to go in 2.2.3!

LamBras
21 Mar 2002, 10:38
Anyone on 2.2.4?
I just installed this hack (which could be my day saver), but I just got

Parse error: parse error in /dvdboard/forum/admin/functions.php on line 1546

Fatal error: Call to undefined function: vbdate() in /dvdboard/forum/admin/sessions.php on line 357

Reverting to default file solves this (of course), templates are all there, /me is clueless.
Thanks for your advice.

LamBras
21 Mar 2002, 13:58
I just realized that 2.2.4 has this function already built-in.

Use the URL www.yourforum.com/register.php?action=requestemail
You can include this link in a specific errormessage in error_nopermission_loggedin template.

Heineken77
15 Jul 2002, 02:22
Sweet hack! Thanks :)

sabret00the
01 Jun 2003, 14:20
very usefull little hack