SW:Rebellion NetworkHosted by the SW:Rebellion Network
Welcome to Evaders Squadron Coding [ESC]
Need help running your HTML, PHP, ASP website? - Evaders Squadron Coding - Webmaster Services
Home Forums Nuke Patched Core Coding Services Webmaster Services Personal
  Login/Create an Account    

Forums
· Forums FAQ
· Search
· Usergroups
· Profile
· Private Messages

Support Us
This site runs with your support. Please donate:

User Info/Login
Welcome, Anonymous
Nickname
Password
Security Code: Security Code
Type Security Code

(Register)
Membership:
Latest: melvin
New Today: 0
New Yesterday: 0
Overall: 9108

People Online:
Visitors: 16
Members: 0
Total: 16

Link to Us

Affliates
RPG Boards Hosting

Evaders Squadron Coding [ESC] :: View topic - counter.php has stopped inserting stats_date
counter.php has stopped inserting stats_date

 
Post new topic   Reply to topic    Evaders Squadron Coding [ESC] Forum Index -> Coding Services
View previous topic :: View next topic  
Author Message
outseeker
Newbie
Newbie


Joined: Feb 01, 2007
Posts: 9
Location: Australia baby!

PostPosted: Thu Mar 13, 2008 12:50 pm    Post subject: counter.php has stopped inserting stats_date Reply with quote

Hey Evaders! Very Happy I've just re-done my whole phpnuke setup with 7.8 patched and everything was looking completely perfect. I started with the full patched archive and modded everything back up again so my site looked just like how it used to be, in order to make sure all the code was gonna be ok and I didn't miss anything or mess it up.

I also updated from MySQL 4.1 to 5.0, and since then I have noticed when I look at my stats page, the counts for the day are not being added anymore :/

Has there been any change to the stats_date table in recent versions of patched? I know MySQL 5.0 has some data restrictions or some bs new "feature" that stops the data being added to the table unless it matches the correct format the column is expecting, and figure that's my problem but I'm not sure what the column types used to be compared to what they now are. You know like varchar, string etc.

You can see what it looks like here: http://outer.reaches.dyndns.org/modules.php?name=Statistics

It is currently adding the hourly stats to the database, but not the daily stats, so I have been manually adding up the hourly stats at the end of each day and adding the new row to the stats_date table. I haven't added todays manually, so you can see the 14th is missing from the stats screen. If you use the link to display hourly stats from the 13th and replace 13 with 14, you can see the hourly stats are there no worries.

Any idea how to fix this one up mate? Perhaps where to start debugging if you don't know off-hand? I know the code resides in includes/counter.php but that's about it! Any suggestions would be greatly appreciated mate.

Many kind regards,
_________________
outseeker.
http://outer.reaches.dyndns.org/index.php
Back to top
View user's profile Send private message Visit poster's website
Evaders99



Joined: Jan 11, 2002
Posts: 3063
Location: USA

PostPosted: Thu Mar 13, 2008 9:56 pm    Post subject: Reply with quote

I don't see anything offhand. If you want me to look into it, PM or email me access to your site (I don't run MySQL 5 so I can't replicate this easily)
_________________
Evaders99
SW:Rebellion Fans! Webmaster
Star Wars roleplaying community! Administrator

Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -

The cake is a lie.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
outseeker
Newbie
Newbie


Joined: Feb 01, 2007
Posts: 9
Location: Australia baby!

PostPosted: Sun Mar 16, 2008 2:38 am    Post subject: would you be willing to help me craft a mysql query for it? Reply with quote

I don't have any ftp or other access available at the moment to get you to the files themselves, but I had an idea that someone with mysql command line knowledge like yourself could definately make use of to fix the problem.

The code in the counter.php that updates that stats_date table is:
$db->sql_query("UPDATE ".$prefix."_stats_date SET hits=hits+1 WHERE (year='$nowYear') AND (month='$nowMonth') AND (date='$nowDate')");

Can you possibly tell me how to make that line hits=sum(stats_hour) instead? Really phpnuke should probably only have to count up the hourly stats- everything else can be calculated from those instead of saying +1 and having its own seperate count. This could also stop any stats not matching up for previous dates, as I have manually added them up myself and may have made mistakes..

Any way you could help me out here with either that one line, or if you have the time/inclination maybe a code that will update all my dates by adding up that day's hourly hits? (just to be run once only)?

I think this still leaves me with the problem of the insert line not inserting for stats_date also, which is INSERT INTO ".$prefix."_stats_date VALUES ('$nowYear','$i','$k','0')"); - but I may be able to work that one out myself. I know I'm already asking a lot of you Wink

Thanks for your time Evaders. Smile
_________________
outseeker.
http://outer.reaches.dyndns.org/index.php
Back to top
View user's profile Send private message Visit poster's website
Evaders99



Joined: Jan 11, 2002
Posts: 3063
Location: USA

PostPosted: Sun Mar 16, 2008 10:15 pm    Post subject: Reply with quote

Keeping two data records, for dates and hours, is actually more efficient. There is a specific entry to update when it does hits=hits+1
It does not have to do any reprocessing and further subqueries.

Updating at this point is rather pointless. Yes you could write a subquery and do hits=sum(stats_hour) ... but then you still have that as a separate data record.
_________________
Evaders99
SW:Rebellion Fans! Webmaster
Star Wars roleplaying community! Administrator

Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -

The cake is a lie.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Evaders Squadron Coding [ESC] Forum Index -> Coding Services All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

^Top
Home Your Account Forums Downloads F.A.Q. Submit News Hosting Contact Us

© 2005 - 2007 by Evaders99. All Rights Reserved.
All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters.
You can syndicate our news using the file backend.php
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL.
PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 10.4 Seconds