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)

Milktruck 09-18-2004 09:23 AM

Thank you! Installed it perfectly.

*clicked Install*

Jack28 09-22-2004 07:20 PM

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?

gspot 09-22-2004 11:49 PM

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/

etaslim 10-15-2004 11:41 AM

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

SaN-DeeP 10-15-2004 12:46 PM

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


Boofo 10-15-2004 01:01 PM

That's because you have a table prefix. You need to add . TABLE_PREFIX . before each table. ;)

SaN-DeeP 10-15-2004 01:30 PM

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,

gspot 10-15-2004 10:17 PM

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.

SaN-DeeP 10-17-2004 07:29 AM

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 :(

gspot 10-19-2004 06:22 AM

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.

SaN-DeeP 10-19-2004 12:36 PM

Quote:

Originally Posted by gspot
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.

Code:

there is no table name sandeep_f1nalDbaS3.user but a table named sandeep_f1nalDbaS3.vb3_user exisits, i assume you still need to tweak the file a lil for me :(

gspot 10-19-2004 01:24 PM

No, there shouldnt be any more editing needed to the files. - Your post number 125 up above shows that you were gettting the following database error: Table 'sanp_faS3.user' doesn't exist
Now when I visit your website I see the following error:
sandeep_f1nalDbaS3.user No table exists

So the only thing I can think of is that you dont have the table prefix being integrated correctly on your site... You can try adding (FROM " . TABLE_PREFIX . "vb3_referrals) - the (vb3_) into the each query being executed in the configuration file of my script that you posted in #127 above. That should do the trick, but make sure you add (vb3_) to every table like i showed you in the above example.

Let me know - good luck

trackpads 10-25-2004 02:06 AM

Great work!

SupraT 10-25-2004 02:39 AM

OK question, this is perfect for what I want to do with competitions and such. I also have am using the Store Hack.

I want to create a easy way for member to refer. How do I create "buttons" for the members to put on their sites etc so when they click on the button, get referred to my site, register, that the referrer gets credit automatically without having the person that is registering enter the referrerrrrrr's name?

Get that sorted and I click install :)

SaN-DeeP 10-25-2004 07:27 PM

Quote:

Originally Posted by gspot
No, there shouldnt be any more editing needed to the files. - Your post number 125 up above shows that you were gettting the following database error: Table 'sanp_faS3.user' doesn't exist
Now when I visit your website I see the following error:
sandeep_f1nalDbaS3.user No table exists

So the only thing I can think of is that you dont have the table prefix being integrated correctly on your site... You can try adding (FROM " . TABLE_PREFIX . "vb3_referrals) - the (vb3_) into the each query being executed in the configuration file of my script that you posted in #127 above. That should do the trick, but make sure you add (vb3_) to every table like i showed you in the above example.

Let me know - good luck

gspot last request, i have tried my best to make this nice addon work for me, but alas :(, can you make a different file for me which will have the prefix vb3_ added for all tables ?

Warm Regards,
Sandy...

gspot 10-26-2004 02:39 AM

This file has been modified only for "san-deeps" configuration. Please do not use this file unless you are this user listed above.

LET ME KNOW...

* You still need to edit the path to your vbulletin directory, and you need to make sure the path to your global.php file is correct. If you get any error messages, please post them or send them to me via. vbulletin instant messenger.

SaN-DeeP 10-26-2004 08:34 PM

Big thanks gspot, there were 2 or 3 small problems with prefix in above file, i have fixed them now, and the referral system on my forums work great.

Big thanks for the hack and morever, your great support of taking time to make a seperate file finally :) I apprecaite ur efforsts for same.

Regards,
Sandy...

gspot 10-26-2004 08:44 PM

You are welcome.. :) And I'm glad I could help. Enjoy!!

etaslim 10-27-2004 04:39 PM

bump.....

Quote:

Originally Posted by etaslim
Ups, appearently not all :ermm: In one of my forum, the total number of 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


SaN-DeeP 10-27-2004 06:40 PM

i have a strange problem now. :S
i have also installed - link for each user for inviting members hack
and all the new users are getting added to webmaster (user id =1) referrals list
check this page - http://forums.tech-arena.com/referrals.php

Any idea ?

Regards,

kall 10-27-2004 09:40 PM

Quote:

Originally Posted by SaN-DeeP
i have a strange problem now. :S
i have also installed - link for each user for inviting members hack
and all the new users are getting added to webmaster (user id =1) referrals list
check this page - http://forums.tech-arena.com/referrals.php

Any idea ?

Regards,

Possibly it is due to that hack duplicating an already exisitng vB feature?

dominick32 10-27-2004 11:12 PM

Guys.
I am usually very good at making my hacks fully functional.
But I dont seem to understand how to add this to the database:
Quote:

//////////////////////////////////////
//////////////////////////////////////
////////// NEW TABLE /////////////////
//////////////////////////////////////
1) create a new database table
CREATE TABLE `referrals` (
`date` TEXT NOT NULL
);
I can use phpAdmin to create a new table.
But after I create a table called referrals. what do I do?
Am I doing this right?

Thanks.
Dom

dominick32 10-27-2004 11:32 PM

Never Mind Guys.
Sorry, i just read page 7 of this thread.
Question Solved.

Dom

gspot 10-28-2004 04:21 AM

Quote:

Originally Posted by dominick32
Never Mind Guys.
Sorry, i just read page 7 of this thread.
Question Solved.

Dom

Dominick32 - remember to click install please. :)

rex_b 11-01-2004 08:26 PM

Man that took forever to fix the prefix glitches.. ugh

but thanks for the hack!

Kaktus 11-10-2004 04:56 PM

I had the same mysql error as SaN-DeeP..
Just removed the vb3_ - prefix from all my tables.. now it works like a charm :)

Sweet Evil 11-10-2004 05:53 PM

nice mod, thanks

etaslim 11-12-2004 06:09 AM

Any solution to this yet? The total referrals number & the date since referrals reset are not shown. What could possibly wrong?

Quote:

Originally Posted by etaslim
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


gspot 11-12-2004 01:41 PM

Quote:

Originally Posted by etaslim
Any solution to this yet? The total referrals number & the date since referrals reset are not shown. What could possibly wrong?

etaslim - There has to be a problem with one of the other hacks you have installed prior to this one. I told you earlier how you can error check by usergroups, so please do that prior to double-posting. It sounds to be from what you have told me - that there is another hack that you have installed that is more than likely messing up your forum. You might want to back trace to fix this issue...

etaslim 11-16-2004 09:02 AM

Quote:

Originally Posted by gspot
etaslim - There has to be a problem with one of the other hacks you have installed prior to this one. I told you earlier how you can error check by usergroups, so please do that prior to double-posting. It sounds to be from what you have told me - that there is another hack that you have installed that is more than likely messing up your forum. You might want to back trace to fix this issue...

hmm....ok i will try to trace back my installation. thanks.

T3MEDIA 12-13-2004 09:22 AM

I am sorry can I get a clear answer on this?

Does this hack count referals from a user that has new members join fully?

As in a referal becomes a full member.

I see the usergroups thing but that sounds to me like only "registered members" or what ever user group you pick can be PART of this hack (race, competion what ever)

Please and thank you.

T3MEDIA 12-13-2004 11:58 AM

Quote:

Originally Posted by joeychgo
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?

Joey did you get a answer?

T3MEDIA 12-13-2004 12:15 PM

This part is confusing. I will wait untill some one can help me in this area.

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 -->

I just want registered referals to show. people who refered people and now they are registered. that group is 2.

thanks.

gspot 12-14-2004 12:55 AM

Quote:

Originally Posted by T3MEDIA
This part is confusing. I will wait untill some one can help me in this area.

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 -->

I just want registered referals to show. people who refered people and now they are registered. that group is 2.

thanks.


If you leave the settings at default - then only registered members will be counted that are fully registered. If you add what I specified to add if you wanted to as an option then it would only count referrals by that usergroup.

GOOD LUCK. please click install :)

T3MEDIA 12-14-2004 03:36 AM

Quote:

Originally Posted by gspot
If you leave the settings at default - then only registered members will be counted that are fully registered. If you add what I specified to add if you wanted to as an option then it would only count referrals by that usergroup.

GOOD LUCK. please click install :)

ok. sorry but to be clear. default will have full registered people. not people waiting for email confirmation. becuase at default it shows a lot of referals. an they are not full members.

this is why I thought it would be best to ask.
Here dont take my word for it. look here and view the members for persona. They are not members yet they are waiting for email verification.

any ideas? or maybe a print out of some sort I could paste in to fix this? I know this took some time to make and I did click install. I honestly am greatefull you did it. But I would love to see it work at its full potental.

gspot 12-14-2004 04:03 AM

Ok, so you have it setup so when you have a new user they are considered to be in one usergroup correct?? And then when they are confirmed they are changed to another user group? If this is the case then you need to add into the script the usergroup number that i show commented out in the script. If not please let me know how you have your forum setup.

T3MEDIA 12-14-2004 05:02 AM

Quote:

Originally Posted by gspot
Ok, so you have it setup so when you have a new user they are considered to be in one usergroup correct?? And then when they are confirmed they are changed to another user group? If this is the case then you need to add into the script the usergroup number that i show commented out in the script. If not please let me know how you have your forum setup.

Only group that should count as a good referal is usergroup 2. Reg. users.
But with this User group 3 (users awaiting confirmation) also shows with 2.

do you mind showing me in text what you mean? Sorry and thank you.

gspot 12-14-2004 05:07 AM

Quote:

Originally Posted by T3MEDIA
Only group that should count as a good referal is usergroup 2. Reg. users.
But with this User group 3 (users awaiting confirmation) also shows with 2.

do you mind showing me in text what you mean? Sorry and thank you.

Post up your referrals.php file and I will edit it to what you will want to use.

T3MEDIA 12-14-2004 06:31 AM

Ok well 1,3,4 are the no no groups.... they are not logged in, waiting for confirmation and COPPA.

Any one that refers a person and they are part of this list it just wouldnt count.

I really want referrals that become full members. (really any number besides the three I just stated)

gspot 12-15-2004 04:54 AM

T3media - I will have this edited for you by tomorrow night. Sorry for the delay.. :(


All times are GMT. The time now is 03:28 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.01678 seconds
  • Memory Usage 1,862KB
  • 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
  • (5)bbcode_code_printable
  • (18)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