PDA

View Full Version : "Express" Registration


LanciaStratos
09-05-2001, 12:26 AM
I'd like to make a request of sorts, but I don't believe this hack would require too much...

I want unregistered/not logged in visitors to receive a small pop-up window every time they visit a page in my forums. Inside of this window, a small, stripped-down registration form would be displayed with only the essential fields. Hopefully, after a few page views, they would be annoyed enough to go ahead and fill it in or log in.

Can anyone tell me how to do this?

FreshFroot
09-05-2001, 11:36 AM
This is a really great idea...surprised it hasn't been mentioned before. Maybe if we're lucky, someone will pull through.

Admin
09-05-2001, 12:11 PM
The page itself is very easy, you don't need help with that (or do you?).

I can help you with the poping the page if the user isn't loggedin though:
In global.php add
if ($bbuserinfo['userid']==0) {
eval("\$headexpressreg = \"".gettemplate('head_expressreg')."\";");
}
right after
$newpmmsg=1;
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}
now create a new template, head_newpm, and put this in it:
<script language="javascript"><!--
window.open('http://www.yoursite.com/forum/file.php');
// --></script>
This will pop file.php up.

LanciaStratos
09-05-2001, 07:34 PM
The page itself is very easy, you don't need help with that (or do you?). Well, actually, I do. I can make the form of course, but how do I create it so that it adds a member to the database?

FreshFroot
09-05-2001, 07:55 PM
Almost there :)

Admin
09-06-2001, 10:45 AM
[QUOTE]Originally posted by LanciaStratos
Well, actually, I do. I can make the form of course, but how do I create it so that it adds a member to the database?

Joe
09-06-2001, 03:24 PM
Visit automotiveforums.com, guests will get the pop-up box. I think igor did it with a javascript and cookie (i posted that code earlyer), so the guest will only get the pop-up once, or whatever you set the cookie too... Anyhow, view source of the pop-up, you get the idea :)

FreshFroot
09-06-2001, 05:40 PM
Originally posted by Joe
Visit automotiveforums.com, guests will get the pop-up box. I think igor did it with a javascript and cookie (i posted that code earlyer), so the guest will only get the pop-up once, or whatever you set the cookie too... Anyhow, view source of the pop-up, you get the idea :)

That's exactly what I'm looking for, but I'd rather have it pop up everytime until they're registered as Lancia suggested.

Joe
09-06-2001, 05:49 PM
What do you mean everytime? Once a day? Once per session? Once per page view? FireFly's way will pop up on every page view, as far as i can tell, I woudlnt view many pages if i got a pop-up on each and every one! I think once per day would be fine, you can do that by setting the cookie timeout to 24hrs.

You can find the code anywhere on the net, i posted it in one of Igor's threads when he was reciving hundreds of guests from a a magazine artical...

FreshFroot
09-08-2001, 01:55 AM
The pop up in this case would pop up ever time only until the register. Seeing how it's a pop up form, most people would probably register the first time the see the pop up. If they don't hopfully they'll get the picture after the second or third time.

The condensed registration form from the automotiveforums.com site is perfect. I think we might see something from FireFly :)

Joe
09-08-2001, 03:29 AM
I dont know about you, but when i visit a forum, i usualy lurk for a week or more. I see if i will fit into the community, to see if the standards are upto my own standards... If i recive a popup for every page i visit there, theres no way your going to get me to register! If you do that to guests, how do i know you wont exploit members down the line? I think one pop-up per day is enough. :)

Thomas P
09-09-2001, 07:55 AM
Have a look at our forums, I did a very small and simple version of an express registration:

http://www.mcseboard.de/forum/register.php

Just added some text and a second button after the required info fields stating: "Infos below can be added later" for people who are in a hurry :)

I'm not sure if this "meets your standards" pals, but it surely works well for us :D

cu,
-Tom

P.S.: Visit above or see attached screenshot (~40k)

