TinyPortal

Development => Feedback => Topic started by: Xarcell on October 30, 2005, 02:43:27 AM

Title: SSI Functions
Post by: Xarcell on October 30, 2005, 02:43:27 AM
Hey Bloc, it I think it would be a good idea, if you created a sticky with a list of ssi functions we can use over in block snippets. Maybe even make a short tutorial....

-Xarcell
Title: Re: SSI Functions
Post by: Moocat on October 30, 2005, 04:25:55 AM
there is a list of ssi functions if you open ssi_examples.php.
you can go there from the root directory of your forum, for instance www.blahblah.com/forum/ssi_examples.php.

there are more ssi functions but those are the basics.
Title: Re: SSI Functions
Post by: bloc on October 30, 2005, 11:44:21 AM
The ssi type block alreay support some of them, and a few other places also relies on SSI.php. I reckon the rest could just be added to the ssi-blocktype.
Title: Re: SSI Functions
Post by: Nokonium on October 30, 2005, 04:15:33 PM
I know, I'm way out of my tree but how can you add an ssi function?

Being the fiddler that I am ........

elseif($context['TPortal']['ssifunction']=='recentposts')
           ssi_recentPosts();


?????????
Title: Re: SSI Functions
Post by: bloc on October 30, 2005, 07:15:47 PM
:) Thats a start..in the TPortalBlocks template. You need to add the options in TPortalAdmin.tempalte as well...

But it would be easier to call it in a phpblock, just like:

ssi_recentPosts();

:)
Title: Re: SSI Functions
Post by: Nokonium on October 30, 2005, 07:52:23 PM
Quote from: Bloc on October 30, 2005, 07:15:47 PM
:) Thats a start..in the TPortalBlocks template. You need to add the options in TPortalAdmin.tempalte as well...

Like this?
               // SSI block..which function?
                    if(!in_array($context['TPortal']['blockedit']['body'],array('recentpoll','toppoll','topposters','topboards','topreplies','topviews','calendar','recentposts')))
                      $context['TPortal']['blockedit']['body']='';
                    echo '<br />';
                    echo '<input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="" ' , $context['TPortal']['blockedit']['body']=='' ? 'checked' : '' , '>' .$txt['tp-none-'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="recentpoll" ' , $context['TPortal']['blockedit']['body']=='recentpoll' ? 'checked' : '' , '>'.$txt['tp-ssi-recentpoll'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="toppoll" ' , $context['TPortal']['blockedit']['body']=='toppoll' ? 'checked' : '' , '>'.$txt['tp-ssi-toppoll'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="topboards" ' , $context['TPortal']['blockedit']['body']=='topboards' ? 'checked' : '' , '>'.$txt['tp-ssi-topboards'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="topposters" ' , $context['TPortal']['blockedit']['body']=='topposters' ? 'checked' : '' , '>'.$txt['tp-ssi-topposters'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="topreplies" ' , $context['TPortal']['blockedit']['body']=='topreplies' ? 'checked' : '' , '>'.$txt['tp-ssi-topreplies'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="topviews" ' , $context['TPortal']['blockedit']['body']=='topviews' ? 'checked' : '' , '>'.$txt['tp-ssi-topviews'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="calendar" ' , $context['TPortal']['blockedit']['body']=='calendar' ? 'checked' : '' , '>'.$txt['tp-ssi-calendar'];
                    echo '<br /><input name="blockbody' .$context['TPortal']['blockedit']['id']. '" type="radio" value="recentposts" ' , $context['TPortal']['blockedit']['body']=='recentposts' ? 'checked' : '' , '>'.$txt['tp-ssi-recentposts'];
                    echo '<hr />';
Title: Re: SSI Functions
Post by: Nokonium on October 30, 2005, 07:58:35 PM
Getting there, well near there anyway  ;D
Title: Re: SSI Functions
Post by: Nokonium on October 30, 2005, 08:17:33 PM
Drat

QuoteFatal error: Cannot redeclare recentposts() (previously declared in /homepages/6/d119724375/htdocs/sgr/Sources/Load.php(1600) : eval()'d code:430) in /homepages/6/d119724375/htdocs/sgr/Sources/Load.php(1600) : eval()'d code on line 455
Title: Re: SSI Functions
Post by: gerrymo on October 31, 2005, 10:40:14 AM
In SSI examples, what is the difference between "Who's Online Function:" and "Log Online Presence + Who's Online Function:"? They both look the same to me.

Is there a way to show "Online Users Today" using SSI?
Title: Re: SSI Functions
Post by: bloc on October 31, 2005, 11:09:37 AM
No, Online users today is a mod, and not included in SSI functions.

Log Online also records your presence, while Who's online don't. Otherwise its the same.
Title: Re: SSI Functions
Post by: gerrymo on October 31, 2005, 11:11:00 AM
Thanks.