PDA

View Full Version : Add-On Releases - EPC PM Notifications "SUITE" with AJAX


blogtorank
08-22-2007, 10:00 PM
EPC PM Notifications "SUITE" with AJAX


Ok, you may have to ask, what would we want this for? Because we just fulfilled a member's request here in our other MOD: EPC vbMailer (https://vborg.vbsupport.ru/showthread.php?t=155820)

Where this member asked in posts, 8 (https://vborg.vbsupport.ru/showpost.php?p=1322128&postcount=8), 18 (https://vborg.vbsupport.ru/showpost.php?p=1322220&postcount=18), and 34 (https://vborg.vbsupport.ru/showpost.php?p=1322305&postcount=34)... So that being said we put the whole idea wrapped around his thoughts into a FREE mod here... :)

Description


Basically the paid subscriptions in vbulletin when someone signs up and buys something from the forums/payments.php page there is no email/pm notification sent to them.

For people who use the paid subscriptions in vbulletin for one thing or another, it is quite often very useful to set up a email/pm notification to say thanks, or to let them know what they have to do next, or to let them know what features that now have access to etc.So what he wanted we built :), that's what you get when you support our by leaving us feedback!

Installation Guide

If you had our previous hack installed, from version 1.1 and prior, remove it totally!

Step 1) Upload the files in the 'upload' folder to your forums' root folder

Step 2) Import the 'product-sub_receipt.xml' file into your Product Manager (Add/Import Product)

Step 3) Enjoy and remember us in the future! Click INSTALL for updates!

Settings Documentation

General Settings --
Send PM Global - this is a switch to turn global PM sending on and off, allowing you to control every notification sender in EPC PM Notifications.
Send Email Global - same as above except pertaining to emails.
Admin Username - set this to the admin username of your forum. This is where admin PM notifications are sent and where user notifications are sent from.Paid Subscription Settings --
Send PM - allows you to turn PM sending for Paid Subscription Notifications on or off.
PM CC Usernames - a comma-separated entry of usernames to send CC of the Paid Subscription Notification to.
PM Title - the title of every outgoing notification.
PM Message - the message of every outgoing notification. To display a user's username, enter '%1$s'. To display the subscription's name, enter '%2$s'. To display the subscription's cost, enter '%3$s'.
Send Email - allows you to turn Email sending for Paid Subscription Notifications on or off.
Email Subject - the subject of every outgoing notification email.
Email Body - the body of every outgoing notification email. To display a user's username, enter '%1$s'. To display the subscription's name, enter '%2$s'. To display the subscription's cost, enter '%3$s'.Change Log

v1.1:
Ajaxified the whole backend for the admin
Added support for sending as e-mail alsov1.2:
Converted to a Suite with many more options and cool features
More secure than v1.1 due to a flag we just received last night about a possible SQL Injection possibility. So we corrected it all overnight :)v1.5:
Renamed the whole project to EPC PM Notifications "Suite" you will see why when you install!
Security fixes
Optimized code

blogtorank
08-23-2007, 04:53 AM
Reserving first post for future usages... Have a great day!

jasculs
08-23-2007, 05:12 AM
Great Mod!....I'll check it out...cause I could use this.

Jon_Simmonds
08-23-2007, 05:48 AM
great mod - this should be a default feature...

blogtorank
08-23-2007, 06:00 AM
Great Mod!....I'll check it out...cause I could use this.

Glad we can cater to your needs! If you have any questions let them rip!

great mod - this should be a default feature...

Thanks, but now it is a default feature :D

Hornstar
08-23-2007, 07:07 AM
you rock :D

I cant wait to get this installed tomorrow, I will let you know how things go then.

Thanks heaps :)

ps. just incase this doesnt already do it, can you add email support as well. that way it pms and emails them.

Also, what happens if they pay with a pending echeque through paypal? will it pm them straight away, or when the funds clear? Would be cool if it pm/emailed them letting them know that the funds are pending, and then another pm/email when it clears.

