News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SSI Archives

Started by LampArtPro, December 13, 2009, 08:27:41 PM

Previous topic - Next topic

LampArtPro

I got a lot of my forum working thanks to the many people on this site. But I still have a few questions.

First, I have an archive I'm trying to make, where it'll show all the posts on a certain board using ssi_boardnews. I removed the Icon because that's not needed, and I also removed the date. All I have is the subject, and a little preview of the text.

What I want is for the subject of the post to be a link to the topic. So if the archive says
"Latest News:
Blah blah blah blah blah"
That Latest news will be a link to the topic "Latest News" in the forum.

Kays

Have you tried using $news['link'] ?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

LampArtPro

Yes, that gives me a thing saying "# Comments" as a link. Which technically is a link to the page. But I don't want to confuse users.

JBlaze

$news['subject']['href'] or ['link']
Jason Clemons
Former Team Member 2009 - 2012

Kays

Quote from: LampArtPro on December 13, 2009, 09:18:02 PM
Yes, that gives me a thing saying "# Comments" as a link. Which technically is a link to the page. But I don't want to confuse users.

I forgot about that extra garbage there. Use href as JBlaze suggested.

<a href="', $news['href'], '">', $news['subject'], '</a>

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

LampArtPro

$news['subject']['href'] ---replaces the subject with the number "1"
<a href="', $news['href'], '">', $news['subject'], '</a> ----comes back with a script error and the page displays nothing.

Owdy

I use this:

<?php 
$array 
ssi_boardNews(19.04null285'array');
foreach (
$array as $news)
{
echo '

<div>

<div class="news_header"><a href="'
$news['href'], '"><b>'$news['subject'], '</b></a> </div>
<div class="news_body">'
$news['body'], ' &nbsp;<a style="font-style:italic;text-decoration:underline;font-size:smaller" href="'$news['href'], '">Read more...</a></div>

</div>
'
;

}
?>


19.0 is board ID, 4 topics, 285 characters

Demo http://hoitajat.net/ -> Ajankohtaista
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Owdy

Quote from: LampArtPro on December 13, 2009, 11:32:41 PM
$news['subject']['href'] ---replaces the subject with the number "1"
<a href="', $news['href'], '">', $news['subject'], '</a> ----comes back with a script error and the page displays nothing.
Remember include SSi.php
http://www.simplemachines.org/community/index.php?topic=14906.0
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

LampArtPro

THANKS! That worked, one more question. Is there a way to include the signature of the person posting?

Advertisement: