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 05-10-2004 03:12 AM

Quote:

Originally Posted by lifesourcerec
I got 5 uncached templates (2 from the referals hack). even after adding
PHP Code:

$globaltemplates = array(
'reflist',
'GENERIC_SHELL'
); 


That is wierd then, I don't get that, and I have checked with many other hacks and all of them are set-up the same way as mine... I even followed this thread on creating hacks and other modifications for vb3.x.x

How to create vb pages??

** ALSO PLEASE NOTE: DON'T USE GENERIC_SHELL... Thats has nothing to do with this hack anymore.. **

REMEMBER TO CLICK INSTALL AS WELL ONCE YOUR HAVE IT ON YOUR SITE.

lifesourcerec 05-10-2004 03:35 AM

Heh.. nevermind. It's not that. It's the adcolumn hack which will not cache for anything.

Fluous 05-10-2004 12:39 PM

GSpot, can you PLEASE message me when you get on. I keep not seeing you for days wondering when you will appear. Thanks. :)

Boofo 05-10-2004 12:48 PM

Are you going to be adding a pagenav to this so we can list all of the referrers? ;)

gspot 05-10-2004 02:04 PM

Quote:

Originally Posted by Boofo
Are you going to be adding a pagenav to this so we can list all of the referrers? ;)

You can list all the referrers, just by not giving it a limit in the referals.php page.

Boofo 05-10-2004 02:17 PM

Quote:

Originally Posted by gspot
You can list all the referrers, just by not giving it a limit in the referals.php page.

And what happens when you get 100 or 150 of them and no pagenav? ;)

msimplay 05-10-2004 04:03 PM

yeh i was on about pagination earlier :P

gspot 05-10-2004 10:49 PM

Quote:

Originally Posted by msimplay
yeh i was on about pagination earlier :P

Still working on the pagination scripting... :( sorry for the delay guys

msimplay 05-10-2004 11:05 PM

Quote:

Originally Posted by gspot
Still working on the pagination scripting... :( sorry for the delay guys

naww don't be silly

we appreciate your work :)

JagFan 05-11-2004 08:25 PM

I have installed and it is working fine....nice work :)

Big Kahuna 05-12-2004 01:03 AM

Ok -- what's the secret format for the //path to your vbulletin directory?

I getting the below error

Quote:

Warning: chdir(): No such file or directory (errno 2) in /home/moparsty/public_html/forums/referals.php on line 28




Unable to add cookies, header already sent.
File: /home/moparsty/public_html/forums/referals.php
Line: 28



my forums are at www.moparstyle.com/forums

gspot 05-12-2004 01:07 AM

For you it would be: /home/moparsty/public_html/forums/

REMEMBER CLICK INSTALL :)

Big Kahuna 05-12-2004 01:10 AM

Ok thanx -- that got me one step further -- but now I have a blank screen

http://www.moparstyle.com/forums/referals.php

Suggestions?

Big Kahuna 05-12-2004 01:19 AM

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.

Big Kahuna 05-12-2004 01:29 AM

Fixed -- I gave the full URL to the referals.php so I could also use it in the footer of the Portal.

Thanx

I'll click install as soon as I update the other styles.

Big Kahuna 05-12-2004 01:35 AM

I'm missing the big picture here -- how does it relate new members to the person that referred them? Is this something that occurs this moment forward as a person registers?

I already have an extra field in the user CP that has the person registering leave the name of the person refering them. Any way to use that data?

gspot 05-12-2004 02:08 AM

Quote:

Originally Posted by Big Kahuna
I'm missing the big picture here -- how does it relate new members to the person that referred them? Is this something that occurs this moment forward as a person registers?

I already have an extra field in the user CP that has the person registering leave the name of the person refering them. Any way to use that data?

What version are u using for vbulletin? This hack is to show statistics on referrals that have been made. For instance, if you referred 5 people, it will show the 5 people you referred as well as a count of referrals for you which would be 5 and your username as the referrer. This is just for statistics. I'm currently finishing an addon for this hack that will be used for competitions. Say you only want to show statistics for members who have referred new members that have posted a certain amount of times. This will show the results based on this condition. Hope this helps.. By the way, did you get it up and working??

** Change that I have visited your site and you didn't copy and paste the information for the templates correctly. Please re-copy the templates and make sure they are named: refer & referbit .. Then this hack will work properly, it works for all referrals made prior to this hack and for future referrals. :)

Big Kahuna 05-12-2004 04:35 AM

this is the template refer

Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head><title>$vboptions[bbtitle] - Referral Statistics</title>
$headinclude
</head>
<body>
$header
$navbar
<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="550" align="center"><tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="550" align="center">
<tr>
  <td class="thead" align="center" width="160"><b>Member</b></td>
  <td class="thead" align="center" width="80"><b>Referrals</b></td>
  <td class="thead" align="center" width="310"><b>Members Referred</b></td>
</tr>
$referbits
</table>
</td></tr></table>
$footer
</body>
</html>

this is the template referbit

Code:

<tr align="center">
        <td class="alt1"><b><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$referrer[userid]">$referrer[username]</a></b></td>
        <td class="alt2">$referrer[referrals]</td>
        <td class="alt1">$referrerlist</td>
</tr>

I copied and paste exactly as the .txt file instructed. Am I seeing something different than you?

Big Kahuna 05-12-2004 04:37 AM

although the instructions has referbit (singular) -- I see the refer wants to call $referbits (plural)

gspot 05-12-2004 04:47 AM

Quote:

Originally Posted by Big Kahuna
although the instructions has referbit (singular) -- I see the refer wants to call $referbits (plural)

That doesn't matter.. It's how the script actually works. Do you actually have members at this time that have made referrals?? Please feel free to AIM me my username is: gspot003

Big Kahuna 05-12-2004 04:51 AM

I changed $referbits to $referbit in the refer template -- but that didn't change anything.

Quote:

This hack is to show statistics on referrals that have been made. For instance, if you referred 5 people, it will show the 5 people you referred as well as a count of referrals for you which would be 5 and your username as the referrer. This is just for statistics.
What I don't understand is what is the link between the referrer and the referred? I tried a throwdown registration -- and I was not asked who referred me. No where in the instructions did I do anything to perform a database modification.

These were the instructions from the hack I downloaded earlier today.

Quote:

Installation Instructions:
I have edited this code from vb version 2.x.x to work with vb 3.0.1.
follow the instructions below to install, and feel free to make any
modifications to the code as you wish. I made some options for this
hack to limit results such as referrals by usergroups. More instructions
on implementing the results limiter is in the referals.php

Thanks to unixman - all the referred members are now clickable to their profile.

Open /includes/functions_online.php
/////////////////////////////////////
/////////////////////////////////////

Search for:
/////////////////////////////////////
case 'modcplogin':
$userinfo['action'] = $vbphrase['moderator_control_panel_login'];
break;
/////////////////////////////////////

After add:
/////////////////////////////////////
case 'referrals':
$userinfo['action'] = 'Viewing Referral Statistics';
break;
/////////////////////////////////////

Search for:
/////////////////////////////////////
case '/robots.txt':
$userinfo['activity'] = 'spider';
break;
/////////////////////////////////////

After add:
/////////////////////////////////////

case 'referals.php':
$userinfo['activity'] = 'referrals';
break;
/////////////////////////////////////

Close functions_online.php and upload to server.

/////////////////////////////////////



Open refer.txt attached to this hack and add a new template
named: refer copy and paste all into this template.

Open referbit.txt attached to this hack and add a new template
named: referbit copy and paste all into this template.


//////////////////////////////////////
//////////////////////////////////////

Open your footer template and find:
//////////////////////////////////////
<a href="$vboptions[homeurl]">$vboptions[hometitle]</a> -
//////////////////////////////////////

Before it add:
//////////////////////////////////////
<a href="referals.php">Referral Statistics</a> -
//////////////////////////////////////


END ENJOY.... HAVE FUN WITH IT.......

I've gone over the steps outline above, plus the path to my forum in the referal.php, and put that in my forum's directory. I've had a long day and it is possible that I'm missing something obvious -- but I've gone over the instructions many times and can't see it.

I might also suggest that it may help alieviate a little confusion if your above instructions indicate what directory to upload the referal.php file to -- and a little clarity on the directory change you need to make to the file first.

gspot 05-12-2004 05:00 AM

In your admincp panel make sure that under vbulletin options - user registration options - you have selected to use the "user referrer". This will give a credit towards each referrer in which the referred member has signed up from them. Automatically adding a field in the user registration for this to work, once you have this feature enabled.

Big Kahuna 05-12-2004 03:30 PM

Ok -- I misunderstood how this worked. Instead of referral by a link -- I thought it was a question asked in New User Registration "Who Referred You?"

Thanx

gspot 05-13-2004 01:07 AM

Quote:

Originally Posted by Big Kahuna
Ok -- I misunderstood how this worked. Instead of referral by a link -- I thought it was a question asked in New User Registration "Who Referred You?"

Thanx

Actually it's by both.. No matter if you follow a link with the referrers information or if you type in the referrers name during registration. It will work the same.. But you wont see any statistics until someone has referred someone else. No matter in the past or in the future.. :)

Big Kahuna 05-13-2004 01:50 PM

OK -- I'm back to confused again since I tried a throwdown registration and didn't see anywhere the referrer's name was asked in a new registration.

Was something suppose to be modified in the database (because I didn't see it happen) to add a field for the name of the person that referred a member?

gspot 05-13-2004 05:27 PM

YES, you do have a referrer spot in your new user registration. Please see the attachment.. You will only get statistics if someone has referred someone else. But, they have to either type in the members name in this field during new registration, or they have to follow the link sent to them by the use of your other hack refer friends..

If you still can't get it, I would be more than happy to check out your settings myself, if you want to give me access. Else, I would recommend you to seek some assistance by a website designer. Many people have installed this hack with no problems. Just read the instructions word for word and everything should work properly. :) GOOD LUCK.

armani1072 05-15-2004 03:17 PM

got this database error when i click on the "refer stats" link any ideas???

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users
LEFT JOIN user ON (users.referrerid = user.userid)
WHERE user.userid > 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 10

gspot 05-15-2004 06:11 PM

Did you use a table prefix while installing vbulletin? If so you will need to edit that query to fit your tables database prefix...

There should have been more to that error as well, if you can please post it all. :)

armani1072 05-15-2004 09:56 PM

Quote:

Originally Posted by gspot
Did you use a table prefix while installing vbulletin? If so you will need to edit that query to fit your tables database prefix...

There should have been more to that error as well, if you can please post it all. :)

here is the rest of the error message. Yeah it looks like that table does not exist. Umm if you could point me in the right direction that would be swell :)



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

mysql error number: 1146

gspot 05-15-2004 10:20 PM

Quote:

Originally Posted by armani1072
here is the rest of the error message. Yeah it looks like that table does not exist. Umm if you could point me in the right direction that would be swell :)



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

mysql error number: 1146

Looks to me that u need to change all instances for the mysql querys that have "FROM user" to "FROM precisi_forums.user" since you used a table prefix when installing vbulletin. So edit the referals.php file to meet your needs.. Let me know. I hope this helps.

armani1072 05-15-2004 11:17 PM

Samething. does the table have to be created in the database? thanks for all your help by the way :)


Database error in vBulletin 3.0.1:

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

mysql error number: 1146

Boofo 05-16-2004 12:25 AM

Quote:

Originally Posted by armani1072
Samething. does the table have to be created in the database? thanks for all your help by the way :)


Database error in vBulletin 3.0.1:

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

mysql error number: 1146

Very simple fix. In the referals.php file

Find:

PHP Code:

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

REPLACE it with:

PHP Code:

$referrers $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM 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"); 


armani1072 05-16-2004 12:37 AM

Umm you want me to replace the code i find with the same code? still got the error. sorry to be a bother.

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM 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 'precisi_forums.user' doesn't exist

mysql error number: 1146

Boofo 05-16-2004 12:44 AM

Quote:

Originally Posted by armani1072
Umm you want me to replace the code i find with the same code? still got the error. sorry to be a bother.



Database error in vBulletin 3.0.1:

Invalid SQL: SELECT COUNT(*) AS referrals, user.username, user.userid FROM 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 'precisi_forums.user' doesn't exist

mysql error number: 1146

I changed the second line in the query to user AS user ON. Anytime there is a table prefix being used, all tables must must delared like that in a query if you are accessing more than one table in the query.

armani1072 05-16-2004 01:29 AM

same error message as post #73

gspot 05-16-2004 06:01 AM

TRY THIS:

PHP Code:

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

AND THEN CHANGE THE OTHER QUERY TO:

PHP Code:

$referreds $DB_site->query("SELECT username FROM precisi_forums.user WHERE referrerid = '$referrer[userid]' AND referrerid > 0"); 

Once those changes are made, that should work.. Just let me know. :)

gspot 05-17-2004 03:35 AM

Did this work for u?? :speechless:

armani1072 05-17-2004 08:21 PM

Samething. I think i am doing something wrong here. it cannot be that difficult. also everytime i have to run queries for any hack it gives me an error. I am in the middle of building vB3.01 for an upgrade from vB2.3.4 so it is just in a test directory. Could this be causing my problems? I did set up a new database to run the test dir. ugh this bites. Thanks for all the help.

Database error in vBulletin 3.0.1:

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

mysql error number: 1146

Boofo 05-17-2004 08:24 PM

Quote:

Originally Posted by gspot
Did this work for u?? :speechless:

What about the LEFT JOIN table? ;)

gspot 05-18-2004 03:52 PM

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.


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.01874 seconds
  • Memory Usage 1,867KB
  • 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
  • (5)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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