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)

Boofo 05-18-2004 10:10 PM

gspot, this is basically the same query as in my forumhome stats hack. If you don't use the table AS table on all tables in a query that access more than one table, you will never get it working for this guy right. This:

[SQL]LEFT JOIN user ON (users.referrerid = user.userid)[/SQL]

HAS to be this:

[SQL]LEFT JOIN user AS user ON (users.referrerid = user.userid)[/SQL]

gspot 05-19-2004 04:22 AM

Thank you, should I add this to the main file in general?? :)
Not just for this guy, but for everyone??

Boofo 05-19-2004 04:28 AM

Yes, because there will be others who use table prefixes and that is where you will need it. I found out the hard way about this. ;)

Just remember for future reference, that if it is only 1 table with no joins then you don't need the table AS table. Only if the query has more than one table in it is when you will need it. And all the tables in a query like that have to have the table AS table in it. It is the table prefixes that cause the problem with that. ;)

gspot 05-20-2004 04:18 AM

Quote:

Originally Posted by Boofo
Yes, because there will be others who use table prefixes and that is where you will need it. I found out the hard way about this. ;)

Just remember for future reference, that if it is only 1 table with no joins then you don't need the table AS table. Only if the query has more than one table in it is when you will need it. And all the tables in a query like that have to have the table AS table in it. It is the table prefixes that cause the problem with that. ;)

Thanks, the file referals.php has been revised to this latest addon thanks to - BOOFO

msimplay 05-20-2004 06:28 AM

well i have a slight problem now
because the referals php seems to be using getinfo&username=
but it would be better if it used userid because the way thats currently used won't parse ascii code for example a user name like this

Code:

∙?МųşKąąη?

joeychgo 05-20-2004 12:44 PM

Quote:

Originally Posted by gspot
Option: To limit your referral results by usergroups, such as how many referrals were made to members in the registered usergroup, etc..



OK so my question is this.....

My board is set up so that when you first register, your a registered user. When you make 5 posts, your automatically upgraded to a full member.

Now, what I would like is to run a referral contest - but I only want those referrals that become full members to count in the score. (this way someone cant refer 20 false people or people who just sign up and never come back)

Does this hack do that now?

Aside from tht - what does this hack do that is different then the referral system built into VB3?

Boofo 05-20-2004 12:53 PM

Quote:

Originally Posted by gspot
Thanks, the file referals.php has been revised to this latest addon thanks to - BOOFO

You almost got it. You forgot to add the TABLE_PREFIX to the tables. ;)

The query should actually be:

PHP Code:

$referrers $DB_site->query("SELECT COUNT(*) AS referrals, 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 referrals DESC 
                   LIMIT 
$max"); 


armani1072 05-20-2004 08:02 PM

Quote:

Originally Posted by gspot
Did you make this test site for vbulletin with a table prefix?? If so, please post the prefix that you used for the installation of vbulletins sql tables.. This will help me eliminate the problem you are having.


yes i added a prefix of "vB3" so all the table in mysql database start with vB3....


if i have to change this everytime then this would explain why i get errors everytime i have to run a query right?

Boofo 05-20-2004 09:39 PM

Quote:

Originally Posted by armani1072
yes i added a prefix of "vB3" so all the table in mysql database start with vB3....


if i have to change this everytime then this would explain why i get errors everytime i have to run a query right?

You should be able to run the query I just posted above just fine the way it is with a table prefix. You don't need to change or add anything to the query.

armani1072 05-20-2004 09:52 PM

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT username FROM precisi_forums.user WHERE referrerid = '1' AND referrerid > 0
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

sorry to keep bugging. changed code in referals.php and this is the new error i got. at least it is different

Boofo 05-20-2004 10:24 PM

Quote:

Originally Posted by armani1072
Database error in vBulletin 3.0.1:

Invalid SQL: SELECT username FROM precisi_forums.user WHERE referrerid = '1' AND referrerid > 0
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146



sorry to keep bugging. changed code in referals.php and this is the new error i got. at least it is different

Can you post the fulll error code on that?

armani1072 05-21-2004 03:24 AM

Quote:

Originally Posted by Boofo
Can you post the fulll error code on that?

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT username FROM precisi_forums.user WHERE referrerid = '1' AND referrerid > 0
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

Date: Friday 21st of May 2004 12:27:15 AM
Script: http://www.precisionmuscle.org/testv...s/referals.php
Referer: http://www.precisionmuscle.org/testvb/forums/index.php?
Username: armani1072
IP Address: 205.201.132.83

gspot 05-21-2004 04:51 AM

Quote:

Originally Posted by armani1072
Database error in vBulletin 3.0.1:

Invalid SQL: SELECT username FROM precisi_forums.user WHERE referrerid = '1' AND referrerid > 0
mysql error: Table 'precisi_forums.user' doesn't exist

mysql error number: 1146

Date: Friday 21st of May 2004 12:27:15 AM
Script: http://www.precisionmuscle.org/testv...s/referals.php
Referer: http://www.precisionmuscle.org/testvb/forums/index.php?
Username: armani1072
IP Address: 205.201.132.83

Try this - If u used vb3 as the prefix, put in either:

SELECT username FROM vb3.user WHERE referrerid = '1' AND referrerid > 0

or

SELECT username FROM precisi_forums.vb3.user WHERE referrerid = '1' AND referrerid > 0

Because we got past the first query, so now it's only hanging up on the last query... BOOFO if you have any suggestions, please post them... :)

Boofo 05-21-2004 07:52 AM

What is the actual table_prefix in the config.php?

armani1072 05-21-2004 09:29 PM

Quote:

Originally Posted by Boofo
What is the actual table_prefix in the config.php?


// ****** DATABASE NAME ******
// This is the name of the database where your vBulletin will be located.
// This must be created by your webhost.
$dbname = 'precisi_forums';



// Prefix that your vBulletin tables have in the database.
// For example: $tableprefix = 'vb3_';
$tableprefix = 'vB3';

Boofo 05-21-2004 09:31 PM

Quote:

Originally Posted by armani1072
// ****** DATABASE NAME ******
// This is the name of the database where your vBulletin will be located.
// This must be created by your webhost.
$dbname = 'precisi_forums';



// Prefix that your vBulletin tables have in the database.
// For example: $tableprefix = 'vb3_';
$tableprefix = 'vB3';

Try chnage the user table name in the query to this:

vb3user

and see if it runs that way.

armani1072 05-21-2004 09:45 PM

Quote:

Originally Posted by Boofo
Try chnage the user table name in the query to this:

vb3user

and see if it runs that way.


if were to change in config.php to not have a prefix and upload it will that update everything? this is too much trouble i should have never put a prefix.

gspot 05-22-2004 04:15 AM

Quote:

Originally Posted by armani1072
if were to change in config.php to not have a prefix and upload it will that update everything? this is too much trouble i should have never put a prefix.

NO that wouldn't change everything. Since you installed vbulletin with a prefix, you would have to completely reinstall it with no prefix to never use one again. :( But try like BOOFO said it is really easy.

Try vB3.user for the table in the query
or try vb3.user depending on the cap locks if you used them or not
or last try vb3user in that last query... :)

That should make it work

etaslim 09-05-2004 03:34 PM

Quote:

Originally Posted by Big Kahuna
I modified includes/functions_online.php and uploaded it

I created the two templates (in one of my 12 styles to test) in my 64 Imperial style

I added the path to the referals.php and put it in my main forum directory

I added the call in the footer of the style with the templates http://www.moparstyle.net/forums/index.php?styleid=36

But I get a white screen.

I got the same problem, white screen. I've redo everything but still get the empty screen. I'm using vb 3.0.3. Please help...

gspot 09-05-2004 10:06 PM

Quote:

Originally Posted by etaslim
I got the same problem, white screen. I've redo everything but still get the empty screen. I'm using vb 3.0.3. Please help...

ETASLIM,

Please re-download the zip file, I have updated the coding to work with people who are using databases with prefix's. Try this, if it still doesn't work please let me know. Sorry I have been out of town for the past few days...

Thanks,
GSPOT

etaslim 09-06-2004 01:15 PM

thanks for the prompt reply, gspot.

I've downloaded the new files, edited & uploaded, but still get the blank page. I did all steps very carefully but still no success. Is this hack compatible for 3.0.3?

gspot 09-06-2004 02:14 PM

Quote:

Originally Posted by etaslim
thanks for the prompt reply, gspot.

I've downloaded the new files, edited & uploaded, but still get the blank page. I did all steps very carefully but still no success. Is this hack compatible for 3.0.3?

Yes, this hack is compatible for 3.0.3 - Let me look at a few things and I will get back to you here in a few minutes

gspot 09-06-2004 02:24 PM

Quote:

Originally Posted by gspot
Yes, this hack is compatible for 3.0.3 - Let me look at a few things and I will get back to you here in a few minutes

Make sure the path to your vbulletin directory is correct in the referals.php file. Also make sure the new template names are spelt correctly and contain the correct data that was supplied. I just edited a few more things on the zip, so please re-download the files again and start fresh with this new install. Then please let me know... Also, give me a link to your white page that your receiving.

etaslim 09-06-2004 02:51 PM

Sory to disturb you gspot. It was my mistake. After read more carefully, I found the problem...quite silly actually :). When I added the 2 templates, I named both as "refer copy" and "referbit copy". That's why I always get the blank referals.php page. What a dumb mistakes! I must get some more coffee :laugh:

Now it's working smoothly. Thanks for this great hack & your support! It's really a perfect feature for my referral contest. I definitely will install it to my other two forums.

Wifey 09-06-2004 05:53 PM

Yeah, so I'm getting this error at the top of my referals.php page. It's working like a charm this time (I had to uninstall before), except for this one little error :)

Quote:

Warning: chdir(): No such file or directory (errno 2) in /home/degrassi-boards.com/html/referals.php on line 28
Any ideas?

gspot 09-06-2004 09:08 PM

Quote:

Originally Posted by ashkarita
Yeah, so I'm getting this error at the top of my referals.php page. It's working like a charm this time (I had to uninstall before), except for this one little error :)



Any ideas?

your path to your vbulletin forums directory has to be wrong. Check with your host for the correct path, then you should be ok. Let me know.

venomx 09-06-2004 11:38 PM

Would be nice if this listed all refs from all usergroups... Plus have a second page with ref stats that could be deleted as per the admin... that way you could run ref contests and after its down reset the stats for the contest....

Wifey 09-07-2004 12:47 AM

I'd just like to express my EXTREME gratitude for gspot and say how wonderful it is to have a hack creator who gives support for their hack. I had a problem and gspot solved it for me and I wish that everyone were like that.

gspot you get 2 thumbs up from me and I hope everyone gives you the credit you deserve because YOU ROCK.

gspot 09-07-2004 02:55 AM

venomx - this hack should show all referrals from all usergroups by default. I have only an option to limit the referral results by usergroups that you can implement into the code listed in the commented out instruction in referals.php file.

venomx 09-07-2004 04:59 AM

Sorry didnt try to install this yet just read the first few pages. How about a way to count how many new refs since last reset?

gspot 09-08-2004 07:44 AM

Quote:

Originally Posted by venomx
Sorry didnt try to install this yet just read the first few pages. How about a way to count how many new refs since last reset?

Ok people I have re-edited the whole layout of this hack... I think everyone will like it. Please check-out the new pictures and the new features that it has to offer. Many features where added from VENOMX's requests that I think all of us will find useful. Enjoy and post any comment or suggestions that you may have. :)

venomx 09-08-2004 08:08 AM

Cool :)
Ill install this in a few hours.. Was just heading to bed when the email came in saying you posted.. :P

gspot 09-08-2004 08:10 AM

Quote:

Originally Posted by venomx
Cool :)
Ill install this in a few hours.. Was just heading to bed when the email came in saying you posted.. :P

No problem, had some free time this afternoon and now its bedtime for me as well. Hope you all like it. :)

venomx 09-08-2004 08:14 AM

Hey just had an idea.... What would be nice is for you/someone to make an addon for this and uShop.

Like an on/off switch for the "since reset" counter and when we turn it off it auto awards the top 3 members whatever amount of points we have set for the winners...
When its turned off it wouldnt show the since last reset text of the pages for the members... :P

gspot 09-08-2004 02:33 PM

Quote:

Originally Posted by venomx
Hey just had an idea.... What would be nice is for you/someone to make an addon for this and uShop.

Like an on/off switch for the "since reset" counter and when we turn it off it auto awards the top 3 members whatever amount of points we have set for the winners...
When its turned off it wouldnt show the since last reset text of the pages for the members... :P

Remember to click Install. Yes, that is a whole different hack that I dont support. Sorry, but if someone else wants to make this an addon then please go ahead. Since everyone's referal competitions are probably going to be different. Some people will issue points, some will issues prizes and so forth. Sorry.

etaslim 09-12-2004 02:14 PM

How to add the new database table? Has to be done from PHPMyAdmin, is it? Can someone be kind enough to advice step by step procedure. Thanks alot!

gspot 09-12-2004 04:16 PM

Quote:

Originally Posted by etaslim
How to add the new database table? Has to be done from PHPMyAdmin, is it? Can someone be kind enough to advice step by step procedure. Thanks alot!

In PHPMyAdmin run this query:

CREATE TABLE `referrals` (
`date` TEXT NOT NULL
);

Or for step by step:
1) create a new table named: "referrals"
2) create one new field named: "date"
3) Type: "text"
4) not null

Hope this helps :)

SaN-DeeP 09-14-2004 10:48 AM

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 ******.user' doesn't exist

aNy fix for this ?

thnx

gspot 09-14-2004 03:19 PM

Quote:

Originally Posted by SaN-DeeP
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 ******.user' doesn't exist

aNy fix for this ?

thnx

SAn-deep

I think you need to try it again. If your using a database table prefix for vbulletin, it looks like the script is working then. Is your prefix "vb3" for your database tables? The script is trying to grab the table "vb3_user" - do you even have this table in your vbulletin database? If not, you need to not use a database prefix and it should be trying to use table "user". Many people have installed this hack with no problems.

-GSPOT-

etaslim 09-16-2004 11:52 AM

Quote:

Originally Posted by gspot
In PHPMyAdmin run this query:
Hope this helps :)

Great! Thanks for the help, gspot. It runs perfectly now on my two forums.


All times are GMT. The time now is 04:20 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.01786 seconds
  • Memory Usage 1,859KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (24)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