• Welcome to Simple Machines Community Forum. Please login or sign up.
October 27, 2021, 07:44:30 PM

News:

Wondering if this will always be free?  See why free is better.


SSI Topic and Replies

Started by tyty1234, April 06, 2007, 07:35:13 AM

Previous topic - Next topic

tyty1234

Attachments? Not sure.
You could have your users include the attachment image link and have it be part of their post or something like that. Or you can use this mod.
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

GhostHunter


No biggie. I'm selling it to TPTB as an incentive for web site visitors to look at the actual forum pages. I think that they will buy it.

-Jim

Neverhurry

Hi there, thank you guy to have made such useful mod.

But i have problems to use it. First i have it successfully installed in SMF 2.0rc1.2. but then, when i run mysite.com/ssi-example.php i had this error:

Show a Topic and its Replies Function: <?php ssi_topic($topic_id); ?>
Error!
The topic you are looking for appears to be either missing or off limits to you.


then, when i tried:

// Get our SSI.
require('SSI.php');

// The topic id we would like to grab from.
$topic_id = 123;

// Return the topic and posts that follow.
echo ssi_topic($topic_id);


I got this error:

Fatal error: Cannot redeclare ssi_shutdown() (previously declared in /home/veryeuro/public_html/21arte/SSI.php:213) in /home/veryeuro/public_html/21arte/SSI.php on line 215

please help! thanks!
I am using SMF 2.0.1, curve themes.

tyty1234

Quote from: neverhurry on November 03, 2009, 05:27:02 PM
Hi there, thank you guy to have made such useful mod.

But i have problems to use it. First i have it successfully installed in SMF 2.0rc1.2. but then, when i run mysite.com/ssi-example.php i had this error:

Show a Topic and its Replies Function: <?php ssi_topic($topic_id); ?>
Error!
The topic you are looking for appears to be either missing or off limits to you.


then, when i tried:

// Get our SSI.
require('SSI.php');

// The topic id we would like to grab from.
$topic_id = 123;

// Return the topic and posts that follow.
echo ssi_topic($topic_id);


I got this error:

Fatal error: Cannot redeclare ssi_shutdown() (previously declared in /home/veryeuro/public_html/21arte/SSI.php:213) in /home/veryeuro/public_html/21arte/SSI.php on line 215

please help! thanks!

Hi there!

Sorry about the late reply, been a little busy lately....but I did release a new version of the mod (1.3). You can try it out, and tell me what errors you get.

Thanks. :)
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Neverhurry

Thank. I installed the latest 1.3, then when i run the ssi_example.php i got this error, actually the same error i got before:

Topic's Poll Function: <?php ssi_showPoll($topic); ?>
Show a Topic and its Replies Function: <?php ssi_topic($topic_id); ?>
error!
The topic you are looking for appears to be either missing or off limits to you.
I am using SMF 2.0.1, curve themes.

tyty1234

try re-downloading the package, and then re-installing it. :)
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.


Bijan641

Is there a way to show the avatar next to the posts?

TestMonkey

Quote from: Bijan641 on January 16, 2010, 08:05:28 PM
Is there a way to show the avatar next to the posts?
Set the output method as an array and customize the output how you like it along with user information, see the source code of viewnews.php and other examples in this thread.

Particularly pay attention to:
$news['poster']['link']

From the default ssi_boardNews(); function documentation I assume it's the same here this is what get's pulled:
Quote
poster  => Array:
The standard array of poster information - id (member ID or 0 for guests), name (display name or the name the guest entered), href (URL to poster's profile or an empty string for guests), link (link to the poster's profile or just the name if they were a guest)
If nothing else you could get the member's ID and do a custom query of your own to pull the avatar information.
Knowledge is power
www.serverhash.com

Sunday Driver

March 09, 2010, 01:32:11 AM #69 Last Edit: March 09, 2010, 01:35:52 AM by Sunday Driver
I really appreciate the time that went into this, but it's not working for me and I can't figure out why. In ssi_examples.php, I get the get the "ssiTopic_notfound" error of "The topic you are looking for appears to be either missing or off limits to you.", which is coming from this code:


// No results? That's not good!
if (mysql_num_rows($result) == 0)
fatal_lang_error('ssiTopic_notfound');


