vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Mini Mods - [OzzModz] Email Admin For Expiring Subscriptions (https://vborg.vbsupport.ru/showthread.php?t=316513)

ozzy47 01-08-2015 11:31 PM

Quote:

Originally Posted by TheLastSuperman (Post 2531373)
*Idea

If possible, have option to allow admin to specify receiving email of subscriptions not renewed after X days of expiring - this way they know who has not renewed by said set # of days since subscription is marked as expired. Edit: This will allow the admin to reach out to them and see why they didn't renew and possibly work something out or give them a discount to regain their subscription.

Actually now that I think about it, is the subscription information retained in the subscriptionlog table after it expires? I don't use them, so I do not know for sure.

TheLastSuperman 01-09-2015 12:53 AM

Isn't that what status in that table is used for?

Edit: Why does that seem like grammar in a half shell ^ :p

PHP Code:

AND status 


ozzy47 01-09-2015 12:57 AM

This is the lines of code that runs on the cron.

Code:

if (is_array($subobj->subscriptioncache))
{
    foreach ($subobj->subscriptioncache as $key => $subscription)
    {
        // disable people :)
        $subscribers = $vbulletin->db->query_read("
            SELECT userid
            FROM " . TABLE_PREFIX . "subscriptionlog
            WHERE subscriptionid = $subscription[subscriptionid]
                AND expirydate <= " . TIMENOW . "
                AND status = 1
        ");

        while ($subscriber = $vbulletin->db->fetch_array($subscribers))
        {
            $subobj->delete_user_subscription($subscription['subscriptionid'], $subscriber['userid'], -1, true);
        }
    }

So if I read that right, it deletes the subscription.

TheLastSuperman 01-09-2015 01:00 AM

I read the same... so then perhaps add a field to your mod, when it emails them it adds their userid and subscription type then query said table every 10 days or so via cron, if their userid is present it emails admin or something like that still just spitting out ideas. One way to work around the deletion of subs and also retain prior sub info in a sense but like I said twas just an idea up to you IF you want to go through the trouble.

ozzy47 01-09-2015 01:03 AM

Perhaps, if their is enough interest. but it seems like a lot of trouble to go through. IMO the records should not be deleted anyway, they should stay in the DB untill I of course want to thin out the table, then I should be able to run a cron, to delete subscriptions older than X.

To bad they did not think of it when they built the system.

CharlieDelta 01-09-2015 02:05 AM

I like the idea proposed by Superman. :up:

ozzy47 01-09-2015 10:07 AM

Cool, that's two. :)

Fields 01-09-2015 10:17 AM

Damn, can you read my mind? :D I've been waiting for months for this, thank you very much ozzy :)

ozzy47 01-09-2015 10:19 AM

I know something like this has been asked for quite a few times over the years, so I figured why not. :p

Thanks for marking as installed. :)

ozzy47 01-09-2015 11:12 AM

Quote:

Originally Posted by TheLastSuperman (Post 2531399)
I read the same... so then perhaps add a field to your mod, when it emails them it adds their userid and subscription type then query said table every 10 days or so via cron, if their userid is present it emails admin or something like that still just spitting out ideas. One way to work around the deletion of subs and also retain prior sub info in a sense but like I said twas just an idea up to you IF you want to go through the trouble.

I just made a subscription expire, and it seems to just update the DB and set status to 0

So could someone that actually runs paid subscriptions check their DB and see if it holds all the expired ones?


All times are GMT. The time now is 10:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01182 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete