News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Looking for how to be able to influence, where, SSI output renders on page

Started by richardwbb, December 01, 2016, 04:59:42 PM

Previous topic - Next topic

richardwbb

attachment; fetch.php, fetch.html and fetch-example.jpg

I have been reading to understand SSI.php and made a piece of code that will suit my needs. I'm looking for, how to learn, where, SSI's output, is rendered on screen. My idea was; write, 'fetch.php', and use a php require statement. Since I have told you all, i'm not a programmer, I did reason, that I am able, to find the place in the SMF code, where, all boards are rendered and then, implement another php if statement, to put the 'recent posts' between two boards.

I've put, '<?php require("fetch.php"); ?>', inside, index.template.php, BoardIndex.template.php and MessageIndex.template.php, the output of SSI.php gets rendered on top of the forum, see; 'fetch-example.jpg'. How can I overcome this?

If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

Illori

what exactly are you trying to add? ideally you should not need to include SSI.php in SMF, there may be other ways to get what you want where you want it.

bestnow

Quote from: richardwbb on December 01, 2016, 04:59:42 PM
attachment; fetch.php, fetch.html and fetch-example.jpg

I have been reading to understand SSI.php and made a piece of code that will suit my needs. I'm looking for, how to learn, where, SSI's output, is rendered on screen. My idea was; write, 'fetch.php', and use a php require statement. Since I have told you all, i'm not a programmer, I did reason, that I am able, to find the place in the SMF code, where, all boards are rendered and then, implement another php if statement, to put the 'recent posts' between two boards.

I've put, '<?php require("fetch.php"); ?>', inside, index.template.php, BoardIndex.template.php and MessageIndex.template.php, the output of SSI.php gets rendered on top of the forum, see; 'fetch-example.jpg'. How can I overcome this?

ssi is for page that are not forum but <include> forum status example <forum posts>

Dzonny

I'm still not sure what exactly you're trying to achieve. If I understand correctly, you'd like to show recent posts between two boards, or categories on your forum? If so, you don't need to include SSI, like Illori said. You should seek for appropriate code in  BoardIndex.template.php, like:
foreach ($context['categories'] as $category)
{
// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
if (empty($category['boards']) && !$category['is_collapsed'])
continue;

And then add an if statement above that with $category['id'] check, to see if you need to show the ad before it. Similar is for boards as well. Then you can use relevant part for "recent posts" from BoardIndex.template.php file, which is located after the comment:    
// This is the "Recent Posts" bar.

richardwbb

Thank you for your replies people.

I am under the assumption that, what Illori wrote, SSI isn't meant to be used on the forum itself. That is a pitty to me because I spent quite some time with that file I posted but I am a little slow on PHP, haha.

What you posted Dzonny, I will look in to that [that will be helpful to me], and then get back to what dougiefresh wrote to me [but that is another subject], and I found a neat modification [I don't remember it's name], and if I can get it to do what I and my users need, I'll be a happy man.

So I will let you know about that as soon I get myself a tweaked Linux kernel, 2.2Ghz just isn't enough and the laptop doesn't take a higher processor, haha. Maybe I didn't tell you much, but when I got it working I'll post that here [now I'll read up with the coding discussion, since this topic has been moved] so don't expect me to say anything, haha.
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

Advertisement: