TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,983
  • Total Topics: 21,321
  • Online today: 431
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 84
  • Total: 84

Last post by?

Started by Asshandler, January 08, 2007, 05:20:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Asshandler

This is the code I'm using in my PHP block to show Recent Forum Activity in our forums.  How would I add "Last Post by..." to each listing as it is by default in the normal recent activity block?
$result=ssi_recentTopics(10,array(15),'return');

echo '<ul style="padding-left: 10px;">';
foreach($result as $my){
  echo '<Li>'.$my['link'];
  if(!$my['new'])
    echo ' <a href="'.$my['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';
echo ' <br />';
  echo ' ',$my['time'],'</Li>';
echo ' <hr>';
}
echo '</UL>';
echo'</center>';
echo '<span class="smalltext"></span>';


http://www.othersi.com

Lesmond

#1
this is the code I use, it will give you "Last post by" at the top of the poster column.
use in a Front page Block or center block.
global $scripturl;
$what=ssi_recentTopics('10', NULL, 'array');

echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3"><td valign="middle" align="left">Subject</td><td valign="middle" align="left">Board</td><td valign="middle" align="center">Last Post by</td><td valign="middle" align="left">Time</td></tr>';

foreach ($what as $topic)
  {
    echo '<tr><td class="windowbg" valign="middle" align="left">', $topic['link'];
    // Is this topic new? (assuming they are logged in!)
    if (!$topic['new'] && $context['user']['is_logged'])
      echo '<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
      echo '</td><td class="windowbg2" valign="middle" align="left">', $topic['board']['link'], '</td>';
      echo '</td><td class="windowbg2" valign="middle" align="left">', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" align="left">';
      if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
      echo '<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
      echo '<span class="smalltext">', $topic['time'], '</span></td></tr>';
  }

echo '</table>';

Asshandler

I don't want to change the table I have set up already, just would like to know what particular piece of code I'd need to add to my existing stuff to show the last post by info.

Crip

Asshandler --
I suggest you go change your [username] like Now!!

crip~
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



IchBin

Would be nice not to have vulgar words in usernames. We try to keep this site as family oriented as possible. Thanks!

As to your question:

I think you're looking for this code ', $topic['poster']['link'], '

Asshandler

I've used this username for years, came from playing online and dominating the opposition, one day a guy called me the Asshandler because of the way I handed people their butts on a platter when I faced off against them online.  It was funny because it was a typo, should have been Asshander.  Been my username ever since.  :p

Ichbin thanks for that snippet.  :)

Asshandler

Hmmm where exactly would that snippet of code fit in with the exisiting code?  Each place I attempt to insert it causes a parser error.

akulion

ooohh ok i thought u meant ass handler as in people who sell donkeys

no offence but its quite common word in my country an ass handler

so i didnt think twice of it at first

Asshandler

O.o I wasn't aware of the donkey meaning.  lol

IchBin

Post your code so we can see what you're doing. Can't tell you why you have an error if you don't do that.

This website is proudly hosted on Crocweb Cloud Website Hosting.