Version: 1.00, by Till
Developer Last Online: Aug 2007
Version: 2.3.x
Rating:
Released: 08-30-2003
Last Update: Never
Installs: 2
No support by the author.
Hello,
this is a really small hack, very basic. It's the first I released too, certainly not the first I have done. It's so not rocket science or advanced l33t PHP code hacking. But since I didn't really find the same hack on the site, I guess it qualifies.
Preface:
We have Qmail running, and since we (ab)use Qmail a lot, we run ezmlm with it. Very nice combo, if I may add.
Anyways, ezmlm handles the subscription via email. You send an email to listname-subscribe@whatever.domain.tld and the user recieves an email asking to confirm it (double opt-in style).
So I guess it really works with any listmanager that does the subscription via email request and confirm.
So, I had to write this in order to enable users to sign up for our newsletter on registration.
Here we go:
Create a file called "register_subscribe.php" in your forum's home directory. Put the following PHP code in it:
That's the first part where you should adjust "listname-subscribe@domain.tld" to your list manager's subscription email address.
You can remove the comments for the other mail() function and adjust it with your email address, if you feel like it. Starting it off, it can be pretty useful to track who makes use of it, and who doesn't.
Next step is to go into your control panel, then "Templates", "Modify" and "Expand..." the list. Find "Registration Templates" and edit "registeradult".
I added the following lines:
Code:
<tr>
<td bgcolor="#13486D"><normalfont><b>Would you like to recieve our newsletter?</b></normalfont></td>
<td bgcolor="#13486D"><normalfont>Yes</normalfont> <input type="checkbox" class="bginput" name="subscribe_newsletter" size="25" maxlength="15" value="yes" checked></td>
</tr>
OK, I guess that was pretty easy so far. We are almost done.
Now, let's go into register.php.
Assuming that you didn't edit the file before (and that you run vBulletin 2.3.2), you should find the following piece of code on line 476:
PHP Code:
$homepage = trim($homepage);
if ($homepage) {
if (preg_match('#^www\.#si', $homepage)) {
$homepage = "http://$homepage";
} else if (!preg_match('#^[a-z0-9]+://#si', $homepage)) {
// homepage doesn't match the [url]http://-style[/url] format in the beginning -- possible attempted exploit
$homepage = '';
}
}
Why did I add it there? Well, just because that is the very last moment before the user gets written to the database. Which means that all validation has been done until this point, which means that there's not going to be another error message about the registration process.
Not being able to register for the board for whatever reason, but still getting the message to confirm list subscription might confuse users. If you know what I mean.
So yay! That should be it.
:banana:
You may change all variables used, you can even put the file into another directory or whatever. Please do not complain that it doesn't work after you changed everything.
The hack *should* work with any version of vBulletin. The line number may be different though, but I guess you can figure it out.
I won't have any screenshots right now, maybe later. If you guys need anything, let me know, I'll try to respond to each post in time - if possible.
Have fun,
Till
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
The reason is not so that non-licensed users cannot get it, although you should never put the instructions into the hack database for that purpose. The purpose is so that people can download it and have a copy on their machine so they can re-install it when they upgrade:
Quote:
From the Full Releases rules:
Please attache the hacking instructions in a text file of some sort, so that users can download and use them again in the case of a vBulletin upgrade.
Yesterday at 10:41 PM Link14716 said this in Post #5 The reason is not so that non-licensed users cannot get it, although you should never put the instructions into the hack database for that purpose. The purpose is so that people can download it and have a copy on their machine so they can re-install it when they upgrade:
I gotcha. Added the thread as .txt to it. I guess that works. I'll do a better release with my next hack.
Today at 07:40 AM SmEdD said this in Post #7 They cannot see it any ways A mod will also tell you that. As long as it is in the [ PHP ] or [ CODE ] tags it's fine.