FreshFroot
09-13-2001, 06:21 PM
Originally posted by Thomas P
Have a look at our forums, I did a very small and simple version of an express registration:

http://www.mcseboard.de/forum/register.php

Just added some text and a second button after the required info fields stating: "Infos below can be added later" for people who are in a hurry :)

I'm not sure if this "meets your standards" pals, but it surely works well for us :D

cu,
-Tom

P.S.: Visit above or see attached screenshot (~40k)

This is great, but I don't think it's what Lancia described, which sounded like a great idea.

veedee
10-04-2001, 06:07 PM
Brilliant.

I am working on the full version of this. I will post all the code etc in a couple of days.

Cheers,

veedee

LanciaStratos
10-04-2001, 07:42 PM
Originally posted by veedee
Brilliant.

I am working on the full version of this. I will post all the code etc in a couple of days.

Cheers,

veedee Cool! :D http://www.vbulletin.com/forum/images/icons/icon14.gif

Rcooper
10-06-2001, 09:00 PM
I would also be interested in this! sounds like a great idea!

rcooper

veedee
10-08-2001, 06:14 AM
I am a bit behind on this due to launching a subscription card on my forum that I want to mother until it can stand alone.

The code will make an appearance this week though :D

Thanks for being patient,

veedee

DarkManX_19
10-26-2001, 02:59 AM
any update on this???

DarkManX_19
10-29-2001, 11:07 PM
Originally posted by veedee
Brilliant.

I am working on the full version of this. I will post all the code etc in a couple of days.

Cheers,

veedee


any updates yet??

thanks :)

amykhar
10-29-2001, 11:22 PM
Darkman, all the code you could possibly need is right here in this thread, or is linked off of this thread. No need for you to wait. Just piece it together :)

Amy

DarkManX_19
10-30-2001, 12:44 AM
well, not all of us are as web savy as others.....some things aren't as easy to peice together....and since you obviously already know the answer...why cna't ya just help a guy out??

veedee
11-27-2001, 12:07 PM
Arrggh

So sorry for forgetting about this. I have changed jobs and lost the code. I will re-do it and *promise* to post everything I have done.

Cheers,

veedee

Wolf42
02-05-2002, 01:45 PM
I tryed it for myself, but I have a little problem. I added the following code into register.php:

// ############################### start fast signup ###############################
if ($action=="fast") {

if (!$allowregistration) {
eval("standarderror(\"".gettemplate("error_noregister")."\");");
exit;
}

if ($bbuserinfo[userid]!=0 and !$allowmultiregs) {
$getuser=$DB_site->query_first("SELECT username FROM user WHERE userid='$bbuserinfo[userid]'");
$username=$getuser[username];

eval("standarderror(\"".gettemplate("error_alreadyregistered")."\");");

exit;
}

$coppadate=vbdate($dateformat,mktime(0,0,0,date("m"),date("d"),date("Y")-13));

if (!$usecoppa) {
$who="adult";
}

if ($who=="coppa") {
eval("dooutput(\"".gettemplate("signupcoppa")."\");");
} else {
if ($who=="adult") {
eval("dooutput(\"".gettemplate("signupadult_fast")."\");");
} else {
eval("dooutput(\"".gettemplate("signupverify")."\");");
}
}
}
// ############################### start register fast ###############################
if ($action=="registerfast") {
if (!$allowregistration) {
eval("standarderror(\"".gettemplate("error_noregister")."\");");
exit;
}

if ($bbuserinfo[userid]!=0 and !$allowmultiregs) {
$getuser=$DB_site->query_first("SELECT username FROM user WHERE userid='$bbuserinfo[userid]'");
$username=$getuser[username];

eval("standarderror(\"".gettemplate("error_alreadyregistered")."\");");

exit;
}

if ($allowhtml) {
$htmlonoff=$ontext;
} else {
$htmlonoff=$offtext;
}
if ($allowbbcode) {
$bbcodeonoff=$ontext;
} else {
$bbcodeonoff=$offtext;
}
if ($allowbbimagecode) {
$imgcodeonoff=$ontext;
} else {
$imgcodeonoff=$offtext;
}
if ($allowsmilies) {
$smiliesonoff=$ontext;
} else {
$smiliesonoff=$offtext;
}
//MaxPosts by User
$optionArray = explode(",", $usermaxposts);
while (list($key, $val) = each($optionArray))
{
eval ("\$maxpostsoptions .= \"".gettemplate("modifyoptions_maxposts")."\";");
}
$postsdefaultselected = "selected";
// Referrer
if ($usereferrer and $bbuserinfo['userid']==0) {
if ($bgcolor=="{firstaltcolor}") {
$bgcolor="{secondaltcolor}";
$bgclass="alt2";
} else {
$bgcolor="{firstaltcolor}";
$bgclass="alt1";
}
if ($bbreferrerid) {
if ($referrername=$DB_site->query_first("SELECT username FROM user WHERE userid = '".addslashes($bbreferrerid)."'")) {
$referrername = $referrername['username'];
}
}
eval("\$referrer = \"".gettemplate("register_referrer")."\";");
}
//Birthday
if ($calbirthday == 1) {
if ($bgcolor=="{firstaltcolor}") {
$bgcolor="{secondaltcolor}";
$bgclass="alt2";
} else {
$bgcolor="{firstaltcolor}";
$bgclass="alt1";
}
eval("\$birthday = \"".gettemplate("register_birthday")."\";");
}
// get extra profile fields
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";
if ($profilefield[required] == 1) {
if ($bgcolor1=="{firstaltcolor}") {
$bgcolor1="{secondaltcolor}";
$bgclass1="alt2";
} else {
$bgcolor1="{firstaltcolor}";
$bgclass1="alt2";
}
$temp = $bgcolor;
$tempclass = $bgclass;
$bgcolor = $bgcolor1;
$bgclass = $bgclass1;
eval("\$customfields_required .= \"".gettemplate("register_customfields")."\";");
// vBPortal Begin
$showleftcolumnchecked="checked";
$showleftcolumnnotchecked="";
eval ("\$leftcolumncell = \"".gettemplate("P_leftcolumncell")."\";");
// vBPortal End
$bgcolor = $temp;
$bgclass = $tempclass;
} else { // Not Required
if ($bgcolor=="{firstaltcolor}") {
$bgcolor="{secondaltcolor}";
$bgclass="alt2";
} else {
$bgcolor="{firstaltcolor}";
$bgclass="alt1";
}
eval("\$customfields .= \"".gettemplate("register_customfields")."\";");
}
}

$bgcolor = "{secondaltcolor}";
// User selectable style sets
$stylesetlist = "";
if ($allowchangestyles==1) {
$stylesets=$DB_site->query("SELECT * FROM style WHERE userselect=1");
while($thisset=$DB_site->fetch_array($stylesets)) {
if ($bbuserinfo[styleid]==$thisset[styleid]) {
$selected = "selected";
} else {
$selected = "";
}
$thisid = $thisset[styleid];
$thisstylename = $thisset[title];

eval ("\$stylesetlist .= \"".gettemplate("modifyoptions_styleset")."\";");
eval ("\$stylecell = \"".gettemplate("register_stylecell")."\";");
$bgcolor = "{firstaltcolor}";
}
} else {
$stylecell = "";
}

if ($avatarenabled) {
$avatars = $DB_site->query("SELECT avatarid, title, avatarpath
FROM avatar
WHERE minimumposts = 0
ORDER BY title");
if ($DB_site->num_rows($avatars) > 0) {
while ($avatar = $DB_site->fetch_array($avatars)) {
if (!$avatar['title']) {
$avatar['title'] = $avatar['avatarpath'];
if (strstr($avatar['title'], '/')) {
$avatar['title'] = substr( strrchr($avatar['title'], '/') , 1);
}
$avatar['title'] = str_replace('_', ' ', $avatar[title]);
$dotpos = strrpos($avatar[title], '.');
$avatar[title] = substr($avatar[title], 0, $dotpos);
}
eval("\$avatarbits .= \"".gettemplate("register_avatarbit")."\";");
}
eval("\$avatarbit = \"".gettemplate("register_avatar")."\";");
}
}

if ($who=="adult") {
eval("dooutput(\"".gettemplate("register_fast")."\");");
} else {
eval("dooutput(\"".gettemplate("registercoppa")."\");");
}
}
$adminemail=1;
$showemail=0;
$invisible=1;
$cookieuser=0;
$nosessionhash=0;
$emailnotification=1;
$options=1;
$options+=2;
$options+=4;
$options+=8;
$receivepm=0;
$emailonpm=1;
$pmpopup=0;

Also I added two new templates register_fast and signupadult_fast.

Now my problem: If I set $adminemail=1 it becomes NO. If I set $adminemail=0 it becomes NO. WHY?? :confused:

Please help.

veedee
02-05-2002, 01:54 PM
I have made enough excuses. Here is another one. I was made redundant and forgot about all this stuff. I need this for my site and will spend the rest of the day gathering info on this. I will post up any updates.

Cheers,

Ben

veedee
02-05-2002, 03:15 PM
ok here goes...


In global.php add


if ($bbuserinfo['userid']==0) {
eval("\$headexpressreg = \"".gettemplate('head_expressreg')."\";");
}


right after


$newpmmsg=1;
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}


now create a new template, head_expressreg and put this in it:


<script language="javascript"><!--
window.open('http://www.yoursite.com/forum/file.php');
// --></script>


Now go to your style set area. Find the text area where you enter content to go in the <head> of the page. Enter in $headexpressreg under $headnewpm

This will pop file.php up. Now to make file.php

Try this:


<html>
<title>Welcome to visordown.com - register today</title>
<head>
<STYLE type=text/css>
.nf { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt }
.sf { font-family: verdana,arial,helvetica,sans-serif; font-size: 8pt; color: #ffffff; }
</style>
</head>
<body bgcolor="#000000">

<!-- content table -->
<font class="sf">Registration is required if you want to post messages on visordown.com</font>
<table bgcolor="#000000" width="100%" cellpadding="10" cellspacing="0" border="0"><tr><td>
<form action="http://www.visordown.com/forums/register.php" method="post">
<input type="hidden" name="s" value="">

<table border="0" cellspacing="1" cellpadding="4" width="100%" bgcolor="#555576">
<!-- *** -->
<tr>
<td bgcolor="#0000ee" colspan="2"><font face="verdana" size="2" color="#ffffff" class="thtcolor"><b>Registration</b></font>
<font face="verdana" size="1" color="#ffffff" class="thtcolor">(*) fields are required. Please note that passwords are case sensitive.</font></td>
</tr>
<!-- *** -->
<tr>
<td bgcolor="#AAAAE6"><font class="nf"><b>*User Name:</b></font></td>
<td bgcolor="#AAAAE6"><font class="nf"><input type="text" name="username" size="25" maxlength="15"></font></td>
</tr>
<tr>
<td bgcolor="#C3C3EB"><font class="nf"><b>*Password:</b></font></td>
<td bgcolor="#C3C3EB"><font class="nf"><input type="password" name="password" size="25" maxlength="15"></font></td>
</tr>
<tr>
<td bgcolor="#C3C3EB"><font class="nf"><b>*Enter Password Again:</b></font></td>
<td bgcolor="#C3C3EB"><input type="password" name="passwordconfirm" size="25" maxlength="15"></td>
</tr>
<tr>
<td bgcolor="#AAAAE6"><font class="nf"><b>*Email:</b></font><br>
<font color="#000000" face="verdana" size="1">Please enter a <b>valid</b> email address.</font></td>
<td bgcolor="#AAAAE6"><font class="nf"><input type="text" name="email" size="25" maxlength="50"></font></td>
</tr>
<tr>
<td bgcolor="#AAAAE6"><font class="nf"><b>*Enter Email Again:</b></font></td>
<td bgcolor="#AAAAE6"><font class="nf"><input type="text" name="emailconfirm" size="25" maxlength="50"></font></td>
</tr>


<tr><td bgcolor="#113274">
&nbsp;
</td><td bgcolor="#113274"><input type="hidden" name="allowmail" value="yes">
<input type="hidden" name="invisible" value="no">
<input type="hidden" name="showemail" value="yes">
<input type="hidden" name="cookieuser" value="yes">
<input type="hidden" name="nosessionhash" value="yes">
<input type="hidden" name="emailonpm" value="yes">
<input type="hidden" name="prunedays" value="-1">
<input type="hidden" name="umaxposts" value="-1">
<input type="hidden" name="startofweek" value="1">
<input type="hidden" name="timezoneoffset" value="-5">
<input type="hidden" name="emailnotification" value="yes">
<input type="hidden" name="showsignatures" value="yes">
<input type="hidden" name="showavatars" value="yes">
<input type="hidden" name="showimages" value="yes">
<input type="hidden" name="vbcode" value="yes">
<input type="hidden" name="pmpopup" value="yes">
<input type="hidden" name="receivepm" value="yes">
<input type="hidden" name="url" value="http://www.visordown.com/forums/thanks.html">
<input type="hidden" name="action" value="addmember">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset"></td>
</tr></font>
</td></tr></table>
</form>
<font class="sf">By pressing the registration button above you declare that you have read and agree with the <a href="/" target="blank">Community Guidelines</a></font>
<!-- End content area table -->
</td></tr></table>
</body>
</html>


Obviously modify the colours and the paths to your site. It should work a treat. Just visit my site now www.visordown.com/forums as a guest and it should pop up. It isn't perfect, however it works !

Does this help?

Ben

Wolf42
02-06-2002, 08:10 AM
Thank you very much!! :up:

veedee
02-06-2002, 09:55 AM
Great - Now all I need to work out is how to make the pop up only pop up once per user visit. I would also like to make it pop up in a nicer looking window.

Hmmm can we get together on this one ?

Wolf42
02-06-2002, 10:34 AM
For the windowsize: How about a little change in your head_expressreg template:

<script language="javascript">
window.open("file.php?, "Register now!!", "toolbar=no,scrollbars=yes,resizable=yes,width="300",height="600");
</script>


For once per visit: How about setting a cookie with lifetime i.e. 1 day.

veedee
02-06-2002, 10:51 AM
Superb!

How do I set a cookie. I have had a go but it doesn't work.

Any code going?

Cheers!

Ben

Wolf42
02-06-2002, 01:25 PM
How to set a cookie:

<script language="javascript">
document.cookie = "your-cookie-settings";
</script>

I have tryed to figure out how vB is setting the cokkies, but I didn't. Sorry.

99SIVTEC
03-07-2002, 05:03 AM
Ok, I have the popup working perfectly. It is adding the user to the database and everything. However, when you fill out the fields and click submit nothing happens. How do I make the page forward you to a thank you screen or back to the forums so they know they have registered successfully? Here is my file.php file

<html>
<title>Welcome to sportcompactracing.com - register today</title>
<head>
<STYLE type=text/css>
.nf { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt }
.sf { font-family: verdana,arial,helvetica,sans-serif; font-size: 8pt; color: #ffffff; }
</style>
</head>
<body bgcolor="#000000">

<!-- content table -->
<font class="sf">Registration is required if you want to post messages on sportcompactracing.com</font>
<table bgcolor="#000000" width="100%" cellpadding="10" cellspacing="0" border="0"><tr><td>
<form action="http://www.sportcompactracing.com/vbulletin/register.php" method="post">
<input type="hidden" name="s" value="">

<table border="0" cellspacing="1" cellpadding="4" width="100%" bgcolor="#555576">
<!-- *** -->
<tr>
<td bgcolor="#0000ee" colspan="2"><font face="verdana" size="2" color="#ffffff" class="thtcolor"><b>Registration</b></font>
<font face="verdana" size="1" color="#ffffff" class="thtcolor">(*) fields are required. Please note that passwords are case sensitive.</font></td>
</tr>
<!-- *** -->
<tr>
<td bgcolor="#AAAAE6"><font class="nf"><b>*User Name:</b></font></td>
<td bgcolor="#AAAAE6"><font class="nf"><input type="text" name="username" size="25" maxlength="15"></font></td>
</tr>
<tr>
<td bgcolor="#C3C3EB"><font class="nf"><b>*Password:</b></font></td>
<td bgcolor="#C3C3EB"><font class="nf"><input type="password" name="password" size="25" maxlength="15"></font></td>
</tr>
<tr>
<td bgcolor="#C3C3EB"><font class="nf"><b>*Enter Password Again:</b></font></td>
<td bgcolor="#C3C3EB"><input type="password" name="passwordconfirm" size="25" maxlength="15"></td>
</tr>
<tr>
<td bgcolor="#AAAAE6"><font class="nf"><b>*Email:</b></font><br>
<font color="#000000" face="verdana" size="1">Please enter a <b>valid</b> email address.</font></td>
<td bgcolor="#AAAAE6"><font class="nf"><input type="text" name="email" size="25" maxlength="50"></font></td>
</tr>
<tr>
<td bgcolor="#AAAAE6"><font class="nf"><b>*Enter Email Again:</b></font></td>
<td bgcolor="#AAAAE6"><font class="nf"><input type="text" name="emailconfirm" size="25" maxlength="50"></font></td>
</tr>

<tr><td bgcolor="#113274">

</td><td bgcolor="#113274"><input type="hidden" name="allowmail" value="yes">
<input type="hidden" name="invisible" value="no">
<input type="hidden" name="showemail" value="yes">
<input type="hidden" name="cookieuser" value="yes">
<input type="hidden" name="nosessionhash" value="yes">
<input type="hidden" name="emailonpm" value="yes">
<input type="hidden" name="prunedays" value="-1">
<input type="hidden" name="umaxposts" value="-1">
<input type="hidden" name="startofweek" value="1">
<input type="hidden" name="timezoneoffset" value="-5">
<input type="hidden" name="emailnotification" value="yes">
<input type="hidden" name="showsignatures" value="yes">
<input type="hidden" name="showavatars" value="yes">
<input type="hidden" name="showimages" value="yes">
<input type="hidden" name="vbcode" value="yes">
<input type="hidden" name="pmpopup" value="yes">
<input type="hidden" name="receivepm" value="yes">
<input type="hidden" name="url" value="http://www.sportcompactracing.com/vbulletin/thankyou.html">
<input type="hidden" name="action" value="addmember">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset"></td>
</tr></font>
</td></tr></table>
</form>
<font class="sf">By pressing the registration button above you declare that you have read and agree with the <a href="/" target="blank">Community Guidelines</a></font>
<!-- End content area table -->
</td></tr></table>
</body>
</html>

TECK
03-07-2002, 05:25 AM
you could also try my vbPopup hack and insert in the template there only the username password and email. keep the rest of inputs hidden. alot faster and i would say more elegant? is up to you to judge.

regards,
nakkid.

thehobbyforum
05-07-2002, 03:08 AM
Ok as an extension of this I want to make the location a required feild - if I do this then the quick regstration from above will no longer work - what do I need to add to it to make it also submit the location??