View Full Version : Display threads creation date
VBDev
04-24-2004, 10:00 PM
Display thread's creation date
Total hack's description : http://www.vbulletindev.net/forums/hacks_root.php?do=aff_hack&hackid=69
Please click https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=64378) if you like this hack
I've created this hack, and I saw then that it was already done here, but with my hack, you can display the date from the searcH.php and it adds a new column :nervous:
With this small hack, you'll add the thread's creation date in the forumdisplay (and search results)
VBDev
04-25-2004, 09:09 PM
I can't post .gif attachment :(
The page load stops at 39% :disappointed:
here is an exemple :
http://www.vbulletindev.net/forums/forumdisplay.php?f=46
with the style 760
Gio Takahashi
04-25-2004, 11:25 PM
Not too shabby. I'll install this.
FleaBag
04-26-2004, 12:50 PM
Nice - I'll be switching to this one from the other.
VBDev
04-26-2004, 03:05 PM
Zip updated, the first mod to do is not in the showthread.php but in forumdisplay.php
Tarion
04-26-2004, 04:44 PM
Zip updated, the first mod to do is not in the showthread.php but in forumdisplay.php
THX for this nice Hack
*installed*
but basicly same here: https://vborg.vbsupport.ru/showthread.php?t=63791
Do you have options to show it in serach results?
VBDev
04-26-2004, 10:08 PM
but basicly same here: https://vborg.vbsupport.ru/showthread.php?t=63791
Do you have options to show it in serach results?
Am I obliged to answer this ?
Do you know reading ?
Snapperhaed
04-29-2004, 02:31 AM
The mod for search.php you state to find xxxx ...
That doesnt exist for v3.0.1 ... Mines much different.
sorry.. missed it first time ;) good one so ;)
Isotope
06-01-2004, 09:09 PM
Hi! Quick question...
I want to have the Creation Date column come AFTER the "Last Post" column, not before.
How do I do this?
Isotope
06-01-2004, 09:40 PM
Hi! Quick question...
I want to have the Creation Date column come AFTER the "Last Post" column, not before.
How do I do this?
I just wrestled this, and figured it out. :)
But now, I have one other question - the "Date of Creation" column that's added is the only column you can't sort by. What do I have to change in order to make this column sortable?
lazytown
06-19-2004, 09:18 AM
How about adding this to the "Similar Threads" feature? Also, does this work with 3.01?
dniMTheory
07-03-2004, 11:51 PM
Would be great if you can sort from oldest to newest or newest to oldest
Andreas
07-04-2004, 12:59 AM
Nice one, although I wrote that myself about half a year ago (with ability to sort by thread creation date) ;)
Adding sorting should be fairly straightforward:
In Template FORUMDISPLAY
REPLACE
<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[date_creation]</a></span></td>
WITH
<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&order=asc&sort=threadstarted">$vbphrase[date_creation]</a> $sortarrow[threadstarted]</span></td>
In forumdisplay.php FIND
case 'postusername':
$sqlsortfield = $sortfield;
break;
BELOW that ADD
case 'threadstarted':
$sqlsortfield = 'thread.dateline';
break;
That's it (at least if I remeber correctly).
Ocean
07-05-2004, 08:23 PM
vBDev, with vBulletin 3.0.3, some of the code has changed - especially in the ThreadBit Template.
Is there any chance you can update this hack for vB 3.0.3?
Thanks! :)
dookie
07-06-2004, 06:15 PM
Works fine @ 3.0.3
What changes in threadbit do you mean?
There are no changes in threadbit. :surprised:
Ocean
07-06-2004, 07:20 PM
Works fine @ 3.0.3
What changes in threadbit do you mean?
There are no changes in threadbit. :surprised:
http://www.vbulletin.com/forum/showpost.php?p=696714&postcount=2
The threadbit has changed with 3.0.2. In order to make sure that there are no conflicts/problems, I was hoping that the hack code could be brought up to date.
Ocean
07-14-2004, 09:52 PM
There are a number of issues that need to be dealt with, for this hack.
1. The "Threadbit" template has changed between 3.0.0 and 3.0.3, but VBDev has not yet updated his code to reflect that.
2. This hack does not support the Subscribed Threads section in your UserCP.
3. This hack causes problems with the Subscribed Threads section of the UserCP. An additional empty column is created, where the Thread Creation Date should have been - if it were supported - but that throws off the synchronization between column headers and data.
Since VBDev no longer seems to be responding to this Thread, nor is he responding on his home forum, I've updated this hack to correct the issues listed above, and to add support for Thread Subscriptions - if anyone is interested.
I've listed it as a Revised Version 1.2. Use it if you like.
If you want to use it, however, and you've already installed the original 1.0 version - I suggest that you replace the end section of the "Threadbit" template with the Default code before applying that portion of my revision.
I made my instructions so that they interfered as little as possible with the original code. Personally, I dislike hacks that say "find this entire huge section, and *replace* it with this one", when they could have just specified the few lines that needed to be changed.
If you guys use this revised version, let me know if it works well for you. :)
Version 1.3 Update
I took KirbyDE's code suggestions and integrated/modified them. Now, you can sort by Creation Date in both ForumDisplay, as well as Subscribed Threads. :)
Version 1.31 Update
I added the Sort by Creation Date option to the ForumDisplay "Display Options" menu.
Upgrade Instructions:
Upgrade from v1.2 to 1.3:
1. Open the ForumDisplay Template and Find:
<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[date_creation]</a></span></td>
2. Replace the above code with:
<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&order=asc&sort=threadstarted">$vbphrase[date_creation]</a> $sortarrow[threadstarted]</span></td>
3. Repeat steps 1 and 2 for the SUBSCRIBE Template.
4. Open the ForumDisplay.php file and Find:
case 'postusername':
$sqlsortfield = $sortfield;
break;
5. Below, Add:
case 'threadstarted':
$sqlsortfield = 'thread.dateline';
break;
6. Repeat steps 4 and 5 for Subscription.php
Upgrade from v1.3 to 1.31:
In the ForumDisplay Template, Find:
<option value="lastpost" $sort[lastpost]>$vbphrase[last_post_time]</option>
Below, Add:
<option value="threadstarted" $sort[threadstarted]>$vbphrase[date_creation]</option>
And you're done!
snake-boy
07-19-2004, 03:06 PM
Hi,
Everything looking good, I hit a snag right at the start:
<td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&order=desc&sort=lastpost">$vbphrase[last_post]</a> $sortarrow[lastpost]</span></td>
This line does not exist in my forumdisplay.php? (V3.0.3) Am I just crazy?
-snake :)
Ocean
07-19-2004, 04:17 PM
Hi,
Everything looking good, I hit a snag right at the start:
This line does not exist in my forumdisplay.php? (V3.0.3) Am I just crazy?
-snake :)
If you check the instructions, you will see that that line is found in the ForumDisplay Template, not the PHP file. :)
snake-boy
07-19-2004, 06:13 PM
Doh! :) Sorry, I opened my eyes and followed the instructions, and everything went fine (installation-wise), but now I have a problem:
The sort creation date column is there, but I should mention that column "Date of Creation", although it is there, it is not clickable. And in the dropdown options "Sort By", I don't have an option to sort by Creation Date?
Threads still appear to be sorted by most-recently-replied to.
Update: I just went through all the changes I made to make sure I didn't miss something, and everything's there.
Do I need to rebuild something or enable this feature in the admincp somewhere before it becomes active? Your advise would be greatly appreciated to acomplish this.
-snake
turbidblue
07-19-2004, 07:08 PM
thanks ocean, yours worked great!
;)
snake-boy
07-19-2004, 07:20 PM
thanks ocean, yours worked great!
;)
Are you running 3.0.3? Is your "date of creation" column clickable? Do you have the option to sort by date of creation from the dropdown?
-snake
turbidblue
07-19-2004, 11:02 PM
actually no, i didnt know it was supposed to do that, i wouldnt want it to do that anyway..
yes i am on 3.0.3
:)
snake-boy
07-20-2004, 12:06 AM
Ocean - I guess maybe I missed the point? Does your hack allow sorting by thread creation date or not? If not, then I guess it is working correctly, (my misunderstanding), but I would like to ask if you could give us the code that will allow sorting by this new column. (newest to oldest preferrably)?
I know frighfully little about php, but surely this can't be too hard to do now that there is a field that can be sorted?
I'd really appreciate it if you could add this feature to this mod?
-snake
Natch
07-20-2004, 12:01 PM
KirbyDE's instructions work to sort by Creation Date - follow those after using Ocean's code and you should be apples ...
This is of course dependant on whether you want to be apples ...
Ocean
07-20-2004, 01:09 PM
Ocean - I guess maybe I missed the point? Does your hack allow sorting by thread creation date or not? If not, then I guess it is working correctly, (my misunderstanding), but I would like to ask if you could give us the code that will allow sorting by this new column. (newest to oldest preferrably)?
I know frighfully little about php, but surely this can't be too hard to do now that there is a field that can be sorted?
I'd really appreciate it if you could add this feature to this mod?
-snake
That was one improvement I had not gotten around to testing. The changelog in my post and the Instructions lists the new features/fixes that I put in.
Even without the sorting (which I will hopefully add to my instructions soon), it's still worth using over VBDev's, because of all of the other improvements.
But I'll try to update my instructions soon to add Sorting. :)
Ocean
07-20-2004, 01:41 PM
I have revised my instructions (which are now Version 1.3).
I added KirbyDE's code modifications so that you can sort by Thread Creation Date on ForumDisplay. However, I did some further modification so that you can also sort by Creation Date for Thread Subscriptions as well. :)
Thanks, KirbyDE!
snake-boy
07-20-2004, 03:25 PM
Thanks a mil for this! I have just downloaded this, but as I already made the V1.2 changes, I'm not sure which parts are 'new'.
Would it be possible to have a 'diff' of the two versions so that I can upgrade the code to allow the sorting, or must I go through it all again going over the changes I previously made?
Thanks again for this long awaited mod :)
-snake
Edit: Oh, and how do I make this the default sort order?
Ocean
07-20-2004, 03:40 PM
Thanks a mil for this! I have just downloaded this, but as I already made the V1.2 changes, I'm not sure which parts are 'new'.
Would it be possible to have a 'diff' of the two versions so that I can upgrade the code to allow the sorting, or must I go through it all again going over the changes I previously made?
Thanks again for this long awaited mod :)
-snake
I've updated my original post with upgrade instructions. :)
snake-boy
07-20-2004, 06:20 PM
Ocean - thank you! :)
I only have two questions:
- How do I make this the default order for all forums?
- Only the column's heading is clickable to select this. In the dropdown for "Sorted by", should there also be an option for "Date of Creation"?
I only have the (usual) options from the dropdown:
Thread Title
Last Post Time
Number of Replies
Number of Views
Thread Starter
Thread Rating
-snake
Ocean
07-20-2004, 06:58 PM
Ocean - thank you! :)
I only have two questions:
- How do I make this the default order for all forums?
- Only the column's heading is clickable to select this. In the dropdown for "Sorted by", should there also be an option for "Date of Creation"?
1. I'm not sure, at the moment, how to set anything other than Last Post Date as the default order, as I have never needed to change this myself. I'm sure someone else here can pipe in, or you can post a quick question on vBulletin.com.
2. Oops! I never use that, so it just slipped right past me. I've revised my original post. We're now up to v1.31. I have upgrade instructions from 1.3 to 1.31 at the bottom of that post.
:)
snake-boy
07-20-2004, 09:44 PM
2. Oops! I never use that, so it just slipped right past me. I've revised my original post. We're now up to v1.31. I have upgrade instructions from 1.3 to 1.31 at the bottom of that post
:) I applied the new settings, and it's working just fine.
The ONLY item I still have on my wishlist is to be able to set this as the default sort order for all forums. (On a per-forum would be better, but I'd settle for a global setting.)
Now, if anyone out there can advise on how to acomplish this, I think this mod can be classified as 100% perfect for my needs.
I'd appreciate any input on this, perhaps if someone could supply the code, it could be added to the mod in a final revision?
Anyone?
-snake
PS - Thanks once again to Ocean and KirbyDE for helping me implement the most requested change of all time to my forums. :)
crabacus
07-20-2004, 11:28 PM
really good mod here, thanks.
what do you suggest if i want to setup a few of my forums to sort this way by default? not the entire forums, just certain ones.
thanks again, good mod.
Andreas
07-20-2004, 11:45 PM
The ONLY item I still have on my wishlist is to be able to set this as the default sort order for all forums. (On a per-forum would be better, but I'd settle for a global setting.)
Global (this is for formumdisplay only) is simple:
In forumdisplay.php FIND
default:
$sqlsortfield = 'lastpost';
$sortfield = 'lastpost';
REPLACE that with
default:
$sqlsortfield = 'thread.dateline';
$sortfield = 'threadstarted';
Instructions on how to do this on a per-forum basis will follow.
snake-boy
07-21-2004, 01:05 AM
My wish is complete! :-)
Just made the change to sort like this globally, and it's working 100% perfectly. I cannot express enough thanks for this mod. It's great to finally get this feature working (that I feel should be part of the default vb choices, but that's a separate issue).
Thank you very much for your help. It is really appreciated.
-snake - one happy camper! :-)
Andreas
07-21-2004, 01:13 AM
So here is a solution for doing this on a per-forum basis.
You can select a global default sort field
For each forum you can specify a default sort field. If this is not specified it will use the global default instead
@Ocean
Feel free to include this too if you want.
@snake-boy
If you want to use this instead, undo the previous change first.
snake-boy
07-21-2004, 02:30 AM
Although I am 100% satisfied with the results as I have them right now, I would be interrested to hear if it is possible with vBulletin to have the sort method be selectable on a per-user basis in his/her profile settings?
It does seem reasonable to me that users may wish to set a sort order that THEY want.
I don't know enough about the internal workings of vBulletin to know if this is viable to consider? If so, perhaps a feature request or a mod? Is this do-able and if so, is it a major undertaking?
-snake (still a very happy camper ;)
Andreas
07-21-2004, 02:34 AM
This is pretty easy. I'll post smth. tomorrow :)
snake-boy
07-21-2004, 03:22 AM
WoW! - that's all I can say about that. If this could be done, it would be REALLY awesome.
Many thanks for all your help here. I'll b back tomorro :)
-snake
crabacus
07-22-2004, 12:42 AM
1. Create the following option in Forum Display options:
Where do I find the Forum Display options?
turbidblue
08-14-2004, 12:42 AM
thank you!
;)
* turbidblue clicks install
lazytown
08-15-2004, 07:07 AM
It would be *VERY* helpful if vbulletin.org used this mod!
Blam Forumz
08-15-2004, 07:42 AM
No it wouldnt...
Ocean
08-30-2004, 04:48 PM
For those of you who prefer my revised version of this hack, I have posted it in a seperate thread - so that I can continue to support and develop it in its own seperate environment.
If you're interested, the URL is here:
https://vborg.vbsupport.ru/showthread.php?t=68878
Come on by and say hi! (Or, you could come on by just to click the Install button... :) )
ambumann
11-21-2004, 07:13 PM
Just installed a kind of "light" version of this based on Ocean's update.
I didn't want/couldn't afford an extra column in my layout, so I just added the start/creation date next to the thread starters name (see attachment). Same file mods, just different template mods.
:)
Could you post your specific mods here? Really liked your solution, and haven't got any space for an extra column.
CyberSlash69
02-28-2005, 10:26 PM
I just added this hack, here's my code:
<tr>
<td class="alt1"><img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" /></td>
<if condition="$show['threadicons']">
<td class="alt2"><if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else /> </if></td>
</if>
<td class="alt1Active" id="t$thread[threadid]" title="$thread[preview]">
<div>
<span style="float:$stylevar[right]">
<if condition="$show['paperclip']"><img class="inlineimg" src="$stylevar[imgdir_misc]/paperclip.gif" alt="<phrase 1="$thread[attach]">$vbphrase[x_attachments]</phrase>" /></if>
<if condition="$show['subscribed']"><img class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" alt="$vbphrase[you_are_subscribed_to_this_thread]" /></if>
<if condition="$show['sticky']"><img class="inlineimg" src="$stylevar[imgdir_misc]/sticky.gif" alt="$vbphrase[sticky_thread]" /></if>
</span>
<if condition="$show['gotonewpost']"><a href="showthread.php?$session[sessionurl]goto=newpost&t=$thread[threadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a></if>
$thread[movedprefix]
$thread[typeprefix]
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]"><if condition="$show['gotonewpost']"><strong>$thread[threadtitle]</strong><else />$thread[threadtitle]</if></a>
<if condition="$thread['pagenav']"><span class="smallfont" style="white-space:nowrap">( <img class="inlineimg" src="$stylevar[imgdir_misc]/multipage.gif" alt="$vbphrase[multipage_thread]" border="0" /> $thread[pagenav] <if condition="$show[pagenavmore]">... <a href="showthread.php?$session[sessionurl]t=$thread[threadid]&goto=lastpost$thread[highlight]">$vbphrase[last_page]</a></if> )</span></if>
</div>
<div class="smallfont">
<if condition="$show['threadratings'] AND $show['threadrating']"><span style="float:$stylevar[right]"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" border="0" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span></if>
<if condition="$show['guestuser']">
$thread[postusername]
<else />
<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername]</span>
</if>
</div>
<if condition="$show['unsubscribe']">
<div class="smallfont">
<a href="newreply.php?$session[sessionurl]do=newreply&t=$thread[threadid]">$vbphrase[reply]</a> |
<a href="subscription.php?$session[sessionurl]do=removesubscription&return=ucp&t=$thread[threadid]">$vbphrase[unsubscribe]</a>
</div>
</if>
</td>
<if condition="$show['threadmoved']">
<td class="alt2" align="center">-</td>
<else />
<td class="alt2" align="center"><div class="smallfont" style="text-align:$stylevar[center]; white-space:nowrap">$thread_dateline</div></font></td>
<td class="alt1" title="<phrase 1="$thread[replycount]" 2="$thread[views]">$vbphrase[replies_x_views_y]</phrase>">
<div class="smallfont" style="text-align:$stylevar[right]; white-space:nowrap">
$thread[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$thread[lastposttime]</span></if><br />
<phrase 1="member.php?find=lastposter&t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase> <a href="showthread.php?$session[sessionurl]goto=lastpost&t=$thread[threadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</td>
<if condition="$show['notificationtype']">
<td class="alt2"><div class="smallfont" align="$stylevar[right]">
<label for="sub$subscribethread[$threadid]">$thread[notification]<input type="checkbox" name="deletebox[$subscribethread[$threadid]]" id="sub$subscribethread[$threadid]" value="yes" /></label>
<input type="hidden" name="oldemailupdate[$subscribethread[$threadid]]" id="oe_$subscribethread[$threadid]" value="$emailupdate[$threadid]" />
</div></td>
<else />
<td class="alt2" align="center"><a href="#" onclick="who($thread[threadid]); return false;">$thread[replycount]</a></td>
<td class="alt1" align="center">$thread[views]</td>
<if condition="$show['forumlink']">
<td class="alt2"><a href="forumdisplay.php?$session[sessionurl]f=$thread[forumid]">$thread[forumtitle]</a></td>
</if>
</if>
</tr>
***************************
I am getting this error:
The following error occurred when attempting to evaluate this template:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/lokweb/public_html/includes/adminfunctions_template.php(3096) : eval()'d code on line 39
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
When I try to save it.
I am running VB 3.0.7
Any idea's?
CyberSlash69
02-28-2005, 11:23 PM
Nevermind.. I fixed.. and went to the newer version by ocean.. thanks.. very nice. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.