Thanks.

blogtorank
08-23-2007, 07:54 AM
you rock :D

I cant wait to get this installed tomorrow, I will let you know how things go then.

Thanks heaps :)

ps. just incase this doesnt already do it, can you add email support as well. that way it pms and emails them.

Also, what happens if they pay with a pending echeque through paypal? will it pm them straight away, or when the funds clear? Would be cool if it pm/emailed them letting them know that the funds are pending, and then another pm/email when it clears.

Thanks.

LOL, well as I said we would get it done one way or another, because we didn't want to take the core of vbmailer and throw it off it's original intention. I don't know what happens with them payment systems other than just PayPal...

I'll look into the email add.

Konstantinos
08-23-2007, 08:55 AM
but they get an email from paypal !

blogtorank
08-23-2007, 09:45 AM
but they get an email from paypal !

Yes they do... However think of the idea of it being more personalized this way :)

yahoooh
08-23-2007, 10:18 AM
great mod

SMO
08-23-2007, 10:20 AM
Im just brainstorming here as it seems the acp gets a bit crowded...would it be more organized if this was actually in the paid subscription area rather than beneath it?

blogtorank
08-23-2007, 10:26 AM
Im just brainstorming here as it seems the acp gets a bit crowded...would it be more organized if this was actually in the paid subscription area rather than beneath it?

LOL If you have 500 hacks I would suppose s ;) Now for all jokes to the side, yes you are right I'll put that for v1.1 for you! Thanks for the feedback.

projectego
08-23-2007, 11:12 AM
* projectego clicks install :)

blogtorank
08-23-2007, 11:20 AM
Check my newest one I just put out there if you like this one and you use MySpace :)

gforce75
08-23-2007, 11:20 AM
Great product! Installed.

blogtorank
08-23-2007, 12:11 PM
Great product! Installed.

Thanks!!! Click Install helps for any updates... :D

st1905
08-23-2007, 12:23 PM
Another great addon, thank you so much.

Kihon Kata
08-23-2007, 01:41 PM
Installs. We have a member marketplace, so this is perfect. Is there a paid version of this hack?

What would be useful is to show in the receipt, the length of the sub, how much paid for the sub, maybe even an attached spreadsheet or a word document they can download and more details of the paid sub.

Thanks

DiSpy
08-23-2007, 03:07 PM
What would be useful is to show in the receipt, the length of the sub, how much paid for the sub, maybe even an attached spreadsheet or a word document they can download and more details of the paid sub.


Agreed... also, in my forums I have several different subscription options, the pm should state which one they purchased, as well as the person above stated the legth of the subscription, how much they paid, and any other details.

THANKS! (Will install this weekend.)

jasculs
08-23-2007, 03:26 PM
Hello,

Someone purchases a subscription and it posted their username, but I don't think it posted their type of subscription.

This is what is said:

username,

You are now a paid subscriber to !

Thank you!

It just end at "to" and didn't have a subscription name

Inkybro
08-23-2007, 08:14 PM
Hello,

Someone purchases a subscription and it posted their username, but I don't think it posted their type of subscription.

This is what is said:



It just end at "to" and didn't have a subscription name

You're using %2$s for the subscription name, right?

Inkybro
08-23-2007, 08:16 PM
Installs. We have a member marketplace, so this is perfect. Is there a paid version of this hack?

What would be useful is to show in the receipt, the length of the sub, how much paid for the sub, maybe even an attached spreadsheet or a word document they can download and more details of the paid sub.

Thanks

We will consider creating a paid version including some more robust features such as the ones you've requested.

blogtorank
08-23-2007, 08:20 PM
Agreed... also, in my forums I have several different subscription options, the pm should state which one they purchased, as well as the person above stated the legth of the subscription, how much they paid, and any other details.

THANKS! (Will install this weekend.)

Thanks for you idea and thoughts they are what makes our products and mods grow because of this! Look forward to seeing your Install :)

Hello,

Someone purchases a subscription and it posted their username, but I don't think it posted their type of subscription.

This is what is said:



It just end at "to" and didn't have a subscription name

Did you use the variable that's stated in the hack it...

Installs. We have a member marketplace, so this is perfect. Is there a paid version of this hack?

What would be useful is to show in the receipt, the length of the sub, how much paid for the sub, maybe even an attached spreadsheet or a word document they can download and more details of the paid sub.

Thanks


You really want this mod to blow up I take it? :)

Another great addon, thank you so much.

You are welcome, and surely appreciate a good friend like you to keep checking our mods out! Thank you so much for your Support!

Inkybro
08-24-2007, 05:09 AM
LOL If you have 500 hacks I would suppose s ;) Now for all jokes to the side, yes you are right I'll put that for v1.1 for you! Thanks for the feedback.

After looking into this, there seems to be no way to automatically add links to already existing menus in the CP nav. This is unfortunate.

If anyone knows of a way, please let us know.

MB-Soft
08-24-2007, 12:15 PM
Thanks for the great Hack.

Clicked Install :)

SherryG
08-24-2007, 10:03 PM
Awesome hack, thank you!

I just want to mention a very small issue. When changing the PM message, I got a syntax/database error if/when I used apostrophes in my message. I'm not sure if this is an issue with my server or what, but just thought I would mention it.

Cheers,
Sherry

winpro19
08-24-2007, 10:12 PM
Hello

Indeed a great hack however I'm getting database errors as well.

1. When I use an apostrophe in my message, I get a database error.

AND ALSO WHEN

2. When it's enabled and I try to "Add User" to a paid subscription...

Please fix all these DB errors...

Thanks a lot for this great hack!

blogtorank
08-24-2007, 10:37 PM
Upgrade time :)

EPC Subscription Receipts Upgrade and Update:

v1.1:

* Ajaxified the whole backend for the admin
* Added support for sending as e-mail also

blogtorank
08-24-2007, 10:41 PM
Thanks for the great Hack.

Clicked Install :)

Thanks!

Awesome hack, thank you!

I just want to mention a very small issue. When changing the PM message, I got a syntax/database error if/when I used apostrophes in my message. I'm not sure if this is an issue with my server or what, but just thought I would mention it.

Cheers,
Sherry

Can you report too me via PM of the error that it throws? So you don't have to paste the error message as in the public here? Seems there may be a issue with the server, but I'll help you out via PM if you send me the error it gives you.

Hello

Indeed a great hack however I'm getting database errors as well.

1. When I use an apostrophe in my message, I get a database error.

AND ALSO WHEN

2. When it's enabled and I try to "Add User" to a paid subscription...


Please fix all these DB errors...


Thanks a lot for this great hack!

Well if you add a new user, this works right now off REAL transactions after they are made, because this hooks into the payment processing make sense?

Kihon Kata
08-25-2007, 02:01 AM
Thanks for all the hard work.

Tried to upgrade from 1.0. Uploaded new files.
Overwrite during product install, crashed datastore table.

Database error in vBulletin 3.6.8:

Invalid SQL:
INSERT INTO datastore(title, data, unserialize) VALUES('sub_receipt', 'a:7:{s:6:"sendpm";s:2:"on";s:6:"pmfrom";s:5:"admin";s:7:"pmtitle";s:30:"You are now a paid subscriber!";s:9:"pmmessage";s:75:"%1$s,

You are now a paid subscriber to %2$s!

Thank you!";s:9:"sendemail";s:2:"on";s:12:"emailsubject";s:30:"You are now a paid subscriber!";s:9:"emailbody";s:47:"%1$s,

You are now a paid subscriber to %2$s!";}', '1');

MySQL Error : Duplicate entry 'sub_receipt' for key 1
Error Number : 1062
Date : Friday, August 24th 2007 @ 07:53:14 PM


Then I uninstalled and reinstalled product. Seemed to install ok. but when I try to hit the "edit settings" button to customize my receipt, it does nothing. Click click click on the button and nothing. Seeming buggy

Uninstalls.

chewbacca
08-25-2007, 04:52 AM
Very nice, thanks for this mod.

Andreas
08-25-2007, 05:11 AM
This modification has a major Bug:

exec_shut_down();

This call kills the datbase connection - which causes database errors for example in payment_gateway.php for Payment APIs that require feedback display - as there are queries being run after the call to build_user_subscription().

Also, why don't you just use phrases for the subject and body text?
Would make it a lot easier and language independant :)

blogtorank
08-25-2007, 04:14 PM
Update and Security fix:

v1.2:

Converted to a Suite with many more options and cool features
More secure than v1.1 due to a flag we just received last night about a possible SQL Injection possibility. So we corrected it all overnight :)

AzzidReign
08-25-2007, 04:15 PM
Awesome! Great work!! Thanks for the fix.

Andreas
08-25-2007, 04:29 PM
New Bug: Version 1.2 will cause a fatal PHP error if build_user_subscription() is called more then due to redefined functions.

A few suggestions

foreach($_POST as $key => $value){
$ds[$key] = $value;
}
$vbulletin->input->clean_array($ds, array(
'send_pm_global' => TYPE_NOHTML,
'send_em_global' => TYPE_NOHTML,
'pm_from_global' => TYPE_NOHTML,
'send_pm_paidsub' => TYPE_NOHTML,
'pm_title_paidsub' => TYPE_NOHTML,
'pm_message_paidsub' => TYPE_NOHTML,
'send_em_paidsub' => TYPE_NOHTML,
'em_subject_paidsub' => TYPE_NOHTML,
'em_body_paidsub' => TYPE_NOHTML
));


Why not just

$vbulletin->input->clean_array_gpc('p', array(
'send_pm_global' => TYPE_NOHTML,
'send_em_global' => TYPE_NOHTML,
'pm_from_global' => TYPE_NOHTML,
'send_pm_paidsub' => TYPE_NOHTML,
'pm_title_paidsub' => TYPE_NOHTML,
'pm_message_paidsub' => TYPE_NOHTML,
'send_em_paidsub' => TYPE_NOHTML,
'em_subject_paidsub' => TYPE_NOHTML,
'em_body_paidsub' => TYPE_NOHTML
));



$db->query_write("UPDATE " . TABLE_PREFIX . "datastore SET data='" . $db->escape_string(slw_serial($ds)) . "' WHERE title='pmnotify'");

You should never UPDATE table datastore directly, as the user might use a datastore cache - and thus your updated data will not be in the cache (until it gets cleared).
Use build_datastore() instead.


$current_dt = strtotime("now");

The current timestamp is available as constant TIMENOW - seems unnecessary overhead to create it again.

Inkybro
08-26-2007, 03:44 AM
New Bug: Version 1.2 will cause a fatal PHP error if build_user_subscription() is called more then due to redefined functions.

A few suggestions

foreach($_POST as $key => $value){
$ds[$key] = $value;
}
$vbulletin->input->clean_array($ds, array(
'send_pm_global' => TYPE_NOHTML,
'send_em_global' => TYPE_NOHTML,
'pm_from_global' => TYPE_NOHTML,
'send_pm_paidsub' => TYPE_NOHTML,
'pm_title_paidsub' => TYPE_NOHTML,
'pm_message_paidsub' => TYPE_NOHTML,
'send_em_paidsub' => TYPE_NOHTML,
'em_subject_paidsub' => TYPE_NOHTML,
'em_body_paidsub' => TYPE_NOHTML
));


Why not just

$vbulletin->input->clean_array_gpc('p', array(
'send_pm_global' => TYPE_NOHTML,
'send_em_global' => TYPE_NOHTML,
'pm_from_global' => TYPE_NOHTML,
'send_pm_paidsub' => TYPE_NOHTML,
'pm_title_paidsub' => TYPE_NOHTML,
'pm_message_paidsub' => TYPE_NOHTML,
'send_em_paidsub' => TYPE_NOHTML,
'em_subject_paidsub' => TYPE_NOHTML,
'em_body_paidsub' => TYPE_NOHTML
));



$db->query_write("UPDATE " . TABLE_PREFIX . "datastore SET data='" . $db->escape_string(slw_serial($ds)) . "' WHERE title='pmnotify'");

You should never UPDATE table datastore directly, as the user might use a datastore cache - and thus your updated data will not be in the cache (until it gets cleared).
Use build_datastore() instead.


$current_dt = strtotime("now");

The current timestamp is available as constant TIMENOW - seems unnecessary overhead to create it again.

Hey man, thanks for the suggestions and information!

Can you please elaborate on the v1.2 bug, I don't quite understand how to prevent what you're saying. Any help here would be appreciated.

Will be remembering this and implementing it in the next update.

Once again, tons of thanks =]

blogtorank
08-26-2007, 04:29 AM
Update is coming, so hang loose! :)

blogtorank
08-26-2007, 04:39 AM
v1.5:
Renamed the whole project to EPC PM Notifications "Suite" you will see why when you install!
Security fixes
Optimized code

Andreas
08-26-2007, 04:11 PM
Can you please elaborate on the v1.2 bug, I don't quite understand how to prevent what you're saying. Any help here would be appreciated.

It is still present in 1.5 ...

On hook paidsub_build you are defininig two functions - slw_serial() and slw_unserial().
Now, if method build_user_subscription() is being called several times within one script run, this will cause a fatal error as you the functions are already defined when the plugin is called the second time - which will halt script execution.

Also, I don't understand why you are using custom serialize functions anyway :)

Instead of $db->fetch_array($db->query_read()), $db->query_first is easier.

I also suggest to use phrases instead of the datastore item - this is the standard way to do such things (PM;/E-Mail Notifications).

Finally, having hardcoded text in PHP scripts is deprecated.

Inkybro
08-26-2007, 05:02 PM
It is still present in 1.5 ...

On hook paidsub_build you are defininig two functions - slw_serial() and slw_unserial().
Now, if method build_user_subscription() is being called several times within one script run, this will cause a fatal error as you the functions are already defined when the plugin is called the second time - which will halt script execution.

Also, I don't understand why you are using custom serialize functions anyway :)

Instead of $db->fetch_array($db->query_read()), $db->query_first is easier.

I also suggest to use phrases instead of the datastore item - this is the standard way to do such things (PM;/E-Mail Notifications).

Finally, having hardcoded text in PHP scripts is deprecated.

I gotcha now. So running an if(!function_exists()) would probably get that fixed.

About $db->query_first(), never knew what it did but now I do, so thanks =]

As for phrases, we wanted to offer the user a more personal and seamless experience, where they only have to use our control panel to change their settings. I understand that this isn't the standard way of doing things, but it seems to offer a better experience, which is what we're all about. Maybe I could code it to use phrases, create my own phrase group, and have a link pointed to that phrase group. I'll look into this, unless you have some suggestions.

Thanks again for the help, I'm still getting the hang of vB's system, and you've helped a lot!

EDIT The reason I'm using these functions, is because a serialize() or unserialize() fails if there is an apostrophe in the data. I don't know why, it's weird, because in our vbMailer mod, this doesn't occur. I don't have any idea why.

Andreas
08-26-2007, 07:23 PM
serialize() works fine with apostrophes - you just have to run the serialized string through mysql_real_escape_string (eg. $db->escape_string()), just as any other non-sql safe string too.

Not using phrases is bad if you run a board with multiple languages.

blogtorank
08-26-2007, 08:37 PM
serialize() works fine with apostrophes - you just have to run the serialized string through mysql_real_escape_string (eg. $db->escape_string()), just as any other non-sql safe string too.

Not using phrases is bad if you run a board with multiple languages.

Thanks Andreas, you are great help to us and if anything we owe you a link back to you on this next release :) Great help like you is hard to come by, especially with your expertise within vB code!

Thanks again.

blogtorank
08-26-2007, 08:39 PM
Side note to Andreas bug:

However to reproduce your "Bug" that's not happening here neither, I've run this many times on 3.6.8 and can't reproduce no bug as you state that is to the naked eye or to error_logs. As mentioned we are looking at your standards are implement them into our next revision because of my previous post.

Andreas
08-27-2007, 05:09 AM
It most likely does not happen with default vB code, however it would occur on my board (which uses a cronjob to extend subscriptions if the user had chosen a recurring subscription) ;)

blogtorank
08-27-2007, 05:13 AM
But you downloaded so you did check install so I can make a special fix for andreas? :D

Andreas
08-27-2007, 05:16 AM
Yes, I downloaded it but I did not install it - I came across the first bug I posted (exec_shut_down() being called) on a customers board
.

blogtorank
08-27-2007, 06:32 AM
Yes, I downloaded it but I did not install it - I came across the first bug I posted (exec_shut_down() being called) on a customers board
.

Ah I C now.. :P Anyhow I'll send a test your way for that board if you like unless you have made this revision and like to share?

Hornstar
08-31-2007, 12:03 PM
Hey I finally got to install this just now after being so hectic at uni.

Just wanted to say, it does not have the 1 extra feature I need.

The ability to write up different emails/pms per subscription. I dont want to send the same email/pm for the different subscriptions I have, some I may like to give them info of where they have to download the content from, another subscription may be just as simple as saying thanks etc.

Can you add the ability to write up a predefined template per subscription that I have.

Thanks.

Inkybro
08-31-2007, 02:13 PM
Hey I finally got to install this just now after being so hectic at uni.

Just wanted to say, it does not have the 1 extra feature I need.

The ability to write up different emails/pms per subscription. I dont want to send the same email/pm for the different subscriptions I have, some I may like to give them info of where they have to download the content from, another subscription may be just as simple as saying thanks etc.

Can you add the ability to write up a predefined template per subscription that I have.

Thanks.

Hm...

We will certainly look into this for you.

Hornstar
08-31-2007, 11:57 PM
I woke up this morning with database errors as follows:


Database error in vBulletin 3.6.8:

Invalid SQL:
SELECT * FROM vb3_subscription WHERE id='10';

MySQL Error : Unknown column 'id' in 'where clause'
Error Number : 1054
Date : Friday, August 31st 2007 @ 03:25:41 PM
Script : http://www.gamerzneeds.net/forums/payment_gateway.php?method=paypal


Uninstalling until the above can be fixed as well, as I lost several subscriptions last night.

kafi
09-10-2007, 09:09 AM
Very handy add-on. Requested features in this thread are the same I wish to request (name and length of subscription).
I have the sam error "MySQL Error : Unknown column 'id' in 'where clause'" although I am just 3.6.4.

Thanks for the fix :)

Iskib
10-12-2007, 12:20 PM
--------------------------------------------------------------------------------

I purchased the full version of another one of this guys products. It has been 5 days and still not able to download it. They have asked for information which I have sent and still the file is not there to download.

I have sent 3 support tickets with no response.

************WARNING**************

STAY AWAY

Hornstar
10-13-2007, 01:54 AM
Hey, just wondering if you guys are still working on the next update? and if it will include the ability to write up a different thing for each subscription.

thanks.

kafi
10-30-2007, 02:05 PM
looks like it is getting sleepy here :(

Hornstar
11-07-2008, 09:05 PM
uninstalled.