View Full Version : Set Current Date and Time in Editpost
Boofo
05-15-2003, 10:00 PM
Set Current Date and Time in Editpost v1.0
This hack was requested by Rose in this thread:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=51653
Many thanks goes out to Tigga without whom this hack would never have been made. He helped me see a simpler way of doing something that I had only seen as complicated. Thank you, sir. ;)
What this hack does:
When editing a post, there will now be a checkbox to set the date and time of that post to the current posting time. This hack is for those who have threads or posts they edit on a continual basis and need it to rise to the top of the thread list and show as a new post on the forumdisplay and forumhome.
Files to edit: 1 (editpost.php)
Templates to edit: 1 (editpost)
Install time: 5 minutes (if you are really slow)
Please click the install button if you find this hack useful. ;)
Boofo
05-16-2003, 06:48 PM
Here is what it will look like in the editpost.
yxboom
05-16-2003, 07:35 PM
Thanks Boofo! Installing.
Boofo
05-16-2003, 07:48 PM
You're very welcome. Don't forget to click the install button. ;)
yxboom
05-16-2003, 07:48 PM
tested and working fine.
Licked install for ya.
MindTrix
05-16-2003, 07:48 PM
Nice one, i wont be installing but only cause i dont need it on my site. Nice work tho
Crazy Pete
05-16-2003, 07:49 PM
Cool, this will come in handy sometimes! Installed
Boofo
05-16-2003, 07:51 PM
I really didn't need it either. I did it for Rose. But it is one of those hacks that is nice to have in case I ever do need it. ;)
Crazy Pete
05-16-2003, 07:55 PM
This doesn't seem to want to work correctly with a sticky, though. I have one sticky thread that I just edited and was hoping to bump up but it didn't seem to update the date/time on it at all, even though I checked the box before I hit submit.
[Edit -- Err, nevermind. It doesn't seem to want to work for me at all regardless. Guess I'll have to uninstall for now. :( ]
yxboom
05-16-2003, 08:05 PM
Egad man! Crazy you are right its not working. I should have given it more time to check if it tested correctly.
Boofo
05-16-2003, 08:06 PM
Recheck the install. I have been running here here with no problems for the last 2 weeks now. What is it doing on a regular post?
yxboom
05-16-2003, 08:13 PM
I post, then in edit I check the Update option and then it takes you to the post but the same original time and date show up and it doesn't affect bumping at all it remains where it was when the time it was originally posted if it is the last post. I am certain I did nothing in error with the install. Only modification was made was where I put the check box.
Edit to add: rechecked install....nada. :paranoid:
Boofo
05-16-2003, 08:18 PM
Try posting and waiting 5 minutes to edit it. If you edit it right after posting, the time may still be the same as the current time. ;)
Better yet, try use the checkbox on a post that is a few days old.
yxboom
05-16-2003, 08:21 PM
Hey I resemble that remark!
I had not waited 5 mins the first time. I learned my lesson from Crazy Pete's post which is why I tried it on another post.
Here (http://www.theologyweb.com/forum/showthread.php?postid=93080#post93080) I even edited a post I made back on the 10th just for you ;)
MetroSports82
05-16-2003, 08:24 PM
nice addition, thanks Boofo! ;)
* MetroSports82 licks install.
Boofo
05-16-2003, 09:26 PM
Today at 04:21 PM yxboom said this in Post #14 (https://vborg.vbsupport.ru/showthread.php?postid=395865#post395865)
Hey I resemble that remark!
I had not waited 5 mins the first time. I learned my lesson from Crazy Pete's post which is why I tried it on another post.
Here (http://www.theologyweb.com/forum/showthread.php?postid=93080#post93080) I even edited a post I made back on the 10th just for you ;)
So, does it work now then? ;) And I have to register to use that link.
Thanks, MetroSports82. Enjoy! ;)
yxboom
05-16-2003, 11:06 PM
Actually no it still does not.
Sorry. Try this link instead (http://www.theologyweb.com/forum/showthread.php?postid=85423#post85423). You will see the post is still back dated to May 2nd even though I edited it today on the 16th.
Martin64
05-16-2003, 11:19 PM
Excellent, very smart hack. I'll install this. :)
-Sidekick-
05-16-2003, 11:27 PM
Today at 03:55 PM Crazy Pete said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=395854#post395854)
This doesn't seem to want to work correctly with a sticky, though. I have one sticky thread that I just edited and was hoping to bump up but it didn't seem to update the date/time on it at all, even though I checked the box before I hit submit.
[Edit -- Err, nevermind. It doesn't seem to want to work for me at all regardless. Guess I'll have to uninstall for now. :( ]
I'm confused. Why would you have to bump a Sticky Thread?
Boofo
05-16-2003, 11:37 PM
Today at 07:06 PM yxboom said this in Post #17 (https://vborg.vbsupport.ru/showthread.php?postid=395915#post395915)
Actually no it still does not.
Sorry. Try this link instead (http://www.theologyweb.com/forum/showthread.php?postid=85423#post85423). You will see the post is still back dated to May 2nd even though I edited it today on the 16th.
Did you checkmark the Current date and Time box? And did you add this part?
$editedbysql$attachmentsql$updatedate
There's no way that it should not be updating the time and date.
Boofo
05-16-2003, 11:52 PM
Today at 07:19 PM Martin64 said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=395919#post395919)
Excellent, very smart hack. I'll install this. :)
Thank you, sir. ;)
Erwin
05-16-2003, 11:58 PM
Very good idea. :)
Boofo
05-17-2003, 12:28 AM
Thank you, sir. ;)
yxboom
05-17-2003, 12:59 AM
Today at 05:37 PM Boofo said this in Post #20 (https://vborg.vbsupport.ru/showthread.php?postid=395929#post395929)
Did you checkmark the Current date and Time box? And did you add this part?
$editedbysql$attachmentsql$updatedate
There's no way that it should not be updating the time and date.
I'm serious I did that I straight copied and pasted it. And I double checked it. Maybe someone else who installed it can give some feedback if it's working for them cause I did install it and apparently there is something I missed that I am just unaware of.
Crazy Pete
05-17-2003, 01:04 AM
Same thing with me. I tried it on a couple different posts and I got the same result everytime. It was like the checkbox wasn't even being clicked, or may as well not have been, rather.
Boofo
05-17-2003, 01:13 AM
Crazy Pete, pm me your editpost and I will look at it. ;)
yxboom
05-17-2003, 01:19 AM
oh and I'm chopped liver.
Boofo
05-17-2003, 01:24 AM
Today at 09:19 PM yxboom said this in Post #27 (https://vborg.vbsupport.ru/showthread.php?postid=395970#post395970)
oh and I'm chopped liver.
Check your pms. ;)
yxboom
05-17-2003, 01:30 AM
Egad!!! My PM isn't sending.
There seems to have been a slight problem with the vBulletin.org Forum 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.
Austin Dea
05-17-2003, 04:20 AM
It doesn't make the post go down in the order?
AndrewD
05-17-2003, 08:18 AM
I like this - I was going to code this myself - so thanks.
Couple of points..
If you don't want your posts to move around the thread (i.e. you only want the thread/forum to show there's been a change), then don't bother with the
$editedbysql$attachmentsql$updatedate
modification.
If you want to update the "lasterposter" field (e.g. if the original poster is not the editor) then replace
$DB_site->query("UPDATE thread SET lastpost='".time()."' WHERE ...
by
$DB_site->query("UPDATE thread SET lastpost='".time()."', lastposter='".$bbuserinfo[username]."' WHERE ...
You might also like to make the update option the default, in which case add CHECKED into the editpost template change.
all-the-vb
05-17-2003, 09:42 AM
nice hack
Thanks Boofo
Boofo
05-17-2003, 11:35 AM
Austin, this hack is more for when you have a thread (first post) or post that you update continually and want it to rise itself to the top as a new post. I have a "Useless True Facts" post that I add to on a continuing basis and this makes it great for that. ;)
@ yxboom - Did you try the file I fixed for you, yet? How's it working?
@ all-the-vb - Thank you very much. ;) Don't forget to click install in case I update this in the future.
Boofo
05-17-2003, 11:44 AM
Today at 04:18 AM AndrewD said this in Post #31 (https://vborg.vbsupport.ru/showthread.php?postid=396072#post396072)
I like this - I was going to code this myself - so thanks.
Couple of points..
If you don't want your posts to move around the thread (i.e. you only want the thread/forum to show there's been a change), then don't bother with the
$editedbysql$attachmentsql$updatedate
modification.
If you want to update the "lasterposter" field (e.g. if the original poster is not the editor) then replace
$DB_site->query("UPDATE thread SET lastpost='".time()."' WHERE ...
by
$DB_site->query("UPDATE thread SET lastpost='".time()."', lastposter='".$bbuserinfo[username]."' WHERE ...
You might also like to make the update option the default, in which case add CHECKED into the editpost template change.
The reason I didn't make the box checked as default was in case you were editing for like a spelling error or just changing something that you didn't really want the thread to show up as new for.
I had the last poster showing as the editor off the message, and not the original poster (if other than yourself) but that confused a few people when they would go to read the message and it was from someone other than who the last poster was. ;)
yxboom
05-17-2003, 12:15 PM
Boofo: Got it and replied. :)
Floris
05-18-2003, 02:21 AM
Boofo does it again! Good work my friend.
Boofo
05-18-2003, 02:36 AM
Today at 10:21 PM xiphoid said this in Post #36 (https://vborg.vbsupport.ru/showthread.php?postid=396515#post396515)
Boofo does it again! Good work my friend.
Thank you very much. If you install this, please don't forget to hit the install button. ;)
yxboom
05-22-2003, 02:22 PM
Note: If you have Xenon's Admin Edit hack you need to put the line of code in the Editpost template from this hack into the admineditpost template instead for it to function. :)
Boofo
05-22-2003, 02:26 PM
I told you I would get it figured out for you. How's that for relentless? ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.