vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Last Post Date (https://vborg.vbsupport.ru/showthread.php?t=96167)

theArchitect 09-13-2005 04:28 AM

Last Post Date
 
I have a hack on my forum home page which displays the 10 most recent posts. But next to the "Go To Last Post Button" I want to display the date (like in the forum view which is below this list).

The code I am using to show the date and time of the last post in that thread is

Code:

$lastpostinfo[lastpostdate]
But for some reason nothing is being displayed.

Any thoughts as to what I am doing wrong would be appreciated.

Marco van Herwaarden 09-13-2005 06:17 AM

Maybe you should ask this in the thread of the hack you have installed. Maybe this info don't get queried from teh database. Difficult to give an answer without seeing the hack.

theArchitect 09-13-2005 06:44 AM

Quote:

Originally Posted by MarcoH64
Maybe you should ask this in the thread of the hack you have installed. Maybe this info don't get queried from teh database. Difficult to give an answer without seeing the hack.

Well, the problem is that it was a custom hack I paid for and I haven't heard from the original author for months now.

KirbyDE kindly ported it into 3.5.0 for me but I don't think he has the time to assist or I would not need to ask here.

Marco van Herwaarden 09-13-2005 06:46 AM

Well then you should at least post the hack here, and maybe someone will be so kind to look at it. But without seeing it, there is no chance someone can guess why it doesn't work, or what to changes to make it work.

theArchitect 09-13-2005 07:04 AM

Quote:

Originally Posted by MarcoH64
Well then you should at least post the hack here, and maybe someone will be so kind to look at it. But without seeing it, there is no chance someone can guess why it doesn't work, or what to changes to make it work.

Sure. There is one plug-in (but I am not sure if that is needed) and then the template modification which looks like this.

Code:

<tr>
        <td class="alt1Active" id="t$last[threadid]">
               
                <div>
                        <a

href="showthread.php?$session[sessionurl]t=$last[threadid]"><if condition="$shownewpost"><strong><font color="#ca0000"></if>$last[title]<if condition="$shownewpost"></font></strong></if></a>
                </div>
<div class="smallfont"><span style="float:$stylevar[right]">Forum: <a

href="forumdisplay.php?$session[sessionurl]f=$last[forumid]"

alt="$last[forumtitle]">$last[forumtitle]</a></span><span style="cursor:pointer"

onclick="window.open('member.php?$session[sessionurl]u=$last[postuserid]')">$last[postusername]</span>
</div>
               
        </td>
       

        <td class="alt2" title="<phrase 1="$last[replycount]" 2="$last[views]">$vbphrase[replies_x_views_y]</phrase>">
                <div class="smallfont" style="text-align:$stylevar[right]; white-space:nowrap">
                <div><phrase 1="member.php?find=lastposter&amp;t=$last[threadid]" 2="$last[lastposter]">$vbphrase[by_x]</phrase></div> $last[lastpost]&nbsp<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$last[threadid]" title="<phrase 1="$last[title]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="<phrase  1="$last[title]">$vbphrase[go_first_unread_in_thread_x]</phrase>" border="0" /></a>

                </div>

        </td>
       
                <td class="alt1" align="center">
$last[replycount]
</td>
                <td class="alt2" align="center">$last[views]</td>

</tr>

I am assuming that the $last[lastpost] is what should draw the date and time of the last post from the DB.

Do you need any other info?

Marco van Herwaarden 09-13-2005 07:06 AM

:D

You should have posted the plugin, not the template. Not much we can see from that.

Logikos 09-13-2005 07:08 AM

Quote:

Originally Posted by MarcoH64
:D

You should have posted the plugin, not the template. Not much we can see from that.

I was just thinking where is the plugin... :p

theArchitect 09-13-2005 07:29 AM

1 Attachment(s)
Quote:

Originally Posted by Live Wire
I was just thinking where is the plugin... :p

Sorry guys. Here you go.

Logikos 09-13-2005 07:34 AM

So you just want the date and time of the lastpost?

theArchitect 09-13-2005 07:41 AM

Quote:

Originally Posted by Live Wire
So you just want the date and time of the lastpost?

Please.

Paul M 09-13-2005 07:42 AM

What date is $last['lastpost'] ?

(This is the code from the plugin)

Code:

$last['lastpost'] = vbdate($vboptions['dateformat'], $last['lastpost'], true);

theArchitect 09-13-2005 07:45 AM

Quote:

Originally Posted by Paul M
What date is $last['lastpost'] ?

(This is the code from the plugin)

Code:

$last['lastpost'] = vbdate($vboptions['dateformat'], $last['lastpost'], true);

I am not sure. It was the template info that I was told to use along with the plug-in.

Paul M 09-13-2005 07:47 AM

Okay, let me rephrase - have you tried using $last[lastpost] as it would seem to suggest it is what you want.

theArchitect 09-13-2005 07:52 AM

Quote:

Originally Posted by Paul M
Okay, let me rephrase - have you tried using $last[lastpost] as it would seem to suggest it is what you want.

Sorry, my mis-understanding.

If you check the template code I quoted above I am currently using this, but nothing is displaying.

Code:

<div><phrase 1="member.php?find=lastposter&amp;t=$last[threadid]" 2="$last[lastposter]">$vbphrase[by_x]</phrase></div> $last[lastpost]&nbsp<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$last[threadid]" title="<phrase 1="$last[title]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="<phrase  1="$last[title]">$vbphrase[go_first_unread_in_thread_x]</phrase>" border="0" /></a>
This code should display who posted, the date/time and the Go To Last Unread post button. It does everything except the date and time.

Boofo 09-13-2005 08:02 AM

In the plug-in, try changing this line:

PHP Code:

 $last['lastpost'] = vbdate($vboptions['dateformat'], $last['lastpost'], true); 

to this:

PHP Code:

 $last['lastpost'] = vbdate($vbulletin->options['dateformat'], $last['lastpost'], true); 

and see if that helps at all.

Logikos 09-13-2005 08:09 AM

good eye booboo, I didn't even notice that... I guess 3.0 is still stuck in my physie

Boofo 09-13-2005 08:12 AM

Lucky guess is all, as with most of my coding. ;)

theArchitect 09-13-2005 08:27 AM

1 Attachment(s)
Many thanks kind Sir. That has got the date displaying.

However, the time is not next to the date, as in the forum view. Any chance of stretching a favour and asking how I correct this?

You will see from the screen shots what I mean. The first is the view in the Top 10 list, but the second is taken from the forum view and is how I would like it to look.

Boofo 09-13-2005 08:29 AM

Quote:

Originally Posted by theArchitect
Many thanks kind Sir. That has got the date displaying.

However, the time is not next to the date, as in the forum view. Any chance of stretching a favour and asking how I correct this?

You will see from the screen shots what I mean. The first is the view in the Top 10 list, but the second is taken from the forum view and is how I would like it to look.

Just do a nowrap in the template for that line. ;)

Logikos 09-13-2005 08:34 AM

Change that new code BooBoo gave you which was:

PHP Code:

$last['lastpost'] = vbdate($vbulletin->options['dateformat'], $last['lastpost'], true); 

To this:
PHP Code:

$last['lastpost_date'] = vbdate($vbulletin->options['dateformat'], $last['lastpost'], true);  
$last['lastpost_time'] = vbdate($vbulletin->options['timeformat'], $last['lastpost'], true); 

Then you can use $last[lastpost_date] for the date, and $last[lastpost_time] for the time in your template... :)

Boofo 09-13-2005 08:43 AM

You don't use true in the time line, do you? You meant this I take it? ;)

PHP Code:

$last['lastpost_date'] = vbdate($vbulletin->options['dateformat'], $last['lastpost'], true);   
$last['lastpost_time'] = vbdate($vbulletin->options['timeformat'], $last['lastpost']); 

I guess I misunderstood his question. :(

theArchitect 09-13-2005 08:53 AM

Quote:

Originally Posted by Boofo
You don't use true in the time line, do you? You meant this I take it? ;)

PHP Code:

$last['lastpost_date'] = vbdate($vbulletin->options['dateformat'], $last['lastpost'], true);   
$last['lastpost_time'] = vbdate($vbulletin->options['timeformat'], $last['lastpost']); 

I guess I misunderstood his question. :(

Many thanks. That has got the time to display, but it seems to have broken the date as it now looks like this

1126602934 07:15 PM

I think this is the Linux time stamp that is being shown.

<edit>

Scratch that. I haden't changed the date code so it still read $last[lastpost] rather than $last[lastpost_date].

Many thanks for your assistance. You have been a great help.

Boofo 09-13-2005 08:58 AM

I thought that might be it. No problem. ;)

Paul M 09-13-2005 03:48 PM

Quote:

Originally Posted by Live Wire
good eye booboo, I didn't even notice that...

Doh, me neither ..... I was ready for bed (that's my excuse anyway ;)).

Well spotted that man.


All times are GMT. The time now is 07:40 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
  • Page Generation 0.01334 seconds
  • Memory Usage 1,795KB
  • 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
  • (5)bbcode_code_printable
  • (6)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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