So the first query in the ssi_topic function of SSI.php isn't finding the topic I guess? What could be wrong? I am using SMF 1.1.11. I've tried re-installing, using it in code with parameters...etc...nothing seems to work...

Bijan641

March 10, 2010, 03:31:03 PM #70 Last Edit: March 17, 2010, 06:47:23 PM by Bijan641

$topicNum = 97;
$replies = 15;
$startPost = 1;

$return = ssi_topic($topicNum, $replies, $startPost, 'array'); // Setting something to 'null' will use the default value.

// Loop through each post
foreach ($return['replies'] as $post)
{
echo '
<div style="background-color:#cee2ff; color:#000; border:solid; border-width:thin; border-color:#000; padding:3px;">
<div>
<a href="', $post['href'], '"><b>', $post['subject'], '</b></a>
<div class="smaller">', $post['time'], ' Posted by ', $post['poster']['link'], '</div>

<div>', $post['body'], '</div>
</div>';

// The last post? Let's put the page numbers
        if ($post['is_last'])
echo '
', $return['pageindex'];
else
echo '
<br /></div>';

}


http://www.dotswoof.com/theater/t.php                         - code source
http://www.dotswoof.com/forum/index.php?topic=97.30   - original forum topic

I am having trouble getting this function to work. For some reason, the pagination doesn't work at all and it grabs from the end instead of at the starting position I tell it to. I submitted links to the original topic and the malfunctioning page so you could see for yourself.

Sunday Driver

Quote from: Sunday Driver on March 09, 2010, 01:32:11 AM
I really appreciate the time that went into this, but it's not working for me and I can't figure out why. In ssi_examples.php, I get the get the "ssiTopic_notfound" error of "The topic you are looking for appears to be either missing or off limits to you.", which is coming from this code:


// No results? That's not good!
if (mysql_num_rows($result) == 0)
fatal_lang_error('ssiTopic_notfound');


So the first query in the ssi_topic function of SSI.php isn't finding the topic I guess? What could be wrong? I am using SMF 1.1.11. I've tried re-installing, using it in code with parameters...etc...nothing seems to work...

Nevermind....figured out what the issue was here.

Bijan641

http://www.dotswoof.com/forum/ssi_examples.php

I'm getting an error on ssi_examples for the ssi_topic function. Also, like I said in my previous post, ssi-topic wont work for me correctly...

tyty1234

Can you attach your SSI.php file?
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Bijan641

Here it is!

Also, some more information on the problem:

When I use normal function it actually works, it only gives me problems when i use the array. Basically, when I try to use the replies array, it only gives me the last ten replies, no matter how many i specified while calling the function.

Also, the page index never gets posted.

Thanks a lot for the help. This has been a big problem for me.

Bijan641

Sorry for bumping, I'm just really lost on this right now.

HabbStar

Hi, this isn't working for me either now.. I get this error when trying to install it:

   2.   Execute Modification   ./ssi_examples.php   Test failed
   1.   Add After   ./ssi_examples.php   Test failed

Bijan641

You probably need to install the code manually, especially if you've already installed other mods on your theme.

handyrefuse


./ssi_examples.php
Find: [Select]


<?php ssi_showPoll(); flush(); ?>

Add After: [Select]


<hr />

<h3>Show a Topic and its Replies Function: &lt;?php ssi_topic($topic_id); ?&gt;</h3>
<?php ssi_topic(); flush(); ?>



i looked up and down in ssi_examples.php and even used the search, but can't find the showpoll part to put the new code after... any ideas?

tyty1234

Quote from: handyrefuse on April 02, 2010, 11:10:41 AM

./ssi_examples.php
Find: [Select]


<?php ssi_showPoll(); flush(); ?>

Add After: [Select]


<hr />

<h3>Show a Topic and its Replies Function: &lt;?php ssi_topic($topic_id); ?&gt;</h3>
<?php ssi_topic(); flush(); ?>



i looked up and down in ssi_examples.php and even used the search, but can't find the showpoll part to put the new code after... any ideas?
Are you using SMF 2.0 RC3? The file has changed dramatically, which I just noticed, so you won't be able to add the code to it. It's not crucial to installation of the mod, so you can simply skip it. :)
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Advertisement: