Page 2 of 20

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 7:11 pm
by freestyler
phew, I didn't know if I did that right. I ran the code in phpmyadmin and its giving me this database error.

http://www.meanmug.org/forum

I've run it a second time and it tells me the tbl exists.

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 7:32 pm
by Anti.Social
Ok, it looks like you guys have either not ran the sql queries correctly, or perhaps are using a different version of mysql? Like stated before, please make sure to change the 'phpbb_' from the required sql lines to MATCH EXACTLY! the "$table_prefix = "";" line from your config.php file. I suggest paul's modification to the sql query posted above for people who are SURE they have done the required SQL statements via phpMYAdmin or another method. The only version of mysql (or any database engine) I have tested this on is the one stated above in the mod description.

@elcochino6 : Are you sure you completed the template modifications? are you sure you did them for ALL installed templates? or atleast the default template if your board is set to override user settings. Also, you will find the settings for this on the "General" tab of your ACP under "Board Settings" option. Another suggestion, did you remember to clear your templates cache via the ACP as instructed in the DIY section of the install?

If you are sure you did the template edits correctly, try this:

FIND:

Code: Select all

for($i=0; $i < count((isset($today->visitlist)) ? $today->visitlist : '0'); $i++)
{	$today->compiledList .= $today->visitlist[$i];
	$today->compiledList .= ((count($today->visitlist) -1) !== $i) ? ', ' : '';
REPLACE WITH:

Code: Select all

print_r($today->visitlist);
for($i=0; $i < count((isset($today->visitlist)) ? $today->visitlist : '0'); $i++)
{
//	$today->compiledList .= $today->visitlist[$i];
//	$today->compiledList .= ((count($today->visitlist) -1) !== $i) ? ', ' : '';
This will show you if any data is infact in that array. For a while, I had a problem where it wouldn't actually show the usernames, even though they were in the array, but fixed that rather early on.

@ Freestyler: It looks as if your mysql password doesn't match to the mysql username your attempting to use? Did you (or someone else) either modify the config.php file or change the actual password for the database? This doesn't look like something that could be caused by running the sql for this mod, or performing the edits instructed to be done.

@ Stitch: Thanks for the feedback ;) I myself wanted something that was simple, fast, and actually worked the way I expected it too. Just glad some body else finds it useful as well.

I will add the pre-modded files from the demo site to the next update/release of this package, hopefully along with an install_db.php file that will piggy back on phpBB to help those of you who might be having trouble getting the sql executed correctly. However, today is Friday, and I dont code on the weekends, so expect this either Monday, or Tuesday, that is, if you are expecting it at all ;) I do appologize for any inconvience and troubles that you may be encountering with my little mod (thats what I tell the wife as well).

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 7:51 pm
by freestyler
Anti.Social wrote: @ Freestyler: It looks as if your mysql password doesn't match to the mysql username your attempting to use? Did you (or someone else) either modify the config.php file or change the actual password for the database? This doesn't look like something that could be caused by running the sql for this mod, or performing the edits instructed to be done.
Bah! I accidentally changed the password when I tried logging into myphpadmin (go figure). I'll update it in the files. Thanks.

[added] Mod is working perfectly. Thanks!

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 9:30 pm
by elcochino6
Started over again to try to get this working, and thistime I got even more errors while trying to install... I followed the directions exactly, and got the following errors.

Code: Select all

General Error
SQL ERROR [ mysql4 ]

Unknown column 'u.user_id' in 'on clause' [1054]

SQL

SELECT u.user_id, u.username, u.user_type, u.group_id, u.user_colour, u.user_allow_viewonline, v.allow_viewonline, v.user_id, v.last_visit, b.bot_id FROM phpbb_users u, phpbb_visitors_today v LEFT JOIN phpbb_bots b ON (b.user_id = u.user_id) WHERE u.user_id = v.user_id ORDER BY u.user_type DESC

BACKTRACE


FILE: includes/db/mysql.php
LINE: 133
CALL: dbal->sql_error()

FILE: includes/functions_visitors.php
LINE: 82
CALL: dbal_mysql->sql_query()

FILE: includes/functions.php
LINE: 4069
CALL: include('includes/functions_visitors.php')

FILE: index.php
LINE: 124
CALL: page_header()

I would really like to get this working, any suggestions would be greatly appreciated.

Btw I sql'ed everything in the xml, and I cheked my config.php and my prefix is indeed phpbb, so it should be working.

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 9:31 pm
by IzNoGoud
Can I download this somewhere else?
I can't connect to your domain for some reason :cry:

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 9:57 pm
by Anti.Social
@ elcochino6:
OPEN root/includes/functions_visitors.php
FIND :

Code: Select all

$sql = 'SELECT  
		u.user_id, 
		u.username, 
		u.user_type, 
		u.group_id, 
		u.user_colour, 
		u.user_allow_viewonline, 
		v.allow_viewonline, 
		v.user_id, 
		v.last_visit, 
		b.bot_id 
	FROM 
		' . USERS_TABLE . ' u, 
		' . VISITORS_TABLE . ' v 
REPLACE WITH :

Code: Select all

$sql = 'SELECT  
		u.user_id, 
		u.username, 
		u.user_type, 
		u.group_id, 
		u.user_colour, 
		u.user_allow_viewonline, 
		v.allow_viewonline, 
		v.user_id, 
		v.last_visit, 
		b.bot_id 
	FROM (
		' . USERS_TABLE . ' u, 
		' . VISITORS_TABLE . ' v )
Let me know if that solves your problem, if not I will attempt to rewrite the sql for that section again.

