News:

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

Main Menu

ssi_boardNews() crashes in examples_ssi.php with my 2b4 installation

Started by wakewatcher, November 30, 2008, 04:16:53 PM

Previous topic - Next topic

wakewatcher

I just installed 3b4 with no mods and am playing with ssi.php.  I ran the examples file and it exits after it makes the call to ssi_boardNews().  If I comment that call out it processes the rest of the examples.  Don't know if this is a bug in 2b4 or not.
smf 2.0.18

ディン1031

Are there any errors on your error log?

I think you server stop the process, because you can see the example file on this server and the board news function work fine here.
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

wakewatcher

I don't have any errors in the error log.  I'm suggesting that there might be a bug in SSI.php.  At least it should return rather than (apparently) exiting.  As I say when I pull that function call out of the examples file it runs to the end of the page.  When its in it runs until the function call. 
smf 2.0.18

ディン1031

So i tested it on some systems, and i can tell you that this function work fine.
Can you give me a link to you ssi_examples.php?
Because I'm sure that your execute is stopped by a limit setting of the server.
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x


ディン1031

Okay now i see it did not crash :).

It stop the script oO and output "You cannot specify a board that doesn't allow guests. Please check the board ID before trying again."

Okay smf really do a "die($txt['ssi_no_guests']);" on that script... okay i think thats a bug ;).

I will post it in the bug board :). (But first i will look if i can find it at the bug tracker). done

If you need a fix for that than replace

if ($output_method == 'echo')
die($txt['ssi_no_guests']);
else
return array();


with


if ($output_method == 'echo')
{
echo $txt['ssi_no_guests'];
return;
}
else
return array();


But it is possible that you can not upgrade afterward.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

wakewatcher

I guess its how you choose to define 'crash'.   :D  The script aborted at that point so for my purposes it crashed.  But thanks for the help and I (even) see the logic as to why.  Another somewhat unrelated (ok totally unrelated but having to do with integration) question.  Where can I find a list of all the variables that I can access after calling ssi.php.  For example I have stumbled upon things like $context['user']['name'] but how can I for example get the user's profile fields. etc.  Any reference for variables in general?  Thx.
smf 2.0.18

ディン1031

Difficult xD.
There are so many standard things loaded... :X

If you really like to load all fields from a user that you need to load first all informations about the use than you can output them. For this you can use the SSI Function "ssi_fetchMember". If you set it to array it will output the array of the given ids. :) (Only in 2.0. beta 4+)

Example:

global $user_info;
ssi_fetchMember($user_info['id']);


Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x


Advertisement: