vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Referral Statistics (https://vborg.vbsupport.ru/showthread.php?t=64469)

gspot 12-15-2004 01:19 PM

Try this file. I have edited it, make sure that you have all your setting correct in it though. And please let me know if it works for you. :) This is set up to not count users in usergroups 1,3, and 4

T3MEDIA 12-15-2004 03:09 PM

Quote:

Originally Posted by gspot
Try this file. I have edited it, make sure that you have all your setting correct in it though. And please let me know if it works for you. :) This is set up to not count users in usergroups 1,3, and 4

It works! awsome. I couldnt understand the lingo but I see now what you mean.

I am very intrested in having this only accept people who refer new users and the people they refer also refers a person. (WAHHHT?)

I am giving away on my site $100 to each user that refers 5 people. the only catch is the 5 have to be full members and have to refer 5 themselves. (the last 5 dont have to be full members). of course the next set is 90% near their 100$ All they have to do is make sure their 5 also brings 5. It will start a large boost to the site.

In other words you have to bring someone that knows 5 people. (You would need to know 5 people in total like this to win the money)

I am willing to make a donation if you can do that for me.

ericgtr 12-15-2004 06:28 PM

Excellent mod here! I installed it and then setup a contest where the most referrals in a month earns them an award that goes under their avatar that I setup a basic conditional for. So far this has been very productive, thanks!

gspot 12-16-2004 12:35 AM

t3media - sorry man, that would require a lot more hacking for this hack... I dont have the time right now since I opened a new business. :(

Sorry, but thanks for installing. :)

T3MEDIA 12-16-2004 02:04 PM

Quote:

Originally Posted by gspot
t3media - sorry man, that would require a lot more hacking for this hack... I dont have the time right now since I opened a new business. :(

Sorry, but thanks for installing. :)

hey you do what you can right?
That is good enough for me.

djjeffa 01-02-2005 02:31 AM

I think I did everything right but heres what i get
Database error in vBulletin 3.0.3:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM vb_user AS users LEFT JOIN user AS user ON (users.referrerid = user.userid)
WHERE vb_user.vb_userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10
mysql error: Table 'djjeffa_djjeffaVB.user' doesn't exist

mysql error number: 1146

Date: Saturday 01st of January 2005 10:29:39 PM
Script: http://www.djjeffa.com/vb/referrals.php
Referer: http://www.djjeffa.com/vb/home.php

any ideals?

PurpleCow 01-02-2005 09:18 AM

Hi... Great Hack

/me Clicks Install

I would suggest something liek this for a referral promo..

Refer 5 friends and those five refer another 2 each and be eligible to win something as a Prize. We could probably have another few levels of referrals.
Besides...each referred person again can be eligible for the prizes based on referrals.
And similiarly on those lines.

Any help on this ... much Appreciated

Also, does this work with Erwin's refer a Friend ? or works as a stand alone hack ??

Thanks

gspot 01-02-2005 03:16 PM

djeffa - it was a problem in the referrals.php file. ITS BEEN FIXED.

gspot 01-02-2005 03:17 PM

PurpleCow - Someone else even recommended this addon for my hack, I will start looking into it, but however it may take me a few weaks to release it. Thanks for clicking install :)

MajorFm.com 01-04-2005 12:18 AM

I dont suppose u can help with this:

https://vborg.vbsupport.ru/showthrea...t=67407&page=3

deb0 01-04-2005 04:18 PM

nice mod, but directions need to be improved.

djjeffa 01-06-2005 12:35 AM

Quote:

Originally Posted by gspot
djeffa - see this:

mysql error: Table 'djjeffa_djjeffaVB.user' doesn't exist

It's trying to find that table called: djeffa_djjeffaVB.user check your mysql and see if this table exists, if not then you have a problem in using the database prefix maybe even from a previous hack that was installed prior to this one. Someone else had the same problem, but however this is not from my hack. :( sorry.


the only part that i think i could have messed up was this
1) create a new database table
CREATE TABLE `referrals` (
`date` TEXT NOT NULL
);

cause i had a freind do that cause i didnt really understant it.
but i still cant figer it out.

gspot 01-06-2005 04:36 AM

djjeffa - basically all that says is create a new database table: the
CREATE TABLE `referrals` (`date TEXT NOT NULL ); is the command you would use in phpmyadmin to execute this new table named exactly like it says: referrals.

djjeffa 01-12-2005 02:06 AM

Quote:

Originally Posted by gspot
djjeffa - basically all that says is create a new database table: the
CREATE TABLE `referrals` (`date TEXT NOT NULL ); is the command you would use in phpmyadmin to execute this new table named exactly like it says: referrals.

im really bad with this so if you can walk me throug lol
i get to this :
Create new table on database djjeffa_djjeffaVB:
Name:
Fields:

is that where i should be and what do I put for feilds? Name i guss would be referrals ?

gspot 01-12-2005 04:39 AM

Quote:

Originally Posted by djjeffa
im really bad with this so if you can walk me throug lol
i get to this :
Create new table on database djjeffa_djjeffaVB:
Name:
Fields:

is that where i should be and what do I put for feilds? Name i guss would be referrals ?

djjeffa - yes thats where u need to be. This is pretty self explaining, but here i will try to explain it completely for you. NAME = referrals , Fields = date

This field date needs to have the following settings: TEXT, NOT NULL

Thats basically it. You should look into how to run a database query in phpmyadmin somewhere on google. Then all you would have to do is copy and paste the CREATE TABLE script above and click submit. Then it would create the new table and automatically set all the settings up for you. GOOD LUCK :)

coloradok5 01-12-2005 01:05 PM

Quote:

Ability to limit referral counts based on usergroups. (good for limiting referral competitions for certain usergroups)
Hello, sorry if these questions have been anwsered allready, Does this work for secondary usergroups as well? What I mean is could I allow all usergroups to referr, but only the referrees that become paid subscribers that are in a secondary usergroup would count, kind of like an affiliate program?
Can you reset referrals by user only?

gspot 01-13-2005 02:14 AM

Quote:

Originally Posted by coloradok5
Hello, sorry if these questions have been anwsered allready, Does this work for secondary usergroups as well? What I mean is could I allow all usergroups to referr, but only the referrees that become paid subscribers that are in a secondary usergroup would count, kind of like an affiliate program?
Can you reset referrals by user only?

Yes colorado you can limit the count to a specific usergroup which is explained in the referrals.php file. As far as resetting referrals by username, no not in this release, but will be available in the next. You can only reset all referrals in this version. :)

GetGamer.com 01-13-2005 10:42 PM

There something really unclear about the installation instructions for this MOD. I'm using a table prefix of "vb3_" for my forums. I want to maintain that structure for all forum-related tables, for obvious reasons. The instructions on do not explain how to handle prefixes so I created a "vb3_referrals" table rather than simply a "referrals" table.

Now when I load http://www.bigblueball.com/forums/referrals.php I get the following error:
Code:

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 'bbb.user' doesn't exist
 
 mysql error number: 1146

And yes, I edited line #28 of referrals.php to the correct path already (the readme.txt doesn't cover that either). As I understand this error message, it appears that the forum prefix is not being used for just part of the SQL command.

gspot 01-14-2005 01:03 AM

gamer - it was a problem in the referrals.php. IT HAS BEEN FIXED

GetGamer.com 01-14-2005 01:19 AM

Quote:

Originally Posted by gspot
gamer - try it the way the instructions say...

Your problem is the following:
mysql error: Table 'bbb.user' doesn't exist

It's looking for a table with the prefix "bbb" is that what you are using for your vbulletin database tables? I dont know how or where it could be getting that prefix from unless you specified that somewhere within vb. Also there have been 2 or 3 other members that have had problems trying to install this hack, but out of 60 that have installed successfully they (the 3 of them including yourself) might have installed another hack that is somehow conflicting with this one. This hack is setup correctly. And yes the instructions do need to be revised, but that will occur in the next release. I'm sorry, but this is all I can help you with at this time. good luck :)

I have only a few Mods installed, and all of them work perfectly. bbb is the name of the database, not the prefix. My table prefix is "vb3_"

Viks 01-14-2005 04:58 AM

nice utility for users and admins. I have installed it. works p-e-r-f-e-c-t-l-y.

thanks <clicking install>

Viks 01-14-2005 07:19 PM

hey, i think i spoke too soon hehe...
im getting the following error when i click "referal statistics" link from FORUMSHOME page -
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /hsphere/local/home/vikram/thalforum.com/forums/referrals.php on line 28

and following error when no user is logged in.

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /hsphere/local/home/vikram/thalforum.com/forums/referrals.php on line 28


Unable to add cookies, header already sent.
File: N/A
Line: 0

=-=-=-=-=-=

AND when i click the link from CMPS home I get page cannot be displayed because it is trying to hit the refferal.php in the root directory instead from /forums/refferal.php.

any suggestions gspot? others?

V

gspot 01-14-2005 10:17 PM

Quote:

Originally Posted by Viks
hey, i think i spoke too soon hehe...
im getting the following error when i click "referal statistics" link from FORUMSHOME page -
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /hsphere/local/home/vikram/thalforum.com/forums/referrals.php on line 28

and following error when no user is logged in.

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /hsphere/local/home/vikram/thalforum.com/forums/referrals.php on line 28




Unable to add cookies, header already sent.
File: N/A
Line: 0

=-=-=-=-=-=

AND when i click the link from CMPS home I get page cannot be displayed because it is trying to hit the refferal.php in the root directory instead from /forums/refferal.php.

any suggestions gspot? others?

V

viks - on line 28 in referrals.php file you need to have the following:

chdir('/hsphere/local/home/vikram/thalforum.com/forums/');

TRY THAT - it should fix your problem. It seems that you didnt have the path setup correctly. Save the file and reupload once you edit it. Then let me know if it works. :)

Viks 01-15-2005 12:14 AM

thanks gspot.

yeah, i had missed that part. now the URL work perfectly from forumshome and inside the forum.

but I stil cud not get it to work from the CMPS footer. has anyone here with CMPS got this working on CMPS main page?? if yes, then please share the info.

thanks

gspot 01-15-2005 08:10 AM

ATTENTION EVERYONE:

The new version of this hack 2.0 will be released by the end of this weekend. It includes the following:

1) Pagination - yes its finally here
2) The ability to delete referrals by a specific member
3) Updated instructions for install - I might even build an installer :) will see...
4) Any wants? Let me know...

lasto 01-15-2005 10:46 AM

will wait for new version :)

Viks 01-15-2005 04:06 PM

Quote:

Originally Posted by gspot
ATTENTION EVERYONE:

4) Any wants? Let me know...

1. Who has used Referral system (wud be nice addon)
2. Email addresses to which referrals have been sent (wud be a nice addon)
3. How many refferal sent by individual. :ermm:
4 . :ermm: Refferal this year/month/week

howzzat?

gspot 01-16-2005 12:57 AM

EVERYONE THE NEW RELEASE IS HERE.. :)

LET ME KNOW WHAT YOU THINK :)

:):):):):):):):):):)

Viks 01-16-2005 05:26 AM

Quote:

Originally Posted by gspot
EVERYONE THE NEW RELEASE IS HERE.. :)

LET ME KNOW WHAT YOU THINK :)

:):):):):):):):):):)

COOL. thx dude.
I will try it. can i run the install on top of my old version of refferal stats or do i have to uninstall first.

gspot 01-16-2005 06:18 AM

Quote:

Originally Posted by Viks
COOL. thx dude.
I will try it. can i run the install on top of my old version of refferal stats or do i have to uninstall first.

Should be fine over the top of it. :)

MajorFm.com 01-16-2005 11:58 AM

Got the following error on the auto installation on step 2...

Code:

Database error in vBulletin 3.0.3:

Invalid SQL:
            CREATE TABLE referrals (
                  `date` text NOT NULL
                ) TYPE=MyISAM
mysql error: Table 'referrals' already exists

mysql error number: 1050

Date: Sunday 16th of January 2005 08:55:51 AM
Script: http://www.majorfm.com/forum/admincp/install_referrals.php
Referer: http://www.majorfm.com/forum/admincp/install_referrals.php
Username: *****
IP Address: 80.42.131.***

I have masked the username and part of the IP

Please advise...

gspot 01-16-2005 04:54 PM

Major - please re-download the package and re-upload all the files again for the upgrade process. I have created an upgrade script in the auto installer. This should take care of your problem. Good Luck. :)

Megareus Rex 01-16-2005 09:33 PM

Ok, problem. I use table prefixes at my forum. The original version didn't have them, so I added em in manually, but I see this version does. However....there's a problem with one bit of coding in it.

Its this block

PHP Code:

$result $DB_site->query_first("SELECT COUNT(*) as ttl, 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 ttl DESC"
); 

I have to add the table prefix to every single instance of 'user' in the entire block, or else it gives me errors such as "Unknown table 'user' in field" and stuff. And when I add the prefix to all instances of it, for some reason it acts like there's no prefix on ANY of it! So I can't get it to work at all.

Any help?

T3MEDIA 01-16-2005 09:50 PM

Quote:

Originally Posted by gspot
EVERYONE THE NEW RELEASE IS HERE.. :)

LET ME KNOW WHAT YOU THINK :)

:):):):):):):):):):)

I dont know if you remember I was asking for the referal hack to check for a pertiular setup.

each user has to refer 5 users. Those five have to refer 5 as well and the orignal user gets paid.

can this baby do that yet?

its like free ipods for members kinda thing.

gspot 01-16-2005 09:56 PM

REX - It was an error in the referrals.php page. IT HAS BEEN FIXED.

gspot 01-16-2005 09:57 PM

Quote:

Originally Posted by T3MEDIA
I dont know if you remember I was asking for the referal hack to check for a pertiular setup.

each user has to refer 5 users. Those five have to refer 5 as well and the orignal user gets paid.

can this baby do that yet?

its like free ipods for members kinda thing.

Sorry this hack doesnt do that. And It might in the future, just not at this time. :( sorry

Megareus Rex 01-17-2005 04:53 AM

Quote:

Originally Posted by gspot
REX - I see this on your referrals.php page:

mysql error: Table 'lancetjades.user' doesn't exist

Are you using the prefix = 'lancetjades'? Because somehow thats what it is trying to use... This hack seems to work fine on my board and others, so it must be a conflict with another hack you might have installed previously. If this hack worked prior to this release, then try not using the prefix at all and just use the table user delete the " . TABLE_PREFIX ." part.
:( sorry not much help here...

No, lancetjades is the name of the database my forum uses. The prefix I use is vb3_

It gives that error because the "LEFT JOIN user AS user ON" part of the code doesn't have a table prefix code on it, or so I've deduced.

Here is the error text:
PHP Code:

Database error in vBulletin 3.0.5:

Invalid SQLSELECT COUNT(*) as ttluser.usernameuser.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 ttl DESC
mysql error
Table 'lancetjades.user' doesn't exist

mysql error number: 1146

Date: Sunday 16th of January 2005 10:49:54 PM
Script: http://www.evermoreforums.com/forums/referrals.php
Referer: http://www.evermoreforums.com
Username: Blaze
IP Address: ***** 

As you see, the part of the code that has the table prefix code on it shows the vb3_. Once I attached the prefix to all the blank 'user' instances, it says "Unknown table 'user' in field set, and so on until ALL instances of 'user' have a prefix. Then, it drops the prefix from all of the instances, and it still refuses to work.

gspot 01-17-2005 02:03 PM

Rex - try changing this:
PHP Code:

////////////////////////////////////////////
$result $DB_site->query_first("SELECT COUNT(*) as ttl, 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 ttl DESC"
); 
///////////////////////////////////////////////// 

To this:
PHP Code:

////////////////////////////////////////////////
$result $DB_site->query_first("SELECT COUNT(*) as ttl, user.username, user.userid FROM " TABLE_PREFIX "user AS users LEFT JOIN " TABLE_PREFIX "user AS user ON (users.referrerid = user.userid) 
                   WHERE user.userid > 0
                   GROUP BY users.referrerid 
                   ORDER BY ttl DESC"
); 
//////////////////////////////////////// 

AND THIS:
PHP Code:

////////////////////////////////////////
$referrers $DB_site->query("SELECT COUNT(*) AS number, user.username, user.userid, user.referrals 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 number DESC 
                   LIMIT 
$from$max_results");
///////////////////////////////////// 

To this:
PHP Code:

/////////////////////////////////////
$referrers $DB_site->query("SELECT COUNT(*) AS number, user.username, user.userid FROM " TABLE_PREFIX "user AS users LEFT JOIN " TABLE_PREFIX "user AS user ON (users.referrerid = user.userid) 
                   WHERE user.userid > 0
                   GROUP BY users.referrerid 
                   ORDER BY number DESC 
                   LIMIT 
$from$max_results"); 
///////////////////////////////
/////////////////////////////// 

This should fix anyones problem who is having the same issue as REX - sorry all.. :) Make these changes is the referrals.php file.

Megareus Rex 01-17-2005 05:34 PM

Yes, that fixed it! Thanks a lot!!! :):):)

James Goddard 01-17-2005 05:50 PM

Great hack, but the pagination stuff is not quite working for me:

I have $max_results set to 10 and 1 user with any referrals (new board), however I still get 2 pages?

Here is an example:

http://www.midwestdive.com/forums/referrals.php

James


All times are GMT. The time now is 02:57 PM.

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.02357 seconds
  • Memory Usage 1,879KB
  • 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
  • (6)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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