@ IzNoGoud : Here are 2 mirrors I just setup. They are for the 1.0.1RC1 version, I will post mirrors when I update the code next time as well.
http://www.wikiupload.com/download_page.php?id=164621
http://www.filesend.net/download.php?f= ... 4967e51b5b

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 9:59 pm
by IzNoGoud
Thank you!

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 10:23 pm
by LuckyPip
Anti.Social wrote:Ok, it looks like you guys have either not ran the sql queries correctly, or perhaps are using a different version of mysql? Like stated before, please make sure to change the 'phpbb_' from the required sql lines to MATCH EXACTLY! the "$table_prefix = "";" line from your config.php file. I suggest paul's modification to the sql query posted above for people who are SURE they have done the required SQL statements via phpMYAdmin or another method. The only version of mysql (or any database engine) I have tested this on is the one stated above in the mod description.
It was not the SQL not being executed correctly or a different version of mySQL, as I am using mySQL and I know for sure I followed your SQL instruction to the dot - it finally worked after following paul999's fix, so obviously that where the problem was

But anyway, thanks for this great MOD - it is an excellent addition to any forums

And thanks to paul999 too for the fix

Have a good weekend ! :D

Re: [RC1] Visitors Today

Posted: Fri Jun 22, 2007 10:46 pm
by elcochino6
Anti.Social wrote:@ elcochino6:
OPEN root/includes/functions_visitors.php
FIND :

Code: Select all

$sql = 'SELECT  
		u.user_id, 
		u.username, 
		u.user_type, 
		u.group_id, 
		u.user_colour, 
		u.user_allow_viewonline, 
		v.allow_viewonline, 
		v.user_id, 
		v.last_visit, 
		b.bot_id 
	FROM 
		' . USERS_TABLE . ' u, 
		' . VISITORS_TABLE . ' v 
REPLACE WITH :

Code: Select all

$sql = 'SELECT  
		u.user_id, 
		u.username, 
		u.user_type, 
		u.group_id, 
		u.user_colour, 
		u.user_allow_viewonline, 
		v.allow_viewonline, 
		v.user_id, 
		v.last_visit, 
		b.bot_id 
	FROM (
		' . USERS_TABLE . ' u, 
		' . VISITORS_TABLE . ' v )
that appears to solve the problem, until I go into the acp. when displaying the options for the mod I get these errors at the top of the page:

Code: Select all

[phpBB Debug] PHP Notice: in file /adm/index.php on line 277: Undefined index: visit_delete
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3661)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 155: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3661)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 156: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3661)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 157: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3661)
any ideas? Thanks for your help!

Re: [RC1] Visitors Today

Posted: Sat Jun 23, 2007 12:47 am
by Anti.Social
quick fix, open includes/acp/acp_board.php

find : 'visit_delete'

replace with : 'visit_delete_threshold'

be back monday.

Re: [RC1] Visitors Today

Posted: Sat Jun 23, 2007 1:51 am
by Stitch625
Anti,

The mod isn't counting the bots.
In total there were 25 users online :: 8 registered Members, 0 hidden Members, 0 bots and 17 guests.
(This data based on users active Today Friday Jun 22nd 2007)
I have plenty of bots visiting but they aen't being counted as you can see. Is there a QUICK FIX FOR THIS?

Re: [RC1] Visitors Today

Posted: Sat Jun 23, 2007 6:36 am
by bikesandscooters
Works fine for me, I would be checking to see if you installed the mod correctly.
my site looks like this wrote:In total there were 53 users online :: 19 registered users, 0 hidden users, 3 bots and 31 guests.
(This data based on users active during Saturday Jun 23rd 2007)
The most ever members to visit in one day was 53 on Saturday June 23rd, 2007

Re: [RC1] Visitors Today

Posted: Sat Jun 23, 2007 10:48 am
by Dr.Death
Hi,

in your file includes/functions_vistors.php i found some "hardcoded" language.

Please swap the title="Last visit: ' to the language file.

Re: [RC1] Visitors Today

Posted: Sat Jun 23, 2007 11:36 am
by LuckyPip
bikesandscooters wrote:Works fine for me, I would be checking to see if you installed the mod correctly.
my site looks like this wrote:In total there were 53 users online :: 19 registered users, 0 hidden users, 3 bots and 31 guests.
(This data based on users active during Saturday Jun 23rd 2007)
The most ever members to visit in one day was 53 on Saturday June 23rd, 2007
Works fine for me too, as you can see below (bots were Google and Ask Jeeves)
In total there were 60 users online :: 18 registered users, 2 hidden users, 2 bots and 38 guests.
(This data based on users active during Saturday Jun 23rd 2007)
The most ever members to visit in one day was 60 on Saturday June 23rd, 2007
Anti.Social, just a little suggestion to improve your MOD, I notice that if there was only one member online today, it'd say

Code: Select all

In total there were 1 users
Obviously, that's grammatically incorrect so my suggestion is to do the same as phpbb does for who is online - to put an extra IF command when there was only one user logged in today, to show

Code: Select all

In total there was 1 user
Only a suggestion and should be easily done :D

Re: [RC1] Visitors Today

Posted: Sat Jun 23, 2007 5:58 pm
by Stitch625
bikesandscooters wrote:Works fine for me, I would be checking to see if you installed the mod correctly.
my site looks like this wrote:In total there were 53 users online :: 19 registered users, 0 hidden users, 3 bots and 31 guests.
(This data based on users active during Saturday Jun 23rd 2007)
The most ever members to visit in one day was 53 on Saturday June 23rd, 2007
I know the mod is installed correctly. Everything else works just fine.