Advertisement:

Author Topic: Subject with Time  (Read 1149 times)

Offline pixeleyes

  • Jr. Member
  • **
  • Posts: 302
Subject with Time
« on: June 17, 2012, 10:14:18 AM »
I want to add post subject before page index

Subject is working fine but time is not showing.

Quote
   echo '
   <div class="topsub">
   ', $txt['topic'],  ':
   ', $context['subject'], '
   <p ', $topic['first_post']['member']['link'], ' ', $topic['first_post']['time'], '</p>
   </div>';

Can anyone correct it?

Offline Suki

  • Carthago delenda est
  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 15,936
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Subject with Time
« Reply #1 on: June 17, 2012, 10:54:29 AM »
Where exactly are you putting this code on? which page and on which part.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

Offline pixeleyes

  • Jr. Member
  • **
  • Posts: 302
Re: Subject with Time
« Reply #2 on: June 17, 2012, 11:12:30 AM »
I'm putting these codes on top of post page.

Right after red marked subject I want Poster name with time.

Offline Suki

  • Carthago delenda est
  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 15,936
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Subject with Time
« Reply #3 on: June 17, 2012, 06:09:28 PM »
Don't you mean Display.template?

On display.template.php $topic holds nothing mire than the topic ID,  is an int and not an array, meaning $topic['first_post']['member']['link'] will not exist.

If you want info about the first message then you will need to do a query like this mod does: http://custom.simplemachines.org/mods/index.php?mod=1472
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.