vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Forum Home Enhancements - Latest Paid Subscribers v1.1 (https://vborg.vbsupport.ru/showthread.php?t=128735)

paul41598 10-09-2006 10:00 PM

Latest Paid Subscribers v1.1
 
Latest Paid Subscribers v1.1 (LITE VER) :)

- This Hack Does Use The Usergroups Markup Color For A More Accurate Display Of Subscription Members!! This Hack Has It All!

Description:
This hack is fully functional and flexible allowing you to display the latest [x] subscribers on your forumhome! It also allows you to display a reminder/alert to your users who's subscriptions are expiring.

Features: (Lite Version)
  • Activate The System (Latest Paid Subscribers)
  • Select The Number Of Subscribers To Show On ForumHome

Features: (Premium Version Only)
  • Activate The System (Latest Paid Subscribers)
  • Select The Number Of Subscribers To Show On ForumHome
  • Display A Reminder/Alert Window To Warn Subscribers When Their Subscription Is Up
  • Select The Number Of Days Before That Reminder Shows
  • Never Show This Again For Reminder Alert!
  • Allow The Subscriber Info In The Title HoverOver Or Turn It Off
  • Select A Date Format For That HoverOver

Installation:
1.) 1 Template Edit
2.) 1 Product Upload
3.) Enjoy Release

Bug Fixes:
Allow Subscriber Info In HoverOver Never Worked - FIXED
Activate Latest Paid Subscribers Only Deactivated The Users, Not The Phrases Or Expiry Alert. - FIXED
SQL Bugs. - FIXED

Notes:
- Adds 1 extra query
- Premium Version Of Hacks Found Here

If you find any bugs, have comments, questions feel free to post them. I'll do my best to accomidate anything.
Disclaimer: Any modification to this hack, must get prior consent/authorization by me first.

steelerwatch 10-10-2006 12:28 PM

Nice - but could you work something up that recognizes recrurring contributors as well? This only displays brand new contributors.

Distance 10-10-2006 02:22 PM

yeah true, its the whole

'special offer to new customers'

thing again

paul41598 10-10-2006 02:34 PM

we'll see, maybe in th next version

Quarterbore 10-10-2006 03:48 PM

I HAD a strange error from vB 3.6.0...

Problem resolved as posted below

Snake 10-10-2006 04:52 PM

Wow that is great!

rmxs 10-10-2006 07:04 PM

Installed and works :)

thanks

oberheimhaven 10-10-2006 08:15 PM

had huge sql error uninstalled!! Ouch

Quarterbore 10-10-2006 08:23 PM

OK, I got help from paul41598 on this but by changing the Latest Paid Subscribers pluggin to as follows this works 100% on my site (tested in 3.6.0. and 3.6.1.)


PHP Code:

// plugin by Paul41598

if ($vbulletin->options['latest_paid_subscribers_reminder_on'])
{    
if (
$vbulletin->userinfo['userid'] AND !$_COOKIE['lpscookie']) {
$alertdays $vbulletin->options['latest_paid_subscribers_warndays'];
$day1 = (TIMENOW + ($alertdays 86400));
$getexpirers $vbulletin->db->query_read("
SELECT subscriptionlog.userid, subscriptionlog.subscriptionid, subscription.subscriptionid, subscriptionlog.expirydate,
user.userid, user.username
FROM " 
TABLE_PREFIX "subscriptionlog AS subscriptionlog, " TABLE_PREFIX "subscription AS subscription
LEFT JOIN " 
TABLE_PREFIX "user AS user ON (subscriptionlog.userid = user.userid)
WHERE subscriptionlog.status != '0' AND subscriptionlog.subscriptionid = subscription.subscriptionid AND user.userid = "
.$vbulletin->userinfo['userid']." AND subscriptionlog.expirydate < $day1
ORDER BY subscriptionlog.expirydate ASC LIMIT 5"
);


    while(
$getexpirer $vbulletin->db->fetch_array($getexpirers))
    {
      
$expiryremaining round((($getexpirer['expirydate'] - TIMENOW)/86400),2);
    
$expirytitle $getexpirer['title'];
    
$expirydate vbdate('F jS, Y'$getexpirer['expirydate']);
    eval(
'$expiryalert .= "' fetch_template('expirydatebits') . '";');
    }
}
}

if (
$vbulletin->options['latest_paid_subscribers_on'])
{        
$show['subscribers'] = true;
$max $vbulletin->options['latest_paid_subscribers'];

$getsubscribers $vbulletin->db->query_read("
SELECT subscriptionlog.userid, subscriptionlog.status, subscriptionlog.regdate, subscriptionlog.expirydate,
user.userid, user.username, user.usergroupid, displaygroupid,
usergroup.usergroupid, usergroup.title,
groupa.opentag as opentaga, groupa.closetag as closetaga, 
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX "subscriptionlog AS subscriptionlog
LEFT JOIN " 
TABLE_PREFIX "user as user ON (subscriptionlog.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE subscriptionlog.status != '0' ORDER BY subscriptionlog.regdate DESC LIMIT 0, 
$max");


if (
$vbulletin->db->num_rows($getsubscribers) > 0)
{
    
$count 0;
    while(
$getsubscriber $vbulletin->db->fetch_array($getsubscribers))
    {
       
        
$getsubscriber['opentag'] = $getsubscriber['opentagb'] ? $getsubscriber['opentagb'] : $getsubscriber['opentaga'];
        
$getsubscriber['closetag'] = $getsubscriber['closetagb'] ? $getsubscriber['closetagb'] : $getsubscriber['closetaga'];

if (
$vbulletin->options['latest_paid_subscribers_dateselect'])
        {
        
$expireson vbdate($vbulletin->options['latest_paid_subscribers_dateselect'], $getsubscriber['expirydate']);
        }
else {
        
$expireson vbdate($vbulletin->options['dateformat'], $getsubscriber['expirydate']);
     }

if (
$vbulletin->options['latest_paid_subscribers_hoverover']) {
        
$subscribers[$count] .= "<a href=\"member.php?" $vbulletin->options[sessionurl] . "u=$getsubscriber[userid]\" title='$getsubscriber[username] Subscription Expires On: $expireson'>";
        
$subscribers[$count] .= $getsubscriber['opentag'].$getsubscriber['username'].$getsubscriber['closetag']."</a>";
        
$count++;
        }
    else {
        
$subscribers[$count] .= "<a href=\"member.php?" $vbulletin->options[sessionurl] . "u=$getsubscriber[userid]\" title='$getsubscriber[title]'>";
        
$subscribers[$count] .= $getsubscriber['opentag'].$getsubscriber['username'].$getsubscriber['closetag']."</a>";
        
$count++;
    }    

    }
    
    
$showsubscribers implode(", "$subscribers);
    unset(
$count$getsubscriber$max);
    @
mysql_free_result($getsubscribers);
}


The difference is in these TWO lines of code!

PHP Code:

LEFT JOIN " . TABLE_PREFIX . "user as user ON (subscriptionlog.userid user.userid
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid usergroup.usergroupid

My site uses PHP 4.4.1. and MySQL 4.1.21 in case that helps debug this... but it works 100% with those two "As" terms included!

Oh yea, did you mean to have you help link in your hack go to Google (as opposed to here?)?

jgommel 10-10-2006 08:47 PM

Not sure if this a 3.6.2 issue, but I just intalled and now I'm getting database errors. If I deactivate the hack, I'm back to normal. I checked my Template edits... all there and correct according to the documentation.

Code:

Database error in vBulletin 3.6.2:

Invalid SQL:

SELECT subscriptionlog.userid, subscriptionlog.status, subscriptionlog.regdate, subscriptionlog.expirydate,
user.userid, user.username, user.usergroupid, displaygroupid,
usergroup.usergroupid, usergroup.title,
groupa.opentag as opentaga, groupa.closetag as closetaga,
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM vb_subscriptionlog AS subscriptionlog
LEFT JOIN vb_user ON (subscriptionlog.userid = user.userid)
LEFT JOIN vb_usergroup ON(user.usergroupid = usergroup.usergroupid)
LEFT JOIN vb_usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN vb_usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE subscriptionlog.status != '0' ORDER BY subscriptionlog.regdate DESC LIMIT 0, 5;

MySQL Error  : Unknown table 'user' in field list
Error Number : 1109
Date        : Tuesday, October 10th 2006 @ 03:35:33 PM
Script      : http://www.website.com/vb/
Referrer    : http://www.website.com/index.php
IP Address  : xx.xx.xx.xx
Username    : xxxxxxxx
Classname    : vb_database

and

Code:

Database error in vBulletin 3.6.2:

Invalid SQL:

SELECT subscriptionlog.userid, subscriptionlog.status, subscriptionlog.regdate, subscriptionlog.expirydate,
user.userid, user.username, user.usergroupid, displaygroupid,
usergroup.usergroupid, usergroup.title,
groupa.opentag as opentaga, groupa.closetag as closetaga,
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM vb_subscriptionlog AS subscriptionlog
LEFT JOIN vb_user ON (subscriptionlog.userid = user.userid)
LEFT JOIN vb_usergroup ON(user.usergroupid = usergroup.usergroupid)
LEFT JOIN vb_usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN vb_usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE subscriptionlog.status != '0' ORDER BY subscriptionlog.regdate DESC LIMIT 0, 5;

MySQL Error  : Unknown table 'user' in field list
Error Number : 1109
Date        : Tuesday, October 10th 2006 @ 03:36:30 PM
Script      : http://www.website.com/index.php
Referrer    : http://www.website.com/index.php
IP Address  : xx.xx.x.xx
Username    : xxxxxx
Classname    : vb_database

Site Stats:
Apache Server 1.3.37 (Unix)
PHP 4.4.4
MySQL 4.1.21
vBulletin 3.6.2
vBadvanced CMPS 2.2.0


All times are GMT. The time now is 10:32 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.01283 seconds
  • Memory Usage 1,797KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_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