Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.
Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

Stats

  • *Total Members: 4319
  • *Latest: thygrim

  • *Total Posts: 15781
  • *Total Topics: 2384
  • *Online Today: 4
  • *Most Online: 157
(27.08.09, 03:54:53)
  • *Users: 0
  • *Guests: 2
  • *Total: 2

Author Topic: Recent posts using more space  (Read 3605 times)

0 Members and 0 Guests are viewing this topic.

Offline mack

  • Newbie
  • *
  • Posts: 18
    • Game-Bank
Recent posts using more space
« on: 14.10.11, 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)

Offline b4pjoe

  • PortaMx Supporter
  • *
  • Posts: 301
  • Gender: Male
    • B4Print
Re: Recent posts using more space
« Reply #1 on: 14.10.11, 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.

Offline mack

  • Newbie
  • *
  • Posts: 18
    • Game-Bank
Re: Recent posts using more space
« Reply #2 on: 14.10.11, 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).

Offline mack

  • Newbie
  • *
  • Posts: 18
    • Game-Bank
Re: Recent posts using more space
« Reply #3 on: 20.11.11, 05:23:58 »
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)

Offline b4pjoe

  • PortaMx Supporter
  • *
  • Posts: 301
  • Gender: Male
    • B4Print
Re: Recent posts using more space
« Reply #4 on: 21.11.11, 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

Offline mack

  • Newbie
  • *
  • Posts: 18
    • Game-Bank
Re: Recent posts using more space
« Reply #5 on: 21.11.11, 22:59:32 »
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!

Offline b4pjoe

  • PortaMx Supporter
  • *
  • Posts: 301
  • Gender: Male
    • B4Print
Re: Recent posts using more space
« Reply #6 on: 22.11.11, 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.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5586
  • Gender: Female
Re: Recent posts using more space
« Reply #7 on: 22.11.11, 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.