PDA

View Full Version : newsletter / mailing list system


alexp
04-17-2002, 10:00 PM
This hack allows user to opt-in to mailing lists which you, or a marketing colleague (with appropiate permissions) can create and send mail to. It uses code from the email.php script in the admin section but adds the flexibility of multiple mailing lists which users can opt-in and opt-out of.

Changes made:

1) New directory (called newsletter:) which can be accessed by poduct managers etc so non-admins can use the functionality

2) Changes to usergroup.php in the admin section allow you to assign newsletter priveleges to a user group from the admin CP

3) Changes to user options allow members to subscribe or unsubscribe to various mailing lists.

All necessary code and a fairly involved readme are included as attachments. You'll need direct access to your DB for this one, as you'll be setting up a couple of new tables.

I hope you find this helpful, and please don't hesitate to contact me via email (PM may take a while as I'm not here that regularly) if I can help at all. I'll do my best to offer support for the hack as quickly as possible.

Cheers,

Alex

PS .zip file is posted further down in the thread

If a user has permission to "cansendALLnewsletters" they will also need the lower permission of "cansendnewsletter". This is not given automatically. I suppose its a bug, but its no big deal..




Instead of uploading the new full version of usergroup.php as instructed in the readme, follow the instructions in the usergroup_changes.txt file to alter this file.

With the long SQL queries, make sure that no variable names span a line break - this will cause a DB error.

alexp
04-18-2002, 11:05 AM
some piccies to prove it works :bunny:

alexp
04-18-2002, 11:06 AM
.

Admin
04-18-2002, 11:13 AM
Please remove usergroup.php from the zip file and instead provide instructions to hack it. :) (it's against the rules to post full files of vB)

jly2klee
04-18-2002, 01:16 PM
Nice Hack Man! Nice idea! Will install right now!

Admin
04-18-2002, 01:19 PM
You will also need to remove adminfunctions.php, functions.php and global.php from the sub-zip file. Sorry.

alexp
04-18-2002, 01:30 PM
sorted. That readme's getting a bit lardy though (:

PS Chen - interesting one here - I had to repost the attachment in a different post, because when I re-posted it on the top post, it reverted to the older version.

Try it - doesn't matter if you rename, it still gives the older version (even if you delete the file first then re-edit & re-attach)

vB bug?

Floris
04-18-2002, 08:26 PM
Not a vB bug, you have to a) select 'use new attachment' and/or b) refresh your cache (with .jpg sometimes)

alexp
04-19-2002, 07:53 AM
I selected "use new attachment" but the old one still appeared..

it could be our proxy cache at work though - I'll run some tests at home on localhost next week to see if I can recreate it.

Velocd
04-20-2002, 12:33 AM
I have seen many threads where people ignore this rule and still posts PHP files from Vbulletin. Maybe you guys need another mod, like *cough* me *cough*

j/k, hahahahhahaha.....hah....^_^'

Admin
04-20-2002, 06:11 AM
That post was baseless. ;) You can see in this thread I "caught" alexp merely 2 hours after he posted the thread.

KarateKid
04-20-2002, 11:01 AM
Quiet a nice hack :)

Lars
04-20-2002, 11:44 AM
Which code in Global.php (in forum/admin or /forum?) should I change.. You can't just write lines 130-143.. :) Maybe I write something over that is not like your global.php.

Chris M
04-20-2002, 12:11 PM
Just a Q here...

I dont want to have to go give usergroup permissions out...

Is there any way to give Specific Users access?

i.e. userid=32

Satan

alexp
04-21-2002, 06:02 PM
@lars - I will go through the code at work tomorrow and replace the line numbers with "between this code and that code" - Basically the changes to Global just set a different cookie (newsletter OK instead of admin OK.)


PS as you are copying the file into a new directory and not editing the existing file in your admin directory, why not take a clean copy from your install .zip and follow the line numbers then?


@hellsatan - yes that is possible, I just thought using the usegroup was a more flexible method. Hack the "get perms" section to set $getperms[cansendnewsletter] =1 if your user has an acceptable userID. You could store an array of acceptable userIDs at the top of the script. - I'll post code tomorrow if I get a chance.

@firefly - ' fair cop guv :cheeky: '

legd723
04-29-2002, 03:24 PM
Anyone had any luck with this and version 2.25 of vbulletin?

alexp
04-30-2002, 10:40 AM
for some reason, $HTTP_POST_VARS['action'] doesn't seem always to work (a colleague and I both had this problem this morning whilst it worked fine yesterday :cross-eyed: )

To solve this:

in email.php, change line 15 from "if ($HTTP_POST_VARS['action']=="dosendmail") {"

to simply "if ($action=="dosendmail") {"

Now the question is, why doesn't $HTTP_POST_VARS work today when it worked yesterday and the day before that???? Very odd!

Also enclosed is a new manage.php file which allows those with newsletter admin priveleges to subscribe all users to a newsletter. Whilst this feature could be useful in some situations, remember SPAM IS BAD! You should also tell users how to unsubscribe from the list again if you choose to use this feature.