News:

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

Main Menu

Expert SSI FAQ

Started by Tomer, June 28, 2004, 07:31:34 PM

Previous topic - Next topic

[SiNaN]

Because that seems as easy way.

I'll be using this way from now on, thanks.

Former SMF Core Developer | My Mods | SimplePortal

spottedhog

I would still recommend to do it via an $array as with the example I put up earlier.

[SiNaN]

My awful English caused a misunderstanding again.

I meant, from now on, I'll will be using the way you gave.

Another question: When I use ssi_shutdown(), it doesn't display the copyright. Is there a solution so that I can show the copyright also?
Former SMF Core Developer | My Mods | SimplePortal

spottedhog

I would not worry about it....  also, I have not used that function, so I am not totally sure what it does.

Kender

looked through teh basic and expert faq and didnt see the answer
also looked in the docs section....

is there a way to use the users default theme, or forum default (by selection, or for guests) with the ssi ?

like a ssi header, for the top half of the page
then insert conten
then ssi footer, for the bottom half of the page
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

[SiNaN]

You can use this:

<?php
error_reporting
(E_ALL);

// Theme we're going to use
$ssi_theme 4;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip true;

require(
'SSI.php');

?>

Put your HTML content here!
<?php

ssi_shutdown
();
?>
Former SMF Core Developer | My Mods | SimplePortal

Kender

Quote from: [SiNaN] on February 17, 2008, 09:30:03 AM
You can use this:

<?php
error_reporting
(E_ALL);

// Theme we're going to use
$ssi_theme 4;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip true;

require(
'SSI.php');

?>

Put your HTML content here!
<?php

ssi_shutdown
();
?>

This works beautifully, thanks, but is there a way to allow for using the members preferred theme as well? 
not to be a pain, you have me 1000% happier than i was an hour ago.. and i thank you for that
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

spottedhog

comment out this line...  make it like this:
//$ssi_theme = 4;

[SiNaN]

Yes, as spottedhog said, if you do not set an ssi_theme, it will use the theme of user.

Not at all.
Former SMF Core Developer | My Mods | SimplePortal

spottedhog

If you wish to include IP banning, add this line under $ssi_theme:

$ssi_ban = true;  //true--means a banned forum user will be banned also in the SSI page.

Kender

you guys are great! thanks a lot
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

Kender

#91
Okay, I am pulling a Poll from a board

when logged in as admin, the poll shows as unanswered

the poll shows unanswered in all 3 situations, admin, member and logged out when using toppoll and recentpoll...

using showpoll(6) as logged in member, it shows results, and as guest it shows results, but as admin it shows unanswered (admin created the poll)

this is using   ssi_showPoll(6); with 6 being the post number, unless you can get me using top or recent poll and limiting it to a specific board/post
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Kender

lol, thanks for that.. my search didnt show up with this on the first page, or second (half of it at least before i gave up)

appreciated!
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

Kender

is there a way to show a poll from a board, not a post in SSI?

using ssi_showPoll($number); isnt really effective for a changing environment, but i have a board dedicated to polls, and i would love to have it change on the SSI page to the most recent poll, not whatever is coded into it

(i can made a database query and fill in the $number if necessary, but would rather do it through SSI if possible)
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

Kender

#95
hey, need some SSI assistance, still looking for help with my last question, but would also like to know...

what do i need to add to my includes on a SSI page to get $modSettings enabled ?

trying to get the ad manage mod to work, along with just getting a menu button for felblog (when user is allowed to view it) -- reads like.. if(isset($modSettings['felblog_enabled']))
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

[SiNaN]

In the function that you use the $modSettings variable, you should firstly define it after defining the function. To give an example:

<?php
//This is an example function.
function ssi_test($output_method 'echo')
{
global $context$txt$scripturl;

if (
$output_method == 'echo')

echo 
'Test, Test, Test, Test';

}
?>


After $scripturl you should add $modSettings as done below;

<?php
//This is an example function.
function ssi_test($output_method 'echo')
{
global $context$txt$scripturl$modSettings;

if (
$output_method == 'echo')

echo 
'Test, Test, Test, Test';

}
?>

Former SMF Core Developer | My Mods | SimplePortal

Kender

in ssi.php  $modsettings is global, shoudnt it already be enforced?
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

[SiNaN]

Quote from: Kender on February 22, 2008, 08:50:44 AM
in ssi.php  $modsettings is global, shoudnt it already be enforced?

You should make it global for the function you use it in also.
Former SMF Core Developer | My Mods | SimplePortal

Gantry

I would like to use some SSI functions on Joomla pages, but what I don't want is those users navigating to what amounts to a wrapped forum.  For instance, if I show a top poster on the front page with ssi_topPoster(); , it displays the top poster's name, which is also a link to his or her profile. If the user clicks to the profile, it's just one more click to the full forum, and I don't want users to be browsing my forum inside an iframe in Joomla.  My thinking is that the SSI output should be for informative purposes, not navigational purposes, and would like to prevent this.

I would like to prevent the output of any of the SSI functions as a link, instead just a plain text result.  Alternatively, if it isn't possible, could I make the links open up in a new window/tab? How would I change the output of any of the SSI functions to do either of these?

Advertisement: