vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Set Current Date and Time in Editpost (https://vborg.vbsupport.ru/showthread.php?t=53020)

Boofo 05-15-2003 09:00 PM

Set Current Date and Time in Editpost
 
Set Current Date and Time in Editpost v1.0

This hack was requested by Rose in this thread:
https://vborg.vbsupport.ru/showthrea...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)

[high]Please click the install button if you find this hack useful.[/high] ;)

Boofo 05-16-2003 05:48 PM

Here is what it will look like in the editpost.

yxboom 05-16-2003 06:35 PM

Thanks Boofo! Installing.

Boofo 05-16-2003 06:48 PM

You're very welcome. Don't forget to click the install button. ;)

yxboom 05-16-2003 06:48 PM

tested and working fine.

Licked install for ya.

MindTrix 05-16-2003 06: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 06:49 PM

Cool, this will come in handy sometimes! Installed

Boofo 05-16-2003 06: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 [high]do[/high] need it. ;)

Crazy Pete 05-16-2003 06: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 07: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 07: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 07: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 07: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 07: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 I even edited a post I made back on the 10th just for you ;)

MetroSports82 05-16-2003 07:24 PM

nice addition, thanks Boofo! ;)

[high]* MetroSports82 licks install.[/high]

Boofo 05-16-2003 08:26 PM

Quote:

Today at 04:21 PM yxboom said this in Post #14
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 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 10:06 PM

Actually no it still does not.

Sorry. Try this link instead. 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 10:19 PM

Excellent, very smart hack. I'll install this. :)

-Sidekick- 05-16-2003 10:27 PM

Quote:

Today at 03:55 PM Crazy Pete said this in Post #9
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 10:37 PM

Quote:

Today at 07:06 PM yxboom said this in Post #17
Actually no it still does not.

Sorry. Try this link instead. 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 10:52 PM

Quote:

Today at 07:19 PM Martin64 said this in Post #18
Excellent, very smart hack. I'll install this. :)
Thank you, sir. ;)

Erwin 05-16-2003 10:58 PM

Very good idea. :)

Boofo 05-16-2003 11:28 PM

Thank you, sir. ;)

yxboom 05-16-2003 11:59 PM

Quote:

Today at 05:37 PM Boofo said this in Post #20
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 12: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 12:13 AM

Crazy Pete, pm me your editpost and I will look at it. ;)

yxboom 05-17-2003 12:19 AM

oh and I'm chopped liver.

Boofo 05-17-2003 12:24 AM

Quote:

Today at 09:19 PM yxboom said this in Post #27
oh and I'm chopped liver.
Check your pms. ;)

yxboom 05-17-2003 12:30 AM

Egad!!! My PM isn't sending.

Quote:

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 03:20 AM

It doesn't make the post go down in the order?

AndrewD 05-17-2003 07: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
PHP Code:

$editedbysql$attachmentsql$updatedate 

modification.

If you want to update the "lasterposter" field (e.g. if the original poster is not the editor) then replace
PHP Code:

$DB_site->query("UPDATE thread SET lastpost='".time()."' WHERE ... 

by
PHP Code:

$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 08:42 AM

nice hack

Thanks Boofo

Boofo 05-17-2003 10: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 10:44 AM

Quote:

Today at 04:18 AM AndrewD said this in Post #31
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
PHP Code:

$editedbysql$attachmentsql$updatedate 

modification.

If you want to update the "lasterposter" field (e.g. if the original poster is not the editor) then replace
PHP Code:

$DB_site->query("UPDATE thread SET lastpost='".time()."' WHERE ... 

by
PHP Code:

$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 11:15 AM

Boofo: Got it and replied. :)

Floris 05-18-2003 01:21 AM

Boofo does it again! Good work my friend.

Boofo 05-18-2003 01:36 AM

Quote:

Today at 10:21 PM xiphoid said this in Post #36
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 01: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 01:26 PM

I told you I would get it figured out for you. How's that for relentless? ;)


All times are GMT. The time now is 11:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03239 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (39)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete