Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
List latest X paid subscribers on Forum Home Details »»
List latest X paid subscribers on Forum Home
Version: 1.10, by tamarian tamarian is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 05-17-2004 Last Update: Never Installs: 15
 
No support by the author.

There's also a vB 3.5 version here: https://vborg.vbsupport.ru/showthrea...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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-04-2004, 02:33 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
Ah, yes. Thanks for the catch!
No problem
Reply With Quote
  #23  
Old 07-04-2004, 06:46 PM
Cold Steel's Avatar
Cold Steel Cold Steel is offline
 
Join Date: Nov 2001
Location: Manhattan
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks assassingod and tamarian.

This is my code:

Code:
// ###################### thankyou #######################
function thankyou(){
global $DB_site, $stylevar, $vboptions, $vbphrase;
 
require_once('./global.php');
 
$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 .= ", ' . fetch_template('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'");
}
And this is my error:

Quote:
Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/global.php on line 645

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/includes/functions.php on line 2895

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/includes/functions.php on line 2895

Warning: Invalid argument supplied for foreach() in /home/asiansin/public_html/forums/includes/functions.php on line 2895

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT username, status, regdate, subscriptionlog.userid
FROM subscriptionlog AS subscriptionlog
LEFT JOIN user AS user
USING ( userid )
WHERE user.userid = subscriptionlog.userid
AND STATUS = '1'
ORDER BY regdate DESC
LIMIT 5
mysql error: Column: 'status' in field list is ambiguous

mysql error number: 1052

Date: Sunday 04th of July 2004 02:44:37 PM
Script: http://forums.asiansinc.com/admincp/subscriptions.php
Referer: http://forums.asiansinc.com/admincp/...iptionlogid=12
Username: Webmaster
IP Address:
Reply With Quote
  #24  
Old 07-04-2004, 06:51 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cold Steel
Thanks assassingod and tamarian.

This is my code:

And this is my error:
O.k., I've made a small change by adding subscriptionlog. prefix, even though it's not ambigious!

Give it another try (just step #2), and let's see how it goes.
Reply With Quote
  #25  
Old 07-04-2004, 07:04 PM
Cold Steel's Avatar
Cold Steel Cold Steel is offline
 
Join Date: Nov 2001
Location: Manhattan
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Apparently, mysql still can't get it clear:

Quote:
Invalid SQL: SELECT username, status, regdate, subscriptionlog.userid
FROM subscriptionlog AS subscriptionlog
LEFT JOIN user AS user
USING ( userid )
WHERE user.userid = subscriptionlog.userid
AND subscriptionlog.status = '1'
ORDER BY subscriptionlog.regdate DESC
LIMIT 5
mysql error: Column: 'status' in field list is ambiguous
Reply With Quote
  #26  
Old 07-04-2004, 07:24 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cold Steel
Apparently, mysql still can't get it clear:
Let's try this:

PHP Code:
   // ###################### thankyou #######################
      
function thankyou(){
            global 
$DB_site,  $stylevar$vboptions$vbphrase;
      
          require_once(
'./global.php');
      
          
$latestcontributers $DB_site->query("SELECT *
                     FROM " 
TABLE_PREFIX "subscriptionlog AS subscriptionlog
                     LEFT JOIN " 
TABLE_PREFIX "user AS user
                     USING ( userid )
                     WHERE user.userid = subscriptionlog.userid
                 AND subscriptionlog.status = '1'
                     ORDER BY subscriptionlog.regdate DESC
                     LIMIT 5"
);
      
          
$latest_str "";
          while (
$contributer $DB_site->fetch_array($latestcontributers))
          {
             eval (
'$latest_str .= ", ' fetch_template('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'");
      } 
Reply With Quote
  #27  
Old 07-04-2004, 07:36 PM
Cold Steel's Avatar
Cold Steel Cold Steel is offline
 
Join Date: Nov 2001
Location: Manhattan
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That worked. Thanks a ton!

BTW I'm a big anti-carb person myself.
Reply With Quote
  #28  
Old 07-04-2004, 07:52 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cold Steel
That worked. Thanks a ton!
That's great to hear. I'm just curious, what versions of PHP and MySQL do you run?
Reply With Quote
  #29  
Old 07-04-2004, 09:32 PM
Cold Steel's Avatar
Cold Steel Cold Steel is offline
 
Join Date: Nov 2001
Location: Manhattan
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP v4.3.3
MySQL v4.0.18-standard
Reply With Quote
  #30  
Old 07-20-2004, 07:53 PM
RapCheck RapCheck is offline
 
Join Date: Nov 2001
Location: CA
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting these errors when editing subscription users


Quote:
Warning: Invalid argument supplied for foreach() in /home/sites/site8/web/b/includes/functions.php on line 2878

Warning: Invalid argument supplied for foreach() in /home/sites/site8/web/b/includes/functions.php on line 2878

Warning: Invalid argument supplied for foreach() in /home/sites/site8/web/b/includes/functions.php on line 2878
I see others have had similar, though I have no mySQL error with it, and the everything seems to work fine updating the subscription. I don't have the store hack or cash hack installed...

I'd just like to know what it means, and if it'll affect anything on my board or subscriptions.

nice hack though, btw.
Reply With Quote
  #31  
Old 07-20-2004, 08:20 PM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you edit functions.php with dreamweaver by chance? If so it's one of a couple of vB3 files it will mess up by changing code on you.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:36 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.05142 seconds
  • Memory Usage 2,356KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (11)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete