News:

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

Main Menu

SSI integration changed

Started by Owdy, March 18, 2008, 07:04:34 PM

Previous topic - Next topic

Owdy

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;
}

?>
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

codenaught

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');
Dev Consultant
Former SMF Doc Coordinator

Owdy

#2
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.
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

codenaught

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?
Dev Consultant
Former SMF Doc Coordinator

metallica48423

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.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owdy

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.
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

codenaught

Owdy, you don't by any chance have code in your index.template.php to load SSI.php from your test forum perhaps?
Dev Consultant
Former SMF Doc Coordinator

Owdy

Bingo! Aaaaahhh, i got wrong path in my index.template. :)

Thanks!
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

metallica48423

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owdy

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.
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

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
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

metallica48423

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?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owdy

It should show 50 last topics. Now it gives 'Database error, given array of integer values is empty.'
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

metallica48423

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

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

SleePy

use NULL instead of array().
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Owdy

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();
?>

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

Advertisement: