Advertisement:

Author Topic: SSI Topic and Replies  (Read 78355 times)

Offline AmaZulu

  • Semi-Newbie
  • *
  • Posts: 80
Re: SSI Topic and Replies
« Reply #20 on: June 26, 2007, 01:20:59 PM »
Firstly I'd just like to thank you for this mod, I am using it to good effect on a couple of my sites.

Secondly, I think I have found a bug or something that I am unable to fix (I'm still very new to PHP). If you go here: http://www.thephotojournals.com/GeoffCronje/SeaPhoenix_4.php you will see at the bottom of the page, where I am bringing in replies to the article from a linked forum topic that any replies by Guests have been given the name of the last guest to leave a comment.

Is there anyway to fix this? If its a mission I would be happy if it shows any posts by Guests simply as "by Guest" rather than the name they left.

Offline MPT.

  • Jr. Member
  • **
  • Posts: 226
Re: SSI Topic and Replies
« Reply #21 on: August 03, 2007, 02:04:09 PM »
How to use a Board as ID instead of a topic as ID?

Is that possible?

Offline MPT.

  • Jr. Member
  • **
  • Posts: 226
Re: SSI Topic and Replies
« Reply #22 on: August 06, 2007, 04:28:04 PM »
How to use a Board as ID instead of a topic as ID?

Is that possible?
Anyone, please? :(

Offline Flying Drupalist

  • Jr. Member
  • **
  • Posts: 294
    • http://www.miydai.com
Re: SSI Topic and Replies
« Reply #23 on: August 06, 2007, 07:49:04 PM »
You may use SSI boardnews which takes from boards...

Offline MPT.

  • Jr. Member
  • **
  • Posts: 226
Re: SSI Topic and Replies
« Reply #24 on: August 07, 2007, 04:18:27 PM »
But I want to show the replies too, that's the point..

Offline MPT.

  • Jr. Member
  • **
  • Posts: 226
Re: SSI Topic and Replies
« Reply #25 on: August 09, 2007, 10:43:40 AM »
*Buummpp..

How to use a Board as ID instead of a topic as ID?

Is that possible?

Offline aldo

  • Sophist Member
  • *****
  • Posts: 1,356
  • Gender: Male
Re: SSI Topic and Replies
« Reply #26 on: August 18, 2007, 12:34:52 AM »
This mod is very cool! You can make pages on your site editable and make your site seem very interactive
« Last Edit: August 18, 2007, 12:45:40 AM by aldo »

hoochie coochie man

  • Guest
Re: SSI Topic and Replies
« Reply #27 on: August 20, 2007, 12:20:43 PM »
is there any manuel install?  :(

Offline Wal-Mart Security

  • Full Member
  • ***
  • Posts: 550
  • Defender of Simplemachines
    • Achilleus Technologies
Re: SSI Topic and Replies
« Reply #28 on: August 21, 2007, 07:03:24 PM »
I'd like to use this mod for the flash gallery at insanereality.com, only I've come up with a few problems.  I have not been able to get rid of the first post using the $start variable.  The first post in each thread made for the flash movies is an exact copy of the description already listed on the flash gallery.  I'll continue to play around with it and if I find a fix or find out what I'm doing wrong I'll post it here.  :)

[edit]
Nevermind, I just commented out the following:

Code: [Select]
/*echo '
<div>
<a href="', $return['href'], '">', $return['icon'], '<b>', $return['subject'], '</b></a>
<div class="smaller">', $return['time'], ' ', $txt[525], ' ', $return['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">', $return['body'], '</div>

', $return['locked'] ? '' : $return['comment_link'], '<br /><br />
</div>

<h2>', $txt['ssiTopic_replies'], ':</h2>
', $return['pageindex'];
*/
« Last Edit: August 21, 2007, 07:18:31 PM by Wal-Mart Security »
Achilleus Technologies
Ace Gaming Syndicate
PART TIME SMF CHARTER MEMBER 4LIFE

SMF slays phpbb, puts it in an IPB coffin, and buries them both with the ashes of vBulletin.

Offline Badmovies.org

  • Semi-Newbie
  • *
  • Posts: 24
  • Gender: Male
  • I know where my towel is.
    • Badmovies.org
Re: SSI Topic and Replies
« Reply #29 on: November 15, 2007, 08:30:03 AM »
Secondly, I think I have found a bug or something that I am unable to fix (I'm still very new to PHP). If you go here: http://www.thephotojournals.com/GeoffCronje/SeaPhoenix_4.php [nofollow] you will see at the bottom of the page, where I am bringing in replies to the article from a linked forum topic that any replies by Guests have been given the name of the last guest to leave a comment.

Is there anyway to fix this? If its a mission I would be happy if it shows any posts by Guests simply as "by Guest" rather than the name they left.


This mod is a great idea.  I hope that it is pushed into the main release as a standard feature.

I saw the same issue you did with the last guest's name being carried along.  Look in SSI.php and find this line:

Code: [Select]
'poster' => &$memberContext[$row['ID_MEMBER']],
take out the "&" and make it:

Code: [Select]
'poster' => $memberContext[$row['ID_MEMBER']],
Andrew Borntreger
Champion of Cinematic Disasters
The Bad Movie Website
www.badmovies.org [nofollow]

Offline growwl

  • Semi-Newbie
  • *
  • Posts: 29
Re: SSI Topic and Replies
« Reply #30 on: December 02, 2007, 07:58:54 AM »
is this mod still being developed?
how about a bit of customization/css styling of the output?
and how about attachments?

Offline fangweile

  • Jr. Member
  • **
  • Posts: 111
  • Saranghaeyo ^_^
    • All Koreans / Home of Korean Actors and Actresses
Re: SSI Topic and Replies
« Reply #31 on: December 13, 2007, 12:41:23 AM »
would it be possible to display the recent replies there??

Offline ryanhellyer

  • Jr. Member
  • **
  • Posts: 376
    • PixoPoint Web Development
Re: SSI Topic and Replies
« Reply #32 on: January 11, 2008, 07:11:59 PM »
Thanks for the mod, it works great :)

Offline Joker Grafix

  • Semi-Newbie
  • *
  • Posts: 50
Re: SSI Topic and Replies
« Reply #33 on: April 04, 2008, 04:34:23 PM »
I was just wondering if this will work on 1.1.4? I'd like to be able to use this so that I may be able to use the simple blog also.

Offline ryanhellyer

  • Jr. Member
  • **
  • Posts: 376
    • PixoPoint Web Development
Re: SSI Topic and Replies
« Reply #34 on: April 05, 2008, 08:18:15 AM »
I was just wondering if this will work on 1.1.4? I'd like to be able to use this so that I may be able to use the simple blog also.

I've used it with SMF 1.1.4, it worked fine.

Offline mark7144

  • Sophist Member
  • *****
  • Posts: 1,174
Re: SSI Topic and Replies
« Reply #35 on: April 15, 2008, 06:22:38 AM »
Quote
Cool mod! I've put it in but I was wondering how the best way of intergrating this with the board news would be? I'm a novice when it comes to this but instead of clicking the news link which takes you to the actual forum topic, could it take you to another page on your site utilizing this mod?
Alright, let's see :)
The page you want the news on, put something like this:
Code: [Select]
<?php
// Require SSI
require('SSI.php');

// Some variables. Change these if you like :)
$board 1// Board to use
$number 10// Number of items to return
$length 300// Return this number of characters, followed by "...".

// Get the news
$news_items ssi_boardNews($board$numbernull$length'array'); // board, number of items, item to start at, number of characters, output method
// Loop through all items
foreach ($news_items as $news)
{
// Output this item
echo '
<div>
<a href="viewnews.php?topic='
$news['id'], '">'$news['icon'], ' <b>'$news['subject'], '</b></a>
<div class="smaller">'
$news['time'], ' by '$news['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">'
$news['body'], '</div>

'
$news['link'], $news['locked'] ? '' ' | ' $news['comment_link'], '
</div>'
;

// If it isn't the last item, output a <hr />
if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0;" width="100%" />'
;
}
?>


The most important things are:
1) The "array" return method is used (so we can customise the output)
2) Instead of linking to the topic page (that's $news['href']), we link to a file called "viewnews.php"

Now, in viewnews.php, add something like:
Code: [Select]
<?php
// Require SSI
require('SSI.php');

// No topic? That's bad
if (empty($_REQUEST['topic']))
die('No topic passed');

// Get this topic and its replies
$return ssi_topic($_REQUEST['topic'], nullnull'array'); // Setting something to 'null' will use the default value.

// Output the first post
echo '
<div>
<a href="'
$return['href'], '">'$return['icon'], '<b>'$return['subject'], '</b></a>
<div class="smaller">'
$return['time'], ' by '$return['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">'
$return['body'], '</div>

'
$return['locked'] ? '' $return['comment_link'], '<br /><br />
</div>

<h2>'
$txt['ssiTopic_replies'], ':</h2>
'
$return['pageindex'];

// Loop through each post
foreach ($return['replies'] as $post)
{
echo '
<div>
<a href="'
$post['href'], '">'$post['icon'], ' <b>'$post['subject'], '</b></a>
<div class="smaller">'
$txt['ssiTopic_reply'], ' '$post['number'], ': '$post['time'], ' by '$post['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">'
$post['body'], '</div>
</div>'
;

// The last post? Let's put the page numbers
if ($post['is_last'])
echo '
'
$return['pageindex'];
else
echo '
<hr style="margin: 2ex 0;" width="100%" />'
;

?>

I've used the "array" return type because this allows you to customise the output however you want :). If you want it to only show replies (and not the topic itself), remove the bit that outputs the topic (the // Output the first post bit).

Quote
Also, I liked the page function and I was wondering how I could get that on my news page also?
Ah, that's SMF in-built page number thingy :D.
constructPageIndex is responsible for doing that. In this mod, the line that gets all the page numbers is:
Code: [Select]
'pageindex' => constructPageIndex('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?start=%d', $start, $row['numReplies'], $num_replies, true),
Basically, you pass the base URL (with %d to tell it where the number should go), the position to start at, the number of total replies, and the number of replies per page, and it returns a nicely formatted list of page numbers.

I wish I knew about constructPageIndex() sooner - I only discovered it recently. Before that, I spent time writing my own page number functions to duplicate SMF's ones :P :o.

If you need any help adding the page numbers to something, please feel free to ask :)

news.php is working, you can see it here. However, when you click on a topic it simply loads up a blank page yet I did copy and paste your viewnews.php code over.

Offline Joker Grafix

  • Semi-Newbie
  • *
  • Posts: 50
Re: SSI Topic and Replies
« Reply #36 on: April 17, 2008, 12:47:55 PM »
Thanks Ryan, I'll test it out more.

Offline jankariwo

  • Semi-Newbie
  • *
  • Posts: 29
Re: SSI Topic and Replies
« Reply #37 on: May 01, 2008, 05:53:07 PM »
I installed ok but the "use this board as a blog" in my blog boards does not stay ticked so the blog tab is empty. what to do ?

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: SSI Topic and Replies
« Reply #38 on: July 21, 2008, 07:07:45 PM »
This still in production ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits