Add this code in an HTML block to have a registeration form on all the pages of your portal. May increase the rate of registeration.
<table border="0"><tr><td><form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();"><table border="0" cellpadding="3" cellspacing="0"><tr><td><b>Choose username:</b></td></tr><tr><td><input type="text" name="user" size="20" tabindex="1" maxlength="25" /></td></tr><tr><td><b>Email:</b></td></tr><tr><td><input type="text" name="email" size="30" tabindex="2" /><label for="hideEmail"><br><input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> Hide email address from public?</label></td></tr><tr><td><b>Choose password:</b></td></tr><tr><td><input type="password" name="passwrd1" size="30" tabindex="3" /></td></tr><tr><td><b>Verify password:</b></td></tr><tr><td><input type="password" name="passwrd2" size="30" tabindex="4" /></td></tr><tr><td><label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" value="ON" /> <b>I Agree to the </b><b><a href="../index.php?action=register">terms.</b></label></td></tr><tr><td><input type="submit" name="regSubmit" value="Register" /></td></tr></table></form></td></tr></table>
Demo: http://www.webmastertradecenter.com/trade/
Thanks for this.
Also have a quick register box.
But for some reason it always gave an error when you went to the normal registration page...
Worked fine on other pages though...
Hey Harro, what gives you an error? I dont see any on any of my pages.
Was with the quick register form that I was using. Made it myself. That one gave an error.
This one seems to work fine :)
added to block code snippets under "Q" as "Quick register block"
Thanks akulion. :)
i like it.....but i use captcha with my registration. wonder if it is possible to make a block like this with captcha in it too?
Hmmz, I do get an error.
Don't get it on your site.
This is the error message document.forms.creator.regagree is empty or not an object.
Only get it when I go to the registeration page, and the quick register block is showed aswell.
rbh, well, I will see if I could add that.
Harro, Dont really know what is casuing this problem. Used same data names as of default form names. Will see into that later.
chodhry......i have seen it with phpnuke forums, the quick register with captcha ability, and always thought it would be a nice addition to tp.
hmmm. I have taken a quick look. It seems possible. I yet have to install the code on one of my test forums. BTW, do you know what files it chages/add of the forum.
Hmm. Advice needed!
On my site here (http://www.nets-and-edges.co.uk), with the Quick Register Block as-supplied, if I click on the 'Terms' link it doesn't open the Registration Terms as I expected, but instead goes to my default (file-not-found) page. The link appears to be to "<a href="../index.php?action=register">" but putting that (full path http://ccgi.zillion.plus.com/netsandedges/index.php?action=register) into my browser just brings-up the 'standard' registration page.
Changing the 'Terms' link to "./agreement.txt" (as I now have) brings-up the actual Registration agreement, but full-page with no formatting (ie crap-looking to boot!). Can anyone tell me how to bring this up in the centre column (ie as a link to an Article might)?
When i try this code out i input the code into a phpblock and i get this code back
<table border="0"><tbody><tr><td><table cellspacing="0" cellpadding="3" border="0"><tbody><tr><td><strong>Choose username:</strong></td></tr><tr><td> </td></tr><tr><td><strong>Email:</strong></td></tr><tr><td><br />Hide email address from public?</td></tr><tr><td><strong>Choose password:</strong></td></tr><tr><td> </td></tr><tr><td><strong>Verify password:</strong></td></tr><tr><td> </td></tr><tr><td><strong>I Agree to the </strong><strong><a href="?action=register">terms.</a></strong></td></tr><tr><td> </td></tr></tbody></table></td></tr></tbody></table>
it rips the form statements right out. what am i possibly doing wrong here?
you can see the code in action. http://www.domainzone.us
Your input field size are too long (at least that's one thing wrong).
Try changing the '30's to '20's.
i already fixed both the inputs and the script. in the instructions he tells you to use a htmlblock but it should be a scriptblock. just so you kniw
Well, when I looked at the source code that the page serves up, it shows the top input, which fits, as being length 20 and it shows the next inputs as being length 30 when you first posted it.
If it's html, it will work in an HTML block.
I took this a small step further and cleaned it up a bit. It will also fit into a normal sized panel.
In a phpblock add:
echo '<div>
<form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td><b>' , $txt[35] , ':</b></td>
</tr>
<tr>
<td><input type="text" name="user" size="20" tabindex="1" maxlength="20" /></td>
</tr>
<tr>
<td><b>' , $txt[69] , ':</b></td>
</tr>
<tr>
<td class="smalltext"><input type="text" name="email" size="20" tabindex="2" /><label for="hideEmail"><br /><input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> ' , $txt[721] , '</label></td> </tr>
<tr>
<td><b>' , $txt[81] , ':</b></td>
</tr>
<tr>
<td><input type="password" name="passwrd1" size="20" tabindex="3" /></td>
</tr>
<tr>
<td><b>' , $txt[82] , ':</b></td>
</tr>
<tr>
<td><input type="password" name="passwrd2" size="20" tabindex="4" /></td>
</tr>
<tr>
<td class="smalltext"><label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" value="ON" /> <b>', $txt[quick_register_agree] , ' <a href="', $scripturl, '?action=register">', $txt[quick_register_terms] , '</b></a>.</label></td>
</tr>
<tr>
<td><input type="submit" name="regSubmit" value="Register" /></td>
</tr>
</table>
</form>
</div>';
For a smaller version use this:
echo '<div>
<form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="smalltext" ><b>' , $txt[35] , ':</b></td>
</tr>
<tr>
<td class="smalltext" ><input type="text" name="user" size="20" tabindex="1" maxlength="20" /></td>
</tr>
<tr>
<td class="smalltext" ><b>' , $txt[69] , ':</b></td>
</tr>
<tr>
<td class="smalltext"><input type="text" name="email" size="20" tabindex="2" /><label for="hideEmail"><br /><input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> ' , $txt[721] , '</label></td> </tr>
<tr>
<td class="smalltext" ><b>' , $txt[81] , ':</b></td>
</tr>
<tr>
<td class="smalltext" ><input type="password" name="passwrd1" size="20" tabindex="3" /></td>
</tr>
<tr>
<td class="smalltext" ><b>' , $txt[82] , ':</b></td>
</tr>
<tr>
<td class="smalltext" ><input type="password" name="passwrd2" size="20" tabindex="4" /></td>
</tr>
<tr>
<td class="smalltext"><label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" value="ON" /> <b>', $txt[quick_register_agree] , ' <a href="', $scripturl, '?action=register">', $txt[quick_register_terms] , '</b></a>.</label></td>
</tr>
<tr>
<td class="smalltext" ><input type="submit" name="regSubmit" value="Register" /></td>
</tr>
</table>
</form>
</div>';
I have used language strings instead of written text. However there is 2 strings you need to add. Open file located in: "themes > default > languages > index.english.php".
Before ?> add:
$txt[quick_register_agree] = 'I agree to the';
$txt[quick_register_terms] = 'terms';
Save.
I'm also working on trying to create a pop-up of just the written agreement when you click on terms, but haven't had any luck so far.
Hi Xarcell,
everything seemed to be working fine, until i checked my forum error logs - a freaking 3500 pages!!! ALL of the errors are with the quick register mention.
here is what is displayed for every guest or member and these lines seem to be repeated every time the visitor views a new topic (and it goes very fast as i've got a busy forum)
8: Use of undefined constant quick_register_agree - assumed 'quick_register_agree'
/public_html/Sources/Load.php(1049) : eval()'d code
562
8: Use of undefined constant quick_register_terms - assumed 'quick_register_terms'
/public_html/Themes/default/index.template.php (eval?)
Line: 610
8: Use of undefined constant quick_register_terms - assumed 'quick_register_terms'
public_html/Sources/Load.php(1049) : eval()'d code
563
Apply Filter: Only show the errors with the same message
8: Use of undefined constant quick_register_agree - assumed 'quick_register_agree'
public_html/Themes/default/index.template.php (eval?)
Line: 609
8: Use of undefined constant quick_register_agree - assumed 'quick_register_agree'
/public_html/Themes/default/Display.template.php (eval?)
Line: 29
i had installed some other SMF hack before - the smf blog hack from smfhacks.com and i think thats when these error started. i checked the index.template.php file and the last two lines that i had added were not in the file anymore, so i added them again, but still not work.
advice needed!!
Thanks!
Did you add the language strings that he defined at the bottom of his post.
Quote from: IchBinâââ,¬Å¾Ã,¢ on November 25, 2006, 09:32:30 PM
Did you add the language strings that he defined at the bottom of his post.
i followed every step carefully and reviewed the instructions more than a dozen times. no luck.
is there any way to clean the code off my .php files based from the line code errors shown?
there is a huge buildup of errors and i'm afraid my database will be oversized and saturated in a couple of hours from now. unless i sit clicking to empty the error log...all night!?!
Change
$txt[quick_register_agree] = 'I agree to the';
$txt[quick_register_terms] = 'terms';
to
$txt['quick_register_agree'] = 'I agree to the';
$txt['quick_register_terms'] = 'terms';
i edited the index.template.php and replaced with your codes.
errors still there :-\
errors increase around 5 pages per 30-45secs!! :(
is there a way to clean my forum from the whole mess? i prefer skip having this quick register module... against losing my forum's database...
QuoteI edited the index.template.php and replaced with your codes.
Wrong file. From the earlier post, it goes in the
themes > default > languages > index.english.php file.
If you want to remove it, just delete the block that it's in.
I cant see the code on the first page, just a scroll bar? can someone repost it pls?
Quote from: JPDeni on November 26, 2006, 12:11:24 AM
Wrong file. From the earlier post, it goes in the themes > default > languages > index.english.php file.
If you want to remove it, just delete the block that it's in.
/shifty :) ok, i replaced the new register codes in the correct index.english.php file.
still errors!
so, i deleted the whole content in the register module + deleted the 2 added lines of codes from my index.english.php file. no errors in the log.
can someone please help with fixing the register module? - since i've taken that module down the number of new members have slowed down :(
Quote from: JRW on November 26, 2006, 01:58:18 AM
I cant see the code on the first page, just a scroll bar? can someone repost it pls?
here it is:
Quote
<table border="0"><tr><td><form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();"><table border="0" cellpadding="3" cellspacing="0"><tr><td>Choose username:</td></tr><tr><td><input type="text" name="user" size="20" tabindex="1" maxlength="25" /></td></tr><tr><td>Email:</td></tr><tr><td><input type="text" name="email" size="30" tabindex="2" /><label for="hideEmail">
<input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> Hide email address from public?</label></td></tr><tr><td>Choose password:</td></tr><tr><td><input type="password" name="passwrd1" size="30" tabindex="3" /></td></tr><tr><td>Verify password:</td></tr><tr><td><input type="password" name="passwrd2" size="30" tabindex="4" /></td></tr><tr><td><label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" value="ON" /> I Agree to the <a href="../index.php?action=register">terms.</label></td></tr><tr><td><input type="submit" name="regSubmit" value="Register" /></td></tr></table></form></td></tr></table>
thanks mate :)
I tried to make it so it sits nicely in a center block, but it isnt working now:
<table border="0"><tr><td><form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();"><table border="0" cellpadding="3" cellspacing="0"><tr><td>Username:<input type="text" name="user" size="10" tabindex="1" maxlength="25" /></td><td>Email:<input type="text" name="email" size="15" maxlength="50" tabindex="2" /></td><td><label for="hideEmail">
<input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> Hide email?</td><td>Password:<input type="password" name="passwrd1" size="8" tabindex="3" /></td><td>Verify Password:<input type="password" name="passwrd2" size="8" tabindex="4" /></td><td><label for="regagree"> <input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" value="ON" /></td><td>Agree to <a href="../index.php?action=register">terms. </label></td><td><input type="submit" name="regSubmit" value="Register" /></td></tr></table></form></td></tr></table>
I removed a heap of <tr></tr> etc... does that make a difference? My normal version (the one in the post above) works fine.
JRW, is this how you're trying to make it look: http://www.webmastertradecenter.com/trade/
coz i have no idea (already tried but didnt work) how to make the register line appear at the top of the forum. think it might be an edit in the index[---].php file/s itself, and maybe called function by a php code block...
in the meantime, i have had to disable error logging on my forum to continue to run the quick register module, as the latter is generating way TOO MANY errors. like 2 pages per 30sec!! pheeww... any help would be appreciated to clean up the code mess.
the forum still remains fully functional, but the errors seem to come from some misplaced code that got processed into the load.php and index.english.php files. help?!
I already have it looking like that ( http://www.techdomain.com.au ) but want to put it just under my menu in a center block (so it doesnt annoy me as teh admin. Either that, or making a way that it shows it to JUST guests, not admin would be cool!
lol @ me... the code i posted above for center block works fine... it just didnt work when I was still logged in!!! rofl
Quote from: JRW on November 26, 2006, 10:06:50 AM
I already have it looking like that ( http://www.techdomain.com.au ) but want to put it just under my menu in a center block (so it doesnt annoy me as teh admin. Either that, or making a way that it shows it to JUST guests, not admin would be cool!
could you please help with your site's top (yellow) register bar?
i've been wanting to make one - but somehow it never worked out :(
Thanks.
Ok... I made it work for Aero_79 (which is my default theme) so it displays the quick registration to guests only:
echo '
<div id="outer">
<div id="hello">';
if($context['user']['is_logged']){
echo '<a align="left">', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b>', '</a>';
echo '<span class="smalltext">';
if ($context['allow_pm'])
echo '<br />',$txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '</span>';
}
else
echo $txt['welcome_guest'];
echo '
</div>
<table id="top" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="headerdown" align="left" width="30%" style="padding-right: 8px;">
<b>', $context['common_stats']['total_posts'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt[64], ' ', $txt[525], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt[19], '</span><br />
', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
</td></tr>
</table>';
echo '
<div id="outer">';
if($context['user']['is_logged']){
echo ' <br>', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , ' Welcome to TechDomain!</b>';
}
else echo '<table id="top" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();"><table border="0" cellpadding="3" cellspacing="0"><tr><td>Choose username:<input type="text" name="user" size="10" tabindex="1" maxlength="25" /></td><td> Email:<input type="text" name="email" size="15" maxlength="50" tabindex="2" /></td><td><label for="hideEmail">
<input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> Hide email?</td><td>Choose password:<input type="password" name="passwrd1" size="8" tabindex="3" /></td><td> Verify Password:<input type="password" name="passwrd2" size="8" tabindex="4" /></td><td><label for="regagree"> <input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" value="ON" /></td><td> Agree to <a href="../index.php?action=register">terms. </label></td><td><input type="submit" name="regSubmit" value="Register" /></td></tr></table></form></td></tr></table>';
Obviously that replaces the whole "welcome user, you have x amt of PM's there are x amt of users who have made x amt of posts" bit.
Example http://www.techdomain.com.au
I have added pics of "Guest" view and "Logged" View.
PS the yellow bar is the "regbar" mod available at SMF (I did have to manually install it) If I can be of further assistance for it, let me know.
thanks... but newbie here... what file.php to replace the code?
ah sorry: index.template.php in /Themes/Aero79_TP
It should be possible to modify this to work with most themes (let me know if you want one inparticular modded)
the code you asked to find to replace doesnt exit in my template. i use TP 0.96beta and default theme to add the quick register mod.
i also downloaded the regbar mod but help needed on how to proceed with its installation..
thanks.
I can help you with the regbar mod, and throwing the code above into the default theme... but we should prolly move to another thread.
Did you try to install the mod with the package manager?
If you trust me, PM me the details to an admin account for your server (FTP info will be needed too actually).
Quote from: JRW on November 26, 2006, 11:39:19 AM
I can help you with the regbar mod, and throwing the code above into the default theme... but we should prolly move to another thread.
Did you try to install the mod with the package manager?
If you trust me, PM me the details to an admin account for your server (FTP info will be needed too actually).
have successfully installed the regbar mod using package manager as you advised. but is there a way to customize the text it displays in the bar? hopefully a solution can be figured out for the quick register module as well.
regards!
yes -
go to /Themes/default/languages and the file there modifications.english.php - in there, find the regbar mod (or the text that it displays) and change it :)
can you post a copy of your /Themes/default/index.template.php and I will have a go at adding the code (or email it to me at john -at- techdomain.com.au)
Quote from: JRW on November 26, 2006, 11:52:03 AM
yes -
go to /Themes/default/languages and the file there modifications.english.php - in there, find the regbar mod (or the text that it displays) and change it :)
can you post a copy of your /Themes/default/index.template.php and I will have a go at adding the code (or email it to me at john -at- techdomain.com.au)
have sent you link in PM :)
just testing it now.
Try this one :o (backup your old one first!)
ok, replaced and everything seems unchanged (as before replacing)
getting these errors:
8: Use of undefined constant quick_register_agree - assumed 'quick_register_agree'
File: public_html/Themes/default/index.template.php (eval?)
Line: 609
8: Use of undefined constant quick_register_terms - assumed 'quick_register_terms'
File: /public_html/Themes/default/index.template.php (eval?)
Line: 610
8: Undefined index: hello_member_ndt
File: public_html/Themes/default/languages/ModSettings.english.php (eval?)
Line: 193
8: Use of undefined constant quick_register_agree - assumed 'quick_register_agree'
File: /public_html/Themes/default/languages/ModSettings.english.php (eval?)
Line: 29
hmmm.. it worked on my site. will take another look.
those errors are alittle wierd.. do you still have the $txt strings in your modifications.english.php (or actually - it looks like they are in modsettings???)
also, is the mod still enabled as a block?
Edit: if you logged out with the changed file, did it make a difference?
Hi Xarcell (and anyone who might help)-
Thanks for posting the php block. It looks great, but I get an error when submitting the form:Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'blah_clss1'@'localhost' (using password: YES) in /home/blah/public_html/gorum/dbproperty.php on line 300
Mysql connection failed. Host: localhost, Username: blah_clss1Any thoughts on the problem? Thanks!
You shouldn't be getting anything to do with mysql. Are you sure this is the block causing this? And do you have any other code in this block?
Thanks IchBin - Here's the code in the php boxecho '<div>
<form action="../index.php?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td><b>' , $txt[35] , ':</b></td>
</tr>
<tr>
<td><input type="text" name="user" size="20" tabindex="1" maxlength="20" /></td>
</tr>
<tr>
<td><b>' , $txt[69] , ':</b></td>
</tr>
<tr>
<td class="smalltext"><input type="text" name="email" size="20" tabindex="2" /><label for="hideEmail"><br /><input type="checkbox" name="hideEmail" id="hideEmail" class="check" value="ON" /> ' , $txt[721] , '</label></td> </tr>
<tr>
<td><b>' , $txt[81] , ':</b></td>
</tr>
<tr>
<td><input type="password" name="passwrd1" size="20" tabindex="3" /></td> when i register using the regular method there is no problem. Here's a link to the page: http://promusicbus.com/smf/index.php?page=21.
The error message indicates the block is trying to access a classified ad database _clss1, not the smf database. I don't know why this would be the case when using the quick register.
Try temporarily disabling your other custom blocks to see if something is conflicting.
that didn't do the trick. I also tried clicking the "Register" button without the agree to terms box checked. rather than get the message that i need to agree to terms, i got the same error message. i don't need the classified ads database. I'll try to remove that.
removed the clss1 database but get the same error message. when i submit the Quick Register form there is an attempt to log on to a non-SMF, now non-existent database.
Well there's something else going on because this code doesn't seem to be touching anything like that. Not sure what to tell you at this point.
i appreciate your help thus far (and on many other topics) will post later.
Quote from: rbh on June 19, 2006, 09:58:33 PM
i like it.....but i use captcha with my registration. wonder if it is possible to make a block like this with captcha in it too?
I hate to bother everybody, but has anybody figured out a way to make this happen in the html block in the first post when captcha is enabled on a forum? If so, please do tell us how to do it.
Thanks,
ZarPrime
So, I Did a new install of smf 1.1.2 and TP 9.8 in a new directory with new database. I created the php block and entered registration info. got the same error. :o
i can register just fine if i click on register and submit the form that has the user terms...do i need to speak with my host about this?
Solved:- This would be a stupid error if I considered myself knowledgeable in php. The problem was that smf is installed in a sub folder and the php code here assumes it is installed in the root. the fix is to add "/subfoldername" to "index.php?..." in the second line so it reads "/subfoldername/index.php?..."
Quote from: penfield on March 27, 2007, 10:35:26 PM
Solved:- This would be a stupid error if I considered myself knowledgeable in php. The problem was that smf is installed in a sub folder and the php code here assumes it is installed in the root. the fix is to add "/subfoldername" to "index.php?..." in the second line so it reads "/subfoldername/index.php?..."
That's true except it still doesn't work if you have captcha enabled. Disable captcha and it probably works.
ZarPrime
Skiller - did you figure out how to get the problem fixed that was generating your error messages? I have the same problem 8: Use of undefined constant quick_register_terms - assumed 'quick_register_terms'
File: /home/mysite/public_html/smf/Themes/default/TPortal.template.php (eval?)
Line: 29 I changed the code in index.english.php, but still getting lots of errors. Thanks!
For me, the php block produced too many errors, so I had to remove it. However, the html block is working just fine :)
very best snippet
I am using scriptbox :)
Any way around to make it work with Captcha ?
how to add fields like age and location and make them compulsory otherwise the user cant register.