![]() |
Does anyone know how to get rid of this error when viewing the leader board? Warning: Division by zero in /web/blarg/public_html/testvb/timeonline.php on line 42
Dark Shogun |
Quote:
|
Quote:
|
Hi guys... I got it working fine except for one thing. I'm really not in need of the leader list, but a few members requested it. I was getting the 'Division by Zero' error, but edited the 'timeonline.php' with the fix. Now when I click on the link in postbit, it opens up the timeonline.php link, but i'm getting a blank page. This could have possibly been covered already, but i dont remember seeing a fix or solution. Any help? Thanks!
|
Can someone write an idiots guide and post an updated file - this thread is getting confusing now.
|
I am having slight problem with this hack
The Time Online is not being displayed in the user threads, which I assume is the postbit templates. Attached is SS of what it is doing. |
Why did you incert a new row for this?
You dont need to do any database edits to make this hack. |
should i say it's a great one... you hack, still?? :)
btw, i use a very light part of you hack, i mod it to give me only the online hours spent.. in the post only. here it is a little piece my postbit, with the activity online: |
Neo what do u mean?
|
Quote:
|
hmm g-force, i just realised that the hack it's adding a query everywhere, in all pages. i really dont like that because i'm trying to stay with an average of max 18queries on my forums.
and you should use in your sessions.php something like: Code:
$timeactive = time() - $bbuserinfo['lastactivity']; UPDATE :) check below how to optimise the code and eliminate the extra query... wait for g-force to update his files... or do it yourself if your belt is strong enough. |
NSeXcellent:
make sure that the link is this: PHP Code:
everything is included in the zip file, other changes are just custom ones nothing necessary Da GoTTi: did you include the $post[onlinetime] variable in the postbit? Neo: how would you do it? TECK: thanks for the addition :) i will add the link to the first post ;) regards... g-force2k2 |
ok, g-force i found a way to dont load any query at all. you can update your code if you want... is your hack and it's a great tool.
now let's optimise shall we? :) here it is what i did, step by step (keep in mind i used my own terms, change them to yours): run this query: [sql]ALTER TABLE user ADD timeactivity int(10) unsigned DEFAULT '0' NOT NULL AFTER posts[/sql] in /admin/functions.php find: Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); Code:
if ($ourtimenow - $bbuserinfo['lastactivity'] > $cookietimeout) { Code:
$timeactive = time() - $bbuserinfo['lastactivity']; Code:
Activity Online: <font color="#E4630A">$post[activity]</font> hour$pluralhour as i said before, i did it this way because all i wanted to have is the time in postbit. the results? a screenshot is here... go ahead and update your cool hack now. :) thanks for letting me aport a small contribution to it. cheers. floren. :) |
Great great HACK ! :classic:
Thank YOU very much man ! I use it on a (mutilated :) ) 2.2.2 board and works PERFECT ! Have A Cool Day ! |
TECK > your modification is NOT working for me :glasses:
Give me MySQL error :( PS: esti cumva Roman ? :D |
monitox, it doesnt work because the params and variables are not identical. this is a custom install for my forum, not the original hack. just wait for g-force to customize it, because you add an extra query on the process with his current hack...
and yes i'm romanian.. you can tell by the name. :) |
g-force =
Yes the code is in the postbit, here is what I got in there: <p align="right"><smallfont><a href="javascript:openeditsigwindow(490,320,'$session[sessionhash]','$post[userid]')">Edit Sig</a> | <a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged] | <a href='timeonline.php?s=$session[sessionhash]&action=view_leader'>Time Online:</a>$post[onlinetime]</smallfont></p> anything wrong? |
Da_GoTTi: did you make the admin/functions.php file edit? regards...
g-force2k2 |
Quote:
|
yes the modification is on the functions....
all of it is in correctly, i dunno what is causing it. |
Da Gotti - I'm having the same issue. Just comes up not finding the page.
|
I get a division by zero error when I click on the Time Online link. I've looked at the zero.php file, but it looks like a lot of computer garble. Am I supposed to upload this .php file? I can't decipher directions from it.
|
Quote:
|
Anyone know how to make it so regular users can't see how long the Admins have been online?
|
Any possible way to like reset the time after each month? So I can create like a "Loser of the month" award or something :) ... and maybe add some sort of log of each month...
Thanks! |
ok I have that Profile Change Thingy installed that changes it . .. then when I did what it said in for getinfo template it showed up like this . .
Can someone post a fix for this? Thankx \ \ - Speedy - / / |
You need to make sure that the bgcolor is set correctly for the <td> tags in the getinfo_timeone (I think?) template. They should be either { firstaltcolor } or { secondaltcolor } without the spaces.
|
Merci pour ce hack car je vien de le mettre et il est geniel
|
nice hack..:D installed it and working.. one prob when I click time online though :(
Fatal error: Call to undefined function: dotimeonline() in c:\www\apache\htdocs\zforce\timeonline.php on line 39 whats wrong there? and is there any way I can show the total time online of the user? thanx mate :) |
g-force, a tiny request: maybe you could optimize TECK's code on page 15? It reduces queries :) [I dont know about the params and variables so I can't use it...]
|
Yes, Please update TECK's code! :(
|
Quote:
Open your timeonline.php and search for: WHERE userid !=0 AND timeonline > 0 Change it to: WHERE userid > 1 AND timeonline > 0 open up member.php ans search for: $userinfo[onlinetime] = dotimeonline($userinfo[timeonline]); if($userinfo[timeonline] > 0) { eval("\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";"); } else { $getinfo_template = ""; } Replace it with: if ($userinfo[userid] != 1){ $userinfo[onlinetime] = dotimeonline($userinfo[timeonline]); if($userinfo[timeonline] > 0) { eval("\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";"); } else { $getinfo_template = ""; } // +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ } |
g-force2k2 ...
I would be nice if you modified your code in the zip file to include Teck's additional fixes. I just applied one (To settings.php) and it automatically removed one query from all of my pages. You've served us well in the past, and personally have done a lot for me behind the scenes. Everyone (Including the non-coders) here would appreciate it! Regards, Rolodex! :) |
Quote:
What other mods have you installed as my file doesnt contain the same as yours.. |
Quote:
Quote:
Quote:
So, maybe you've got other hacks you're working around? |
Can't you see the similarities?
Change this "WHERE userid!=0" to: WHERE userid > 1 We all don't have the same hacks on our boards so that may answer your question. Like I did, you have to learn to improvise from others code to get yours to work the way you want. Peace! |
Place the condition around the code you showed me ....
if ($userinfo[userid] != 1){ // +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ $userinfo[onlinetime] = dotimeonline($userinfo[timeonline]); eval("\$getinfo_timeonline = \"".gettemplate('getinfo_timeonline')."\";"); // +++++++ Start Time Online Hack [ g-force2k2 ] +++++++ } |
Bump for optimized version :(
|
A Question: TECK, maybe you can answer this, how many queries does this hack add, and on what pages, w/o your modification?
Also, someone please modify TECK's code so it works, pwease :D |
...bump...
|
All times are GMT. The time now is 06:31 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|