To use this website completely, it is necessary to store cookies on your computer.
 

* Statistic

  • *Total Posts: 16418
  • *Total Topics: 2549
  • *Online Today: 8
  • *Most Online: 292
(2016 November 12, 09:37:31)
  • *Users: 0
  • *Guests: 0
  • *Spiders: 4
  • *Total: 4

  • *Yahoo!
  • *Google (2)
  • *Baidu

Recent posts using more space

Started by mack, 2011 October 14, 16:10:52

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

mack

2011 October 14, 16:10:52
Hi there.

I'm looking for a slightly altered version of the recent posts block. Currently if I put a recent posts block in the 'header' section the details for each post appear on diffferent lines - this makes a HUGE block if I add even 5 recent posts to it, which isn't really what I want.

What I would like is for it to be displayed like this, all on ONE line ..

name of post > person's name who posted it > forum the post is in > date/time

If you look at my site you can see that I have plenty of space in the block currently called 'Follow us' to use, and spreading recent posts over 3 lines would make that block unnecessarily big.

I'm sure it's quite an easy bit of php .. but I'm a little rusty and could use a pointer or two!

Thanks in advance  8)

b4pjoe

#1
2011 October 14, 18:19:50
You can make it a php block and use this:

Code Select
ssi_recentTopics(15);

or

Code Select
ssi_recentPosts(15);

Change 15 to how many recent posts you want.

mack

#2
2011 October 14, 18:50:21
Ah ok .. I'll check once I get a slightly bigger problem sorted on my site hehe. Thanks for the reply, I'll get back to you with the result fairly soon (hopefully).

mack

#3
2011 November 20, 05:23:58
Quote from: b4pjoe ,  2011 October 14, 18:19:50
You can make it a php block and use this:

Code Select
ssi_recentTopics(15);

or

Code Select
ssi_recentPosts(15);

Change 15 to how many recent posts you want.


Sorry for the delay in replying properly .. I've been a bit busy.

I've put the code in and it looks quite good. However, I want to change some aspects. Putting it simply it currently displays the following on one line ..

{forum name}  {full post title}  {poster's name}  {full date and time}

This is great etc .. but I'd like to shorten the date to DD/MM/YYYY and leave off the 'AM' or 'PM' from the time, seeing as my forum default uses a 24hr clock. I would like to remove poster's name too. Also, is there a way to limit the number of characters displayed in the post name for when it appears in this block?

The main reason why I want to shorten each line a little is its position in my site's blocks (and how it might effect the design), and also for when the 'new' icon appears which sometimes forces a new line, making this block appear messy.

Any help would be awesome  8)

b4pjoe

#4
2011 November 21, 17:07:16
Take a look at the ssi examples in the SMF root folder of your forum.

Code Select
http://www.yourdomain.com/ssi_examples.php

Code Select
http://www.yourforumURL.com/ssi_examples.shtml

mack

#5
2011 November 21, 22:59:32
Quote from: b4pjoe ,  2011 November 21, 17:07:16
Take a look at the ssi examples in the SMF root folder of your forum.

Code Select
http://www.yourdomain.com/ssi_examples.php

Code Select
http://www.yourforumURL.com/ssi_examples.shtml


Will do, thanks!

b4pjoe

#6
2011 November 22, 03:43:40
In the ssi examples, if you click the link for Sample 1 you can see how they did the formatting to make it look different. Not sure if you could do that in a PortaMx block though.

feline

#7
2011 November 22, 18:39:14
The SSI function can return a array with a lot of data.
To see WHAT is returned in the array, you can use follow in a php block:
Code Select

echo PortaMx_Printvar(ssi_recentTopics(5, null, null, 'array'));
Many are stubborn in relation to the path, a few in relation to the target.