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
Referral Statistics Details »»
Referral Statistics
Version: 2.3, by gspot gspot is offline
Developer Last Online: Aug 2008 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 04-27-2004 Last Update: 04-16-2005 Installs: 149
DB Changes
 
No support by the author.

Are you looking for statistics on the number of referrals your members have made? Or are interested in promoting your website by allowing members to engage in a referral competition?


THIS HACK IS FOR YOU
To show referral statistics from members and to manage referral competitions.
- this hack is to help you manage your forums referrals
- promote new user registrations
- perfect for contests/promotional giveaways or incentives for referrals
- INSTALL today and start managing your boards referrals.

Features:

- Limit the number of results shown
- Admin ability to reset all members referrals to zero
- Admin ability to reset "specific members" referrals to zero
- Includes an update to your whois online
- Up-to-date listing on when you last reset all members referrals to zero
*** Seen in the admincp and an option for all members to view
- Total number of referrals since last reset
*** viewable in admincp and again an option for all members to view
- Pagination is now included and an option for another at bottom of results
- Shows up-to-date total number of board referrals
- Shows leading referrer in admincp
- Ability to limit referral results by number of posts or a usergroupid(s)
- Configuration is now done in admincp
- Auto installer now included w/ auto un-installer
- BEST OF ALL (LETS MEMBERS REFER MORE PEOPLE TO YOUR SITE.

I will like always SUPPORT my hacks

Thanks goes out to: unixman - for all the referred members are now clickable to their profile.

Total install time: less than 3 minutes.
New templates: 2 - refer, referbit
New files to upload: 2 pages
Edit templates: 2 - footer, /includes/functions_online.php
File edit: 1 - /admincp/index.php


** 4/17/05 - Version 2.3 Released = Includes many new one click options in the admincp, also auto configures your vbulletin path (which many people were having errors performing) **

Show Your Support

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

Comments
  #122  
Old 09-18-2004, 09:23 AM
Milktruck's Avatar
Milktruck Milktruck is offline
 
Join Date: Feb 2004
Location: Orlando, FL, USA
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! Installed it perfectly.

*clicked Install*
Reply With Quote
  #123  
Old 09-22-2004, 07:20 PM
Jack28 Jack28 is offline
 
Join Date: Jan 2002
Location: The Netherlands
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Help! i got the follow error:

Code:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in W:\www\includes\init.php on line 520

Warning: Invalid argument supplied for foreach() in W:\www\includes\sessions.php on line 270

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in W:\www\includes\functions.php on line 3622

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in W:\www\includes\functions.php on line 3622

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in W:\www\includes\functions.php on line 3622

 

There seems to have been a slight problem with the database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.
How can i fix this?
Reply With Quote
  #124  
Old 09-22-2004, 11:49 PM
gspot's Avatar
gspot gspot is offline
 
Join Date: Mar 2003
Location: Nevada
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jack28
Help! i got the follow error:

Code:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in W:\www\includes\init.php on line 520

Warning: Invalid argument supplied for foreach() in W:\www\includes\sessions.php on line 270

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in W:\www\includes\functions.php on line 3622

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in W:\www\includes\functions.php on line 3622

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in W:\www\includes\functions.php on line 3622

 

There seems to have been a slight problem with the database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.
How can i fix this?
To me it sounds like your path to your vbulletin forums is not set correctly in my hack files. Please make sure it is. It looks like your path should be this: /www/
Reply With Quote
  #125  
Old 10-15-2004, 11:41 AM
etaslim etaslim is offline
 
Join Date: Jul 2004
Location: Indonesia
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by etaslim
Great! Thanks for the help, gspot. It runs perfectly now on my two forums.
Ups, appearently not all :ermm: In one of my forum, the total referrals are not shown. I've rechecked but couldn't found anything wrong. Any idea? Anyway, the address is http://forum.chip.co.id/referals.php
Reply With Quote
  #126  
Old 10-15-2004, 12:46 PM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i re-uploaded all the files, did all the edits once again,
but still getting this error :

Code:
 Database error in vBulletin 3.0.3:
Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM vb3_user AS users LEFT JOIN user AS user ON (users.referrerid = user.userid) 
				   WHERE user.userid > 0
				   GROUP BY users.referrerid 
				   ORDER BY referrals DESC 
				   LIMIT 10
mysql error: Table 'sanp_faS3.user' doesn't exist
mysql error number: 1146
Date: Friday 15th of October 2004 01:45:21 PM
Script: http://forums.tech-arena.com/referrals.php
Referer: 
Username: SaN-DeeP
Reply With Quote
  #127  
Old 10-15-2004, 01:01 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's because you have a table prefix. You need to add . TABLE_PREFIX . before each table.
Reply With Quote
  #128  
Old 10-15-2004, 01:30 PM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
That's because you have a table prefix. You need to add . TABLE_PREFIX . before each table.
I am confused boofo, Can you help fixing the table prefix in this code ?
Code:
  <?php
////////////////////////////////////////////////////////
//Referral Statistics// Created By: G-Spot//////////////
////////////////////////////////////////////////////////
///////////////www.gspotracing.com//////////////////////
////////////////////////////////////////////////////////
// INSTRUCTIONS:
// Change the $max variable to show how many results you want. 
////////////////// OPTIONAL REFERRAL RESULTS ///////////
// You can limit your referral results to certain usergroups,
// by adding the following under each query after the WHERE clause's:
// AND user.usergroupid=2 --> 
// this number will be different for different user groups. To find 
// the usergroup number login to your admincp and click on usergroup 
// manager and next to the usergroups you should see something close 
// to: edit usergroup(id:2) where the 2 is the usergroup number.
///////////////////////////////////////
//////////////////////////////////////////////
//////////////////////////////////////////////////////
// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 
// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'referrals');
// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
$globaltemplates = array('refer','referbit','navbar');
// ######################### REQUIRE BACK-END ############################ 
chdir('/path/to/vbulletin/forums/');//edit path to your vbulletin directory
require('./global.php');
// ######################### NAVIGATION ############################ 
$navbits = array(); 
$navbits[$parent] = 'Referral Statistics';
$navbits = construct_navbits($navbits); 
eval('$navbar = "' . fetch_template('navbar') . '";');
// #####################################################
// #####################################################
// ######################### START MAIN SCRIPT #########
// #####################################################   
// START REFERRAL STATISTICS SCRIPT //
//GET TOTAL REFERALS//
$gettotal = $DB_site->query("SELECT COUNT(*) FROM " . TABLE_PREFIX . "user
					   WHERE referrerid > 0");
$total=mysql_fetch_row($gettotal);
// END TOTAL REFERALS //
// GET LAST DATE RESET //
$lastreferals=$DB_site->query("SELECT date FROM " . TABLE_PREFIX . "referrals");
$lastcount = mysql_fetch_row($lastreferals);
if ($lastcount == ''){
$lastcount[0]="(No Reset Record Found!)";
}
// END LAST DATE RESET //
$max=10; //This number decides how many results to display 
$referrers = $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM " . TABLE_PREFIX . "user AS users LEFT JOIN user AS user ON (users.referrerid = user.userid) 
				   WHERE user.userid > 0
				   GROUP BY users.referrerid 
				   ORDER BY referrals DESC 
				   LIMIT $max"); 
while ($referrer=$DB_site->fetch_array($referrers)) { 
  $referreds = $DB_site->query("SELECT username FROM " . TABLE_PREFIX . "user WHERE referrerid = '$referrer[userid]' AND referrerid > 0"); 
  while ($referred = $DB_site->fetch_array($referreds)){ 
	$enc_username = urlencode($referred[username]); 
	if ($referrerlist) { 
	  $referrerlist .= ", <A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>"; 
	} else { 
	  $referrerlist .= "<A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>"; 
	} 
  } 
  eval("\$referbits .= \"".fetch_template("referbit")."\";"); 
  $referrerlist=""; 
} 
eval('print_output("' . fetch_template('refer') . '");');
?>
Regards,
Reply With Quote
  #129  
Old 10-15-2004, 10:17 PM
gspot's Avatar
gspot gspot is offline
 
Join Date: Mar 2003
Location: Nevada
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

San-Deep

Do you see this line in my configuration file that you posted above:
chdir('/path/to/vbulletin/forums/');//edit path to your vbulletin directory

- You need to edit this path to reflect your forums directory and then try it.
- try this first.
Reply With Quote
  #130  
Old 10-17-2004, 07:29 AM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gspot
San-Deep

Do you see this line in my configuration file that you posted above:
chdir('/path/to/vbulletin/forums/');//edit path to your vbulletin directory

- You need to edit this path to reflect your forums directory and then try it.
- try this first.
tried to change the path too, but dont work
Reply With Quote
  #131  
Old 10-19-2004, 06:22 AM
gspot's Avatar
gspot gspot is offline
 
Join Date: Mar 2003
Location: Nevada
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its trying to load this table from mysql: "sandeep_f1nalDbaS3.user" does this table even exist? Please check your table extension that your using against your database tables in your mysql.
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 10:41 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.05425 seconds
  • Memory Usage 2,324KB
  • 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
  • (4)bbcode_code
  • (4)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
  • (2)pagenav_pagelinkrel
  • (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