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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

"recent topics" in SMF style

Started by Lesmond, August 17, 2005, 12:01:38 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

RoarinRow

Quote from: Techdomain on July 19, 2006, 06:31:40 AM
try adding:


<td class="windowbg2" valign="middle" width="10%">
                                                ', $topic['replies']['link'], '
                                        </td>
<td class="windowbg2" valign="middle" width="10%">
                                                ', $topic['views']['link'], '
                                        </td>

in there. you may have to fiddle with the percents, and possibly find out what the function calls for replies and views actually are (though logic tells me they would be called just that)

I'll give it a try, thanks!

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

RoarinRow

That didn't work unfortunately.  But I took what I had and put in your recommendations.  Anyone know how I can make this work?

// "Recent Topics" a php Block
// Prefered settings when being designed
// Border and title on
// Title ="Recent Topics"

global $scripturl;
$what=ssi_recentTopics('35', NULL, 'array');

echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3">
      <td valign="middle">Subject</td>
      <td valign="middle">Board</td>
      <td valign="middle">Poster</td>
      <td valign="middle">Replies</td>
      <td valign="middle">Views</td>
      <td valign="middle">Time</td></tr>';

foreach ($what as $topic)
  {
    echo '<tr><td class="windowbg" valign="middle">', $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" >', $topic['board']['link'], '</td>';
      echo '</td><td class="windowbg2" valign="middle" >', $topic['poster']['link'], '</td>;
      echo '</td><td class="windowbg2" valign="middle" >', $topic['replies']['link'], '</td>';
      echo '</td><td class="windowbg2" valign="middle" >', $topic['views']['link'], '</td><td class="windowbg2" valign="middle" >';
      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>';



This is what I have right now:

// "Recent Topics" a php Block
// Prefered settings when being designed
// Border and title on
// Title ="Recent Topics"

global $scripturl;
$what=ssi_recentTopics('25', NULL, 'array');

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

foreach ($what as $topic)
  {
    echo '<tr><td class="windowbg" valign="middle">', $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" >', $topic['board']['link'], '</td>';
      echo '</td><td class="windowbg2" valign="middle" >', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" >';
      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>';

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

k_4_kelly

Very nice code!  :up:

however, could you please tell me how could I move 'recent topics' block below the articles?   Just like this:
http://www.samsungcommunity.net/index.php?PHPSESSID=5231c4aa4ad86fbc587e9dd3d108019a;

thanks x 10000000 :)

akulion

create a PHP Center block under your TP admin 'Block Settings"

And then simply position it below the articles using the position boxes

Techdomain


akulion

u mean u dont have those with the cool flashing ajax java and flashing lights?

lol

I meant those little boxes in which you put the number for where to display a particular block

But I got mixed up with articles and blocks there ... sorry about that


Techdomain

ah... ok. thought there was something I was missing!

k_4_kelly

there's no an option for show 'Both Articles and Frontpage Blocks' in the general setting/frontpage/What to show on frontpage panel.

currently, my 'recent topics' block is in a PHP centre block, and it appear above the articles in the frontpage, i would like to move it under the articles not above. :(

Could anyone tell me how to do it?

thanks!!!!

technodragon73

I believe that option is what is in the next release of TP...you'll just have to wait.

k_4_kelly

hello..
thanks for your reply
do you have any idea about how could this person able to move the 'recent topic' block under the articles?

http://www.samsungcommunity.net/index.php?PHPSESSID=5231c4aa4ad86fbc587e9dd3d108019a;

thanks!

This website is proudly hosted on Crocweb Cloud Website Hosting.