SII.php & mods_handling with SMF.Bridge

Started by mic, February 16, 2005, 07:44:15 PM

Previous topic - Next topic

mic

Hello Orstio (and Unkown),

one question from developer sight: is there a change to modify (officially) the SSI.php in that way, that i can integrate SMF better in Mambo (for example)?
Why i am asking? The way how SSI.php handles modules (like recent posts, etc.) is not really that what i want.
But as it is now i cant change, because the var "output_methode" is 'hardcoded' in the function - no change without changing
Quotefunction ssi_recentPosts($num_recent = 8, $exclude_boards = array(), $output_method = 'echo')
this line and recieving the array[posts] back and to make a output which combines more or is flexible to the user with parameter as we like to work with modules in Mambo.
Also the var "$num_recent".

This belongs to all modules which are handled by SSI.php.

What can i do - or what are you saying?
Or - did i overlooked something?

michael

Kindred

Mic, you can do what I did with the who's online module...

copy the SSI function to a separated php file... rename the function somethign other than ssi_function and edit to your heart's content.    Changing the WIO module as you did had no bad effects... that was originally taken directly from SSI with minor reformatting.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

[Unknown]

IMHO better to use $output_method as that's what it was designed for.  Search this site for "output_method".

-[Unknown]

mic

Quote from: [Unknown] on February 16, 2005, 10:02:11 PM
IMHO better to use $output_method as that's what it was designed for. Search this site for "output_method".

-[Unknown]

Thx both for your replies!.

@Unknown: maybe you understood me wrong: i dont want to change the SSI.php -> its an amazing script!
After reading all FAQs about SSI.php the situation is the same like before: cant make use of original function of SSI.php.
Because as it is now, vars cant be changed from outside if the vars are defined in the function!
Maybe you think over - another handling will prevent us in copying codeline or writing the same line (of SSI.php function) with minor modifications only to get the result we (i) want.
Could be also better for those, who wants to integrate SMF into other CMS  like Mambo.

@Kindred: yeah i know what you mean, but i tried to avoid to copy that section and make a new script - the lines are still exisiting and i wanted to use the existing section from SSI.php. But as it seems to be, i have it to do as we did it with the WIO-module ;-)
Will send you again what i am doing ...

michael

[Unknown]

#4
Those are just the defaults.  You can pass new values easily.

ssi_recentPosts(20, array(5), 'array')

Returns an array of the latest 20 posts not in board #5...

For more information on parameter defaulting in PHP, please see:
http://www.php.net/functions.arguments#functions.arguments.default

-[Unknown]

mic

Quote from: [Unknown] on February 20, 2005, 03:49:00 AM
Those are just the defaults. You can pass new values easily.

ssi_recentPosts(20, array(5), 'array')

Returns an array of the latest 20 posts not in board #5...

For more information on parameter defaulting in PHP, please see:
http://www.php.net/functions.arguments#functions.arguments.default

-[Unknown]
Thank you Unknown,

very helpfully the link to php.net ... ;-)
And again i think we are talking about two different things,
because i dont want to use the display (unflexible) as provided by this function:
Quotefunction ssi_recentPosts($num_recent = 8, $exclude_boards = array(), $output_method = 'echo')
If i want to  handle the parameters which i can sent to this function, the
output will be allways handled by it, because auf the syntax
Quote$output_method = 'echo'
Of course i could change something in this function, like
Quote$output_methode = ''
or
Quote&$output_methode = 'echo'
but then i have to change the way how the function not to display the result.

And as said before, this is not my intention (to change anything in the SSI.php).
Therefore, if i dont want to display the results given by this function, i have to do this by another function/module.

Am i wrong?

michael

[Unknown]

Quote from: mic on February 20, 2005, 04:54:24 AM
Am i wrong?

I'm afraid you are.... that's what the link I posted should have illustrated.  Let me give you an example.... given this function:

function test($a = 1)
{
   // echo the value of $a!
   echo '$a = ', $a, '!';
}

These two calls are identical:

test();
test(1);

And both will generate the output:

$a = 1!

However, this call:

test(2);

IS NOT THE SAME!  Instead, it generates:

$a = 2!

See?  Here, try this test script:

<?php

function test($a 1)
{
   
// echo the value of $a!
   
echo '$a = '$a'!<br />';
}

test();
test(1);
test(2);

?>


You'll get:

$a = 1!
$a = 1!
$a = 2!

As such, you are not limited by SSI.php.

-[Unknown]

Advertisement: