Back to vBulletin 3.0 Add-Ons

List latest X paid subscribers on Forum Home
Mod Version: 1.10, by tamarian

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 15
Released: 18 May 2004 Last Update: Never Downloads: 2
Not Supported  

There's also a vB 3.5 version here: http://www.vbulletin.org/forum/showthread.php?s=&threadid=99049

What this hack does: This hack will list and instantly refresh (when a new subscription is made) a list of the latest X paid subscribers to your forum. It's a nice way of recognizing members who help pay the the forum bills, and encourages others to join.

Demo: http://forum.lowcarber.org

PHP edits:
1. 2 edits in index.php
2. 1 edit in includes/functions.php
3. 2 edits in includes/functions_subscriptions.php

Template edits:
1. 1 new template: thanks
2. 1 edit in FORUMHOME

Installation:

1. In index.php

Find:

PHP Code:
'FORUMHOME'
Add after:

PHP Code:
'thanks'
Find:

PHP Code:
// ### TODAY'S BIRTHDAYS 
Add before:

PHP Code:
$thanks $templatecache['thanks']; 
2. In include/functions.php

At the end of the file, just before the end/footer stuff,
Code:
/*======================================================================*\
|| ####################################################################
|| # Downloaded: Thu Apr 15th 2004
|| # CVS: $RCSfile: functions.php,v $ - $Revision: 1.967 $
|| ####################################################################
\*======================================================================*/
?>
add before:
PHP Code:
// ###################### thankyou #######################
function thankyou(){
      global 
$DB_site;

    
// This is the template for usernames
    
$thanksbit ' <a href=\"member.php?$session[sessionurl]u=$contributer[userid]\"><font color=\"#228E8E\"><b>$contributer[username]</b></font></a>';

    
$latestcontributers $DB_site->query("SELECT username, status,regdate,  subscriptionlog.userid
                FROM " 
TABLE_PREFIX "subscriptionlog AS subscriptionlog
                LEFT  JOIN " 
TABLE_PREFIX "user AS user
                USING ( userid )
                WHERE user.userid = subscriptionlog.userid
                AND STATUS = '1'
                ORDER  BY  regdate  DESC
                LIMIT 5"
);

    
$latest_str '';
    while (
$contributer $DB_site->fetch_array($latestcontributers))
    {
        eval(
"\$latest_str .= ', ' . \"$thanksbit\";");
    }
    
$latest_str substr($latest_str 2);
    
$latest_str addslashes($latest_str);
    
$DB_site->query("UPDATE " TABLE_PREFIX "template SET template=\"$latest_str\", template_un=\"$latest_str\"  WHERE title='thanks'");

Note 1: Change "LIMIT 5" to any number. By default, it will show the latest 5 paid subscribers. If you want to show the latest 3, simply change to "LIMIT 3".
Note2 The template for usernames is in the code. To change the style and colour, edit this line from the code you added to functions.php:
PHP Code:
    $thanksbit ' <a href=\"member.php?$session[sessionurl]u=$contributer[userid]\"><font color=\"#228E8E\"><b>$contributer[username]</b></font></a>'

3. In includes/functions_subscriptions.php

Find:

PHP Code:
}
      
      
// ###################### Start leavesubscription #######################
      
      
function delete_user_subscription($subscriptionid$userid
Add before (before the bracket):

PHP Code:
thankyou(); 
Find:

PHP Code:
}
      
      
// ###################### Start getsubscriptionscache #######################
      
function cache_user_subscriptions() 
Add before (before the bracket:

PHP Code:
thankyou(); 
4. Create a new template: thanks

Leave the new template empty

5. Edit the FORUMHOME template

Add $thanks where you want the list of members to appear.

For example, I use this in the stats area of FORUMHOME:

Code:
<div>Thanks latest <a href="subscriptions.php">contributing members</a>: $thanks</div>
6. First run To auto fill the list for the first time, you just need to edit an existing subscription, or just wait for the next subscription to arrive.

To auto fill it right now: Simply go to your admin control panel, click on subscriptions, view list, edit any existing subscription, for example, add 1 day to the subscription of a member, and save. You can re-edit to subtract the 1 day if you want.

Download

No files for download.

Similar Mods

Latest X Paid Subscribers on Forum Home vBulletin 3.5 Add-ons
Forum Home Enhancements Latest Paid Subscribers v1.1 Modification Graveyard

vblts.ru supports vBulletin®, 2022-2024