View Full Version : Where to modify Messenger_Tier_1[2/3]
devinci99 05-23-2004, 02:44 PM I'm trying to customize the paypal upgrade box. I know you said as long as I have this in the form:
<input type="hidden" name="item_name" value="Messenger_Tier_1">
or item name is Messenger_Tier_1, Messenger_Tier_2, or Messenger_Tier_3, it will work.
What I want to do is change it, so the item name is, Messenger_Tier_1.
So my question is I want this name to be a bit more accurate, like "20mb_1year_subscription"
I cannot find anywhere in the function.cgi and messenger.cgi for any text related to, Messenger_Tier_1, Messenger_Tier_2, or Messenger_Tier_3... where do I change this? Is it in the database?
----------------------------
BTW, after this and getting my provider to increase the max packet size for me, I'm about ready to go live. Awesome script man! Great forum support, without it, wouldnt have been able to modd it!
Cant wait for 7.0!
Question about instant messenger, does it have any integration with wwm??? will it?
That feature offering is interesting me to offer instant mesenging to my users.
I believe you can change this without any adverse affect, and then you can change the name in the messages file also.
From what I remember and from quickly reviewing the code, the actual Item Name is not important to the script, just the price.
devinci99 05-24-2004, 11:14 PM then how would the script knows if it was a teir 1,2,3 upgrade?
devinci99 05-26-2004, 12:48 PM I know I changed it before and it doesn't work... but i could be wrong... I'll test it again and post here with results.
as a frame of reference, it is currently working with:
<input type="hidden" name="item_name" value="Messenger_Tier_1">
This will be the only line in the template I'll change.
devinci99 05-26-2004, 01:20 PM It some what works and there seems to be a bug.
It succesfully upgraded me, but it did not upgrade to the correct mailbox size. For all tier subscription, it gave me the tier 1 mailbox upgrade.
Let's see if i can illustrate the bug:
(snip from setup.cgi)
tier_1 2.00 52428800
tier_2 2.50 78643200
tier_3 3.00 104857600
(snip from template: upgrade.htm)
<input type="hidden" name="item_name" value="50MB_Annual_Subscription">
<input type="hidden" name="item_name" value="75MB_Annual_Subscription">
<input type="hidden" name="item_name" value="100MB_Annual_Subscription">
(snipe from messages.cgi)
115 50MB subscription
116 75MB subscription
117 100MB subscription
After successfully paying for my subscription (set for $3/yr -- debugging/test purposes!) going to ?Main_Menu page, it shpws my membership level as "100MB subscription" -- which is correct from the messages.cgi.
However the size is "52429" -- set by <!--MAX_LIMIT--> tag.
So either:
(A) <!--MAX_LIMIT--> is not reporting acurrately [or]
(B) it's reporting accurately, so the system isnt upgrading correctly.
Any ideas where to pursue this? For now I guess I can start by offering 1 tier upgrade. :)
Which will lead to another quesiton, but I'll put that in another topic. Thanks!
devinci99 05-26-2004, 01:34 PM ok, I logged in the administrator to check the user.
"Maximum Storage Allotment: 52428800"
even though it's a tier_3 user!
I tested with tier_2 as well. all shows right tier class, but wrong size --> tier_1's mailbox size. I made sure by uploading the original virgin "messenger.cgi" just in case my mods broke something... same thing.
Actually, you are right, there is a code error here, notice in the sub called Do_Paypal:
elsif ($payment_gross == $tier_2) {
if (User_Exists($item_number) eq "OK") {
Change_Max($item_number,$size1);
Change_Prem($item_number,"NO");
Update_Tier($item_number,$message{116});
}
}
elsif ($payment_gross == $tier_3) {
if (User_Exists($item_number) eq "OK") {
Change_Max($item_number,$size1);
Change_Prem($item_number,"NO");
Update_Tier($item_number,$message{117});
}
Should be:
elsif ($payment_gross == $tier_2) {
if (User_Exists($item_number) eq "OK") {
Change_Max($item_number,$size2);
Change_Prem($item_number,"NO");
Update_Tier($item_number,$message{116});
}
}
elsif ($payment_gross == $tier_3) {
if (User_Exists($item_number) eq "OK") {
Change_Max($item_number,$size3);
Change_Prem($item_number,"NO");
Update_Tier($item_number,$message{117});
}
This has been updated for all releases sold as of this post.
devinci99 05-26-2004, 04:05 PM that did it!
all working now. Tested all 3 upgrade.
I do realize another bug... well it's more of a limitation than a bug.
Scenario:
If you upgrade to tier 1, then next day you upgrade again to tier 2... The script appears to do increase the mailbox size correctly... however, the billing is screwly. It charges you the tier_1 fee, and also the tier_2 fee.
then the user has 2 active subscriptions. Further more, when you cancel 1, you still have the other subscription, but the script demotes the account back to "standard" or non-premium.
It may appear safer just to offer 1 tier to avoid this billing confusion, unless you have any ideas to work around this limitation?
devinci99 05-26-2004, 04:39 PM The only work around I can think of is use another template if the user ever loads <script>?Upgrade page.
So I add a simple mod:
### Upgrade Accounts
sub Upgrade {
Validate_User_Id($user,$pass);
Content();
my ($tier_1_cost,$tier_1_bytes) = split(/ /,$settings{'tier_1'});
my ($tier_2_cost,$tier_2_bytes) = split(/ /,$settings{'tier_2'});
my ($tier_3_cost,$tier_3_bytes) = split(/ /,$settings{'tier_3'});
my ($mail,$sent,$logins,$date_joined,$premium,$last_l ogin,$mail_count,$ip,$password,$question1,$questio n2,$question3,$question4,$question5,$question6,$qu estion7,$question8,$question9,$question10,$max,$cu rrent_storage,$tier) = Get_User_Stats($user);
### Mod, Use different template if already a premium user.
if ($premium eq "YES") { @register = Get_Template("$settings{\"basepath\"}/templates","is_premium_upgrade.htm"); }
else { @register = Get_Template("$settings{\"basepath\"}/templates","upgrade.htm"); }
###@register = Get_Template("$settings{\"basepath\"}/templates","upgrade.htm");
### /Mod, Use different template if already a premium user.
foreach $item (@register) {
if ($item =~ /<!--HEADER-->/) { Header(); }
if ($item =~ /<!--FOOTER-->/) { Footer(); }
$item =~ s/<!--URL-->/$url/gm;
$item =~ s/<!--TIER_1_BYTES-->/$tier_1_bytes/gm;
$item =~ s/<!--TIER_1_COST-->/$tier_1_cost/gm;
$item =~ s/<!--TIER_2_BYTES-->/$tier_2_bytes/gm;
$item =~ s/<!--TIER_2_COST-->/$tier_2_cost/gm;
$item =~ s/<!--TIER_3_BYTES-->/$tier_3_bytes/gm;
$item =~ s/<!--TIER_3_COST-->/$tier_3_cost/gm;
$item =~ s/<!--ICON_PATH-->/$settings{'icon_path'}/gm;
$item =~ s/<!--PAYPAL_EMAIL-->/$settings{'paypal_email'}/gm;
$item =~ s/<!--USER-->/$user/gm;
print $item;
}
}
If the user is already a premium user, it loads another template: is_premium_upgrade.htm
otherwise it loads the standard: upgrade.htm template.
So far my is_premium_upgrade.htm template just apoligize that they can only cancel their subscription, and that no refund will be provided. Once they cancel it, they can re-subscribe. =X Best I can do now to avoid billing headache.
|
|