View Full Version : Today's Posts on forumhome (number).
Deaths
04-05-2005, 10:00 PM
A couple of my members requested this hack, so I created it, and decided to share it with you guys :).
What does this hack do?
This hack will display the number of posts made today.
Misc Info:
The "today" text linksto search.php?do=getdaily, for your lazy members ;)
Creator: Deaths
Support is given in Hack's Thread, or preferably at vBadditions.com (when its back up).
Live Demo: http://board.xgnews.org/?styleid=1
The attached .zip contains an install file, for those who would like a copy.
Here we go:
Open up /index.php, and find:
$userstats = unserialize($datastore['userstats']);
$numbermembers = vb_number_format($userstats['numbermembers']);
$newusername = $userstats['newusername'];
$newuserid = $userstats['newuserid'];
Bellow, add:
// START POSTS TODAY ON FORUMHOME HACK
$starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$newposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= $starttime");
$poststoday = vb_number_format($newposts['count']);
// END POSTS TODAY ON FORUMHOME HACK
Save, Close & Upload.
Now, open up the TEMPLATE FORUMHOME.
Find:
$vbphrase[posts]: $totalposts
REPLACE with:
$vbphrase[posts] (<a href="search.php?do=getdaily">$vbphrase[today]</a>): $totalposts ($poststoday)
That's it, you're done!
If you use this hack, please click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=79465)!
Deaths
04-06-2005, 11:08 AM
Reserved for... oh well, its here, live with it :p.
xtreme-mobile
04-06-2005, 04:33 PM
works great on my forum using 3.0.6 :)
thanks
*clicks install*
Deaths
04-06-2005, 05:08 PM
Glad to hear it works on 3.0.6 aswell :).
Zachery
04-06-2005, 05:14 PM
Going to kill any large instaltions, also you are not adding any index to help with the query time.
Deaths
04-06-2005, 05:15 PM
Hmm, didn't think about that yet.
I created it for my rather small board, so I didn't mind those things.
What would your suggestion be on this code?
Zachery
04-06-2005, 05:17 PM
Add an index on dateline.
Deaths
04-06-2005, 05:19 PM
Ok, I'll change it when I get some time.
boeserwolf
04-10-2005, 06:03 PM
Hi
I wanted to ask if it is okay for you if I would translate your hack into german.
2.) Would you mind if I would post the translation at www.vbhacks-germany.com
I promise only licensed vB members may download add-ons from our board.
If that?s not okay for you I would post the translation here in thread
Yours
Markus
Zachery
04-10-2005, 08:36 PM
Hi
I wanted to ask if it is okay for you if I would translate your hack into german.
2.) Would you mind if I would post the translation at www.vbhacks-germany.com
I promise only licensed vB members may download add-ons from our board.
If that?s not okay for you I would post the translation here in thread
Yours
Markus
Markus, how can you do promise that only licensed members will be able to download?
boeserwolf
04-10-2005, 09:48 PM
Hello
This solution is realised over a check on vbulletin-germany.
There is a thread with an Attachment, which contains a password.
If you´re a licensed member of vbulletin, you will be able to open this attachment and read the password.
This password changes very often.
If you have the Password, you create a support ticket at vbhacks-germany.com and if the password is correct, the administrator of vbhacks will put you in the "licensed" usergroup.
Sounds complicated I know, we already talked to scott molinari, and he promised he will talk to jailsoft, to put our site to jelsoft´s (adduco´s) member area.
yours
Markus
Zachery
04-10-2005, 10:07 PM
Hello
This solution is realised over a check on vbulletin-germany.
There is a thread with an Attachment, which contains a password.
If you?re a licensed member of vbulletin, you will be able to open this attachment and read the password.
This password changes very often.
If you have the Password, you create a support ticket at vbhacks-germany.com and if the password is correct, the administrator of vbhacks will put you in the "licensed" usergroup.
Sounds complicated I know, we already talked to scott molinari, and he promised he will talk to jailsoft, to put our site to jelsoft?s (adduco?s) member area.
yours
Markus
So what is keeping that password from being distributed thoughout the piracy sites?
Marco van Herwaarden
04-11-2005, 03:47 AM
and he promised he will talk to jailsoft
Lol, how we can take you serious if this is how you think about Jelsoft. Or am i not getting this?
Eternal2u
04-11-2005, 08:26 AM
Try using cache instead..one of my coders on my site made it use that and its a much better thing to do than make another useless query...
Trust me the webbies with sense will appreciate you for it..
boeserwolf
04-11-2005, 08:50 AM
Sorry for making this nasty error typing the name. It´s Jelsoft clear.
You may only give your best, changing the password very often, so distributing is very hard. But it is not the best solution we all lnow in the community.
We hope to get a better solution very soon from Jelsoft.
lg
Markus
TyleR
04-11-2005, 12:47 PM
[off topic]if you plan on having something as such as a lisence verification here on vb.org for your site, it would be in your best interest to use $_SERVER['HTTP_REFERRER'] = 'https://vborg.vbsupport.ru/showpost.php?p=xxxxx&postcount=xx'; to verify they actually are coming from that specific page..and put the link and verification code into a code box preventing non-lisenced mebers from seeing it ;)[/off topic]
Thanks for this hack, Deaths :)
* TyleR clicks install
Marco van Herwaarden
04-11-2005, 12:54 PM
It is very easy to spoof a referrer.
TyleR
04-11-2005, 12:58 PM
vBAdvanced.com has been using it I believe...havent seen any problems there.. :rolleyes:
Deaths
04-11-2005, 03:45 PM
Thank you for your feedback Tyler.
Please do not spam my hack's thread with stuff like this.
And yes, you may translate my hack, but PLEASE use the PM SYSTEM next time you want to ask something like this!
Zachery
04-11-2005, 03:50 PM
vBAdvanced.com has been using it I believe...havent seen any problems there.. :rolleyes:
AFAIK the password is updated constantly
boeserwolf
04-12-2005, 11:06 AM
Yes thats right
vbadvanced uses nearly the same method we do. We are still waiting for a comment from scott, but I think our system is the best we can until a better solution is suggested by Jelsoft.
lg
Markus
Deaths
04-12-2005, 04:42 PM
Please Do Not Use My Thread To Discuss That Stuff.
Thank you.
illusions
04-15-2005, 01:48 AM
Thanks...nice lil mod.. i was searching for this one...cheers.
Deaths
04-15-2005, 03:02 PM
No problem ;).
gregsbaby64
04-19-2005, 02:41 PM
I'm looking for something similiar to this. On the nav bar, "new posts" I would like to show the number of posts since the person visited the board.
Any way to do this, please? :)
Deaths
04-19-2005, 03:56 PM
That'd add an extra query to each page, if I'm not mistaking...
If you're sure that you want it, I'll create it.
gregsbaby64
04-19-2005, 04:08 PM
I didn't know it was going to put another query on each page...there has to be another way. Thanks Deaths. :)
Deaths
04-19-2005, 04:47 PM
Hmm, there is a posibility to do it using a cronjob and the datastore I guess... I'll look into it for you.
Vevina
04-22-2005, 07:36 PM
Sweet installed :)
lovelyman_x
04-22-2005, 11:43 PM
thanks 4 sharing !
Deaths
04-23-2005, 06:34 AM
No problem guys :).
Please click install if used.
conandoyle
04-27-2005, 02:12 AM
Thanks Deaths so much :)
Deaths
04-27-2005, 01:24 PM
No problem :)
gregsbaby64
04-27-2005, 05:33 PM
Excellent, thanks! :)
Deaths
04-27-2005, 06:33 PM
Glad I could be of help :).
gregsbaby64
04-27-2005, 06:35 PM
Ack, now the "view new posts since your last visit" thing isn't showing the cookies, it's showing the posts for today. Anyway to fix that? Thanks. :)
Deaths
04-28-2005, 01:53 PM
What is the URL?
gregsbaby64
04-28-2005, 04:29 PM
Hey, the url is in my signature, guests can't see it though. I just liked having the number of new posts there, no biggie. :)
Deaths
04-28-2005, 04:37 PM
Ah, I see.
Change the 2 $newposts variables to $todayposts in my hack, and it'll probably work :)
gregsbaby64
04-28-2005, 04:54 PM
Excellent, thanks! Worked great! :) I wish you could join, only chicks though, sorry!
Deaths
04-28-2005, 06:43 PM
Hehe, no problem :).
Tell me when its open to all, and Ill join :p
Allan
04-28-2005, 07:51 PM
thanks, click install ;)
iceytdot
05-05-2005, 01:45 PM
thanks installed! is there a hack that shows Threads today? might as well kill 2 birds with 1 stone lol
Deaths
05-05-2005, 02:11 PM
Be warned, this will add an extra query to index.php!
Replace
// START POSTS TODAY ON FORUMHOME HACK
$starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$newposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= $starttime");
$poststoday = vb_number_format($newposts['count']);
// END POSTS TODAY ON FORUMHOME HACK
With
// START POSTS TODAY ON FORUMHOME HACK
$starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$newposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= $starttime");
$countthreadstoday = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE dateline >= $starttime");
$threadstoday = vb_number_format($countthreadstoday['count']);
$poststoday = vb_number_format($newposts['count']);
// END POSTS TODAY ON FORUMHOME HACK
Untested, but should work.
got1-2
05-07-2005, 12:17 PM
very easy..thanks! I just changed the order a little so it reads like this
[<div>$vbphrase[threads]:=$totalthreads: $vbphrase[posts] = $totalposts: (<a href="search.php?do=getdaily">$vbphrase[today]</a>)= ($poststoday): $vbphrase[members]:=$numbermembers</div>
ptlink
05-16-2005, 01:34 AM
thanks installed
mcyates
08-03-2005, 10:04 PM
My server is 5 hours behind as its in the us and my site is uk based. So at midnight i'd expect the posts to be reset to 0 but this happens at 5am in the morning. Is there anyway to sort this out.
mcyates
08-12-2005, 10:58 PM
*bump*
Deaths
08-18-2005, 11:43 AM
Try looking up the function "mktime" (without quota) on php.net, that'll explain how I used the function and how you can adjust your time to it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.