Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Owdy on March 18, 2008, 07:04:34 PM

Title: SSI integration changed
Post by: Owdy on March 18, 2008, 07:04:34 PM
I use custom pages. How this is changed?

<?php
$ssi_gzip 
true;
$ssi_ban true;
$ssi_layers = array('main');
$context['page_title'] = 'ytutu.Net -  haun tulokset';
ob_start();
$ssi = include('/var/www/fs5671/0/567567/public_html/foorumi/SSI.php');

if (!
$ssi)
   {
   echo 
'Serverillä näyttää olevan ongelmia. Ole hyvä ja yritä myöhemmin uudelleen.';
   die;
}

?>
Title: Re: SSI integration changed
Post by: codenaught on March 18, 2008, 07:11:33 PM
Well for starters, there is no longer a layer called 'main'. It has been split into 'body' and 'html' layers.

So you would probably want to change the $ssi_layers part of code to:

$ssi_layers = array('html', 'body');
Title: Re: SSI integration changed
Post by: Owdy on March 18, 2008, 07:23:27 PM
Okay, now i get

Fatal error: Cannot redeclare ssi_shutdown() (previously declared in /var/www/fs1/0/public_html/foorumi/SSI.php:182) in /var/www/fs1/0/public_html/tetst/SSI.php on line 184


edit: wait a minute. That second path is wrong. Hmmm, wonder why.
Title: Re: SSI integration changed
Post by: codenaught on March 18, 2008, 07:26:09 PM
You don't happen to have ssi_shutdown() declared a second time anywhere do you?

It seems from the error message you may be loading SSI from both /foorumi/SSI.php and tetst/SSI.php at the same time?
Title: Re: SSI integration changed
Post by: metallica48423 on March 18, 2008, 07:28:24 PM
try using require_once() or include_once on SSI.php instead of include or require.

For some strange reason i found that i had this happen for some reason in my script.
Title: Re: SSI integration changed
Post by: Owdy on March 18, 2008, 07:29:21 PM
Quote from: akabugeyes on March 18, 2008, 07:26:09 PM
You don't happen to have ssi_shutdown() declared a second time anywhere do you?
No

Quote
It seems from the error message you may be loading SSI from both /foorumi/SSI.php and tetst/SSI.php at the same time?
Yeah, that other path is to my test forum. I dont understand how that path is there.
Title: Re: SSI integration changed
Post by: codenaught on March 18, 2008, 07:31:24 PM
Owdy, you don't by any chance have code in your index.template.php to load SSI.php from your test forum perhaps?
Title: Re: SSI integration changed
Post by: Owdy on March 18, 2008, 07:33:46 PM
Bingo! Aaaaahhh, i got wrong path in my index.template. :)

Thanks!
Title: Re: SSI integration changed
Post by: metallica48423 on March 18, 2008, 07:41:42 PM
woo :)

All taken care of, Owdy?
Title: Re: SSI integration changed
Post by: Owdy on March 18, 2008, 07:59:18 PM
Quote from: metallica48423 on March 18, 2008, 07:41:42 PM
All taken care of, Owdy?
Heh, i hope so. I only got that issue with my Team Preview page: http://www.simplemachines.org/community/index.php?topic=216143.msg1472620#msg1472620

Maybe i should start own topic about that.
Title: Re: SSI integration changed
Post by: Owdy on March 18, 2008, 08:06:26 PM
LOL, every custom hack has to change. Sorry guys, but how do i fix this?

<?php
$viestit 
ssi_recentPosts(50, array(), 'return');
foreach (
$viestit as $post)
     echo 
''$post['time'], '&nbsp;<a href="'$post['href'], '">'$post['subject'], '</a> - '$post['poster']['link'], '<br />';
echo
'
</div>'
;
ssi_shutdown();
?>


Im sorry to keep you this busy with my guestions :D
Title: Re: SSI integration changed
Post by: metallica48423 on March 18, 2008, 08:24:18 PM
what is it or is it not doing?  Have you checked to see if the parameters that the function is expecting has changed between 1.1.4 and 2.0's SSI? (just to knock that out).  I'd also check that the keys are the same.

I've never used return, shouldn't it be array?
Title: Re: SSI integration changed
Post by: Owdy on March 18, 2008, 08:25:47 PM
It should show 50 last topics. Now it gives 'Database error, given array of integer values is empty.'
Title: Re: SSI integration changed
Post by: metallica48423 on March 18, 2008, 10:01:52 PM
well... The array IS empty :P

You're missing an argument as well.  Its changed (i guess)

from SSI.php
function ssi_recentPosts($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo')

So your first array needs to carry the boards you want to EXCLUDE, the second is the ones you want to INCLUDE

Title: Re: SSI integration changed
Post by: SleePy on March 19, 2008, 12:31:51 AM
use NULL instead of array().
Title: Re: SSI integration changed
Post by: Owdy on March 19, 2008, 02:05:58 AM
Okay, this works :)

<?php
$viestit 
ssi_recentPosts(50NULLNULLNULL);
foreach (
$viestit as $post)
     echo 
''$post['time'], '&nbsp;<a href="'$post['href'], '">'$post['subject'], '</a> - '$post['poster']['link'], '<br />';
echo
'
</div>'
;
ssi_shutdown();
?>